/* WifOR Song – Gestaltung nach dem WifOR Design System (Navy trägt, Rot ist das Signal). */
@font-face { font-family: 'Inter Tight Variable'; src: url('/fonts/inter-tight-latin-wght-normal.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Inter Variable'; src: url('/fonts/inter-latin-wght-normal.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }

:root {
  --navy-950: #001324; --navy-900: #002240; --navy-800: #003663; --navy-700: #0c4775; --navy-600: #195d92;
  --navy-500: #2c76ae; --navy-400: #5897c6; --navy-300: #93bddc; --navy-200: #c4dcee; --navy-100: #e4eff7; --navy-50: #f1f7fb;
  --red-700: #a52833; --red-600: #bb313c; --red-500: #cc3a45; --red-400: #db5f68; --red-300: #e9949a; --red-100: #fbe3e5;
  --ink-900: #16202b; --slate-700: #36465a; --slate-500: #64748b; --slate-300: #c2ccd6; --slate-200: #dde3ea; --slate-100: #eef1f5; --paper: #f6f8fa;
  --success-500: #2e9e62; --success-300: #7fd0a5; --warning-500: #d7920f; --warning-300: #f0c264;
  --font-display: 'Inter Tight Variable', 'Inter Variable', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-sans: 'Inter Variable', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --r-sm: 4px; --r-md: 6px; --r-lg: 10px;
  --line: rgba(196, 220, 238, 0.16);
  --dock-h: 148px;
}
* { box-sizing: border-box; }
html { overflow-x: clip; overscroll-behavior-x: none; touch-action: manipulation; -webkit-text-size-adjust: 100%; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font-sans); font-size: 17px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--font-display); letter-spacing: -0.02em; line-height: 1.12; margin: 0; }
p { margin: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

/* ---------- Studio (dunkel) ---------- */
body.studio { background: var(--navy-950); color: #fff; min-height: 100dvh; }
body.studio::before {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(900px 480px at 85% -10%, rgba(44, 118, 174, 0.34), transparent 70%),
    radial-gradient(700px 420px at -10% 30%, rgba(204, 58, 69, 0.16), transparent 70%);
}
#app { position: relative; z-index: 1; }
.eyebrow { font-size: 13px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--navy-300); }
.muted { color: var(--navy-200); }
.small { font-size: 15px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 12px 22px;
  border: 1px solid transparent; border-radius: var(--r-md); font-weight: 650; font-size: 17px; text-decoration: none;
  transition: background 0.15s, border-color 0.15s, transform 0.05s;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible, .icon-btn:focus-visible, .choice:focus-visible, .take-btn:focus-visible { outline: 3px solid var(--navy-300); outline-offset: 2px; }
.btn-red { background: var(--red-500); color: #fff; }
.btn-red:hover { background: var(--red-600); color: #fff; }
.btn-light { background: #fff; color: var(--navy-900); }
.btn-light:hover { background: var(--navy-100); color: var(--navy-900); }
.btn-ghost { background: rgba(255, 255, 255, 0.06); border-color: var(--line); color: #fff; }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.14); color: #fff; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.btn-wide { width: 100%; }
.btn svg, .icon-btn svg, .take-btn svg { width: 22px; height: 22px; flex: none; }

.boot { min-height: 100dvh; display: grid; place-items: center; }
.boot-bars { display: flex; gap: 6px; align-items: center; height: 56px; }
.boot-bars i { width: 6px; height: 20px; background: var(--navy-300); border-radius: 2px; animation: bars 1s ease-in-out infinite; }
.boot-bars i:nth-child(2) { animation-delay: 0.12s; } .boot-bars i:nth-child(3) { animation-delay: 0.24s; background: var(--red-400); }
.boot-bars i:nth-child(4) { animation-delay: 0.36s; } .boot-bars i:nth-child(5) { animation-delay: 0.48s; }
@keyframes bars { 0%, 100% { height: 14px; } 50% { height: 54px; } }

/* ---------- Ankommen ---------- */
.hall { min-height: 100dvh; display: flex; flex-direction: column; padding: 28px 22px calc(28px + env(safe-area-inset-bottom)); max-width: 640px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { width: 40px; height: 40px; border-radius: var(--r-sm); display: block; }
.brand b { font-family: var(--font-display); font-size: 18px; font-weight: 650; letter-spacing: 0.01em; }
.hall-main { margin: auto 0; padding: 36px 0; }
.hall h1 { font-size: clamp(40px, 11vw, 64px); font-weight: 750; margin: 14px 0 18px; }
.hall h1 em { font-style: normal; color: var(--red-300); }
.lead { font-size: 19px; color: var(--navy-100); max-width: 34em; }
.steps { list-style: none; margin: 30px 0; padding: 0; display: grid; gap: 18px; }
.steps li { display: grid; grid-template-columns: 48px 1fr; gap: 16px; align-items: start; }
.steps .ico { width: 48px; height: 48px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: var(--r-md); color: var(--navy-200); background: rgba(255, 255, 255, 0.04); }
.steps .ico svg { width: 26px; height: 26px; }
.steps b { display: block; font-size: 18px; }
.steps span { color: var(--navy-200); font-size: 16px; }
.consent { display: grid; grid-template-columns: 30px 1fr; gap: 14px; align-items: start; padding: 18px; border: 1px solid var(--line); border-radius: var(--r-lg); background: rgba(255, 255, 255, 0.04); margin-bottom: 20px; font-size: 16px; cursor: pointer; }
.consent input { width: 26px; height: 26px; margin: 2px 0 0; accent-color: var(--red-500); }
.field { display: block; margin: 22px 0; }
.field span { display: block; font-weight: 600; margin-bottom: 8px; }
.input { width: 100%; min-height: 56px; padding: 14px 16px; font-size: 18px; border-radius: var(--r-md); border: 1px solid var(--navy-400); background: rgba(255, 255, 255, 0.07); color: #fff; }
.input::placeholder { color: var(--navy-300); }
.input:focus { outline: 3px solid var(--navy-400); outline-offset: 1px; }
textarea.input { min-height: 96px; resize: vertical; }
.error { color: var(--red-300); font-weight: 600; margin-top: 12px; min-height: 1.5em; }

/* ---------- Studio ---------- */
.top { display: flex; align-items: center; gap: 12px; padding: 14px 18px; max-width: 1180px; margin: 0 auto; }
.top .brand img { width: 34px; height: 34px; }
.top h1 { font-size: 20px; font-weight: 700; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .who { font-size: 15px; color: var(--navy-200); white-space: nowrap; }
.icon-btn { width: 48px; height: 48px; display: grid; place-items: center; border-radius: var(--r-md); border: 1px solid var(--line); background: rgba(255, 255, 255, 0.05); color: #fff; }
.icon-btn:hover { background: rgba(255, 255, 255, 0.14); }

.stage { position: sticky; top: 0; z-index: 5; background: linear-gradient(var(--navy-950) 82%, rgba(0, 19, 36, 0)); padding: 4px 0 18px; }
.stage-in { max-width: 1180px; margin: 0 auto; padding: 0 18px; }
.wave { position: relative; border: 1px solid var(--line); border-radius: var(--r-lg); background: rgba(0, 34, 64, 0.72); overflow: hidden; touch-action: pan-y; cursor: pointer; }
.wave canvas { display: block; width: 100%; height: 150px; }
.wave .now { position: absolute; left: 12px; top: 8px; font-family: var(--font-display); font-size: 15px; font-weight: 650; font-variant-numeric: tabular-nums; color: var(--navy-100); pointer-events: none; }
.wave .hint { position: absolute; right: 12px; top: 8px; font-size: 13px; color: var(--navy-300); pointer-events: none; }
@media (max-width: 520px) { .wave .hint { display: none; } }
.rec-flag { display: none; align-items: center; gap: 8px; color: #fff; font-weight: 700; }
.rec-flag i { width: 12px; height: 12px; border-radius: 50%; background: var(--red-400); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0.25; } }
body.recording .rec-flag { display: inline-flex; }
body.recording .wave { border-color: var(--red-400); cursor: default; }
body.recording .wave .hint { display: none; }

.cols { max-width: 1180px; margin: 0 auto; padding: 4px 18px calc(var(--dock-h) + 40px + env(safe-area-inset-bottom)); display: grid; gap: 22px; }
@media (min-width: 900px) { .cols { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; } }
.panel { border: 1px solid var(--line); border-radius: var(--r-lg); background: rgba(0, 34, 64, 0.6); padding: 20px; }
.panel > h2 { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.panel > .sub { color: var(--navy-200); font-size: 16px; margin-bottom: 16px; }

.lyrics { max-height: 46vh; overflow-y: auto; margin: 0 -8px; padding: 0 8px; scroll-behavior: smooth; }
@media (min-width: 900px) { .lyrics { max-height: calc(100dvh - 520px); min-height: 260px; } }
.ly { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 7px 10px; border-radius: var(--r-sm); font-size: 21px; line-height: 1.35; font-family: var(--font-display); font-weight: 550; color: var(--navy-300); }
button.ly:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
.ly.on { color: #fff; background: rgba(255, 255, 255, 0.09); }
.ly.past { color: var(--navy-400); }
.ly-head { font-family: var(--font-sans); font-size: 13px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--red-300); padding: 16px 10px 4px; }
.ly-gap { height: 14px; }

.takes { display: grid; gap: 12px; }
.take { border: 1px solid var(--line); border-radius: var(--r-md); background: rgba(255, 255, 255, 0.04); padding: 14px; }
.take.picked { border-color: var(--red-400); background: rgba(204, 58, 69, 0.14); }
.take-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.take-head b { font-family: var(--font-display); font-size: 19px; }
.take-head span { color: var(--navy-200); font-size: 15px; font-variant-numeric: tabular-nums; }
.take-state { font-size: 15px; color: var(--warning-300); margin-top: 6px; }
.take-state.ok { color: var(--success-300); }
.take-state.bad { color: var(--red-300); }
.bar { height: 4px; background: rgba(255, 255, 255, 0.14); border-radius: 2px; margin-top: 8px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--navy-300); width: 0; transition: width 0.2s; }
.take-actions { display: grid; grid-template-columns: 1fr 1fr 52px; gap: 8px; margin-top: 12px; }
.take-btn { min-height: 52px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: var(--r-md); border: 1px solid var(--line); background: rgba(255, 255, 255, 0.06); color: #fff; font-weight: 600; font-size: 16px; padding: 8px 10px; }
.take-btn:hover { background: rgba(255, 255, 255, 0.15); }
.take-btn.on { background: var(--red-500); border-color: var(--red-500); color: #fff; }
.take-btn.on:hover { background: var(--red-600); color: #fff; }
.take-btn[disabled] { opacity: 0.4; cursor: not-allowed; }
.empty { color: var(--navy-200); border-top: 1px dashed var(--line); padding-top: 16px; }

.choices { display: grid; gap: 12px; margin: 6px 0 18px; }
@media (min-width: 560px) { .choices { grid-template-columns: 1fr 1fr; } }
.choice { text-align: left; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.04); color: #fff; border-radius: var(--r-md); padding: 16px; display: grid; grid-template-columns: 44px 1fr; gap: 14px; align-items: center; min-height: 92px; }
.choice:hover { background: rgba(255, 255, 255, 0.1); }
.choice svg { width: 40px; height: 40px; color: var(--navy-300); }
.choice b { display: block; font-family: var(--font-display); font-size: 20px; }
.choice span { font-size: 15px; color: var(--navy-200); }
.choice[aria-pressed='true'] { border-color: #fff; background: #fff; color: var(--navy-900); }
.choice[aria-pressed='true'] span { color: var(--slate-700); }
.choice[aria-pressed='true'] svg { color: var(--red-500); }
.done-box { text-align: center; padding: 10px 0 4px; }
.done-box svg { width: 56px; height: 56px; color: var(--success-300); }
.done-box h3 { font-size: 26px; margin: 10px 0 8px; }

details.setup { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 6px; }
details.setup summary { min-height: 48px; display: flex; align-items: center; gap: 10px; font-weight: 600; cursor: pointer; list-style: none; color: var(--navy-100); }
details.setup summary::-webkit-details-marker { display: none; }
details.setup summary svg { width: 22px; height: 22px; }
.slider { display: grid; grid-template-columns: 130px 1fr; gap: 12px; align-items: center; min-height: 48px; font-size: 16px; }
.slider input { width: 100%; accent-color: var(--red-400); height: 32px; }
select.input { min-height: 52px; font-size: 16px; appearance: auto; color: #fff; }
select.input option { color: #000; }

/* ---------- Bedienleiste ---------- */
.dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; background: rgba(0, 19, 36, 0.94); backdrop-filter: blur(14px); border-top: 1px solid var(--line); padding: 10px 18px calc(12px + env(safe-area-inset-bottom)); }
.dock-in { max-width: 560px; margin: 0 auto; }
.meter { height: 8px; border-radius: 2px; background: rgba(255, 255, 255, 0.1); overflow: hidden; position: relative; }
.meter i { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(90deg, var(--navy-400), var(--success-300) 55%, var(--warning-300) 82%, var(--red-400)); background-size: 560px 100%; }
.meter-row { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center; font-size: 13px; color: var(--navy-300); min-height: 20px; }
.controls { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; margin-top: 8px; }
.controls .left { display: flex; gap: 10px; justify-content: flex-end; }
.controls .right { display: flex; gap: 10px; justify-content: flex-start; }
.round { width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.07); color: #fff; }
.round:hover { background: rgba(255, 255, 255, 0.16); }
.round svg { width: 26px; height: 26px; }
.minus10 { font-family: var(--font-display); font-weight: 700; font-size: 19px; letter-spacing: -0.02em; }
.round[disabled] { opacity: 0.35; cursor: not-allowed; }
.rec { width: 88px; height: 88px; border-radius: 50%; border: 3px solid #fff; background: transparent; display: grid; place-items: center; position: relative; }
.rec i { width: 62px; height: 62px; border-radius: 50%; background: var(--red-500); transition: all 0.18s; }
.rec:hover i { background: var(--red-400); }
.rec::after { content: ''; position: absolute; inset: -3px; border-radius: 50%; box-shadow: 0 0 0 calc(var(--lvl, 0) * 22px) rgba(219, 95, 104, 0.35); pointer-events: none; }
body.recording .rec i { width: 32px; height: 32px; border-radius: 5px; }
.rec-label { text-align: center; font-size: 15px; font-weight: 600; color: var(--navy-100); margin-top: 6px; min-height: 22px; }

.count { position: fixed; inset: 0; z-index: 40; background: rgba(0, 19, 36, 0.9); display: grid; place-items: center; text-align: center; }
.count b { font-family: var(--font-display); font-size: min(46vw, 300px); font-weight: 800; line-height: 1; display: block; animation: pop 0.8s ease-out; }
.count span { font-size: 20px; color: var(--navy-200); }
@keyframes pop { from { transform: scale(1.5); opacity: 0; } 30% { opacity: 1; } to { transform: scale(1); } }

#toast { position: fixed; left: 50%; bottom: calc(var(--dock-h) + 26px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); z-index: 50; max-width: min(92vw, 520px); background: #fff; color: var(--ink-900); padding: 14px 18px; border-radius: var(--r-md); font-weight: 600; font-size: 16px; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4); opacity: 0; pointer-events: none; transition: all 0.25s; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
body:not(.in-studio) #toast { bottom: 26px; }

.sheet-back { position: fixed; inset: 0; z-index: 30; background: rgba(0, 10, 20, 0.7); display: grid; align-items: end; }
.sheet { background: var(--navy-900); border-top: 1px solid var(--line); border-radius: 14px 14px 0 0; padding: 22px 22px calc(22px + env(safe-area-inset-bottom)); max-height: 88dvh; overflow-y: auto; }
.sheet h2 { font-size: 24px; margin-bottom: 10px; }
.sheet p { color: var(--navy-100); margin-bottom: 14px; }
.sheet-actions { display: grid; gap: 10px; margin-top: 18px; }
.linkbox { font-size: 15px; word-break: break-all; padding: 12px; border: 1px dashed var(--line); border-radius: var(--r-sm); color: var(--navy-100); user-select: all; }
@media (min-width: 560px) { .sheet-back { align-items: center; justify-items: center; } .sheet { border-radius: var(--r-lg); border: 1px solid var(--line); width: min(520px, 92vw); } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
