@font-face { font-family: 'FT Polar'; src: url('assets/fonts/FTPolar-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'FT Polar'; src: url('assets/fonts/FTPolar-Medium.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'FT Polar'; src: url('assets/fonts/FTPolar-Semibold.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'FT Polar'; src: url('assets/fonts/FTPolar-Bold.woff2') format('woff2'); font-weight: 700; font-display: swap; }

:root {
  --bg: #3A0209;          /* dunkles Weinrot: Rand der Szene / Vorhang */
  --bg-deep: #1E0105;
  --ink: #FFF6F2;
  --red: #D7192D;
  --gold: #E8B45A;
  --gold-hi: #F6D58E;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; }
body {
  background: radial-gradient(120% 90% at 50% 45%, var(--bg) 0%, var(--bg-deep) 100%);
  color: var(--ink);
  font-family: 'FT Polar', system-ui, sans-serif;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
#app { position: fixed; inset: 0; overflow: hidden; }

/* Bühne: 16:9, deckt das Fenster ab (Position/Größe setzt main.js) */
#stage { position: absolute; transform-origin: 0 0; }
#plate, #clips, #glow { position: absolute; inset: 0; width: 100%; height: 100%; display: block; user-select: none; }
#glow { pointer-events: none; mix-blend-mode: screen; mix-blend-mode: plus-lighter; }   /* Lichterkette: Glühen addiert sich aufs Bild */
#hits { position: absolute; inset: 0; pointer-events: none; }
body.free #hits { pointer-events: auto; }
.hit { position: absolute; cursor: pointer; border-radius: 40% 40% 12% 12%;
  appearance: none; -webkit-appearance: none; background: transparent; border: 0; padding: 0; }
.hit:focus-visible { outline: 3px solid var(--gold); outline-offset: 4px; }
body.debug .hit { background: rgba(255, 255, 255, .12); outline: 1px dashed #fff; }

/* Theater: Licht auf der Bühne, Ränder im Dunkel (Mitte/Radien setzt main.js passend zur Bühne) */
#vignette { position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(14, 0, 3, .42) 0%, rgba(14, 0, 3, .12) 7%, transparent 15%),
    radial-gradient(var(--rx, 62vw) var(--ry, 72vh) at var(--vx, 50%) var(--vy, 48%),
      transparent 0%, transparent 62%, rgba(22, 0, 5, .28) 80%, rgba(16, 0, 4, .62) 93%, rgba(12, 0, 3, .82) 104%); }
#snow, #fx, #fxnear, #frame { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
#frame { filter: blur(.3px); }                 /* Showlichter im Vordergrund: minimal weich (Tiefe) */
#fxnear { filter: blur(5px); opacity: .9; }

/* ---------- Ladeanimation ---------- */
#loader { position: absolute; inset: 0; z-index: 20; display: grid; place-items: center; pointer-events: none; }
body:not(.intro-on) #loader { display: none; }
#veil, #shade { position: absolute; inset: 0; }
#veil { -webkit-backdrop-filter: blur(34px); backdrop-filter: blur(34px); }        /* Bühne taucht aus der Unschärfe auf … */
#shade { background: radial-gradient(ellipse at center, #2A0309 0%, #120104 75%, #0A0002 100%); }   /* … und aus dem Dunkel */
#loader-logo { z-index: 1; }
#loader-logo { aspect-ratio: 164 / 28; position: relative; color: var(--ink); }
#loader-logo { width: min(56vw, 780px); }
#loader-logo svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; will-change: transform, opacity; }
#loader-logo .intro__fill { opacity: 0; }
#loader-logo .intro__stroke { fill: none; stroke: #ffffff47; stroke-dasharray: 1 1; stroke-dashoffset: 1px; }
/* Fortschrittslinie: nur sichtbar, wenn nach der Logo-Animation noch geladen wird */
#loader-bar { position: absolute; z-index: 1; left: 50%; top: calc(50% + min(4.8vw, 67px) + 44px); width: min(220px, 36vw); height: 1px;
  transform: translateX(-50%); background: rgba(255, 255, 255, .14); opacity: 0; transition: opacity .45s var(--ease); overflow: hidden; }
#loader-bar i { position: absolute; inset: 0; background: rgba(255, 255, 255, .8); transform-origin: left center;
  transform: scaleX(var(--p, 0)); transition: transform .3s linear; }
body.loading-slow #loader-bar { opacity: 1; }
/* Ladesprüche unter der Linie: rotieren flott, solange geladen wird */
#loader-status { position: absolute; z-index: 1; left: 50%; top: calc(50% + min(4.8vw, 67px) + 60px); transform: translateX(-50%);
  height: 22px; width: min(90vw, 520px); overflow: hidden; text-align: center; opacity: 0; transition: opacity .45s var(--ease); }
body.loading-slow #loader-status { opacity: 1; }
#loader-status span { display: inline-block; font-size: 15px; font-weight: 500; letter-spacing: .01em; color: var(--ink);
  white-space: nowrap; opacity: .92; }
#loader-status span.out { animation: status-out .22s cubic-bezier(.4, 0, 1, 1) forwards; }
#loader-status span.in { animation: status-in .32s cubic-bezier(.1, .7, .2, 1) forwards; }
@keyframes status-out { to { opacity: 0; transform: translateY(-9px); filter: blur(2px); } }
@keyframes status-in { from { opacity: 0; transform: translateY(10px); filter: blur(2px); } to { opacity: .92; transform: none; filter: none; } }
#loader-note { position: absolute; z-index: 1; left: 50%; bottom: clamp(44px, 12vh, 130px); transform: translateX(-50%);
  display: flex; align-items: center; gap: 11px; white-space: nowrap; opacity: 0; transition: opacity .7s var(--ease); }
