/* =====================================================================
   Smartphone-Ansicht (Teilnehmer) – Hochformat UND Querformat
   Jede Szene = .screen__aside (Logo + Visual) + .screen__main (Inhalt).
   Hochformat: untereinander. Querformat: nebeneinander, Liste scrollt innen.
   ===================================================================== */
html, body { height: 100%; }
.theme-mobile { background: #120720; overflow-x: hidden; }

/* ---------- Hintergrund: Glow, Lichtstrahlen, Bokeh, Welle, Schnee ---------- */
.bg { position: fixed; inset: 0; z-index: 0; overflow: hidden;
  background: radial-gradient(120% 55% at 50% -12%, #3d1470 0%, rgba(61, 20, 112, 0) 65%), #120720; }
.beam { position: absolute; top: -25vh; width: 58vw; height: 150vh; opacity: .85; transform-origin: top center;
  background: linear-gradient(180deg, rgba(196, 92, 255, 0.55), rgba(196, 92, 255, 0) 62%); filter: blur(34px); }
.beam--l { left: -14vw; rotate: -24deg; animation: swayL 9s ease-in-out infinite; }
.beam--r { right: -14vw; rotate: 24deg; animation: swayR 11s ease-in-out infinite; }
@keyframes swayL { 0%, 100% { rotate: -24deg; opacity: .8; } 50% { rotate: -19deg; opacity: 1; } }
@keyframes swayR { 0%, 100% { rotate: 24deg; opacity: .85; } 50% { rotate: 19deg; opacity: .6; } }
.blob { position: absolute; width: 42vw; height: 42vw; max-width: 320px; max-height: 320px; border-radius: 50%; filter: blur(48px); opacity: .32;
  background: #7c3aed; animation: drift 14s ease-in-out infinite alternate; }
.blob--1 { left: -10vw; top: 22vh; background: #9333ea; animation-duration: 13s; }
.blob--2 { right: -12vw; top: 48vh; background: #c026d3; animation-duration: 17s; animation-delay: -5s; }
.blob--3 { left: 30vw; top: 70vh; background: #6d28d9; animation-duration: 15s; animation-delay: -9s; }
@keyframes drift { from { translate: 0 0; scale: 1; } to { translate: 6vw -5vh; scale: 1.15; } }
.wave { position: absolute; bottom: 0; left: 0; width: 100%; height: 17vh; min-height: 120px; opacity: .9; }
.snow { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }
#app { position: relative; z-index: 2; }
.sound-toggle { top: 10px; left: 10px; }

/* ---------- Grundgerüst ---------- */
.phone { max-width: 500px; margin: 0 auto; padding: 12px 16px calc(18px + env(safe-area-inset-bottom)); min-height: 100vh; min-height: 100dvh; }
.screen { display: flex; flex-direction: column; gap: 14px; min-height: calc(100vh - 30px); min-height: calc(100dvh - 30px); }
.screen__aside, .screen__main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.screen__main { flex: 1; min-height: 0; }
.screen--fixed { height: calc(100vh - 30px); height: calc(100dvh - 30px); min-height: 0; overflow: hidden; }
.screen--fixed .list { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 2px 2px 6px; margin: -2px -2px 0; }
.screen--welcome, .screen--wait, .screen--done, .screen--missed, .screen--finished { text-align: center; }
.screen--welcome .screen__aside, .screen--wait .screen__aside, .screen--done .screen__aside, .screen--missed .screen__aside, .screen--finished .screen__aside,
.screen--welcome .screen__main, .screen--wait .screen__main, .screen--done .screen__main, .screen--missed .screen__main, .screen--finished .screen__main { align-items: center; }
.screen__aside .logo { margin: 2px auto 0; }
.screen--reveal .screen__aside .ribbon, .screen--login .screen__aside .card { align-self: stretch; }

.hero { width: min(80%, 340px); margin: -6px auto 0; filter: drop-shadow(0 22px 28px rgba(0, 0, 0, 0.55)); cursor: pointer; }
.mascot { width: min(52%, 220px); margin: 4px auto 0; filter: drop-shadow(0 18px 24px rgba(0, 0, 0, 0.55)); cursor: pointer; }
.mascot--sm { width: min(36%, 150px); }

.headline { font-size: clamp(24px, 7.2vw, 30px); font-weight: 800; margin: 2px 0 0; line-height: 1.15; }
.sub { font-size: 17px; color: var(--text-2); margin: 0; line-height: 1.45; }
.sub b { color: #fff; }
.hint { font-size: 12.5px; color: var(--text-3); margin: 4px 0 0; line-height: 1.4; }

.screen--welcome .stats { width: 100%; margin: 2px 0; font-size: 15px; }
.screen--welcome .stat__value { font-size: 23px; }
.btn-xl { font-size: 23px; padding: 14px 24px; min-height: 66px; }
.btn-xl .ico { width: 1.15em; height: 1.15em; }
.btn-xl .btn__divider { height: 1.3em; margin: 0 .15em; }

/* Kopf-Karte */
.card--head { display: flex; align-items: center; gap: 14px; padding: 14px 16px; }
.card--head > .ico { width: 44px; height: 44px; color: #e9d5ff; stroke-width: 1.5; filter: drop-shadow(0 0 6px rgba(196, 92, 255, 0.6)); }
.card--head h2 { margin: 0; font-size: 22px; font-weight: 800; line-height: 1.15; }
.card--head p { margin: 4px 0 0; font-size: 14px; color: var(--text-2); line-height: 1.35; }
.card--compact { padding: 10px 14px; }
.card--compact > .ico { width: 36px; height: 36px; }
.card--compact h2 { font-size: 19px; }
.card--compact p { font-size: 13px; }

/* Timer-Zeile mit Seitenlinien */
.timer-row { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 0; }
.timer-line { flex: 0 0 56px; height: 2px; background: #d8a9ff; opacity: .85; border-radius: 2px; box-shadow: 0 0 6px var(--violet-glow); }

/* Frage-Streifen */
.question-strip { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 0 4px; }
.question-strip.center { align-items: center; text-align: center; }
.question-strip .pill { font-size: 11px; padding: .3em .9em; }
.question-strip p { margin: 0; font-size: 16px; font-weight: 700; line-height: 1.3; }

.list-head { display: flex; align-items: center; justify-content: space-between; font-weight: 700; font-size: 16px; padding: 0 4px; }
.list-head .ico { width: 24px; height: 24px; color: #d8a9ff; }
.list { display: flex; flex-direction: column; gap: 10px; }
.list .row { min-height: 66px; }
.list .row:active { scale: .985; }
.list__empty { padding: 20px; text-align: center; color: var(--text-3); }

.field { display: grid; gap: 6px; font-size: 13px; font-weight: 700; color: var(--text-2); }
.field input { border: 2px solid var(--violet-bright); background: rgba(40, 12, 75, 0.75); color: #fff; border-radius: 14px; padding: 12px 14px; font-size: 18px; font-weight: 700; letter-spacing: .12em; outline: 0; width: 100%; }
.field input:focus { box-shadow: var(--shadow-glow); }
.field--code input { text-align: center; font-size: 22px; letter-spacing: .4em; }

.cta-bar { display: grid; gap: 10px; padding-top: 8px; }
.cta-bar[hidden] { display: none; }
.cta-bar .btn { font-size: 17px; min-height: 58px; white-space: nowrap; }

/* Warten / Fertig */
.dots-anim { display: flex; gap: 8px; justify-content: center; margin-top: 4px; }
.dots-anim span { width: 10px; height: 10px; border-radius: 50%; background: #c04dff; animation: blink 1.2s infinite ease-in-out; box-shadow: 0 0 8px var(--violet-glow); }
.dots-anim span:nth-child(2) { animation-delay: .2s; }
.dots-anim span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; scale: .8; } 40% { opacity: 1; scale: 1; } }
.question-card { width: 100%; padding: 16px; text-align: left; display: grid; gap: 8px; }
.question-card .pill { font-size: 11px; padding: .3em .9em; justify-self: start; }
.question-card p { margin: 0; font-size: 18px; font-weight: 700; line-height: 1.3; }
.check-big { width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; margin-top: 6px;
  background: linear-gradient(135deg, #9b2cf5, #d05cff); box-shadow: 0 0 0 6px rgba(196, 92, 255, 0.25), 0 0 40px var(--violet-glow); }
.check-big svg { width: 56px; height: 56px; }
.icon-big { width: 84px; height: 84px; color: #d8a9ff; stroke-width: 1.4; margin-top: 6px; filter: drop-shadow(0 0 10px var(--violet-glow)); }
.screen__footer { margin-top: auto; padding-top: 8px; }
.link { background: none; border: 0; color: var(--text-3); font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: .4em; padding: 8px; }
.link:hover { color: #fff; }

/* Ergebnis (Top 3) auf dem Handy */
.podium-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; width: 100%; }
.place-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 16px; background: var(--row); border: 1.5px solid var(--row-border); }
.place-row.is-hidden { opacity: .55; }
.place-row .avatar { width: 56px; height: 56px; border-width: 3px; }
.place-row.gold .avatar { border-color: var(--gold); box-shadow: 0 0 14px rgba(246, 197, 68, 0.6); }
.place-row.silver .avatar { border-color: var(--silver); }
.place-row.bronze .avatar { border-color: var(--bronze); }
.place-row__body { flex: 1; min-width: 0; display: grid; gap: 4px; }
.place-row__rank { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.gold .place-row__rank { color: var(--gold); }
.silver .place-row__rank { color: var(--silver); }
.bronze .place-row__rank { color: var(--bronze-2); }
.place-row__name { font-size: 18px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.place-row__score { font-size: 13px; color: var(--text-2); }
.place-row__score b { color: #e2b4ff; font-size: 15px; }
.tie-badge { font-size: 10px; font-weight: 800; padding: .2em .6em; border-radius: 999px; background: rgba(255, 255, 255, 0.15); margin-left: 6px; letter-spacing: .05em; }
.ribbon--mobile { align-self: center; font-size: 15px; letter-spacing: .12em; }
.place-row .crown-mini { width: 22px; height: 22px; color: var(--gold); margin-left: 6px; vertical-align: -4px; }

.confetti--fixed { position: fixed; }
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); translate: -50% 20px; opacity: 0; pointer-events: none;
  background: #2b1150; border: 1.5px solid var(--violet-bright); color: #fff; padding: 12px 18px; border-radius: 14px; font-weight: 700; font-size: 14px;
  box-shadow: var(--shadow-glow); transition: all .25s ease; z-index: 60; max-width: 90vw; text-align: center; }
.toast.is-visible { opacity: 1; translate: -50% 0; }

/* ---------- Kleine Hochformat-Displays (z. B. 375×667) ---------- */
@media (orientation: portrait) and (max-height: 720px) {
  .screen { gap: 10px; }
  .screen__aside, .screen__main { gap: 10px; }
  .hero { width: min(62%, 250px); }
  .mascot { width: min(42%, 170px); }
  .btn-xl { font-size: 20px; min-height: 58px; padding: 10px 20px; }
  .screen--welcome .stats { font-size: 13px; }
  .screen--welcome .stat__value { font-size: 20px; }
  .screen--vote .timer { --size: 112px !important; }
  .timer-line { flex-basis: 40px; }
  .card--head p { display: none; }
  .question-strip p { font-size: 14px; }
}

/* ---------- Querformat: zwei Spalten ---------- */
@media (orientation: landscape) and (min-width: 640px) {
  .phone { max-width: 1100px; padding: 10px 20px; min-height: 100vh; min-height: 100dvh; display: flex; }
  .screen { flex: 1; flex-direction: row; align-items: stretch; gap: 24px; min-height: calc(100vh - 20px); min-height: calc(100dvh - 20px); text-align: left; }
  .screen--fixed { height: calc(100vh - 20px); height: calc(100dvh - 20px); }
  .screen__aside { flex: 0 0 38%; justify-content: center; align-items: center; text-align: center; gap: 10px; }
  .screen__main { flex: 1; justify-content: center; gap: 10px; }
  .screen--fixed .screen__main { justify-content: flex-start; }
  .screen--welcome .screen__main, .screen--wait .screen__main, .screen--done .screen__main, .screen--missed .screen__main, .screen--finished .screen__main { align-items: flex-start; text-align: left; }
  .screen--welcome .stats { width: 100%; max-width: 520px; }
  .screen__aside .logo { --logo: 36px; }
  .hero { width: auto; height: min(62vh, 360px); max-width: 100%; margin: 0; }
  .mascot { width: auto; height: min(50vh, 240px); margin: 0; }
  .mascot--sm { height: min(40vh, 170px); }
  .headline { font-size: clamp(22px, 3.2vw, 32px); }
  .sub { font-size: clamp(14px, 1.9vw, 18px); }
  .btn-xl { font-size: 21px; min-height: 58px; width: auto; min-width: 280px; }
  .screen--vote .timer { --size: min(26vh, 150px) !important; }
  .timer-line { flex-basis: 34px; }
  .question-strip { align-items: center; text-align: center; }
  .card--head p { display: none; }
  .cta-bar { grid-template-columns: 1fr auto; align-items: end; }
  .cta-bar .hint { grid-column: 1 / -1; margin: 0; }
  .cta-bar .btn { min-height: 54px; }
  .field--code input { font-size: 18px; padding: 10px 12px; }
  .screen__footer { margin-top: 0; }
  .screen--reveal .screen__main { overflow-y: auto; min-height: 0; }
  .screen--reveal .screen__aside { justify-content: flex-start; padding-top: 6px; }
  .question-card { max-width: 520px; }
  .sound-toggle { top: 8px; left: 8px; width: 34px; height: 34px; }
}

/* ---------- Sehr flache Querformate (Handy, Höhe ≤ 430px) ---------- */
@media (orientation: landscape) and (max-height: 430px) {
  .phone { padding: 8px 16px; }
  .screen { gap: 16px; }
  .screen__aside .logo { --logo: 30px; }
  .hero { height: min(66vh, 250px); }
  .mascot { height: min(48vh, 170px); }
  .check-big { width: 70px; height: 70px; }
  .check-big svg { width: 40px; height: 40px; }
  .screen--vote .timer { --size: 104px !important; }
  .list .row { min-height: 54px; padding: 6px 10px 6px 6px; }
  .list .row .avatar { width: 40px; height: 40px; }
  .row__name { font-size: 15px; }
  .search input { padding: .6em 0; font-size: 15px; }
  .list-head { font-size: 14px; }
  .question-strip p { font-size: 13px; }
  .place-row { padding: 6px 10px; }
  .place-row .avatar { width: 42px; height: 42px; }
  .place-row__name { font-size: 15px; }
}

/* ---------- Scan-Szene (kein Beitritt vorhanden) ---------- */
.screen--scan { text-align: center; }
.screen--scan .screen__aside, .screen--scan .screen__main { align-items: center; }
.scan-icon { width: 76px; height: 76px; border-radius: 22px; display: grid; place-items: center; color: #fff; margin-top: 4px;
  background: linear-gradient(135deg, #9b2cf5, #d05cff); box-shadow: 0 0 0 5px rgba(196, 92, 255, 0.22), 0 0 34px var(--violet-glow); animation: bob 2.2s ease-in-out infinite; }
.scan-icon .ico { width: 44px; height: 44px; stroke-width: 1.8; }
@media (orientation: landscape) and (min-width: 640px) {
  .screen--scan .screen__main { align-items: flex-start; text-align: left; }
}
