:root { --bg: #120d24; --card: rgba(255,255,255,.06); --line: rgba(255,255,255,.1); --text: #f3eef6; --muted: #b1a6c4; --accent: #ff6fae; --cyan: #7ef2ff; --gold: #ffd27a; --ok: #7ef2ff; }
/* Marke Flimmerwerk: Neon-Pink auf tiefem Violett, Cyan für Status und Ringe */
html, body { background: linear-gradient(170deg, #2e1a4f 0%, #1d1238 45%, #120d24 100%) fixed; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 17px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
[hidden] { display: none !important; }
h1 { font-size: clamp(26px, 3.4vw, 46px); line-height: 1.1; margin: 10px 0 14px; }
h2 { font-size: 15px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 12px; }
.muted { color: var(--muted); }
.btn { border: 0; border-radius: 14px; background: var(--accent); color: #fff; font: inherit; font-weight: 700; padding: 12px 22px; cursor: pointer; }
.btn.big { font-size: 22px; padding: 18px 34px; border-radius: 18px; }

.unlock, .message { position: fixed; inset: 0; display: grid; place-items: center; background: radial-gradient(ellipse at 50% 30%, #2e1a4f 0%, var(--bg) 70%); z-index: 10; text-align: center; padding: 24px; }
.unlock-card, .msg-card { max-width: 560px; }
.logo { width: 84px; height: 84px; margin: 0 auto; border-radius: 24px; background: var(--accent); display: grid; place-items: center; color: #fff; }
.logo svg { width: 44px; height: 44px; }

/* Übersicht: QR links, Text rechts, darunter Figuren und Playlisten. */
.idle { min-height: 100%; padding: clamp(20px, 4vw, 56px); display: grid; gap: clamp(20px, 3vw, 40px); align-content: start; }
.pair { display: grid; grid-template-columns: auto 1fr; gap: clamp(20px, 4vw, 56px); align-items: center; }
.qr-box { background: #fff; padding: 18px; border-radius: 24px; box-shadow: 0 20px 60px rgba(0,0,0,.4); }
.qr svg, .qr img { display: block; width: clamp(200px, 26vw, 340px); height: auto; }
.pair.connected .qr-box { padding: 10px; opacity: .55; }
.pair.connected .qr svg { width: clamp(110px, 12vw, 160px); }
.status { display: inline-flex; align-items: center; gap: 10px; padding: 8px 14px; border-radius: 99px; background: var(--card); font-weight: 700; }
.status i { width: 12px; height: 12px; border-radius: 50%; background: #e0a43a; box-shadow: 0 0 0 4px rgba(224,164,58,.2); }
.status.on i { background: var(--ok); box-shadow: 0 0 0 4px rgba(79,209,139,.2); }
.steps { margin: 0; padding-left: 1.3em; font-size: clamp(17px, 1.6vw, 22px); }
.steps li { margin: 6px 0; }
.lists { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(20px, 3vw, 40px); }
@media (max-width: 820px) { .pair, .lists { grid-template-columns: 1fr; } .qr-box { justify-self: center; } }
.count { color: var(--text); background: var(--card); border-radius: 99px; padding: 1px 9px; margin-left: 6px; letter-spacing: 0; }
.figures { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.fig { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 14px; cursor: pointer; text-align: left; color: inherit; font: inherit; }
.fig:hover { border-color: var(--accent); }
.fig .dot { width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center; margin-bottom: 10px; background: color-mix(in srgb, var(--c) 22%, transparent); color: color-mix(in srgb, var(--c) 70%, #fff); font-weight: 800; font-size: 22px; }
.fig.off { opacity: .55; cursor: default; }
.fig .dot img { width: 100%; height: 100%; object-fit: contain; padding: 3px; }
.fig b { display: block; }
.fig small { color: var(--muted); display: block; }
.empty { background: var(--card); border: 1px dashed var(--line); border-radius: 18px; padding: 18px; color: var(--muted); }
.playlists { display: grid; gap: 10px; }
.pl { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; }
.pl i { width: 14px; height: 40px; border-radius: 6px; flex: none; }
.pl img { width: 72px; height: 40px; object-fit: cover; border-radius: 8px; flex: none; }
.pl div { flex: 1; min-width: 0; }
.pl small { color: var(--muted); }

/* Abspielen: Video so groß wie möglich, Leiste und QR-Code darunter – nie über dem YouTube-Player (YouTube-Regeln). */
.playing { position: fixed; inset: 0; background: #000; display: flex; flex-direction: column; }
.stage { flex: 1; min-height: 0; display: grid; place-items: center; }
.video { position: relative; width: min(100vw, calc((100vh - 96px) * 16 / 9)); aspect-ratio: 16 / 9; background: #000; }
.vb-source, .vb-source iframe, .vb-source video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.vb-source video { object-fit: contain; background: #000; }
.bar { flex: none; height: 96px; display: flex; align-items: center; gap: 20px; padding: 0 clamp(16px, 3vw, 40px); background: #16141d; border-top: 1px solid var(--line); }
.now { flex: 1; min-width: 0; }
.now-title { font-size: clamp(17px, 2vw, 24px); font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.now-sub { color: var(--muted); }
.ctrl { display: flex; gap: 12px; }
.round { width: 54px; height: 54px; border-radius: 50%; border: 0; background: rgba(255,255,255,.1); color: #e9e4ee; cursor: pointer; display: grid; place-items: center; transition: background .15s, transform .08s; }
.round:hover { background: rgba(255,255,255,.18); }
.round:active { transform: scale(.93); }
.round svg { width: 24px; height: 24px; }
.round.big svg { width: 30px; height: 30px; }
.btn svg { width: 20px; height: 20px; vertical-align: -4px; margin-right: 8px; }
.round.warn { background: color-mix(in srgb, var(--accent) 30%, transparent); color: #fff; }
.round.big { width: 66px; height: 66px; background: var(--accent); color: #fff; }
.mini-qr { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; max-width: 260px; }
.mini-qr > div { background: #fff; padding: 4px; border-radius: 8px; flex: none; }
.mini-qr svg { display: block; width: 76px; height: 76px; }

/* Kino-Modus (vom iPhone schaltbar): Video füllt das Fenster, keine Leiste. */
body.kino:not(.phone-off) .playing .bar { display: none; }
/* Vollbild: Video füllt den ganzen Bildschirm (YouTube setzt bei anderem Seitenverhältnis selbst schwarze Balken). */
body.kino:not(.phone-off) .playing .stage { display: block; }
body.kino:not(.phone-off) .playing .video { width: 100vw; height: 100vh; aspect-ratio: auto; }
body.tv-browser { font-size: 20px; }

/* Schluss-Bildschirm des Zeitlimits */
.message .moon { display: none; width: 96px; height: 96px; margin: 0 auto 8px; color: #f4d58d; }
.message.ende .moon { display: block; }
.message.ende h1 { font-size: clamp(34px, 5vw, 64px); }

/* Lokaler Modus in der App (iPhone als Bildschirm, AirPlay-Fenster): nur Hinweis, kein QR-Code, keine Listen */
body.lokal { background: #000; }
body.lokal .idle { min-height: 100vh; place-items: center; align-content: center; text-align: center; background: #000; }
body.lokal .qr-box, body.lokal #steps, body.lokal .lists, body.lokal #status, body.lokal #owner, body.lokal .small-hint, body.lokal #mini-qr { display: none !important; }
body.lokal .pair { grid-template-columns: 1fr; }
body.lokal #headline { font-size: clamp(22px, 5vw, 48px); color: #f3eef6; }
body.lokal .playing .bar { display: none; }
body.lokal .playing .video { width: 100vw; height: 100vh; aspect-ratio: auto; }
body.lokal .playing .stage { display: block; }

.logo-img { width: 110px; height: 110px; border-radius: 26px; box-shadow: 0 0 40px rgba(255,111,174,.45); }
.btn { box-shadow: 0 0 22px rgba(255,111,174,.55); }
.round.big { box-shadow: 0 0 18px rgba(255,111,174,.6); }
.status.on i { background: var(--cyan); box-shadow: 0 0 0 4px rgba(126,242,255,.2), 0 0 12px var(--cyan); }
.qr-box { box-shadow: 0 0 0 3px rgba(255,111,174,.6), 0 0 40px rgba(255,111,174,.35); }
#headline { text-shadow: 0 0 24px rgba(255,111,174,.25); }
.bar { background: #120d24; }