#loader-note svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
body.loader-note #loader-note { opacity: .72; }
@media (max-width: 760px) { #loader-bar { top: calc(50% + 6.9vw + 32px); } #loader-status { top: calc(50% + 6.9vw + 46px); } #loader-status span { font-size: 13px; } #loader-note { bottom: clamp(36px, 9vh, 90px); font-size: 11px; } #loader-note svg { width: 17px; height: 17px; } }

/* ---------- Logo-Feld oben links (1:1 tallbeard.studio) ---------- */
.nav { position: absolute; inset: 0 0 auto; z-index: 30; display: flex; pointer-events: none;
  padding: 22px clamp(20px, 4.5vw, 72px); }
.nav__mark { pointer-events: auto; display: grid; place-items: center; width: 60px; height: 60px;
  background: #fff; color: #0a0a0a; transition: background-color .3s, color .3s, opacity .9s; }
.nav__mark svg { width: auto; height: 26px; display: block; transform: translate(-7.5%, -6.9%); }
.nav__mark:hover { background: #e7e5ef; }
.nav__mark:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
@media (max-width: 760px) { .nav__mark { width: 48px; height: 48px; } .nav__mark svg { height: 21px; } }
body.intro-on .nav__mark { color: #fff; background-color: transparent; }
body.intro-on .nav__mark svg { opacity: 0; }
@media (max-width: 760px) { #loader-logo { width: 80vw; } }

/* ---------- Intro auf dem Vorhang ---------- */
#intro { position: absolute; inset: 0; z-index: 6; display: grid; place-content: center; justify-items: center;
  text-align: center; padding: 24px; gap: 14px; transition: opacity .6s var(--ease), visibility .6s; }
/* Einblenden wie .stage-in auf tallbeard.studio: Titel Zeichen für Zeichen aus der Unschärfe, Rest weich hinterher */
#title .w, #title .ch, #title .ch__i { display: inline-block; }
#title .hy[hidden] { display: none; }
#title .ch__i { opacity: 0; filter: blur(14px); }
body.stage-in #title .ch__i { animation: unblur 1.15s cubic-bezier(.25, .6, .2, 1) forwards; animation-delay: calc(var(--i) * 34ms); }
#intro .sub, #start { opacity: 0; }
body.stage-in #intro .sub { animation: fade-in 1.4s .75s forwards; }
#start { visibility: hidden; }                     /* erst klickbar, wenn er sichtbar wird (Klick zum Überspringen löst ihn nicht mit aus) */
body.stage-in #start { animation: fade-in 1.4s .9s forwards, reveal 0s .9s forwards; }
@keyframes unblur { to { opacity: 1; filter: none; } }
@keyframes fade-in { to { opacity: 1; } }
@keyframes reveal { to { visibility: visible; } }
#title { font-size: clamp(44px, 8vw, 112px); line-height: .92; font-weight: 700; letter-spacing: -.01em;
  text-shadow: 0 4px 30px rgba(20, 0, 4, .55); }
/* 3D-Schriftzug aus Blender (Gold + Lichterketten, Schatten auf dem Vorhang ist im Bild) */
#title.title-3d { font-size: 0; line-height: 0; text-shadow: none;
  width: min(84vw, 1060px, calc((100svh - 220px) * var(--title-ar, 2.33))); margin-bottom: 2px; }
.title-3d__art { position: relative; display: block; opacity: 0; filter: blur(14px); transform: scale(.965); }
body.stage-in .title-3d__art { animation: title-in 1.5s cubic-bezier(.25, .6, .2, 1) forwards; }
@keyframes title-in { to { opacity: 1; filter: none; transform: none; } }
.title-3d__art img { display: block; width: 100%; height: auto; user-select: none; -webkit-user-drag: none; }
#title-glow { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.sub { font-size: clamp(16px, 1.6vw, 21px); opacity: .9; margin-bottom: 18px; text-shadow: 0 2px 12px rgba(20, 0, 4, .6); }
.note { font-size: 13px; letter-spacing: .12em; text-transform: uppercase; opacity: .65; }
body.open #intro { opacity: 0; visibility: hidden; pointer-events: none; }

/* ---------- Buttons ---------- */
.pill { font: 700 clamp(15px, 1.3vw, 18px)/1 'FT Polar', system-ui, sans-serif; white-space: nowrap;
  display: inline-flex; gap: .6em; align-items: center; padding: .95em 1.5em; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--ink); color: var(--red);
  box-shadow: 0 10px 30px rgba(30, 0, 6, .45), inset 0 -2px 0 rgba(0, 0, 0, .08);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease); }
