/* Rauswurf – Gestaltung. Klassisches Brett mit eingelassenen Feldern auf grünem Tisch, ohne Umrandungen.
   Dunkel: dasselbe Brett bei wenig Licht.
   Alles auf dem Brett hängt an der Brettbreite (cqw = 1 % der Brettbreite). */
@font-face { font-family: Fredoka; font-weight: 400; font-display: swap; src: url(../assets/fonts/fredoka-400.woff2) format('woff2'); }
@font-face { font-family: Fredoka; font-weight: 500; font-display: swap; src: url(../assets/fonts/fredoka-500.woff2) format('woff2'); }
@font-face { font-family: Fredoka; font-weight: 600; font-display: swap; src: url(../assets/fonts/fredoka-600.woff2) format('woff2'); }
@font-face { font-family: Fredoka; font-weight: 700; font-display: swap; src: url(../assets/fonts/fredoka-700.woff2) format('woff2'); }

:root {
  --schrift: Fredoka, 'Trebuchet MS', system-ui, sans-serif;
  --tinte: #2a2320; --tinte2: #6e6154; --rand: #2a2320;
  --karte: #fbf3e0; --feld: #efe2c5; --linie: #e2d3b1; --kreis: #fffaf0;
  --seite-bg: radial-gradient(120% 90% at 40% 15%, #4d675b 0%, #365046 48%, #25382f 100%); --boden: #2b4037;
  --brett: #f3e4c4; --brett-rand: #e0caa0; --mulde: #fbf3de; --lippe: rgba(255, 255, 255, .95);
  --creme: #fff8ea;
  --gruen: #2c7f48;
}
html[data-thema='dunkel'] {
  --tinte: #f3e9d6; --tinte2: #b3a894; --rand: #171310;
  --karte: #2a2622; --feld: #38332d; --linie: #463f37; --kreis: #1f1b18;
  --seite-bg: radial-gradient(120% 90% at 40% 15%, #26332d 0%, #18211d 52%, #0e1411 100%); --boden: #131a17;
  --brett: #5b4a36; --brett-rand: #6b5841; --mulde: #d6c5a2; --lippe: rgba(255, 236, 200, .4);
  color-scheme: dark;
}
.f-rot { --farbe: #c9302a; --farbe-d: #8f1d19; --farbe-h: #f3d2ca; --farbe-g: #dd7f7a; --tief: #7e1f1b; --strich: #4e1310; --auf: #fffaf0; }
.f-blau { --farbe: #1f5fae; --farbe-d: #143f76; --farbe-h: #cfdcec; --farbe-g: #789fce; --tief: #1d3863; --strich: #12223c; --auf: #fffaf0; }
.f-gruen { --farbe: #2c7f48; --farbe-d: #1b5730; --farbe-h: #cfe2d2; --farbe-g: #80b291; --tief: #244a2b; --strich: #172f1c; --auf: #fffaf0; }
.f-gelb { --farbe: #e9ae1c; --farbe-d: #a87806; --farbe-h: #f8e6b4; --farbe-g: #f2ce77; --tief: #8c6413; --strich: #5f430e; --auf: #2a2320; }
html[data-thema='dunkel'] :is(.f-rot, .f-blau, .f-gruen, .f-gelb) { --farbe-h: color-mix(in srgb, var(--farbe) 30%, #1f1b18); }

* { box-sizing: border-box; }
html { background: var(--boden); -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 16px/1.4 var(--schrift); color: var(--tinte); min-height: 100dvh; -webkit-tap-highlight-color: transparent; overscroll-behavior: none; }
body::before { content: ''; position: fixed; inset: 0; background: var(--seite-bg); z-index: -1; pointer-events: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; -webkit-user-select: none; user-select: none; }
button:disabled { cursor: default; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #8fb8ff; outline-offset: 2px; }

/* ---------- Bausteine ---------- */
.logo { font: 700 22px/1 var(--schrift); letter-spacing: .07em; color: var(--creme); white-space: nowrap; }
.logo .l-rot { color: #f2766c; } .logo .l-blau { color: #7db4f2; } .logo .l-gruen { color: #7fd197; } .logo .l-gelb { color: #f7cb4d; }
.logo .l-f { display: inline-block; transform: rotate(19deg) translate(.1em, -.13em); }
.logo.gross { font-size: clamp(46px, 14vw, 92px); }

.knopf { border: 0; border-radius: 14px; padding: 10px 18px; background: var(--feld); color: var(--tinte); font-weight: 600; font-size: 16px; line-height: 1.2;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .13); display: inline-flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; transition: transform .08s, filter .15s, box-shadow .08s; }
.knopf:hover:not(:disabled) { filter: brightness(1.05); }
.knopf:active:not(:disabled) { transform: translateY(2px); box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .13); }
.knopf:disabled { opacity: .45; }
.knopf.haupt { background: var(--tinte); color: var(--karte); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .3); }
html[data-thema='dunkel'] .knopf.haupt { box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .18); }
.knopf.hell { background: #fffaf0; color: #2a2320; }
.knopf.glas { background: rgba(255, 255, 255, .11); color: var(--creme); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .2); }
.knopf.gross { font-size: 18px; padding: 14px 22px; border-radius: 16px; width: 100%; }
.knopf.klein { font-size: 14px; padding: 7px 12px; border-radius: 11px; }
.knopf.flach { background: none; box-shadow: none; color: var(--tinte2); font-weight: 500; font-size: 14.5px; text-decoration: underline; text-underline-offset: 3px; }
.knopf small { font-weight: 400; font-size: 13px; opacity: .72; margin-top: 2px; }
.knopf .ik { width: 18px; height: 18px; } .knopf:has(.ik) { flex-direction: row; gap: 8px; }
.ik svg, .rund svg { width: 100%; height: 100%; display: block; }

.rund { width: 40px; height: 40px; border-radius: 50%; border: 0; padding: 10px; background: var(--feld); color: var(--tinte); flex: none; display: grid; place-items: center; transition: filter .15s, transform .08s; }
.rund:hover { filter: brightness(1.08); } .rund:active { transform: scale(.94); }
.rund.auf-dunkel, .leiste .rund { background: rgba(255, 255, 255, .12); color: var(--creme); }

.karte { background: var(--karte); color: var(--tinte); border-radius: 18px; padding: 16px 18px; box-shadow: 0 16px 32px -16px rgba(0, 0, 0, .6); }
.karte > h2, .fenster h2 { font: 600 17px/1.2 var(--schrift); margin: 0 0 10px; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.karte > h2 small { font-weight: 400; font-size: 13px; color: var(--tinte2); }
.leise { color: var(--tinte2); font-size: 14px; } .mittig { text-align: center; }
.fehler { color: #c9362c; font-weight: 500; margin-top: 8px; } html[data-thema='dunkel'] .fehler { color: #ff8b82; }
.du { font-size: 11px; font-weight: 600; background: var(--tinte); color: var(--karte); border-radius: 20px; padding: 1px 7px; margin-left: 6px; vertical-align: 1px; }

.eingabe { width: 100%; min-width: 0; border: 2px solid var(--linie); background: var(--kreis); color: var(--tinte); border-radius: 12px; padding: 8px 12px; font-size: 16px; font-weight: 500; }
.eingabe:focus { outline: 0; border-color: var(--tinte2); }
.eingabe.gross { font-size: 18px; padding: 12px 14px; }
.eingabe.code { text-transform: uppercase; letter-spacing: .3em; text-align: center; font-weight: 700; max-width: 150px; }
.reihe { display: flex; gap: 10px; align-items: stretch; }

.wahl { display: inline-flex; background: var(--feld); border-radius: 12px; padding: 3px; gap: 2px; flex: none; }
.wahl button { border: 0; background: none; font-weight: 500; font-size: 14.5px; padding: 7px 13px; border-radius: 9px; color: var(--tinte2); white-space: nowrap; }
.wahl button.an { background: var(--karte); color: var(--tinte); font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.wahl button:disabled:not(.an) { opacity: .45; }
.wahl.klein button { font-size: 13.5px; padding: 5px 10px; }
html[data-thema='dunkel'] .wahl button.an { background: #4d453c; }

.schalter { width: 48px; height: 28px; border-radius: 14px; border: 0; padding: 0; background: var(--linie); position: relative; flex: none; transition: background .16s; }
.schalter i { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .16s; }
.schalter.an { background: var(--gruen); } .schalter.an i { transform: translateX(20px); }
.schalter:disabled { opacity: .6; }

.zeile { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 10px 0; border-top: 1.5px solid var(--linie); }
.zeile:first-child { border-top: 0; padding-top: 2px; }
.zeile-text { min-width: 0; } .zeile-text b { display: block; font-weight: 600; } .zeile-text span { font-size: 13.5px; color: var(--tinte2); display: block; line-height: 1.3; }
.regler-box { display: flex; align-items: center; gap: 10px; } .regler { width: 150px; accent-color: var(--tinte); } .regler-zahl { width: 46px; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }

dialog.fenster { border: 0; border-radius: 22px; padding: 0; background: var(--karte); color: var(--tinte); width: min(460px, calc(100vw - 20px)); max-height: calc(100dvh - 20px); box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .7); overflow: hidden; }
dialog.fenster[open] { display: flex; flex-direction: column; animation: auf .18s ease-out; }
dialog.fenster.breit { width: min(600px, calc(100vw - 20px)); }
dialog.fenster::backdrop { background: rgba(14, 22, 18, .62); }
@keyframes auf { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.fenster-kopf { display: flex; justify-content: space-between; align-items: center; padding: 14px 14px 8px 20px; }
.fenster-kopf h2 { margin: 0; font-size: 20px; }
.fenster-inhalt { padding: 4px 20px 16px; overflow-y: auto; }
.fenster-fuss { display: flex; gap: 10px; justify-content: flex-end; padding: 12px 16px 16px; border-top: 1.5px solid var(--linie); }
.menue { display: flex; flex-direction: column; gap: 10px; padding-top: 4px; }
.regelpunkt { padding: 9px 0; border-top: 1.5px solid var(--linie); } .regelpunkt:first-child { border-top: 0; padding-top: 0; }
.regelpunkt h3 { font: 600 16px/1.2 var(--schrift); margin-bottom: 3px; } .regelpunkt p { font-size: 15px; color: var(--tinte); opacity: .88; }
.regeltext > .leise { margin-top: 10px; }

/* ---------- Seiten vor dem Spiel ---------- */
.start { min-height: 100dvh; display: grid; place-items: center; padding: 24px 18px; position: relative; }
.start-rad { position: absolute; top: max(14px, env(safe-area-inset-top)); right: 16px; }
.start-mitte { width: min(400px, 100%); display: flex; flex-direction: column; align-items: center; text-align: center; }
.start-figuren { display: flex; gap: 8px; margin-bottom: 10px; }
.start-figuren span { width: 46px; animation: wippen 2.6s ease-in-out infinite; animation-delay: calc(var(--i) * -.45s); }
.start-figuren svg { width: 100%; display: block; filter: drop-shadow(0 5px 4px rgba(0, 0, 0, .3)); }
@keyframes wippen { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-9px); } }
.start-unter { color: rgba(255, 248, 234, .78); font-size: 17px; margin: 8px 0 26px; }
.start-knoepfe { width: 100%; display: flex; flex-direction: column; gap: 11px; }
.start-reihe { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.start-reihe .knopf { padding: 12px; }
a.knopf { text-decoration: none; }
.alle-spiele { position: absolute; top: max(14px, env(safe-area-inset-top)); left: 16px; height: 40px; display: inline-flex; align-items: center; gap: 4px; padding: 0 16px 0 10px; border-radius: 20px; background: rgba(255, 255, 255, .12); color: var(--creme); text-decoration: none; font-weight: 500; }
.alle-spiele .ik { width: 20px; height: 20px; }
.start-konto { min-height: 40px; display: grid; place-items: center; }
.konto { border: 0; background: none; color: rgba(255, 248, 234, .85); font-size: 15px; font-weight: 500; padding: 6px 12px; display: inline-flex; align-items: center; gap: 8px; }
.avatar { width: 26px; height: 26px; border-radius: 50%; flex: none; object-fit: cover; }
.spielt-als { display: flex; align-items: center; gap: 10px; font-size: 18px; } .spielt-als .avatar { width: 36px; height: 36px; }
.oder { margin-top: 10px; } .verweis { color: inherit; font-weight: 600; }
.sitz-name .avatar { margin-right: 8px; }

.seite-voll { min-height: 100dvh; max-width: 940px; margin: 0 auto; padding: 0 16px 30px; padding-top: env(safe-area-inset-top); }
.kopfzeile { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; }
.platzhalter { width: 40px; }
.seiten-titel { color: var(--creme); font: 600 26px/1.2 var(--schrift); margin: 6px 2px 16px; }
.auf-dunkel-text { color: rgba(255, 248, 234, .8); padding: 40px 0; }
.spalten { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.spalten.schmal { grid-template-columns: 1fr; max-width: 440px; margin: 0 auto; }
.spalten > .unten, .raum-kopf { grid-column: 1 / -1; }
.unten { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.unten .knopf { max-width: 440px; background: #fffaf0; color: #2a2320; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .13); }
.unten .leise { color: rgba(255, 248, 234, .78); min-height: 1.4em; }
.raum-kopf { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.raum-kopf h2 { margin: 0 0 2px; justify-content: flex-start; } .code-gross { letter-spacing: .18em; font-weight: 700; background: var(--feld); border-radius: 8px; padding: 1px 4px 1px 9px; }

.sitz { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 11px 0; border-top: 1.5px solid var(--linie); }
.sitz:first-child { border-top: 0; padding-top: 2px; }
.sitz-figur { width: 32px; flex: none; } .sitz-figur svg { width: 100%; display: block; }
.sitz.aus .sitz-figur { opacity: .32; filter: grayscale(.8); } .sitz.frei .sitz-figur { opacity: .5; }
.karte > .leise + .knopf, .karte > .leise + form { margin-top: 10px; }
.sitz-mitte { flex: 1 1 150px; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.sitz-leer { color: var(--tinte2); } .sitz-name { font-weight: 600; font-size: 17px; display: inline-flex; align-items: center; }
.sitz-tun { display: flex; gap: 6px; flex-wrap: wrap; }
.regeln-liste + .knopf.flach { margin-top: 4px; padding-left: 0; }

/* ---------- Spiel ---------- */
.spiel { height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.leiste { display: flex; align-items: center; gap: 8px; padding: 10px 16px 8px; padding-top: max(10px, env(safe-area-inset-top)); flex: none; }
.leiste-mitte { flex: 1; display: flex; justify-content: center; min-width: 0; }
.raum-code { border: 0; background: rgba(255, 255, 255, .12); color: var(--creme); border-radius: 20px; padding: 6px 14px; font-size: 14px; white-space: nowrap; }
.raum-code b { letter-spacing: .14em; font-weight: 700; }
.band { background: #e9ae1c; color: #2a2320; text-align: center; font-weight: 500; font-size: 14px; padding: 5px 12px; }
.spielraster { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) min(330px, 38vw); gap: 16px; padding: 4px 16px 16px; padding-bottom: max(16px, env(safe-area-inset-bottom)); }
.buehne { container-type: size; display: grid; place-items: center; min-width: 0; min-height: 0; }
.seite { display: flex; flex-direction: column; gap: 14px; min-height: 0; overflow-y: auto; scrollbar-width: none; }

/* Brett */
.brett-box { width: min(100cqw, 100cqh); aspect-ratio: 1; position: relative; container-type: inline-size; isolation: isolate; user-select: none; -webkit-user-select: none; }
.brett-grund { position: absolute; inset: 0; border-radius: 2.4cqw; background: url(../assets/img/korn.png) 0 0 / 120px, var(--brett); box-shadow: inset 0 0 0 1.3cqw var(--brett-rand), 0 1.6cqw 3.4cqw -.6cqw rgba(0, 0, 0, .55); }
.brett-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.vorlagen { position: absolute; }
.b-feld { fill: var(--mulde); }
.b-farbe { fill: var(--farbe); }
.b-lippe { fill: none; stroke: url(#rw-lippe); stroke-width: .42; }
.b-kern { fill: color-mix(in srgb, var(--farbe) 20%, #fff); }
.b-pfeil { fill: none; stroke: var(--auf); stroke-width: .85; stroke-linecap: round; stroke-linejoin: round; }
.brett-svg .leer { opacity: .35; }
.v-farbe { stop-color: var(--farbe); } .v-hell { stop-color: color-mix(in srgb, var(--farbe) 86%, #fff); } .v-licht { stop-color: color-mix(in srgb, var(--farbe) 60%, #fff); } .v-tief { stop-color: var(--tief); }
.v-lippe { stop-color: var(--lippe); }

.schild { position: absolute; left: 0; top: 0; max-width: calc(var(--w) * 1cqw); height: 4.2cqw; transform: translate(calc(var(--x) * 1cqw - 50%), calc(var(--y) * 1cqw - 50%)); border-radius: 2.1cqw;
  color: #5d5040; font-weight: 600; font-size: clamp(10px, 2.35cqw, 19px); line-height: 1;
  display: flex; align-items: center; justify-content: center; gap: .8cqw; padding: 0 1.4cqw; transition: background .2s, color .2s; }
html[data-thema='dunkel'] .schild { color: #e0d0b0; }
.schild-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; padding-top: .1em; }
.schild-ik { width: 3.2cqw; height: 3.2cqw; flex: none; opacity: .7; } .schild-ik svg { width: 100%; height: 100%; display: block; }
.schild-symbol { width: 2.6cqw; height: 2.6cqw; flex: none; } .schild-symbol svg { width: 100%; height: 100%; display: block; fill: var(--farbe-d); }
.schild-platz { background: var(--farbe); color: var(--auf); border-radius: 2cqw; padding: .5cqw 1.3cqw .3cqw; font-weight: 700; flex: none; }
.schild.dran, html[data-thema='dunkel'] .schild.dran { background: var(--farbe); color: var(--auf); }
.schild.dran .schild-symbol svg { fill: currentColor; }

.figuren, .marken, .fx { position: absolute; inset: 0; pointer-events: none; }
.figur { position: absolute; left: 0; top: 0; width: 6.9cqw; height: 9.315cqw; padding: 0; border: 0; background: none; pointer-events: none;
  transform: translate(calc(var(--x) * 1cqw - 50%), calc(var(--y) * 1cqw - 73%)); transition: transform var(--ms, 0ms) linear; }
.figur:disabled { opacity: 1; }
.figur.fliegt { transition-timing-function: ease-in-out; }
.figur.gehauen { transition-timing-function: cubic-bezier(.12, .7, .3, 1); }
.figur-bild { position: absolute; inset: 0; display: block; transform-origin: 50% 88%; }
.figur-svg { width: 100%; height: 100%; display: block; overflow: visible; }
.figur-schatten { position: absolute; left: 6%; right: -34%; top: 78%; height: 24%; background: radial-gradient(closest-side, rgba(42, 26, 8, .5), rgba(42, 26, 8, .28) 55%, transparent); }
.k-linie { stroke: var(--strich); stroke-width: 1.5; stroke-linejoin: round; }
.k-fuss { fill: none; stroke: var(--strich); stroke-width: 1; stroke-linecap: round; opacity: .5; }
.k-kragen { fill: color-mix(in srgb, var(--farbe) 84%, var(--tief)); stroke: var(--strich); stroke-width: 1.2; }
.k-glanz { fill: none; stroke: #fff; stroke-width: 2.5; stroke-linecap: round; opacity: .5; }
.k-licht { fill: #fff; opacity: .9; }
.k-symbol * { fill: #fff; stroke: var(--rand); stroke-width: 1.1; stroke-linejoin: round; }
.symbol { fill: currentColor; }
.figur.kann { pointer-events: auto; cursor: pointer; }
.figur.kann::after { content: ''; position: absolute; inset: -18% -32% -22%; }
.figur.kann .figur-bild { animation: huepf .85s ease-in-out infinite; }
.figur.kann .figur-schatten { animation: schattenpuls .85s ease-in-out infinite; }
.figur.kann:hover .k-linie, .figur.kann:focus-visible .k-linie { stroke-width: 2.8; }
.figur:focus-visible { outline: 0; }
@keyframes huepf { 0%, 100% { transform: translateY(0) scale(1, 1); } 45% { transform: translateY(-1.5cqw) scale(1.04, 1.04); } 80% { transform: translateY(0) scale(1.05, .95); } }
@keyframes schattenpuls { 45% { transform: scale(.78); opacity: .7; } }

.marke { position: absolute; left: 0; top: 0; width: 7.9cqw; height: 7.9cqw; padding: 0; border-radius: 50%; pointer-events: auto;
  transform: translate(calc(var(--x) * 1cqw - 50%), calc(var(--y) * 1cqw - 50%)); border: .75cqw solid var(--farbe); background: color-mix(in srgb, var(--farbe) 24%, transparent); box-shadow: 0 0 0 .35cqw rgba(255, 250, 240, .85); animation: marke 1.1s ease-in-out infinite; }
.marke.hell { background: color-mix(in srgb, var(--farbe) 60%, transparent); }
.marke.schlag { border-color: var(--rand); width: 8.9cqw; height: 8.9cqw; background: color-mix(in srgb, var(--farbe) 45%, transparent); }
@keyframes marke { 50% { opacity: .55; } }

.funkeln { position: absolute; left: 0; top: 0; width: 0; height: 0; transform: translate(calc(var(--x) * 1cqw), calc(var(--y) * 1cqw)); }
.funkeln::before, .funkeln::after { content: ''; position: absolute; left: -4cqw; top: -4cqw; width: 8cqw; height: 8cqw; border-radius: 50%; border: .7cqw solid var(--farbe); animation: welle .7s ease-out forwards; }
.funkeln::after { animation-delay: .14s; border-color: #fff; opacity: 0; }
@keyframes welle { from { transform: scale(.4); opacity: 1; } to { transform: scale(1.9); opacity: 0; } }

.toast { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background: var(--karte); color: var(--tinte); border-radius: 16px; padding: 12px 20px; font-size: clamp(14px, 3.4cqw, 20px); text-align: center; max-width: 80%;
  box-shadow: 0 0 0 3px var(--farbe), 0 16px 30px -10px rgba(0, 0, 0, .6); animation: toast .3s cubic-bezier(.2, 1.4, .4, 1); transition: opacity .4s, transform .4s; z-index: 3000; }
.toast b { font-weight: 700; } .toast.weg { opacity: 0; transform: translate(-50%, -70%); }
@keyframes toast { from { opacity: 0; transform: translate(-50%, -40%) scale(.9); } }

/* Ansage: wer ist dran und was ist zu tun (ohne Kasten, direkt auf dem Tisch) */
.ansage { flex: none; color: var(--creme); display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 6px 4px 2px; min-height: 66px; }
.ansage-links { flex: 1; min-width: 0; }
.ansage-text { font-weight: 600; font-size: 22px; line-height: 1.2; }
.wurf-knopf { display: none; background: var(--farbe); color: var(--auf); box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .18), 0 0 0 2px rgba(255, 248, 234, .25); }
.versuche { display: flex; align-items: center; gap: 6px; font-size: 14px; opacity: .85; margin-top: 4px; }
.versuche i { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--creme); } .versuche i.da { background: var(--creme); }
.frist { flex: 1 0 100%; height: 5px; background: rgba(255, 255, 255, .16); border-radius: 3px; overflow: hidden; } .frist i { display: block; height: 100%; background: var(--creme); transform-origin: left; }

/* Würfel: liegt auf dem Brett, in der Ecke von dem, der dran ist */
.wuerfel-platz { position: absolute; left: 0; top: 0; width: 0; height: 0; z-index: 5; transform: translate(calc(var(--x) * 1cqw), calc(var(--y) * 1cqw)); transition: transform .42s cubic-bezier(.3, .9, .3, 1); }
.wuerfel-knopf { position: absolute; left: -7.6cqw; top: -7.6cqw; width: 15.2cqw; height: 15.2cqw; border: 0; background: none; padding: 0; border-radius: 50%; display: grid; place-items: center; }
.wuerfel-knopf:disabled { opacity: 1; }
.wuerfel-knopf::before { content: ''; position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(closest-side, var(--farbe), transparent); opacity: 0; transition: opacity .25s; }
.wuerfel-knopf.lockt::before { opacity: .6; animation: leuchten 1.6s ease-in-out infinite; }
.wuerfel-knopf.sechs::before { opacity: 1; }
@keyframes leuchten { 50% { opacity: .28; } }
.wuerfel-knopf.lockt .wuerfel { animation: locken 1.6s ease-in-out infinite; }
@keyframes locken { 0%, 100% { transform: rotate(0) translateY(0); } 20% { transform: rotate(-7deg) translateY(-4%); } 40% { transform: rotate(6deg) translateY(0); } 60% { transform: rotate(0); } }
.wuerfel { --g: 7.7cqw; width: var(--g); height: var(--g); position: relative; perspective: calc(var(--g) * 9); }
.w-schatten { position: absolute; left: -22%; right: -44%; top: 46%; height: 84%; background: radial-gradient(closest-side, rgba(42, 26, 8, .55), rgba(42, 26, 8, .3) 55%, transparent); }
.kamera, .kubus { position: absolute; inset: 0; transform-style: preserve-3d; }
.w-seite, .w-kern { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.w-seite { background: #fffaec; box-shadow: inset 0 0 0 calc(var(--g) * .03) rgba(120, 88, 40, .2); border-radius: 21%; display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); padding: 13%; transition: background .18s; }
.w-seite[data-licht='1'] { background: #e9dabb; } .w-seite[data-licht='2'] { background: #d2bd93; }
.w-kern { inset: 4%; background: #e2d1ae; border-radius: 12%; }
.w-seite i { border-radius: 50%; background: #231b17; margin: 8%; }
.w-seite .p1 { grid-area: 1 / 1; } .w-seite .p3 { grid-area: 1 / 3; } .w-seite .p4 { grid-area: 2 / 1; } .w-seite .p5 { grid-area: 2 / 2; } .w-seite .p6 { grid-area: 2 / 3; } .w-seite .p7 { grid-area: 3 / 1; } .w-seite .p9 { grid-area: 3 / 3; }
.w-kern { --t: calc(var(--g) * .465); } .w-seite { --t: calc(var(--g) * .5); }
.w1 { transform: translateZ(var(--t)); } .w6 { transform: rotateY(180deg) translateZ(var(--t)); }
.w3 { transform: rotateY(90deg) translateZ(var(--t)); } .w4 { transform: rotateY(-90deg) translateZ(var(--t)); }
.w5 { transform: rotateX(90deg) translateZ(var(--t)); } .w2 { transform: rotateX(-90deg) translateZ(var(--t)); }

/* Runde und Verlauf */
.runde { flex: none; }
.runde-liste, .verlauf-liste, .ende-liste { list-style: none; margin: 0; padding: 0; }
.runde-liste li { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 12px; }
.runde-liste li.dran { background: var(--feld); box-shadow: inset 4px 0 0 var(--farbe); }
.mini { width: 20px; flex: none; display: block; } .mini svg { width: 100%; display: block; }
.runde-name { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.runde-art { display: inline-block; width: 17px; height: 17px; margin-left: 6px; vertical-align: -3px; opacity: .6; } .runde-art svg { width: 100%; height: 100%; display: block; }
.runde-platz { font-weight: 600; font-size: 14px; background: var(--farbe); color: var(--auf); border-radius: 20px; padding: 1px 9px; flex: none; }
.pips { display: flex; gap: 4px; flex: none; } .pips i { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--farbe-d); opacity: .45; } html[data-thema='dunkel'] .pips i { border-color: color-mix(in srgb, var(--farbe) 75%, #fff); }
.pips i.da { background: var(--farbe); opacity: 1; }
.verlauf { flex: 1 1 120px; min-height: 110px; display: flex; flex-direction: column; overflow: hidden; }
.verlauf-liste { overflow-y: auto; font-size: 14.5px; scrollbar-width: thin; margin-right: -8px; padding-right: 8px; }
.verlauf-liste li { padding: 3px 0; } .verlauf-liste li:first-child { animation: neu .3s ease-out; }
@keyframes neu { from { opacity: 0; transform: translateY(-4px); } }
.verlauf b { font-weight: 600; }
.t-rot { color: #c9362c; } .t-blau { color: #1f66c4; } .t-gruen { color: #1f8a3f; } .t-gelb { color: #a57a00; }
html[data-thema='dunkel'] .t-rot { color: #ff7d73; } html[data-thema='dunkel'] .t-blau { color: #71b0ff; } html[data-thema='dunkel'] .t-gruen { color: #62d283; } html[data-thema='dunkel'] .t-gelb { color: #f9d142; }

/* Spielende */
.ende { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 14px; background: rgba(14, 22, 18, .6); animation: einblenden .35s ease-out; overflow: hidden; }
@keyframes einblenden { from { opacity: 0; } }
.ende-karte { width: min(480px, 100%); max-height: 100%; overflow-y: auto; text-align: center; padding: 20px 20px 18px; box-shadow: 0 0 0 4px var(--farbe), 0 30px 60px -20px rgba(0, 0, 0, .8); animation: toast .4s cubic-bezier(.2, 1.3, .4, 1); position: relative; transition: transform .25s; }
.ende-figur { width: 62px; margin: 0 auto 4px; animation: wippen 1.4s ease-in-out infinite; } .ende-figur svg { width: 100%; display: block; }
.ende-karte h2 { font: 700 30px/1.15 var(--schrift); margin-bottom: 14px; display: block; text-align: center; }
.ende-liste li { display: grid; grid-template-columns: 26px 22px minmax(0, 1fr) repeat(4, 52px); gap: 6px; align-items: center; padding: 7px 4px; border-top: 1.5px solid var(--linie); text-align: left; }
.ende-liste li.e-kopf { border-top: 0; font-size: 11.5px; color: var(--tinte2); padding-bottom: 3px; line-height: 1.1; }
.e-platz { font-weight: 700; font-size: 18px; } .e-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.e-zahl { text-align: center; font-variant-numeric: tabular-nums; font-weight: 500; hyphens: manual; }
.ende-karte .knoepfe { display: flex; flex-direction: column; gap: 9px; margin-top: 16px; align-items: center; }
.ende.klein { background: none; pointer-events: none; place-items: end center; }
.ende.klein .ende-karte { display: none; }
.ende-zurueck { display: none; pointer-events: auto; margin-bottom: max(6px, env(safe-area-inset-bottom)); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .3), 0 14px 28px -10px rgba(0, 0, 0, .7), 0 0 0 3px var(--karte); }
.ende.klein .ende-zurueck { display: inline-flex; }
.ende.klein .konfetti { display: none; }
.konfetti { position: absolute; inset: 0; pointer-events: none; }
.konfetti i { position: absolute; top: -4%; left: var(--l); width: 10px; height: 16px; border-radius: 3px; background: var(--farbe); animation: fallen var(--t) linear var(--d) 3 both; }
@keyframes fallen { from { transform: translateY(0) rotate(var(--r)); } to { transform: translateY(112vh) rotate(calc(var(--r) + 540deg)); } }

/* ---------- Hochkant (Handy, Tablet hochkant) ---------- */
@media (max-aspect-ratio: 1/1) {
  .spielraster { display: flex; flex-direction: column; gap: 10px; padding: 0 10px 10px; padding-bottom: max(10px, env(safe-area-inset-bottom)); }
  .buehne { flex: none; width: 100%; aspect-ratio: 1; max-height: calc(100dvh - 60px - 150px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
  .seite { flex: 1; gap: 10px; }
  .verlauf { display: none; }
  @media (min-height: 780px) { .verlauf { display: flex; flex: 1 1 0; min-height: 0; padding: 10px 14px; } .verlauf > h2 { display: none; } }
  .ansage { min-height: 60px; padding: 2px 4px 0; } .ansage-text { font-size: 19px; }
  .ansage .wurf-knopf { display: inline-flex; width: auto; flex: none; padding: 14px 26px; }
  .runde { padding: 8px 10px; } .runde > h2 { display: none; }
  .runde-liste { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 8px; } .runde-liste li { padding: 5px 7px; gap: 7px; font-size: 14.5px; }
  .pips i { width: 10px; height: 10px; }
  .leiste { padding: 8px 12px 6px; padding-top: max(8px, env(safe-area-inset-top)); }
}
@media (max-width: 720px) {
  .raum-code { padding: 6px 11px; } .raum-code span { display: none; }
  .spalten { grid-template-columns: 1fr; }
  .spalten > .unten { position: sticky; bottom: 0; z-index: 5; margin: 0 -16px -30px; padding: 14px 16px max(14px, env(safe-area-inset-bottom)); background: linear-gradient(to top, var(--boden) 64%, transparent); }
  .spalten > .unten .leise:empty { display: none; }
  .ende-liste li { grid-template-columns: 22px 20px minmax(0, 1fr) repeat(4, 42px); gap: 4px; }
  .ende-liste li.e-kopf { font-size: 10px; }
  .regler { width: 110px; }
}
@media (max-height: 480px) and (min-aspect-ratio: 1/1) {
  .leiste { padding-top: 6px; padding-bottom: 4px; } .logo.klein { font-size: 18px; } .rund { width: 34px; height: 34px; padding: 8px; }
  .spielraster { padding-bottom: 8px; } .runde > h2, .verlauf { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .start-figuren span, .ende-figur, .wuerfel-knopf.lockt .wuerfel, .wuerfel-knopf.lockt::before, .marke, .figur.kann .figur-schatten { animation: none; }
  .konfetti { display: none; }
}
