/* Spiele-Olympiade – Ansichten (TV, Host, Team) und Spiel-Layouts. Bausteine stehen in base.css. */

html, body { height: 100%; overflow: hidden; overscroll-behavior: none; }
body { background: var(--bg); -webkit-tap-highlight-color: transparent; }
button { -webkit-user-select: none; user-select: none; }
[hidden] { display: none !important; }
.ell { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.center { text-align: center; }
.wrapx { flex-wrap: wrap; }
.ava { display: block; flex: none; border-radius: 50%; background: var(--surface) center / cover no-repeat; border: .1em solid var(--tc); box-shadow: var(--shadow-s); }
.duo > * + * { margin-left: -.55em; }
.mini-row { display: flex; align-items: center; gap: .55em; font-size: .8em; padding: .28em 0; font-weight: 800; }
.mini-row.me-row { background: var(--surface-2); border-radius: .8em; padding: .28em .5em; }
.dots i { display: inline-block; width: .5em; height: .5em; border-radius: 50%; background: var(--ink-2); margin: 0 .18em; animation: hop 1.2s ease-in-out infinite; animation-delay: calc(var(--i) * 160ms); }
@keyframes hop { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-.45em); } }
.hearts { display: inline-flex; gap: .15em; color: var(--berry); }
.hearts .icon { fill: currentColor; width: 1em; height: 1em; }
.hearts .lost { opacity: .25; }
.tbar { height: 1em; }
.tfill { display: block; height: 100%; border-radius: 999px; background: var(--g); transition: width .2s linear; }
.low { color: var(--danger); }
.die { width: 1.5em; height: 1.5em; flex: none; }
.die rect { fill: #FFFCF7; stroke: #2A1F1A; stroke-width: 1.4; }
.die circle { fill: #2A1F1A; }
.chip.bad { background: var(--danger-soft); color: var(--danger); }
.btn .icon { width: 1.1em; height: 1.1em; }
.clock { font-size: 7em; font-weight: 900; line-height: 1; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }

/* Meldungen, Dialoge, Verbindung */
#toasts { position: fixed; left: 50%; top: max(14px, env(safe-area-inset-top)); translate: -50% 0; z-index: 1000; display: grid; gap: 8px; width: min(92vw, 30em); pointer-events: none; font-size: 16px; }
.toast { background: var(--ink); color: var(--bg); padding: .7em 1.1em; border-radius: 1em; font-weight: 800; box-shadow: var(--shadow); animation: pop .4s var(--spring) both; text-align: center; }
.toast.bad { background: var(--danger); color: #fff; }
.toast.ok { background: var(--ok); color: #fff; }
.toast.out { opacity: 0; transition: opacity .3s; }
.modal { position: fixed; inset: 0; z-index: 900; display: grid; place-items: center; padding: 20px; background: rgba(10, 6, 4, .6); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); font-size: 16px; }
.modal-card { width: min(100%, 30em); max-height: 90dvh; overflow: auto; display: grid; gap: .9em; animation: pop .35s var(--spring) both; }
.modal-text { font-weight: 700; }
.modal-btns { justify-content: flex-end; flex-wrap: wrap; }
.offline-bar { display: none; position: fixed; left: 50%; bottom: max(12px, env(safe-area-inset-bottom)); translate: -50% 0; z-index: 800; background: var(--danger); color: #fff; font-weight: 800; padding: .5em 1em; border-radius: 999px; font-size: 14px; box-shadow: var(--shadow); align-items: center; gap: .5em; white-space: nowrap; }
html.offline .offline-bar { display: flex; }

/* ================= TV: feste Bühne 1920 x 1080, auf den Bildschirm skaliert ================= */
body.tv-page { background: #120C09; }
.stage.tv { position: absolute; left: 50%; top: 50%; border-radius: 0; box-shadow: none; transform-origin: center; }
.stage.tv > .screen { display: block; padding: 1.5em 2em; }
.tv-head { display: flex; align-items: center; gap: .8em; height: 2.6em; }
.tv-head .logo { font-weight: 900; font-size: 1.05em; letter-spacing: -.02em; display: flex; align-items: center; gap: .4em; }
.tv-body { position: absolute; inset: 4.6em 2em 1.6em; display: grid; gap: 1.2em; }
.bigc { padding: 1.4em 1.8em; display: flex; flex-direction: column; gap: .8em; min-width: 0; min-height: 0; }
.bigc > * { position: relative; }
.bigc > .pat { position: absolute; }
.sound-btn { position: absolute; right: 2em; bottom: 1.4em; z-index: 30; }

.lobby { grid-template-columns: 18em 1fr; gap: 1.6em; }
.lobby h1 { font-size: 3.1em; }
.qr { width: 12.5em; height: 12.5em; padding: .8em; background: #FFFCF7; border-radius: 1.4em; box-shadow: var(--shadow); rotate: -2deg; }
.qr img { width: 100%; height: 100%; display: block; }
.teams { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-auto-rows: 1fr; gap: .9em; }
.team-card { position: relative; display: flex; align-items: center; gap: .9em; border-left: .45em solid var(--tc); min-width: 0; }
.team-card h3 { font-size: 1.15em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.team-card > .chip { position: absolute; top: .9em; right: .9em; font-size: .62em; }
.team-card.empty { background: transparent; border: .12em dashed var(--line); box-shadow: none; justify-content: center; color: var(--ink-2); font-weight: 800; }
.ghost-p { width: 3em; height: 3em; margin-left: -.55em; border-radius: 50%; border: .12em dashed var(--line); display: grid; place-items: center; color: var(--ink-2); flex: none; }

.rad { grid-template-columns: 15em 1fr 16em; gap: 1.4em; align-items: center; }
.wheel-box { position: relative; width: 25em; height: 25em; margin: 0 auto; }
.wheel { width: 100%; height: 100%; border-radius: 50%; position: relative; border: .5em solid var(--surface); box-shadow: var(--shadow), inset 0 0 0 .12em rgba(0,0,0,.12); }
.wheel-label { position: absolute; left: 50%; top: 50%; width: 50%; height: 2em; margin-top: -1em; transform-origin: 0 50%; display: flex; justify-content: flex-end; align-items: center; gap: .5em; padding-right: .8em; color: #fff; font-size: .66em; font-weight: 800; text-shadow: 0 1px 2px rgba(0,0,0,.35); white-space: nowrap; }
.wheel.few .wheel-label { font-size: .9em; }
.hub { position: absolute; inset: 50% auto auto 50%; translate: -50% -50%; width: 6em; height: 6em; border-radius: 50%; background: var(--surface); display: grid; place-items: center; box-shadow: var(--shadow); }
.pointer { position: absolute; left: 50%; top: -1.1em; translate: -50% 0; width: 2.4em; height: 2.8em; background: var(--ink); clip-path: polygon(50% 100%, 0 0, 100% 0); border-radius: .3em; z-index: 3; filter: drop-shadow(0 .2em .3em rgba(0,0,0,.3)); }
.wheel-result { position: absolute; left: 50%; bottom: -1em; translate: -50% 0; white-space: nowrap; background: var(--g); color: #fff; padding: .5em 1.4em; border-radius: 999px; font-weight: 900; font-size: 1.7em; box-shadow: var(--clay), var(--shadow); opacity: 0; scale: .6; transition: opacity .3s var(--out), scale .5s var(--spring); z-index: 4; display: flex; align-items: center; gap: .5em; }
.wheel-result.on { opacity: 1; scale: 1; }

.regeln { grid-template-columns: 1fr 17em; }
.hero { padding: 1.6em 1.8em; display: flex; flex-direction: column; gap: 1em; min-height: 0; }
.hero h1 { font-size: 4em; }
.hero > * { position: relative; }
.hero > .pat { position: absolute; }
.rules { display: grid; grid-template-columns: 1fr 1fr; gap: .8em; margin-top: auto; }
.rule { background: var(--surface); border-radius: 1.1em; padding: .8em 1em; display: flex; gap: .7em; align-items: flex-start; font-size: .88em; font-weight: 700; box-shadow: var(--shadow-s); }
.rule > b { display: grid; place-items: center; flex: none; width: 1.8em; height: 1.8em; border-radius: 50%; background: var(--g); color: #fff; font-weight: 900; }
.pts { display: grid; grid-template-columns: auto 1fr auto; gap: .35em .7em; align-items: center; font-size: .85em; font-weight: 800; }
.long { display: grid; grid-template-columns: 1fr 1.15fr; gap: .7em; margin-top: auto; font-size: .62em; font-weight: 700; }
.long .lcard { background: var(--surface); border-radius: 1.2em; padding: .9em 1.1em; box-shadow: var(--shadow-s); }
.long h4 { font-size: 1.15em; font-weight: 900; margin-bottom: .4em; }
.long li { margin: .25em 0 .25em 1.1em; }
.dice-row { display: grid; grid-template-columns: 6.4em auto 1fr; gap: .6em; align-items: center; padding: .28em 0; }
.dice-row .dd { display: flex; gap: .2em; }
.hero.has-long h1 { font-size: 2.8em; }

.live { grid-template-columns: 1fr 16em; }
.duels { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8em; margin: auto 0; }
.duel { background: var(--surface); border-radius: 1.2em; padding: .9em; display: grid; gap: .5em; justify-items: center; text-align: center; font-weight: 900; box-shadow: var(--shadow-s); }
.duel .vs { color: var(--g); font-size: .8em; }

.rang { grid-template-columns: 24em 1fr; gap: 1.6em; }
.podium { display: flex; align-items: flex-end; justify-content: center; gap: .7em; height: 100%; padding-bottom: .4em; }
.pstep { flex: 1; display: flex; flex-direction: column; align-items: center; gap: .4em; min-width: 0; }
.pstep b { max-width: 100%; }
.pstep .block { width: 100%; border-radius: 1.2em 1.2em .5em .5em; background: var(--tc); box-shadow: var(--clay), var(--shadow); display: grid; place-items: start center; padding-top: .5em; color: #fff; font-weight: 900; font-size: 2.2em; transform-origin: bottom; animation: rise .8s var(--spring) both; animation-delay: calc(var(--i) * 140ms + 200ms); }
@keyframes rise { from { transform: scaleY(0); } }
.lb-row { display: grid; grid-template-columns: auto auto 1fr auto auto; align-items: center; gap: .3em .8em; padding: .42em .9em; border-radius: 1.1em; background: var(--surface); box-shadow: var(--shadow-s); }
.lb-row.last { background: var(--danger-soft); }
.lb-row .bar-track { grid-column: 1 / -1; height: .4em; }
.res-row { display: grid; grid-template-columns: auto auto 1fr auto auto; align-items: center; gap: .8em; padding: .55em 1em; border-radius: 1.1em; background: var(--surface); box-shadow: var(--shadow-s); font-weight: 900; }
.res-row.last { background: var(--danger-soft); }
.res-row .big { font-size: 1.5em; min-width: 3em; text-align: right; }

/* ================= Host ================= */
html.host-page { font-size: clamp(13px, 1.11vw, 22px); }
.host-root { height: 100dvh; background:
    radial-gradient(60% 50% at 8% 0%, color-mix(in srgb, var(--honey) 22%, transparent), transparent 70%),
    radial-gradient(50% 45% at 100% 100%, color-mix(in srgb, var(--coral) 20%, transparent), transparent 70%), var(--bg); }
.shell { display: grid; grid-template-columns: 15.5em minmax(0, 1fr); height: 100%; }
.side { padding: 1.4em 1em; display: flex; flex-direction: column; gap: .3em; border-right: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 55%, transparent); min-height: 0; overflow: auto; }
.side .logo { font-weight: 900; font-size: 1.1em; display: flex; align-items: center; gap: .5em; padding: 0 .5em 1em; }
.step { display: flex; align-items: center; gap: .7em; padding: .6em .7em; border-radius: .9em; font-weight: 800; color: var(--ink-2); min-height: 2.75em; width: 100%; text-align: left; }
.step .dot { width: 1.7em; height: 1.7em; border-radius: 50%; display: grid; place-items: center; background: var(--bg-2); font-size: .8em; font-weight: 900; flex: none; }
.step.done { color: var(--ink); }
.step.done .dot { background: var(--ok-soft); color: var(--ok); }
.step.now { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-s); }
.step.now .dot { background: var(--primary); color: var(--primary-ink); }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: .5em; font-size: .85em; padding-top: 1em; }
.main { padding: 1.4em 1.8em; display: flex; flex-direction: column; gap: 1.1em; min-height: 0; min-width: 0; overflow: auto; }
.top { display: flex; align-items: center; gap: .8em; flex-wrap: wrap; }
.top h1 { font-size: 1.9em; }
.cols { display: grid; gap: 1.1em; flex: 1; min-height: 0; }
.cols > * { min-width: 0; min-height: 0; }
.cols > .card { overflow: auto; }
.c2 { grid-template-columns: 1fr 19em; }
.t-row { display: flex; align-items: center; gap: .7em; padding: .45em 0; border-bottom: 1px solid var(--line); }
.t-row:last-child { border-bottom: 0; }
.ibtn { width: 2.75em; height: 2.75em; border-radius: 50%; display: grid; place-items: center; color: var(--ink-2); flex: none; transition: background .2s var(--out), transform .2s var(--spring); }
.ibtn:hover { background: var(--bg-2); color: var(--ink); }
.ibtn:active { transform: scale(.9); }
.ibtn.sm { width: 2em; height: 2em; }
.g-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .45em .9em; }
.g-row { display: flex; align-items: center; gap: .6em; font-weight: 800; font-size: .92em; }
.g-dot { width: 1.9em; height: 1.9em; border-radius: .6em; display: grid; place-items: center; background: var(--g); color: #fff; flex: none; }
.g-dot .icon { width: 1.05em; height: 1.05em; }
.spin-btn { width: 15em; height: 15em; border-radius: 50%; background: var(--primary); color: var(--primary-ink); display: grid; place-items: center; align-content: center; gap: .3em; font-weight: 900; font-size: 1.3em; box-shadow: inset 0 -.5em 0 rgba(0,0,0,.14), inset 0 .3em 0 rgba(255,255,255,.3), var(--shadow); transition: transform .25s var(--spring); margin: auto; flex: none; }
.spin-btn:hover { transform: scale(1.03) rotate(-3deg); }
.spin-btn:active { transform: scale(.94); }
.spin-btn .icon { width: 4.2em; height: 4.2em; stroke-width: 1.6; }
.spin-btn.go .icon { animation: turn 5.4s var(--out); }
.spin-btn[disabled] { opacity: .6; }
@keyframes turn { to { transform: rotate(1800deg); } }
.drawn { margin: auto; display: grid; justify-items: center; gap: .8em; text-align: center; }
.drawn h2 { font-size: 2.6em; }
.place { display: inline-flex; gap: .25em; }
.place button { width: 2.75em; height: 2.75em; border-radius: .8em; font-weight: 900; background: var(--bg-2); color: var(--ink-2); transition: transform .2s var(--spring), background .2s var(--out); }
.place button:hover { color: var(--ink); }
.place button:active { transform: scale(.9); }
.place button[aria-pressed="true"] { background: var(--ink); color: var(--bg); transform: scale(1.08); }
.raw-in { width: 8.5em; min-height: 2.75em; text-align: center; font-weight: 900; padding: .3em; }
table.hist { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.hist th, .hist td { padding: .6em .7em; text-align: center; border-bottom: 1px solid var(--line); }
.hist th { font-size: .78em; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); }
.hist td:first-child, .hist th:first-child { text-align: left; }
.hist tr:last-child td { border-bottom: 0; }
.hist .total { font-weight: 900; font-size: 1.15em; }
.banner { display: flex; align-items: center; gap: .8em; padding: .7em 1em; border-radius: 1em; font-weight: 800; background: color-mix(in srgb, var(--honey) 28%, var(--surface)); }
.banner.bad { background: var(--danger-soft); color: var(--danger); }
.pin-box { height: 100dvh; display: grid; place-items: center; padding: 20px; }
.pin-box .card { width: min(100%, 24em); display: grid; gap: 1em; }
.stages { display: grid; grid-template-columns: repeat(5, 1fr); gap: .8em; margin: auto 0; }
.stage-card { background: var(--surface); border-radius: 1.3em; padding: 1.2em .6em; text-align: center; border: 2px solid transparent; box-shadow: var(--shadow-s); transition: transform .3s var(--spring), border-color .2s var(--out); }
.stage-card.past { opacity: .6; }
.stage-card.now { border-color: var(--g); transform: translateY(-.35em) scale(1.04); }
.stage-card input { width: 3.2em; text-align: center; font-weight: 900; font-size: 1.5em; border: 0; background: var(--bg-2); border-radius: .5em; padding: .2em; min-height: 1.9em; }
.hgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(13em, 1fr)); gap: .7em; }
.hcell { background: var(--surface); border-radius: 1.1em; padding: .7em .9em; box-shadow: var(--shadow-s); display: grid; gap: .4em; }
@media (max-width: 900px) {
  html.host-page { font-size: 15px; }
  .shell { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .side { flex-direction: row; align-items: center; padding: .5em .8em; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .side .logo { padding: 0 .5em 0 0; }
  .side .step:not(.now) span:not(.dot) { display: none; }
  .side .step { width: auto; padding: .3em .5em; min-height: 0; }
  .side-foot { flex-direction: row; margin: 0 0 0 auto; padding: 0; align-items: center; white-space: nowrap; }
  .side-foot .hide-s { display: none; }
  .main { padding: 1em; }
  .c2, .cols { grid-template-columns: 1fr !important; }
  .cols > .card { overflow: visible; }
  .place button { width: 2.4em; height: 2.75em; }
}

/* ================= Team: fester App-Rahmen, die Seite selbst scrollt nie ================= */
html.team-page { font-size: 16px; position: fixed; inset: 0; width: 100%; }
.app { position: fixed; left: 0; top: 0; width: 100%; height: var(--app-h, 100dvh); display: flex; flex-direction: column; overflow: hidden;
  --sat: max(env(safe-area-inset-top, 0px), var(--sat-min, 0px));
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: max(18px, env(safe-area-inset-left, 0px));
  --sar: max(18px, env(safe-area-inset-right, 0px));
  --btn-b: max(10px, calc(var(--sab) - 14px)); }
/* Hintergrund als eigene Ebene über die ganze Fläche: so bleibt unter der Home-Leiste kein Balken. */
.app-bg { position: fixed; left: 0; top: 0; width: 100%; height: 100lvh; z-index: -1; pointer-events: none; background:
    radial-gradient(70% 35% at 0% 0%, color-mix(in srgb, var(--g) 20%, transparent), transparent 70%),
    radial-gradient(60% 30% at 100% 100%, color-mix(in srgb, var(--honey) 18%, transparent), transparent 70%), var(--bg); }
html.standalone .app { height: var(--app-h, 100vh); }
.phone-top { padding: calc(var(--sat) + 10px) var(--sar) 8px var(--sal); display: flex; align-items: center; gap: 10px; flex: none; }
.phone-top .me { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.phone-top .me b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.phone-body { flex: 1; min-height: 0; padding: 6px var(--sar) 0 var(--sal); display: flex; flex-direction: column; gap: 14px; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.phone-body::after { content: ""; flex: none; height: max(10px, calc(var(--sab) - 14px)); }
.phone-body.fixed { overflow: hidden; }
.phone-body.fixed::after { height: var(--btn-b); }
.pane { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.pane.entry { flex: 1; min-height: 0; }
.pane.entry > .push { margin-top: auto; }
.phone-body.fixed .pane.entry { overflow: hidden; }
.app h1 { font-size: 2em; }
.app .btn { min-height: 48px; }
.app .btn.big { font-size: 1.15em; padding: .75em 1.4em; }
.app .input { font-size: 17px; }
.btn-row { display: flex; gap: 10px; }
.btn-row > * { flex: 1; }
.photo { width: 104px; height: 104px; border-radius: 50%; margin: 0 auto; position: relative; display: grid; place-items: center; background: var(--surface); border: 3px dashed var(--line); flex: none; }
.photo .cam { position: absolute; right: -4px; bottom: -4px; width: 44px; height: 44px; border-radius: 50%; background: var(--primary); color: var(--primary-ink); display: grid; place-items: center; box-shadow: var(--clay), var(--shadow-s); }
.photo .ava { border-width: 0; }
.pick { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 20px; background: var(--surface); border: 2px solid transparent; box-shadow: var(--shadow-s); min-height: 60px; width: 100%; text-align: left; transition: transform .2s var(--spring), border-color .2s var(--out); }
.pick:active { transform: scale(.97); }
.pick[aria-pressed="true"] { border-color: var(--tc); background: color-mix(in srgb, var(--tc) 12%, var(--surface)); }
.pick[disabled] { opacity: .5; }
.pick .radio { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line); flex: none; display: grid; place-items: center; color: #fff; }
.pick .radio .icon { width: 16px; height: 16px; }
.pick[aria-pressed="true"] .radio { background: var(--tc); border-color: var(--tc); }
.rule-li { display: flex; gap: 12px; align-items: flex-start; font-weight: 700; }
.rule-li > b { display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--g); color: #fff; font-weight: 900; font-size: .9em; }
.place-big { font-size: 4.6em; font-weight: 900; line-height: 1; letter-spacing: -.04em; }
.lb { display: flex; align-items: center; gap: 10px; padding: 7px 12px; border-radius: 16px; font-weight: 800; }
.lb.me-row { background: var(--surface); box-shadow: var(--shadow-s); }
.steps3 { display: grid; gap: 12px; }
.steps3 .rule-li > b { background: var(--primary); color: var(--primary-ink); }
.keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.keys button { min-height: 52px; border-radius: 18px; background: var(--surface); font-weight: 900; font-size: 1.3em; box-shadow: var(--shadow-s); transition: transform .15s var(--spring); }
.keys button:active { transform: scale(.92); }
.bignum { font-size: 3.4em; font-weight: 900; line-height: 1.1; font-variant-numeric: tabular-nums; min-height: 1.1em; }
.pips { display: flex; gap: 6px; }
.pips i { flex: 1; height: 8px; border-radius: 999px; background: color-mix(in srgb, var(--g) 22%, var(--surface)); }
.pips i.on { background: var(--g); }

/* Quer: zwei Spalten. Links Info, rechts Eingabe. */
@media (orientation: landscape) and (max-height: 560px) {
  .phone-top { padding-top: calc(var(--sat) + 6px); padding-bottom: 4px; }
  .phone-body { flex-direction: row; gap: 16px; overflow: hidden; }
  .phone-body::after { display: none; }
  .phone-body > .pane { flex: 1; overflow-y: auto; padding-bottom: max(10px, var(--sab)); overscroll-behavior: contain; }
  .phone-body > .pane:only-child { max-width: 34em; margin: 0 auto; }
  .place-big { font-size: 3.2em; }
  .keys button { min-height: 44px; }
  .keys { gap: 6px; }
  .pane { gap: 8px; }
  .bignum { font-size: 1.9em; }
  /* Quer mit Tastatur: nur Feld und Knopf bleiben sichtbar. */
  html.kb .phone-body > .pane.info:not(:has(input)), html.kb .hide-kb { display: none; }
}
html.kb .hide-kb-all { display: none; }

/* ================= Spiel-Layouts ================= */
.taboo { display: flex; flex-direction: column; gap: 8px; }
.taboo span { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 16px; background: var(--danger-soft); color: var(--danger); font-weight: 800; }
.letter { width: 3.2em; height: 3.2em; border-radius: .7em; background: var(--g); color: #fff; font-size: 4.4em; font-weight: 900; display: grid; place-items: center; rotate: -5deg; box-shadow: var(--clay), var(--shadow); animation: wiggle 2.4s ease-in-out infinite; flex: none; }
.cat { background: var(--surface); border-radius: 1em; padding: .7em 1em; font-weight: 800; box-shadow: var(--shadow-s); display: flex; align-items: center; gap: .5em; }
.slf-table { width: 100%; border-collapse: separate; border-spacing: .25em; font-size: .62em; font-weight: 800; table-layout: fixed; }
.slf-table th { text-align: left; padding: .2em .5em; color: var(--ink-2); text-transform: uppercase; letter-spacing: .06em; font-size: .85em; }
.slf-table td { background: var(--surface); border-radius: .7em; padding: .4em .6em; overflow: hidden; white-space: normal; overflow-wrap: anywhere; line-height: 1.15; }
.slf-table td.p20 { background: color-mix(in srgb, var(--g) 34%, var(--surface)); }
.slf-table td.p10 { background: color-mix(in srgb, var(--g) 16%, var(--surface)); }
.slf-table td.p0 { opacity: .5; text-decoration: line-through; }
.slf-table td.none { opacity: .35; text-decoration: none; }
.slf-table td b { float: right; margin-left: .4em; }
.slf-table td.tname { background: transparent; }
.line { position: relative; height: 9.4em; margin: 0 3em; }
.line .track { position: absolute; left: 0; right: 0; top: 6.2em; height: .5em; border-radius: 999px; background: color-mix(in srgb, var(--g) 25%, var(--surface)); }
.line .tick { position: absolute; top: 8em; translate: -50% 0; font-size: .7em; font-weight: 800; color: var(--ink-2); }
/* Die Lösung steht als Schild über dem Strahl, ein Stift zeigt auf die Stelle. Die Gesichter sitzen auf dem Strahl. */
.line .truth { position: absolute; top: .9em; translate: -50% 0; background: var(--g); color: #fff; font-weight: 900; padding: .25em .8em; border-radius: 999px; box-shadow: var(--clay); z-index: 40; white-space: nowrap; }
.line .stem { position: absolute; top: 2.9em; height: 3.5em; width: .22em; translate: -50% 0; background: var(--g); border-radius: 999px; z-index: 1; }
.line .guess { position: absolute; top: 6.45em; translate: -50% -50%; display: grid; justify-items: center; font-size: .6em; font-weight: 900; transition: left 1s var(--out); }
.scale { display: flex; align-items: stretch; gap: .3em; min-height: 5.5em; }
.item { flex: 1; min-width: 0; background: var(--surface); border-radius: 1em; padding: .6em .3em; text-align: center; font-weight: 900; box-shadow: var(--shadow-s); display: grid; gap: .2em; align-content: center; font-size: .78em; overflow-wrap: anywhere; }
.item small { font-weight: 700; color: var(--ink-2); font-size: .8em; }
.item.new { outline: .16em solid var(--ok); }
.item.new.bad { outline-color: var(--danger); }
.arrow { display: flex; align-items: center; gap: .6em; font-size: .75em; font-weight: 800; color: var(--ink-2); }
.arrow i { flex: 1; height: .25em; border-radius: 999px; background: linear-gradient(90deg, color-mix(in srgb, var(--g) 20%, transparent), var(--g)); }
.vslot { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 14px; border: 2px dashed var(--line); font-weight: 800; color: var(--ink-2); min-height: 44px; width: 100%; text-align: left; }
.vslot[aria-pressed="true"] { border: 2px solid var(--g); background: var(--g-soft); color: var(--ink); }
.vitem { padding: 8px 14px; border-radius: 14px; background: var(--surface); font-weight: 900; box-shadow: var(--shadow-s); display: flex; justify-content: space-between; gap: 10px; }
.vitem small { color: var(--ink-2); font-weight: 700; }
.pickchip { font-size: .95em; padding: .6em 1em; min-height: 44px; }
.easel { min-height: 0; background: #FFFCF7; border-radius: 1.4em; box-shadow: var(--shadow); overflow: hidden; aspect-ratio: 16 / 9; height: 100%; max-width: 100%; justify-self: center; align-self: center; position: relative; }
.easel canvas, .pad canvas { width: 100%; height: 100%; display: block; }
.padwrap { flex: 1; min-height: 0; display: grid; place-items: center; container-type: size; }
.pad { aspect-ratio: 4 / 3; width: min(100cqw, 100cqh * 4 / 3); border-radius: 22px; background: #FFFCF7; box-shadow: var(--shadow); position: relative; overflow: hidden; touch-action: none; }
.pad canvas { cursor: crosshair; touch-action: none; }
.tools { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.ink { width: 44px; height: 44px; border-radius: 50%; border: 4px solid var(--surface); box-shadow: var(--shadow-s); transition: transform .2s var(--spring); }
.ink[aria-pressed="true"] { transform: scale(1.18); box-shadow: 0 0 0 3px var(--ink); }
.board { display: grid; grid-template-columns: repeat(var(--cols, 6), 1fr); gap: .6em; flex: 1; min-height: 0; grid-template-rows: auto; grid-auto-rows: 1fr; }
.board .ch { background: var(--g); color: #fff; border-radius: .9em; padding: .6em .3em; text-align: center; font-weight: 900; font-size: .85em; box-shadow: var(--clay); display: grid; place-items: center; }
.tile { background: var(--surface); border-radius: 1em; display: grid; place-items: center; font-weight: 900; font-size: 1.9em; box-shadow: var(--shadow); font-style: italic; color: var(--ink); min-height: 0; }
.tile.used { background: transparent; box-shadow: none; border: .06em dashed var(--line); opacity: .7; }
.tile.pick { background: var(--g); color: #fff; scale: 1.06; rotate: -3deg; box-shadow: var(--clay), var(--shadow); animation: wiggle 1.6s ease-in-out infinite; }
.app .board { gap: 6px; }
.app .board .ch { font-size: .62em; padding: .5em .1em; border-radius: 10px; overflow: hidden; hyphens: auto; }
.app .tile { font-size: 1.05em; border-radius: 12px; min-height: 48px; }
.pairs { display: grid; grid-template-columns: 1fr 1fr; gap: .7em; flex: 1; min-height: 0; align-content: center; }
.match { background: var(--surface); border-radius: 1.1em; padding: .6em .9em; display: grid; grid-template-columns: auto minmax(0, 1fr) auto minmax(0, 1fr) auto; align-items: center; gap: .6em; box-shadow: var(--shadow-s); font-weight: 900; }
.match .ans { background: var(--bg-2); border-radius: 999px; padding: .35em .8em; text-align: center; font-size: .85em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.match.yes .ans { background: var(--g-soft); }
.match .mid { color: var(--line); display: grid; }
.match.yes .mid { color: var(--g); animation: beat 1s ease-in-out infinite; }
.match.yes .mid .icon { fill: currentColor; }
@keyframes beat { 50% { transform: scale(1.3); } }
.stepper { display: flex; align-items: center; justify-content: center; gap: 18px; }
.stepper button { width: 64px; height: 64px; border-radius: 50%; background: var(--surface); font-size: 2em; font-weight: 900; box-shadow: var(--shadow); transition: transform .2s var(--spring); }
.stepper button:active { transform: scale(.88); }
.stepper output { font-size: 4.6em; font-weight: 900; min-width: 2ch; text-align: center; font-variant-numeric: tabular-nums; line-height: 1; }
.timeline { position: relative; height: 10.5em; margin: auto 2em; }
.timeline .track { position: absolute; left: 0; right: 0; top: 5.6em; height: .5em; border-radius: 999px; background: color-mix(in srgb, var(--g) 22%, var(--surface)); }
.timeline .done { position: absolute; left: 0; top: 5.6em; height: .5em; border-radius: 999px; background: var(--g); transition: width .6s var(--out); }
.node { position: absolute; top: 4.85em; width: 2em; height: 2em; margin-left: -1em; border-radius: 50%; background: var(--surface); border: .28em solid var(--g); display: grid; place-items: center; }
.node.past { background: var(--g); }
.node.now { scale: 1.3; background: var(--g); box-shadow: 0 0 0 .5em color-mix(in srgb, var(--g) 28%, transparent); animation: pulse 1.6s ease-in-out infinite; }
.node-label { position: absolute; top: 9.7em; translate: -50% 0; font-weight: 800; font-size: .8em; text-align: center; white-space: nowrap; }
.node-who { position: absolute; top: 0; translate: -50% 0; display: flex; }
.node-who > * + * { margin-left: -1em; }
.ring { width: 3.4em; height: 3.4em; flex: none; }
.ring circle { fill: none; stroke-width: 8; }
.ring .spin { stroke: var(--g); stroke-linecap: round; stroke-dasharray: 251; transform-origin: center; rotate: -90deg; }
.search { position: relative; }
.search > span { display: grid; pointer-events: none; position: absolute; left: 16px; top: 50%; translate: 0 -50%; color: var(--ink-2); }
.search .input { padding-left: 46px; font-weight: 800; }
.sug { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 16px; width: 100%; text-align: left; min-height: 56px; transition: background .2s var(--out), transform .2s var(--spring); }
.sug:active { transform: scale(.97); }
.sug[aria-pressed="true"] { background: var(--g-soft); }
.cover { width: 42px; height: 42px; border-radius: 12px; flex: none; display: grid; place-items: center; color: #fff; box-shadow: var(--clay); background: var(--g) center / cover; }
.shake { animation: shake .4s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
html.offline .host-root:has(.pin-box) ~ .offline-bar { display: none; }
html.locked .offline-bar { display: none; }
.c2 { grid-template-columns: minmax(0, 1fr) minmax(0, 29em); }
.g-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.g-row { min-width: 0; }
.side-foot .chip { align-self: flex-start; }
.btn-row .btn { padding-left: .6em; padding-right: .6em; }
/* Zeichnen am Handy: Blatt direkt unter den Werkzeugen, dunkle Farbe sichtbar */
.padwrap { place-items: start center; }
.ink { box-shadow: 0 0 0 1.5px rgba(255,255,255,.28); }
/* SLF-Tabelle: Punkte bleiben rechts in der Zelle, auch bei langen Wörtern */
.slf-table td { position: relative; padding-right: 2.7em; }
.slf-table td b { float: none; position: absolute; right: .6em; top: 50%; transform: translateY(-50%); margin: 0; }
.slf-table td:last-child, .slf-table td.tname { padding-right: .6em; text-align: left; }
.slf-table td:last-child { text-align: center; }

@media (orientation: landscape) and (max-height: 560px) {
  .taboo { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
  .taboo span { padding: 6px 10px; }
  .card h1 { font-size: 1.5em !important; }
}

/* ================= Nachtrag: Kopf, Blatt, Auslosung, Buzzer, Tisch-Spiele ================= */
.hbtn { width: 44px; height: 44px; background: var(--surface); box-shadow: var(--shadow-s); color: var(--ink); }
.hbtn[aria-pressed="false"], .hbtn[disabled] { color: var(--ink-2); opacity: .7; }
.chip.cd { font-variant-numeric: tabular-nums; }
.chip.cd.warn { background: var(--honey); color: #2A1F1A; }
.roomin { text-align: center; font-size: 2em !important; letter-spacing: .3em; font-weight: 900; text-transform: uppercase; padding-left: .3em; }
.roomcode { font-size: 2.2em; font-weight: 900; letter-spacing: .18em; line-height: 1.2; background: var(--surface); padding: .05em .3em .05em .48em; border-radius: .35em; box-shadow: var(--shadow-s); font-variant-numeric: tabular-nums; }
.qr-prev { width: min(70vw, 16em); margin: 0 auto; background: #FFFCF7; padding: 1em; border-radius: 1.2em; }
.qr-prev svg { display: block; width: 100%; height: auto; }
.stepper.sm { gap: .5em; flex: none; }
.stepper.sm button { width: 2.6em; height: 2.6em; font-size: 1em; box-shadow: var(--shadow-s); display: grid; place-items: center; }
.stepper.sm button[disabled] { opacity: .4; }
.stepper.sm output { font-size: 1.15em; min-width: 3.4em; }
label.btn { cursor: pointer; }
.btn.disabled { opacity: .55; pointer-events: none; }
input[type="range"] { width: 100%; accent-color: var(--primary); min-height: 2em; }
.solution { display: flex; align-items: center; gap: .5em; padding: .5em 1em; border-radius: 1em; background: var(--ok-soft); color: var(--ok); font-weight: 900; font-size: 1.15em; }
.solution .icon { flex: none; }
.medal.m1 { background: color-mix(in srgb, var(--honey) 34%, var(--surface)); }
.medal.m2 { background: color-mix(in srgb, #D5D0CA 26%, var(--surface)); }
.medal.m3 { background: color-mix(in srgb, #E0A07A 26%, var(--surface)); }
.bday { position: fixed; inset: 0; z-index: 950; display: grid; place-items: center; padding: 24px; background: rgba(10, 6, 4, .7); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); font-size: 16px; }
.bday .card { position: relative; width: min(100%, 22em); }

/* Hütchen für das Geburtstagskind */
.hatw { position: relative; display: inline-block; flex: none; }
.hat { position: absolute; width: 60%; left: -9%; top: -55%; transform: rotate(-22deg); transform-origin: 50% 100%; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .3)); z-index: 2; pointer-events: none; }

/* Erklär-Blatt */
.modal.sheet { place-items: end center; padding: 0; }
.sheet-card { width: min(100%, 40em); max-height: 88dvh; background: var(--bg); border-radius: 24px 24px 0 0; display: flex; flex-direction: column; box-shadow: var(--shadow); animation: sheetUp .35s var(--out) both; padding-bottom: env(safe-area-inset-bottom, 0px); }
@keyframes sheetUp { from { transform: translateY(100%); } }
.sheet-head { display: flex; align-items: center; gap: 12px; padding: 16px 18px 10px; flex: none; }
.sheet-body { overflow-y: auto; overscroll-behavior: contain; padding: 4px 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.guide h3 { font-size: 1em; font-weight: 900; margin-bottom: .3em; }
.guide ul { display: grid; gap: .3em; }
.guide li { margin-left: 1.2em; line-height: 1.45; }
.guide.open { background: color-mix(in srgb, var(--honey) 24%, var(--surface)); border-radius: 16px; padding: 12px 14px; }
.guide .dice-row { grid-template-columns: 6.4em auto; }
.guide .dice-row .muted { grid-column: 1 / -1; font-size: .85em; }
@media (min-width: 700px) { .modal.sheet { place-items: center; padding: 20px; } .sheet-card { border-radius: 24px; } }

/* Auslosung: die Gesichter wechseln sich ab, am Ende bleibt eines stehen. Ohne Bewegung steht sofort das Ergebnis. */
.pk { display: inline-flex; gap: .6em; align-items: center; }
.pk-f { opacity: .35; transform: scale(.85); animation: pkB 3.2s linear var(--d, 0ms) both; }
.pk-f.win { opacity: 1; transform: scale(1.12); animation-name: pkA; }
.pk-f:only-child { animation: none; }
@keyframes pkA { 0% { opacity: 1; transform: scale(1); } 6%, 18%, 34%, 54% { opacity: 1; transform: scale(1.12); } 12%, 26%, 44%, 66% { opacity: .35; transform: scale(.85); } 80%, 100% { opacity: 1; transform: scale(1.12); } }
@keyframes pkB { 0% { opacity: 1; transform: scale(1); } 6%, 18%, 34%, 54% { opacity: .35; transform: scale(.85); } 12%, 26%, 44%, 66% { opacity: 1; transform: scale(1.12); } 80%, 100% { opacity: .35; transform: scale(.85); } }
.pk-t { animation: pkT .5s var(--out) calc(var(--d, 0ms) + 2.6s) both; }
@keyframes pkT { from { opacity: 0; transform: translateY(.4em); } }
.pick-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .9em; align-content: center; }
.pick-card { border-top: .4em solid var(--tc, var(--g)); gap: .5em; }

/* Du bist dran: Farbrand und Balken */
.app.myturn::before { content: ""; position: absolute; inset: 0; border: 5px solid var(--g); pointer-events: none; z-index: 5; animation: pulse 1.6s ease-in-out infinite; }
.turnbar { margin: 0 var(--sar) 4px var(--sal); padding: .5em 1em; border-radius: 14px; background: var(--surface); font-weight: 900; text-align: center; flex: none; }
.turnbar.on { background: var(--g); color: #fff; box-shadow: var(--clay); }
.buzzwrap { flex: 1; min-height: 0; display: grid; place-items: center; }
.buzzer { width: min(64vw, 38vh, 260px); aspect-ratio: 1; border-radius: 50%; background: var(--bg-2); color: var(--ink-2); display: grid; place-items: center; align-content: center; gap: .3em; font-weight: 900; font-size: 1.15em; touch-action: none; box-shadow: inset 0 -.5em 0 rgba(0, 0, 0, .14), var(--shadow); transition: transform .08s var(--out); text-align: center; padding: 1em; }
.buzzer .icon { width: 3em; height: 3em; }
.buzzer.free { background: var(--danger); color: #fff; animation: buzzGlow 1s ease-in-out infinite; }
.buzzer.hit, .buzzer.free:active { transform: scale(.92); animation: none; }
@keyframes buzzGlow { 50% { box-shadow: inset 0 -.5em 0 rgba(0, 0, 0, .14), 0 0 0 14px color-mix(in srgb, var(--danger) 30%, transparent); } }
.buzzed { display: flex; align-items: center; gap: .7em; padding: .5em 1em; border-radius: 1em; font-weight: 800; background: color-mix(in srgb, var(--tc, var(--g)) 26%, var(--surface)); border-left: .4em solid var(--tc, var(--g)); }
.buzzed.wait { border-left-color: var(--danger); background: var(--surface); }
.board.b2 .ch { background: linear-gradient(135deg, var(--g), color-mix(in srgb, var(--g) 55%, var(--honey))); }
.board.b2 .tile:not(.used) { outline: .07em solid var(--honey); outline-offset: -.07em; }

/* Gleicher Gedanke: wer wann abgegeben hat */
.gtrack { position: relative; height: 8.4em; margin: 0 2em; border-bottom: .3em solid color-mix(in srgb, var(--g) 30%, var(--surface)); border-radius: 0 0 .2em .2em; }
.gpin { position: absolute; bottom: 0; translate: -50% 0; display: grid; justify-items: center; padding-bottom: calc(var(--row) * 2em + .7em); transition: left .6s var(--out); }
.gpin > i { position: absolute; bottom: 0; left: 50%; translate: -50% 0; width: .14em; height: calc(var(--row) * 2em + .7em); background: var(--tc); border-radius: 999px; }

/* Stadt Land Fluss: Prüfen mit zwei Knöpfen je Wort */
.slf-table.edit { font-size: .82em; }
.slf-table.edit td { padding: .45em .55em; vertical-align: top; }
.slf-table.edit td b { position: static; float: right; transform: none; margin-left: .4em; }
.slf-table .w { overflow-wrap: anywhere; }
.slf-table td.okd { outline: .14em solid var(--ok); outline-offset: -.14em; }
.vrow { display: flex; align-items: center; gap: .3em; margin-top: .35em; clear: both; text-decoration: none; }
.vrow small { font-size: .8em; color: var(--ink-2); font-weight: 700; }
.vbtn { width: 2.6em; height: 2.6em; min-width: 36px; min-height: 36px; border-radius: .7em; display: grid; place-items: center; background: var(--bg-2); color: var(--ink-2); flex: none; }
.vbtn.ok[aria-pressed="true"] { background: var(--ok); color: #fff; }
.vbtn.no[aria-pressed="true"] { background: var(--danger); color: #fff; }
.slf-table td.p0 .vrow, .slf-table td.p0 .vbtn { opacity: 1; }

/* Skala: Achse links zeigt die Richtung, der Balken am Wert wächst mit */
.skx { display: grid; grid-template-columns: 3.4em minmax(0, 1fr); gap: 10px; }
.sk-axis { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: .68em; font-weight: 800; color: var(--ink-2); text-align: center; overflow-wrap: anywhere; }
.sk-axis i { flex: 1; width: 8px; min-height: 2em; border-radius: 999px; background: linear-gradient(180deg, color-mix(in srgb, var(--g) 18%, transparent), var(--g)); clip-path: polygon(35% 0, 65% 0, 100% 100%, 0 100%); }
.sk-list { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.sk-it { align-items: center; }
.sk-val { display: grid; justify-items: end; gap: 3px; min-width: 5.5em; flex: none; }
.sk-val i { display: block; height: 5px; border-radius: 999px; background: var(--g); }
.vslot[disabled] { opacity: .5; }
.vslot span { overflow-wrap: anywhere; }

/* Tisch-Spiele */
.pgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pbtn { min-height: 72px; border-radius: 20px; background: var(--surface); box-shadow: var(--shadow-s); display: grid; justify-items: center; align-content: center; gap: 2px; padding: 8px; border: 2px solid transparent; min-width: 0; transition: transform .2s var(--spring); }
.pbtn b { font-size: 1.6em; font-weight: 900; line-height: 1; }
.pbtn span { font-size: .8em; font-weight: 800; color: var(--ink-2); max-width: 100%; }
.pbtn:active { transform: scale(.96); }
.pbtn[aria-pressed="true"] { background: var(--g); color: #fff; box-shadow: var(--clay), var(--shadow-s); }
.pbtn[aria-pressed="true"] span { color: #fff; }
.pbtn[disabled] { opacity: .45; }
.lcard { background: var(--surface); border-radius: 1.2em; padding: .8em 1em; box-shadow: var(--shadow-s); }
.long.one { grid-template-columns: 1fr; font-size: .7em; margin: auto 0; }
.rules-dice { display: grid; grid-template-columns: 1fr 1.3fr; gap: .8em; margin-top: auto; align-items: stretch; min-height: 0; }
.rules-dice .rules { grid-template-columns: 1fr; margin: 0; gap: .5em; }
.rules-dice .rule { font-size: .72em; padding: .55em .8em; }
.rules-dice .lcard { font-size: .62em; font-weight: 700; }
.rules-dice h4 { font-size: 1.15em; font-weight: 900; margin-bottom: .3em; }
.hero.has-dice { gap: .6em; }
.hero.has-dice h1 { font-size: 2.6em; }

/* Musikquiz: unter jeder Stufe eine Spalte */
.mtl { position: relative; display: grid; grid-template-columns: repeat(var(--n, 5), minmax(0, 1fr)); gap: .4em; margin: auto 0; }
.mtl::before { content: ""; position: absolute; left: 8%; right: 8%; top: 2.05em; height: .4em; border-radius: 999px; background: color-mix(in srgb, var(--g) 22%, var(--surface)); }
.mcol { display: flex; flex-direction: column; align-items: center; gap: .35em; min-width: 0; position: relative; }
.mlab { font-size: .68em; font-weight: 800; white-space: nowrap; color: var(--ink-2); }
.mnode { width: 1.5em; height: 1.5em; border-radius: 50%; background: var(--surface); border: .24em solid var(--g); }
.mcol.past .mnode { background: var(--g); }
.mcol.now .mnode { background: var(--g); box-shadow: 0 0 0 .4em color-mix(in srgb, var(--g) 28%, transparent); animation: pulse 1.6s ease-in-out infinite; }
.mcol.now .mlab { color: var(--ink); }
.mstack { display: flex; flex-wrap: wrap; justify-content: center; gap: .25em; min-height: 4.6em; align-content: flex-start; }
.mface { position: relative; display: inline-grid; animation: pop .5s var(--spring) both; }
.mface b { position: absolute; right: -.5em; bottom: -.3em; font-size: .5em; font-weight: 900; background: var(--tc, var(--ink)); color: #fff; border-radius: 999px; padding: .05em .4em; }
.mface.rest b { background: var(--bg-2); color: var(--ink-2); }
.mrest { gap: .35em; min-height: 2.2em; }
.stage-in { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .5em; }
.stage-in label { display: grid; gap: .25em; font-size: .8em; font-weight: 800; color: var(--ink-2); min-width: 0; }
.stage-in .input { text-align: center; font-weight: 900; padding: .3em .2em; min-width: 0; width: 100%; }

/* Zeichnen am Handy: immer quer. Hochkant gehalten liegt die Ansicht gedreht im Bild. */
.zdraw { position: fixed; left: 0; top: 0; width: 100vw; height: 100dvh; display: grid; grid-template-columns: auto minmax(0, 1fr) 8.6em; gap: 8px; background: var(--bg); z-index: 3;
  padding: 6px max(8px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); }
@media (orientation: portrait) {
  .zdraw { width: 100dvh; height: 100vw; transform-origin: 0 0; transform: translateX(100vw) rotate(90deg);
    padding: 6px max(8px, env(safe-area-inset-bottom)) 6px max(8px, env(safe-area-inset-top)); }
}
.ztools { display: grid; grid-template-columns: repeat(2, 38px); gap: 5px; align-content: center; }
.zw { display: contents; }
.zdraw .ink { width: 38px; height: 38px; border-width: 3px; }
.ztool { width: 38px; height: 38px; border-radius: 12px; background: var(--surface); color: var(--ink); display: grid; place-items: center; box-shadow: var(--shadow-s); }
.ztool i { display: block; border-radius: 50%; background: currentColor; }
.ztool[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.ztool:active { transform: scale(.9); }
.zpad { min-width: 0; min-height: 0; display: grid; place-items: center; container-type: size; }
.zpad canvas { width: min(100cqw, 100cqh * 16 / 9); aspect-ratio: 16 / 9; height: auto; display: block; background: #FFFCF7; border-radius: 14px; box-shadow: var(--shadow); touch-action: none; cursor: crosshair; }
.zside { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.zside h2 { font-size: 1.15em; line-height: 1.15; }
.zside .btn { min-height: 44px; padding: .4em .5em; font-size: .9em; }
.zside .chip { align-self: flex-start; }
.zhint { display: none; }
@media (orientation: portrait) { .zhint { display: flex; align-items: center; gap: 6px; position: absolute; left: 50%; bottom: 10px; translate: -50% 0; background: var(--ink); color: var(--bg); font-weight: 800; font-size: .8em; padding: .35em .9em; border-radius: 999px; pointer-events: none; animation: hintOut 5s both; } }
@keyframes hintOut { 0%, 75% { opacity: .92; } 100% { opacity: 0; } }

/* ================= TV: Ton, Countdown, Moment, Siegerehrung ================= */
.tv-snd { position: absolute; right: 2em; bottom: .2em; z-index: 30; display: flex; align-items: center; gap: .2em; font-size: .5em; font-weight: 800; opacity: .4; transition: opacity .2s; }
.tv-snd:hover { opacity: 1; }
#ev { position: absolute; inset: 0; pointer-events: none; z-index: 40; }
.cd-bar { position: absolute; inset: 0; }
.cd-track { position: absolute; left: 0; right: 0; bottom: 0; height: .5em; background: rgba(255, 255, 255, .12); }
.cd-track i { display: block; height: 100%; background: var(--honey); transform-origin: left; transition: transform .2s linear; }
.cd-badge { position: absolute; left: 50%; top: 1.15em; translate: -50% 0; background: var(--honey); color: #2A1F1A; font-weight: 900; font-size: 1.5em; padding: .15em .8em; border-radius: 999px; display: flex; gap: .4em; align-items: center; box-shadow: var(--shadow); font-variant-numeric: tabular-nums; }
.cd-ten { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(10, 6, 4, .6); }
.cd-ten .num { font-size: 15em; font-weight: 900; color: #fff; line-height: 1; text-shadow: 0 .05em .2em rgba(0, 0, 0, .5); }
.bump { animation: bump .9s var(--out) both; }
@keyframes bump { from { transform: scale(1.5); opacity: .3; } }
.moment { position: absolute; inset: 0; overflow: hidden; display: grid; place-items: center; background: radial-gradient(circle at 50% 45%, #6A2F1E, #1D1511 75%); animation: fadeIn .5s both; }
@keyframes fadeIn { from { opacity: 0; } }
.rays { position: absolute; inset: -60%; background: repeating-conic-gradient(from 0deg, rgba(242, 179, 61, .17) 0 10deg, transparent 10deg 20deg); animation: spin 40s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.balloon { position: absolute; left: var(--l); bottom: -7em; width: 3.2em; height: 4em; border-radius: 50% 50% 48% 48%; background: var(--c); box-shadow: inset -.4em -.4em 0 rgba(0, 0, 0, .12); animation: float var(--b, 8s) linear var(--d, 0s) infinite; }
.balloon::after { content: ""; position: absolute; left: 50%; top: 100%; width: 2px; height: 3.4em; background: rgba(255, 255, 255, .5); }
@keyframes float { from { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-22em) rotate(5deg); } to { transform: translateY(-46em) rotate(-4deg); } }
.moment .fx { position: absolute; inset: 0; width: 100%; height: 100%; }
.moment-mid { position: relative; display: grid; justify-items: center; gap: .3em; text-align: center; color: #fff; animation: pop .8s var(--spring) both; }
.moment-mid h1 { font-size: 3.8em; line-height: 1.05; }
.moment-mid p { font-size: 1.5em; font-weight: 800; }
.moment-mid .eyebrow { color: var(--honey); font-size: 1em; }
.moment .mring { position: relative; padding: .5em; display: grid; margin-bottom: .4em; }
.moment .mring::before { content: ""; position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(var(--coral), var(--honey), var(--mint), var(--sky), var(--lav), var(--berry), var(--coral)); animation: spin 6s linear infinite; }
.moment .mring > * { position: relative; }

.cer { grid-template-columns: minmax(0, 1fr) 15em; }
.cer.wide { grid-template-columns: minmax(0, 1fr); }
.cer-side { background: var(--surface); border-radius: 1.2em; padding: 1em; gap: .2em; box-shadow: var(--shadow-s); min-height: 0; }
.cer-side .push { margin-top: auto; }
.cer-cup { width: 5em; height: 5em; color: var(--honey); }
.cer-wrap { display: grid; place-items: center; position: relative; }
.cer-wrap > * { grid-area: 1 / 1; }
.cer-drum { font-size: 2.6em; font-weight: 900; text-align: center; animation: drumOut 1.5s both; }
@keyframes drumOut { 0% { opacity: 0; transform: scale(.9); } 15%, 80% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1.1); } }
.cer-card { display: grid; justify-items: center; gap: .5em; text-align: center; padding: 1.4em 2.4em; border-top: .5em solid var(--tc); min-width: 18em; animation: pop .7s var(--spring) 1.5s both; }
.cer-wrap:has(.win) .cer-drum { animation-duration: 2.4s; }
.cer-card.win { animation-delay: 2.4s; background: color-mix(in srgb, var(--honey) 22%, var(--surface)); }
.rank.big { font-size: 1.8em; }
.cer-pay { font-size: 2em; font-weight: 900; color: var(--ok); display: flex; align-items: center; gap: .3em; }
.race { position: relative; height: calc(var(--n) * 2.9em); }
.race-row { position: absolute; left: 0; right: 0; top: 0; height: 2.5em; transform: translateY(calc(var(--pos) * 2.9em)); transition: transform .9s var(--out); display: grid; grid-template-columns: auto 9em minmax(0, 1fr) 3em; align-items: center; gap: .7em; background: var(--surface); border-radius: 1em; padding: 0 .8em; font-weight: 800; box-shadow: var(--shadow-s); }
.race-row .bar-track { height: .8em; }
.race-fill { display: block; height: 100%; border-radius: 999px; background: var(--tc); transition: width .9s var(--out); }
.race-row .num { text-align: right; }
.duel-row { display: flex; align-items: center; gap: 1.2em; }
.duel-card { display: grid; justify-items: center; gap: .3em; padding: 1.2em 2em; border-top: .5em solid var(--tc); min-width: 13em; text-align: center; }
.duel-card .clock { font-size: 3.4em; }
.qr.sm { width: 7em; height: 7em; padding: .5em; rotate: 0deg; border-radius: 1em; flex: none; }
.pay-card { gap: 1em; background: color-mix(in srgb, var(--ok) 14%, var(--surface)); }
@media (prefers-reduced-motion: reduce) {
  .cer-card, .cer-card.win, .pk-t { animation-delay: 0s !important; }
  .cer-drum, .rays, .balloon { display: none; }
}
.ztv-side .clock { font-size: 3.4em; }
.pick-grid { justify-content: center; }