.pill:hover { transform: translateY(-2px); box-shadow: 0 14px 36px rgba(30, 0, 6, .55); }
.pill.big { font-size: clamp(18px, 1.7vw, 23px); padding: 1em 1.8em; }
.pill .icon { font-size: .8em; }
.round { width: 46px; height: 46px; border-radius: 50%; border: 2px solid rgba(255, 246, 242, .6);
  background: rgba(255, 255, 255, .08); color: var(--ink); font-size: 18px; cursor: pointer; backdrop-filter: blur(6px); }
.round[aria-pressed="true"] { opacity: .5; text-decoration: line-through; }

/* Großer Play-Button: sobald der Vorhang offen ist (nicht während die Kapelle spielt) */
.controls { position: absolute; left: 50%; top: var(--controls-top, calc(100% - 140px)); transform: translate(-50%, calc(-50% + 12px)); z-index: 7;
  display: flex; flex-direction: column; gap: 14px; align-items: center; opacity: 0; pointer-events: none; transition: opacity .8s var(--ease), transform .8s var(--ease); }
body.free .controls { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%); }   /* sitzt auf dem Bühnenboden vor der Band */
.controls .note { white-space: nowrap; text-shadow: 0 1px 8px rgba(20, 0, 4, .8); transition: opacity .6s; }
body.played .controls .note { opacity: 0; }        /* nach dem ersten Mal nicht mehr nötig */
/* Buttons wie auf tallbeard.studio (.btn: 52 px hoch, FT Polar 600 16 px, 26 px Innenabstand, Pille, Hover 2 px hoch) –
   Look „Liquid Glass“: klares, milchiges Glas, dicke lichtbrechende Kante, weißes Icon.
   In Chromium bricht zusätzlich ein SVG-Filter das Bild an der Kante (main.js: liquidGlass). */
.btn { min-height: 52px; font: 600 16px/1 'FT Polar', system-ui, sans-serif; white-space: nowrap; border-radius: 999px;
  display: inline-flex; justify-content: center; align-items: center; gap: 10px; padding: 0 26px; cursor: pointer;
  transition: background .3s, box-shadow .3s, transform .3s cubic-bezier(.2, .7, .1, 1); }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(.985); }
