:root {
  --bg: #0e1322;
  --bg2: #141b2f;
  --panel: #1a2238;
  --panel2: #222c47;
  --line: #2e3a5c;
  --text: #f4efe4;
  --muted: #9ba5c2;
  --gold: #e8c26a;
  --gold2: #f5dc9a;
  --red: #d0583f;
  --green: #1ed760;
  --radius: 14px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: radial-gradient(1200px 600px at 80% -10%, #22305a 0%, transparent 60%), radial-gradient(900px 500px at -10% 110%, #2a1f3a 0%, transparent 60%), var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: 15px/1.45 Inter, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: Fraunces, Georgia, serif; font-weight: 600; margin: 0; letter-spacing: .01em; }
a { color: var(--gold2); }
button { font: inherit; color: inherit; }
input, select, textarea {
  font: inherit; color: var(--text); background: var(--bg2); border: 1px solid var(--line);
  border-radius: 10px; padding: 9px 11px; outline: none; min-width: 0;
}
input:focus, select:focus, textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px #e8c26a33; }
select { cursor: pointer; }
kbd { background: var(--panel2); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; font: 12px Inter, sans-serif; }
code { background: var(--bg2); border: 1px solid var(--line); padding: 3px 7px; border-radius: 6px; word-break: break-all; }
code.copy { cursor: copy; display: inline-block; margin-top: 4px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; width: 100%; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--panel2); border: 1px solid var(--line); border-radius: 10px;
  padding: 9px 14px; cursor: pointer; font-weight: 500; transition: background .15s, transform .05s, border-color .15s;
  white-space: nowrap;
}
.btn:hover:not(:disabled) { background: #2b3757; border-color: #3d4b74; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .4; cursor: default; }
.btn.primary { background: var(--gold); color: #1d1606; border-color: var(--gold); font-weight: 600; }
.btn.primary:hover:not(:disabled) { background: var(--gold2); }
.btn.danger { color: #ffb4a6; }
.btn.sm { padding: 6px 9px; font-size: 13px; border-radius: 8px; }
.btn.accent { border-color: #e8c26a66; color: var(--gold2); }
.btn.ghost { background: transparent; }
.btn.wide { width: 100%; margin-top: 12px; }
.btn.spotify { background: var(--green); color: #07140b; border: 0; font-weight: 700; padding: 13px 22px; border-radius: 999px; font-size: 16px; }
.btn.spotify svg { width: 22px; height: 22px; color: #07140b; }
.btn.spotify svg path { stroke: var(--green); }
.iconbtn { background: transparent; border: 1px solid transparent; border-radius: 9px; width: 36px; height: 36px; cursor: pointer; font-size: 17px; color: var(--muted); flex: none; }
.iconbtn:hover:not(:disabled) { background: var(--panel2); color: var(--text); }
.iconbtn:disabled { opacity: .3; cursor: default; }
.iconbtn.danger:hover { color: #ffb4a6; }

.center-screen { min-height: 100vh; display: grid; place-items: center; padding: 20px 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 32px; max-width: 560px; width: 100%; box-shadow: 0 30px 80px #0008; }
.card.login { text-align: center; }
.card.login p { color: var(--muted); }
.card ol { padding-left: 20px; } .card li { margin: 8px 0; }
.brand-big { display: flex; align-items: center; gap: 12px; justify-content: center; margin-bottom: 12px; }
.brand-big h1 { font-size: 30px; }
.brand-big .star { width: 34px; height: 34px; }
.star { fill: var(--gold); filter: drop-shadow(0 0 8px #e8c26a88); }
.row { display: flex; gap: 8px; } .row input { flex: 1; }
.hint { color: var(--muted); font-size: 13px; margin: 8px 0 0; }
.warn { color: #ffb4a6; }
.spinner { width: 34px; height: 34px; border: 3px solid var(--line); border-top-color: var(--gold); border-radius: 50%; animation: spin .8s linear infinite; margin: 20px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Kopfzeile */
.top {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 12px;
  padding: 10px 18px; background: #0e1322e6; backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 8px; font-family: Fraunces, serif; font-size: 19px; font-weight: 700; }
.brand .star { width: 22px; height: 22px; }
.showpick select { max-width: 200px; }
.tabs { display: flex; background: var(--bg2); border: 1px solid var(--line); border-radius: 11px; padding: 3px; }
.tab { background: transparent; border: 0; padding: 7px 16px; border-radius: 8px; cursor: pointer; color: var(--muted); font-weight: 600; }
.tab.on { background: var(--gold); color: #1d1606; }
.spacer { flex: 1; }
.devicebar { display: flex; align-items: center; gap: 6px; }
.devicebar select { max-width: 230px; padding: 7px 9px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.ok { background: var(--green); box-shadow: 0 0 8px var(--green); }
.dot.bad { background: var(--red); }
.dot.wait { background: var(--gold); animation: pulse 1s infinite alternate; }
@keyframes pulse { to { opacity: .3; } }
.vol { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.vol svg { width: 20px; height: 20px; }
.vol input { width: 90px; padding: 0; accent-color: var(--gold); }
.banner { background: #4a1f19; border-bottom: 1px solid #7a3326; color: #ffd6cc; padding: 10px 18px; font-size: 14px; }
.savestate { font: 500 12px Inter, sans-serif; color: var(--muted); }
.savestate.saving { color: var(--gold); }
.savestate.error { color: #ff9c88; }

/* Editor */
.editor { display: grid; grid-template-columns: minmax(300px, 400px) 1fr; gap: 18px; padding: 18px; max-width: 1400px; margin: 0 auto; }
.cuelist, .detail { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.cuelist { align-self: start; position: sticky; top: 76px; max-height: calc(100vh - 96px); display: flex; flex-direction: column; }
.listhead { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.listhead h2 { font-size: 20px; }
.count { font: 500 13px Inter, sans-serif; color: var(--muted); margin-left: 6px; }
.cues { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }
.cue { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; cursor: pointer; border: 1px solid transparent; }
.cue:hover { background: var(--panel2); }
.cue.sel { background: var(--panel2); border-color: #e8c26a77; }
.cue.playing .num { background: var(--gold); color: #1d1606; }
.num { width: 26px; height: 26px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--bg2); font-size: 12px; font-weight: 700; color: var(--muted); }
.cue img, .noimg { width: 42px; height: 42px; border-radius: 6px; flex: none; object-fit: cover; background: var(--bg2); }
.meta { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.meta b, .meta small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta b { font-weight: 600; }
.meta small { color: var(--muted); font-size: 12.5px; }
.meta small.note { color: var(--gold2); font-style: italic; }
.range { font: 600 12px Inter, sans-serif; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.empty { color: var(--muted); text-align: center; padding: 20px; }
.empty.big { padding: 80px 20px; }

.dhead { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.dhead img { width: 72px; height: 72px; border-radius: 10px; box-shadow: 0 8px 24px #0007; }
.dhead h2 { font-size: 24px; }
.dhead p { margin: 2px 0 0; color: var(--muted); }

.timeline { position: relative; height: 62px; background: repeating-linear-gradient(90deg, #ffffff08 0 2px, transparent 2px 6px), var(--bg2); border: 1px solid var(--line); border-radius: 12px; cursor: crosshair; touch-action: none; margin: 0 8px; }
.tl-seg { position: absolute; top: 0; bottom: 0; background: linear-gradient(180deg, #e8c26a55, #e8c26a2a); border-left: 0; border-right: 0; }
.tl-fade { position: absolute; top: 0; bottom: 0; pointer-events: none; }
.tl-fade.in { background: linear-gradient(90deg, #0e1322cc, transparent); }
.tl-fade.out { background: linear-gradient(270deg, #0e1322cc, transparent); }
.tl-head { position: absolute; top: -4px; bottom: -4px; width: 2px; background: #fff; box-shadow: 0 0 8px #fff; pointer-events: none; transform: translateX(-1px); }
.tl-handle { position: absolute; top: -8px; bottom: -8px; width: 4px; background: var(--gold); transform: translateX(-2px); cursor: ew-resize; border-radius: 2px; }
.tl-handle::before { content: ''; position: absolute; inset: 0 -14px; }
.tl-handle span { position: absolute; top: -22px; left: 50%; transform: translateX(-50%); font-size: 11px; font-weight: 700; background: var(--gold); color: #1d1606; padding: 1px 6px; border-radius: 5px; white-space: nowrap; }
.tl-handle.end span { background: var(--red); color: #fff; }
.tl-handle.end { background: var(--red); }
.tl-handle.drag { box-shadow: 0 0 0 4px #ffffff33; }
.tl-scale { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; margin: 6px 8px 0; font-variant-numeric: tabular-nums; }
.tl-scale .pos { color: #fff; font-weight: 600; }
.detail .timeline { margin-top: 26px; }

.transport { display: flex; gap: 8px; flex-wrap: wrap; margin: 18px 0; }
.points { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.point { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.point.start { border-top: 3px solid var(--gold); }
.point.end { border-top: 3px solid var(--red); }
.plabel { font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.point input { font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; text-align: center; padding: 6px; }
.nudges { display: flex; gap: 6px; } .nudges .btn { flex: 1; }
.fades { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; margin: 16px 0; }
.fades label { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.fades input { width: 70px; text-align: center; }
.fades .len b { color: var(--text); font-variant-numeric: tabular-nums; }
.notefield { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 13px; }
.notefield textarea { resize: vertical; font-size: 15px; }

/* Modal */
.modal-bg { position: fixed; inset: 0; background: #05081299; backdrop-filter: blur(4px); display: grid; place-items: start center; padding: 8vh 16px; z-index: 50; }
.modal { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 22px; width: 100%; max-width: 560px; box-shadow: 0 30px 80px #000a; max-height: 84vh; display: flex; flex-direction: column; }
.modal h2 { margin-bottom: 14px; font-size: 22px; padding-right: 40px; }
.modal .close { position: absolute; top: 14px; right: 14px; }
.search { width: 100%; font-size: 16px; padding: 12px 14px; }
.results { overflow-y: auto; margin-top: 10px; }
.result { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 8px; background: transparent; border: 0; border-radius: 10px; cursor: pointer; }
.result:hover { background: var(--panel2); }
.result img { width: 44px; height: 44px; border-radius: 6px; flex: none; }
.plus { font-size: 22px; color: var(--gold); width: 30px; text-align: center; }
.importinfo { text-align: center; padding: 16px; }
.menu-list { display: flex; flex-direction: column; gap: 8px; }
.menu-list .btn { justify-content: flex-start; }

/* Auftritt */
.live { display: grid; grid-template-columns: 1fr 340px; gap: 18px; padding: 18px; max-width: 1500px; margin: 0 auto; min-height: calc(100vh - 60px); }
.stage { display: flex; flex-direction: column; gap: 18px; }
.now { background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 26px; flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 18px; transition: border-color .3s, box-shadow .3s; min-height: 300px; }
.now.on { border-color: #e8c26a88; box-shadow: 0 0 60px #e8c26a22 inset; }
.now .label { text-transform: uppercase; letter-spacing: .12em; font-size: 12px; font-weight: 700; color: var(--muted); }
.now.on .label { color: var(--gold); }
.nowcard { display: flex; align-items: center; gap: 22px; }
.nowcard img { width: 130px; height: 130px; border-radius: 14px; box-shadow: 0 14px 40px #0009; }
.nowcard .n { color: var(--muted); font-weight: 600; }
.nowcard h1 { font-size: clamp(28px, 4vw, 46px); line-height: 1.1; }
.nowcard p { margin: 6px 0 0; color: var(--muted); font-size: 18px; }
.bignote { font-size: clamp(18px, 2.2vw, 26px); color: var(--gold2); font-family: Fraunces, serif; font-style: italic; border-left: 3px solid var(--gold); padding-left: 14px; }
.ready { font-size: 22px; color: var(--muted); text-align: center; }
.liveprog .bar { height: 12px; background: var(--bg2); border-radius: 99px; overflow: hidden; border: 1px solid var(--line); }
#lpfill { height: 100%; width: 0; background: linear-gradient(90deg, var(--gold), var(--gold2)); border-radius: 99px; }
.times { display: flex; justify-content: space-between; margin-top: 6px; font-variant-numeric: tabular-nums; color: var(--muted); font-size: 18px; font-weight: 600; }
.controls { display: grid; grid-template-columns: 1fr 2.4fr 1fr 1fr; gap: 12px; }
.ctl { padding: 18px 10px; font-size: 17px; border-radius: 16px; }
.ctl.stop:not(:disabled) { color: #ffc1b4; border-color: #7a3326; }
.go { flex-direction: column; gap: 2px; padding: 18px; border-radius: 16px; background: linear-gradient(180deg, var(--gold2), var(--gold)); color: #1d1606; border: 0; box-shadow: 0 10px 30px #e8c26a44; min-height: 96px; white-space: normal; }
.go:hover:not(:disabled) { background: linear-gradient(180deg, #fbe7b4, var(--gold2)); }
.go-main { font-size: 30px; font-weight: 800; font-family: Fraunces, serif; }
.go-sub { font-size: 14px; font-weight: 600; opacity: .75; overflow: hidden; text-overflow: ellipsis; max-width: 100%; white-space: nowrap; }
.keys { color: var(--muted); font-size: 13px; text-align: center; margin: 0; }
.setlist { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; align-self: start; position: sticky; top: 76px; max-height: calc(100vh - 96px); overflow-y: auto; }
.setlist h3 { font-size: 18px; margin-bottom: 10px; display: flex; justify-content: space-between; align-items: baseline; }
.setlist ol { list-style: none; padding: 0; margin: 0; }
.setlist li { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; cursor: pointer; border: 1px solid transparent; }
.setlist li:hover { background: var(--panel2); }
.setlist li.done { opacity: .45; }
.setlist li.cur .num { background: var(--gold); color: #1d1606; }
.setlist li.next { border-color: #e8c26a77; background: #e8c26a12; }
.tag { font-size: 11px; font-weight: 700; color: var(--gold); white-space: nowrap; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--panel2); border: 1px solid var(--line); padding: 12px 18px; border-radius: 12px; box-shadow: 0 10px 40px #000a; z-index: 100; max-width: calc(100vw - 32px); }
.toast.error { background: #4a1f19; border-color: #7a3326; }

@media (max-width: 900px) {
  .editor, .live { grid-template-columns: 1fr; padding: 12px; }
  .cuelist, .setlist { position: static; max-height: none; }
  .cues { max-height: 40vh; }
  .points { grid-template-columns: 1fr; }
  .controls { grid-template-columns: 1fr 1fr 1fr; }
  .go { grid-column: 1 / -1; order: -1; }
  .nowcard img { width: 84px; height: 84px; }
  .top { padding: 8px 12px; gap: 8px; }
  .devicebar select { max-width: 170px; }
  .keys { display: none; }
  .brand span { display: none; }
  .showpick select { max-width: 150px; }
  .vol input { width: 70px; }
  .now { min-height: 200px; padding: 18px; }
}