.btn:focus-visible { outline: 2px solid #fff; outline-offset: 4px; }
.btn--glass { position: relative; color: #fff; padding: 0 28px 0 21px; border: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, .15) 0%, rgba(255, 255, 255, .04) 50%, rgba(120, 0, 22, .14) 100%);   /* Hauch Rauch unten → Schrift lesbar auch auf hellem Rosa */
  -webkit-backdrop-filter: blur(10px) saturate(140%) brightness(.98); backdrop-filter: blur(10px) saturate(140%) brightness(.98);
  text-shadow: 0 1px 2px rgba(90, 0, 18, .5), 0 0 16px rgba(90, 0, 18, .38);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, .30),                /* feine Glaskante */
    inset 2px 2.5px .5px -1px rgba(255, 255, 255, .9),       /* Lichtkante oben links */
    inset -2px -2.5px .5px -1px rgba(255, 255, 255, .5),     /* Gegenlicht unten rechts */
    inset 0 0 5px 1px rgba(255, 255, 255, .22),              /* Fase */
    inset 0 0 18px 3px rgba(255, 255, 255, .09),
    0 14px 32px -8px rgba(50, 0, 10, .32), 0 2px 6px rgba(50, 0, 10, .12); }
.btn--glass:hover { background: linear-gradient(180deg, rgba(255, 255, 255, .22) 0%, rgba(255, 255, 255, .07) 50%, rgba(120, 0, 22, .12) 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, .40),
    inset 2px 2.5px .5px -1px rgba(255, 255, 255, 1),
    inset -2px -2.5px .5px -1px rgba(255, 255, 255, .6),
    inset 0 0 6px 1px rgba(255, 255, 255, .28),
    inset 0 0 20px 4px rgba(255, 255, 255, .12),
    0 18px 38px -8px rgba(50, 0, 10, .38), 0 3px 8px rgba(50, 0, 10, .14); }
/* Runder Play-Button (alle zusammen): Glaskugel-Kreis, nur Icon */
.btn--round { width: 84px; height: 84px; min-height: 0; padding: 0; border-radius: 50%; }
.btn--round svg { width: 36px; height: 36px; fill: #fff;                           /* Musiknote (♫), optisch mittig */
  filter: drop-shadow(0 1px 2px rgba(90, 0, 18, .5)) drop-shadow(0 0 12px rgba(90, 0, 18, .3)); transition: transform .3s cubic-bezier(.2, .7, .1, 1); }
.btn--round:hover svg { transform: scale(1.08); }
/* Nach dem ersten Durchlauf: „Nochmal“ – Pfeil im Kreis statt Play */
.btn--round .ico-replay { display: none; width: 36px; height: 36px; fill: none; stroke: #fff; stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; }
body.played .btn--round .ico-play { display: none; }
body.played .btn--round .ico-replay { display: block; }
.btn--round:hover .ico-replay { transform: rotate(-35deg) scale(1.05); }
.btn--text { padding: 0 30px; }                 /* nur Text, kein Icon (der Vorhang-Button spielt nichts ab) */
#intro #start { margin-top: 22px; }
.btn__icon { width: 22px; height: 22px; flex: none; display: grid; place-items: center; color: #fff;
  filter: drop-shadow(0 1px 2px rgba(90, 0, 18, .5)) drop-shadow(0 0 10px rgba(90, 0, 18, .3)); transition: transform .3s cubic-bezier(.2, .7, .1, 1); }
.btn__icon svg { width: 24px; height: 24px; fill: currentColor; }
.btn:hover .btn__icon { transform: scale(1.08); }

#label { position: absolute; z-index: 8; pointer-events: none; transform: translate(-50%, -100%);
  padding: .5em .9em; border-radius: 999px; background: rgba(255, 246, 242, .95); color: var(--red);
  font-weight: 700; font-size: 15px; white-space: nowrap; opacity: 0;
  transition: opacity .2s var(--ease), transform .3s var(--ease); box-shadow: 0 8px 24px rgba(30, 0, 6, .35); }
#label.show { opacity: 1; transform: translate(-50%, calc(-100% - 8px)); }
#label small { font-weight: 500; opacity: .7; margin-left: .4em; }
/* Verweilzeit: kleiner Balken füllt sich, dann legt die Figur los */
#label .arm { position: absolute; left: 14px; right: 14px; bottom: 5px; height: 2px; border-radius: 2px; background: rgba(215, 25, 45, .18); overflow: hidden; }
#label .arm::after { content: ''; position: absolute; inset: 0; background: var(--red); transform: scaleX(0); transform-origin: 0 50%; }
#label.arming .arm::after { animation: arm var(--dwell, .7s) linear forwards; }
#label.playing .arm { opacity: 0; }
@keyframes arm { to { transform: scaleX(1); } }

@media (prefers-reduced-motion: reduce) {
  #snow { display: none; }
  #title .ch__i, #intro .sub, #start, #intro .note { opacity: 1; filter: none; animation: none; visibility: visible; }
}
