/* Pizza Tornado – Pizza-Turm: Kachel auf der Startseite und das Spiel auf /spiele/turm. Alle Klassen mit Präfix „turm-“.
   Farben über die Tokens aus site.css (hell + dunkel); das Spielfeld selbst ist ein Canvas und zeichnet Tag bzw. Abend. */

/* =====================================================================
   Kachel (Startseite)
   ===================================================================== */
.aktion-kachel.turm-kachel {
  container: turm-kachel / inline-size;
  isolation: isolate;
  padding: 22px;
  border: 0;
  color: #161616;
  background-color: #8FCBF3;
  background-image: linear-gradient(180deg, #6DB8EC 0%, #9ED3F4 38%, #D6ECF4 70%, #FBE6C0 100%);
}
.aktion-kachel.turm-kachel:hover, .aktion-kachel.turm-kachel:focus-visible { color: #161616; }

.turm-kachel-szene { position: absolute; inset: 0; z-index: 0; overflow: hidden; border-radius: inherit; pointer-events: none; }
/* Sonne + zwei Wolken */
.turm-kachel-szene::before { content: ""; position: absolute; right: 18%; top: 14px; width: 54px; height: 54px; border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, #FFFBE6 0 30%, #FFE58A 55%, #FFC94A 72%, rgba(255, 201, 74, 0) 74%);
  box-shadow: 0 0 0 14px rgba(255, 240, 190, .35), 0 0 0 30px rgba(255, 240, 190, .16); }
.turm-kachel-wolke { position: absolute; width: 92px; height: 30px; border-radius: 99px; background: #fff; opacity: .92;
  box-shadow: 18px -12px 0 -2px #fff, 44px -6px 0 2px #fff; }
.turm-kachel-wolke:nth-child(1) { left: 46%; top: 30px; transform: scale(.7); animation: turm-wolke 26s linear infinite; }
.turm-kachel-wolke:nth-child(2) { left: 8%; top: 74px; transform: scale(.55); opacity: .75; animation: turm-wolke 34s linear -12s infinite; }
/* Gehweg */
.turm-kachel-boden { position: absolute; left: 0; right: 0; bottom: 0; height: 34px;
  background: linear-gradient(180deg, #ECE7DD 0 3px, #D9D3C8 3px, #C4BDB0 100%); }
.turm-kachel-boden::before { content: ""; position: absolute; inset: 3px 0 0; background: repeating-linear-gradient(100deg, transparent 0 46px, rgba(90, 80, 64, .2) 46px 47.5px); }
/* Mann mit Kartonturm */
.turm-kachel-bild { position: absolute; z-index: 1; right: 8px; bottom: 12px; width: 148px; height: auto; overflow: visible; }
.turm-kachel-fall { animation: turm-kachel-fallen 2.8s cubic-bezier(.45, 0, .7, .4) infinite; transform-box: fill-box; transform-origin: center; }
.turm-kachel-turm { animation: turm-kachel-wanken 2.8s ease-in-out infinite; transform-box: view-box; transform-origin: 74px 90px; }

.turm-kachel .small-label, .turm-kachel-titel, .turm-kachel-text, .turm-kachel-werte, .turm-kachel-knopf { position: relative; z-index: 2; }
.turm-kachel .small-label { display: block; color: #9A1C14; }
.turm-kachel-titel { display: block; margin-top: 6px; max-width: calc(100% - 120px); color: #161616; font-size: 25px; font-weight: 800; letter-spacing: -0.035em; line-height: 1.06; text-wrap: balance; }
.turm-kachel-text { display: block; max-width: calc(100% - 128px); margin: 8px 0 18px; color: #2C2A26; font-size: 15px; font-weight: 600; line-height: 1.4; text-wrap: pretty; }
.turm-kachel-werte { display: flex; flex-wrap: wrap; gap: 6px; max-width: calc(100% - 118px); margin: -6px 0 18px; }
.turm-kachel-wert { display: inline-flex; align-items: center; gap: 5px; min-height: 28px; padding: 0 11px; border-radius: 999px;
  background: rgba(255, 255, 255, .82); box-shadow: inset 0 0 0 1px rgba(22, 22, 22, .1); color: #2C2A26; font-size: 13px; font-weight: 700; line-height: 1.2; white-space: nowrap; }
.turm-kachel-wert b { color: #161616; font-weight: 800; }
.turm-kachel-knopf { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; min-height: 42px; margin-top: auto; padding: 0 18px;
  border-radius: 999px; background: #E3241B; color: #fff; font-size: 15px; font-weight: 800; white-space: nowrap;
  box-shadow: 0 6px 18px rgba(227, 36, 27, .42), inset 0 1px 0 rgba(255, 255, 255, .25); }
.turm-kachel-knopf span { display: inline-block; transition: transform .2s ease; }
.turm-kachel:hover .turm-kachel-knopf span, .turm-kachel:focus-visible .turm-kachel-knopf span { transform: translateX(4px); }

@container turm-kachel (max-width: 300px) {
  .turm-kachel-bild { width: 118px; right: 2px; }
  .turm-kachel-titel { max-width: calc(100% - 92px); font-size: 23px; }
  .turm-kachel-text, .turm-kachel-werte { max-width: calc(100% - 96px); }
}
@container turm-kachel (min-width: 420px) {
  .turm-kachel-bild { width: 164px; right: 22px; }
  .turm-kachel-titel { font-size: 27px; max-width: calc(100% - 180px); }
  .turm-kachel-text, .turm-kachel-werte { max-width: calc(100% - 190px); }
}

/* Abend (Dunkelmodus): lila-oranger Himmel, Mond statt Sonne, helle Schrift */
html[data-thema="dunkel"] .aktion-kachel.turm-kachel { color: #F3F1EC; background-color: #2A2652;
  background-image: linear-gradient(180deg, #121836 0%, #262A5C 40%, #5A3570 70%, #B5586A 100%); }
html[data-thema="dunkel"] .aktion-kachel.turm-kachel:hover, html[data-thema="dunkel"] .aktion-kachel.turm-kachel:focus-visible { color: #F3F1EC; }
html[data-thema="dunkel"] .turm-kachel-szene::before { width: 34px; height: 34px; top: 20px; background: radial-gradient(circle at 62% 38%, transparent 0 46%, #FFF2D6 48%);
  box-shadow: 0 0 0 12px rgba(255, 236, 200, .1), 0 0 0 26px rgba(255, 236, 200, .05); transform: rotate(-20deg); }
html[data-thema="dunkel"] .turm-kachel-wolke { background: #6F6A9A; box-shadow: 18px -12px 0 -2px #6F6A9A, 44px -6px 0 2px #6F6A9A; opacity: .5; }
html[data-thema="dunkel"] .turm-kachel-boden { background: linear-gradient(180deg, #5D5A63 0 3px, #4F4C55 3px, #3C3A42 100%); }
html[data-thema="dunkel"] .turm-kachel .small-label { color: #FFC531; }
html[data-thema="dunkel"] .turm-kachel-titel { color: #fff; text-shadow: 0 2px 12px rgba(10, 8, 30, .6); }
html[data-thema="dunkel"] .turm-kachel-text { color: rgba(255, 255, 255, .88); text-shadow: 0 1px 8px rgba(10, 8, 30, .7); }
html[data-thema="dunkel"] .turm-kachel-wert { background: rgba(14, 12, 34, .62); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16); color: rgba(255, 255, 255, .88); }
html[data-thema="dunkel"] .turm-kachel-wert b { color: #FFC531; }

@keyframes turm-wolke { from { translate: 0 0; } to { translate: 160px 0; } }
@keyframes turm-kachel-fallen {
  0% { transform: translateY(-46px) rotate(-8deg); opacity: 0; }
  12% { opacity: 1; }
  62% { transform: translateY(0) rotate(0); opacity: 1; }
  80% { transform: translateY(0) rotate(0); opacity: 1; }
  100% { transform: translateY(0) rotate(0); opacity: 0; }
}
@keyframes turm-kachel-wanken { 0%, 100% { rotate: -1.6deg; } 50% { rotate: 1.8deg; } }
.turm-kachel-striche { animation: turm-kachel-striche 2.8s linear infinite; }
@keyframes turm-kachel-striche { 0%, 48% { opacity: 1; } 58%, 100% { opacity: 0; } }

/* =====================================================================
   Spiel (/spiele/turm)
   ===================================================================== */
.turm { --turm-w: 360px; --turm-seite: 0px; --turm-nacht: #1E1613; position: relative; }
.turm-kopf { display: flex; flex-direction: column; gap: 8px; max-width: 780px; margin-bottom: clamp(16px, 2.4vw, 28px); }
.turm-kopf h1 { font-size: clamp(30px, 4.4vw, 52px); font-weight: 800; }
.turm-text { color: var(--muted); font-size: clamp(15px, 1.4vw, 17px); max-width: 660px; }
.turm-noscript { margin-top: 12px; padding: 14px 18px; border-radius: var(--r-s); background: var(--soft); font-weight: 600; }

/* ---------- Bühne: Spielfeld + Infos ---------- */
.turm-buehne { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.turm-feld { grid-column: 1 / -1; display: flex; justify-content: center; min-width: 0; }
.turm-seite { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
@media (min-width: 640px) {
  .turm-buehne:not(.is-breit) { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
.turm-buehne.is-breit { grid-template-columns: var(--turm-seite) var(--turm-w) var(--turm-seite); justify-content: center; align-items: start; gap: 18px; }
.turm-buehne.is-breit .turm-feld { grid-column: 2; grid-row: 1; }
.turm-buehne.is-breit .turm-seite-links { grid-column: 1; grid-row: 1; }
.turm-buehne.is-breit .turm-seite-rechts { grid-column: 3; grid-row: 1; }

/* ---------- Spielfeld ---------- */
.turm-rahmen { position: relative; width: var(--turm-w); height: calc(var(--turm-w) * 1.6); max-width: 100%; border-radius: clamp(18px, calc(var(--turm-w) * .06), 30px);
  overflow: hidden; isolation: isolate; background: #B9E0F7; color: #fff; outline: none;
  box-shadow: 0 18px 44px rgba(22, 22, 22, .2), 0 0 0 1px rgba(22, 22, 22, .06);
  -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; }
.turm-rahmen:focus-visible { box-shadow: 0 0 0 3px var(--card), 0 0 0 6px var(--accent), 0 18px 44px rgba(22, 22, 22, .2); }
.turm-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
/* Hintergrund-Ebenen: einmal gemalt, der Browser verschiebt/skaliert sie nur (transform) */
.turm-ebenen { position: absolute; inset: 0; overflow: hidden; pointer-events: none; background: #9CC9EC; }
html[data-thema="dunkel"] .turm-ebenen { background: #1F2352; }
.turm-ebene { position: absolute; left: 0; top: 0; display: block; max-width: none; transform-origin: 0 0; will-change: transform; pointer-events: none; }
.turm-rahmen[data-zustand="spiel"] .turm-canvas { cursor: none; }
@media (pointer: coarse) { .turm-rahmen[data-zustand="spiel"] .turm-canvas { cursor: default; } }

/* Anzeige oben links */
.turm-hud { position: absolute; z-index: 2; left: calc(var(--turm-w) * .03); top: calc(var(--turm-w) * .03); display: flex; flex-direction: column; gap: calc(var(--turm-w) * .014);
  padding: calc(var(--turm-w) * .02) calc(var(--turm-w) * .03) calc(var(--turm-w) * .022); border-radius: calc(var(--turm-w) * .045);
  background: rgba(24, 17, 14, .7); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1); pointer-events: none; line-height: 1; }
.turm-hud-punkte { display: flex; flex-direction: column; gap: 3px; }
.turm-hud-label { font-size: max(8.5px, calc(var(--turm-w) * .022)); font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--highlight); }
.turm-hud-punkte b { font-size: max(18px, calc(var(--turm-w) * .066)); font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.turm-hud-zeile { display: flex; align-items: center; gap: calc(var(--turm-w) * .03); }
.turm-herzen { display: inline-flex; gap: max(2px, calc(var(--turm-w) * .006)); }
.turm-herz { display: inline-grid; width: max(15px, calc(var(--turm-w) * .046)); height: max(15px, calc(var(--turm-w) * .046)); color: #FF4D42; filter: drop-shadow(0 1px 0 rgba(0, 0, 0, .35)); }
.turm-herz svg { width: 100%; height: 100%; }
.turm-herz.is-leer { color: rgba(255, 255, 255, .22); filter: none; }
.turm-herz.is-weg { animation: turm-herz-weg .6s ease-out both; }
.turm-herz.is-neu { animation: turm-herz-neu .6s cubic-bezier(.2, .9, .3, 1.5) both; }
.turm-hud-hoehe { display: inline-flex; align-items: center; gap: 4px; font-size: max(13px, calc(var(--turm-w) * .04)); font-weight: 800; font-variant-numeric: tabular-nums; }
.turm-hud-hoehe svg { width: max(15px, calc(var(--turm-w) * .046)); height: max(15px, calc(var(--turm-w) * .046)); }
.turm-rahmen[data-zustand="start"] .turm-hud, .turm-rahmen[data-zustand="start"] .turm-ziel, .turm-rahmen[data-zustand="countdown"] .turm-ziel { visibility: hidden; }

/* Kurze Meldung oben in der Mitte („Der Roller ist da – abliefern!“) */
.turm-meldung { position: absolute; z-index: 2; left: 50%; top: calc(var(--turm-w) * .25); max-width: 86%; transform: translateX(-50%); pointer-events: none; opacity: 0; }
.turm-meldung span { display: block; padding: calc(var(--turm-w) * .02) calc(var(--turm-w) * .042); border-radius: 999px; background: rgba(24, 17, 14, .8); color: #fff;
  font-size: max(12px, calc(var(--turm-w) * .036)); font-weight: 800; line-height: 1.2; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .22); }
.turm-meldung[data-art="gut"] span { background: var(--highlight); color: #161616; }
.turm-meldung[data-art="schlecht"] span { background: #D3281E; }
.turm-meldung[data-art="wind"] span { background: #DDF1FF; color: #12324A; }
.turm-meldung.is-an { animation: turm-meldung 2.2s ease both; }

/* Ziel-Leiste unten (nächster Gutschein, Tagesrekord oder Bestwert) */
.turm-ziel { position: absolute; z-index: 2; left: 18%; right: 18%; bottom: calc(var(--turm-w) * .03); display: flex; flex-direction: column; align-items: stretch; gap: 4px;
  padding: calc(var(--turm-w) * .014) calc(var(--turm-w) * .028) calc(var(--turm-w) * .018); border-radius: calc(var(--turm-w) * .035);
  background: rgba(24, 17, 14, .7); text-align: center; pointer-events: none; }
.turm-ziel-text { font-size: max(10.5px, calc(var(--turm-w) * .03)); font-weight: 700; line-height: 1.2; }
.turm-ziel-spur { display: block; height: max(4px, calc(var(--turm-w) * .012)); border-radius: 99px; background: rgba(255, 255, 255, .2); overflow: hidden; }
.turm-ziel-spur i { display: block; height: 100%; border-radius: inherit; background: var(--highlight); transform-origin: left center; transform: scaleX(0); transition: transform .25s linear; }
.turm-ziel[data-art="rekord"] .turm-ziel-spur i, .turm-ziel[data-art="best"] .turm-ziel-spur i { background: #7FD0FF; }
.turm-ziel[data-art="top"] .turm-ziel-spur i { background: #6FE09A; }

/* Ton & Pause oben rechts */
.turm-ecke { position: absolute; z-index: 4; right: calc(var(--turm-w) * .03); top: calc(var(--turm-w) * .03); display: flex; flex-direction: column; gap: calc(var(--turm-w) * .018); }
.turm-rund { width: clamp(38px, calc(var(--turm-w) * .105), 48px); height: clamp(38px, calc(var(--turm-w) * .105), 48px); padding: 0; border: 0; border-radius: 50%; display: grid; place-items: center;
  background: rgba(24, 17, 14, .7); color: #fff; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); transition: background .15s ease, transform .15s ease; }
.turm-rund:hover { background: rgba(24, 17, 14, .9); transform: scale(1.05); }
.turm-rund:focus-visible { outline: 3px solid var(--highlight); outline-offset: 2px; }
.turm-rund svg { width: 52%; height: 52%; }
.turm-rund[aria-pressed="true"] { background: var(--highlight); color: #161616; }

/* ---------- Ebenen: Start, Countdown, Pause, Ergebnis ---------- */
.turm-schicht { position: absolute; inset: 0; z-index: 3; display: flex; align-items: center; justify-content: center; padding: calc(var(--turm-w) * .055); text-align: center; color: #fff; }
.turm-schicht[hidden] { display: none; }
.turm-schicht-start { overflow-y: auto; overscroll-behavior: contain;
  background: linear-gradient(180deg, rgba(30, 20, 16, .12) 0%, rgba(30, 20, 16, .6) 24%, rgba(30, 20, 16, .82) 48%, rgba(30, 20, 16, .88) 100%); }
.turm-schicht-countdown { background: radial-gradient(circle at 50% 42%, rgba(30, 20, 16, .4), rgba(30, 20, 16, 0) 62%); pointer-events: none; touch-action: none; }
.turm-schicht-pause { background: rgba(30, 20, 16, .72); touch-action: none; }
.turm-schicht-ende { display: block; padding: 0; background: var(--turm-nacht); overflow-y: auto; overscroll-behavior: contain; -webkit-user-select: text; user-select: text; }

.turm-start { display: flex; flex-direction: column; align-items: center; gap: calc(var(--turm-w) * .03); width: 100%; margin: auto 0; }
.turm-start-marke { display: inline-flex; align-items: center; gap: 8px; font-size: max(11px, calc(var(--turm-w) * .03)); font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--highlight); }
.turm-start-logo { width: max(26px, calc(var(--turm-w) * .08)); height: max(26px, calc(var(--turm-w) * .08)); object-fit: contain; border-radius: 50%; background: #fff; padding: 2px; }
.turm-start-titel { margin: 0; font-size: max(36px, calc(var(--turm-w) * .14)); font-weight: 800; line-height: .92; letter-spacing: -.05em; color: #fff;
  text-shadow: 0 3px 0 #B3150E, 0 6px 22px rgba(0, 0, 0, .45); }
.turm-start-unter { margin-top: calc(var(--turm-w) * -.012); font-size: max(13px, calc(var(--turm-w) * .04)); font-weight: 700; color: #FFE7A6; }
.turm-regeln { list-style: none; margin: 0; padding: calc(var(--turm-w) * .03) calc(var(--turm-w) * .035); display: flex; flex-direction: column; gap: calc(var(--turm-w) * .022);
  max-width: 100%; text-align: left; font-size: max(12px, calc(var(--turm-w) * .034)); line-height: 1.3; border-radius: calc(var(--turm-w) * .045);
  background: rgba(255, 255, 255, .08); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); }
.turm-regeln li { display: flex; align-items: center; gap: calc(var(--turm-w) * .03); }
.turm-regeln svg { width: max(22px, calc(var(--turm-w) * .07)); height: max(22px, calc(var(--turm-w) * .07)); flex: none; }
.turm-regeln li > svg, .turm-regeln .turm-regel-herz { box-sizing: content-box; padding: max(5px, calc(var(--turm-w) * .014)); border-radius: 50%;
  background: rgba(255, 255, 255, .1); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1); }
.turm-regeln .turm-regel-herz svg { display: block; }
.turm-regel-herz { display: inline-grid; flex: none; color: #FF4D42; }
.turm-start-ziel { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; font-size: max(11px, calc(var(--turm-w) * .031)); }
.turm-start-ziel:empty { display: none; }
.turm-start-ziel-titel { width: 100%; font-weight: 700; color: rgba(255, 255, 255, .78); }
.turm-start-stufe { display: inline-flex; align-items: baseline; gap: 4px; padding: 4px 11px; border-radius: 99px; background: rgba(255, 197, 49, .16);
  box-shadow: inset 0 0 0 1px rgba(255, 197, 49, .5); color: #FFE7A6; font-weight: 600; }
.turm-start-stufe b { color: #fff; font-weight: 800; }
.turm-start-best, .turm-start-stufe-name { width: 100%; color: rgba(255, 255, 255, .78); }
.turm-start-best b { color: #fff; }
.turm-start-stufe-name { margin-top: -2px; font-size: .92em; color: rgba(255, 255, 255, .6); }
.turm-los { min-height: max(50px, calc(var(--turm-w) * .14)); padding: 0 calc(var(--turm-w) * .09); font-size: max(17px, calc(var(--turm-w) * .052)); box-shadow: 0 10px 26px rgba(227, 36, 27, .5); }
.turm-los span { display: inline-block; transition: transform .2s ease; }
.turm-los:hover span { transform: translateX(4px); }
.turm-tasten { font-size: max(11px, calc(var(--turm-w) * .029)); color: rgba(255, 255, 255, .7); }
.turm-nur-touch { display: none; }
@media (hover: none) and (pointer: coarse) {
  .turm-nur-maus { display: none; }
  .turm-nur-touch { display: inline; }
}
/* sehr kleine Spielfläche (z. B. Handy quer): ohne Regeln */
.turm-buehne.is-mini .turm-regeln, .turm-buehne.is-mini .turm-start .turm-tasten, .turm-buehne.is-mini .turm-start-unter { display: none; }
.turm-buehne.is-mini .turm-start-titel { font-size: 30px; }

.turm-countdown { margin: 0; font-size: calc(var(--turm-w) * .17); font-weight: 800; line-height: 1; letter-spacing: -.04em; color: #fff;
  text-shadow: 0 4px 0 #B3150E, 0 8px 28px rgba(0, 0, 0, .45); animation: turm-zahl .5s cubic-bezier(.2, .9, .3, 1.25) both; }
.turm-countdown.is-los { font-size: calc(var(--turm-w) * .24); color: var(--highlight); text-shadow: 0 4px 0 #A66A06, 0 8px 28px rgba(0, 0, 0, .45); animation: turm-los .55s cubic-bezier(.2, .9, .3, 1.35) both; }

.turm-pause { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.turm-pause-titel { font-size: calc(var(--turm-w) * .13); font-weight: 800; line-height: 1; letter-spacing: -.04em; }
.turm-pause-text { color: rgba(255, 255, 255, .84); max-width: 260px; }

/* Ergebnis */
.turm-ende { --metal: var(--turm-nacht); width: 100%; min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: calc(var(--turm-w) * .03); padding: calc(var(--turm-w) * .06) calc(var(--turm-w) * .05) 0; text-align: center;
  background: radial-gradient(120% 60% at 50% 0%, rgba(227, 36, 27, .28), rgba(227, 36, 27, 0) 70%); }
.turm-ende-kopf { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.turm-ende-titel { font-size: max(21px, calc(var(--turm-w) * .068)); font-weight: 800; line-height: 1.05; letter-spacing: -.03em; color: #FFE7A6; }
.turm-ende-punkte { display: flex; flex-direction: column; align-items: center; line-height: 1; }
.turm-ende-punkte b { font-size: max(44px, calc(var(--turm-w) * .15)); font-weight: 800; letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.turm-ende-abzeichen-zeile { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 3px; }
.turm-ende-punkte span { margin-top: 4px; font-size: max(11px, calc(var(--turm-w) * .028)); font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--highlight); }
.turm-ende-abzeichen { padding: 4px 13px; border-radius: 99px; background: var(--highlight); color: #161616; font-size: 14px; line-height: 1.4; font-weight: 800; animation: turm-pokal .6s cubic-bezier(.2, .9, .3, 1.3) both; }
.turm-ende-abzeichen.is-rekord { background: #E3241B; color: #fff; }
.turm-ende-werte { list-style: none; margin: 0; padding: 0; width: 100%; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.turm-ende-werte li { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 2px 8px; border-radius: 12px; background: rgba(255, 255, 255, .07); }
.turm-ende-werte b { font-size: max(16px, calc(var(--turm-w) * .048)); line-height: 1.1; font-weight: 800; font-variant-numeric: tabular-nums; }
.turm-ende-werte span { font-size: max(10px, calc(var(--turm-w) * .025)); line-height: 1.2; color: rgba(255, 255, 255, .7); }
.turm-ende-gutschein { width: 100%; display: flex; flex-direction: column; gap: 10px; color: #fff; }
.turm-ende-gutschein > .ticket, .turm-details .ticket { width: 100%; text-align: left; }
.turm-ende .ticket-main { padding: 12px 16px 10px; }
.turm-ende .ticket-amount { font-size: max(38px, calc(var(--turm-w) * .1)); margin: 2px 0 4px; }
.turm-ende .ticket-text { font-size: 13px; }
.turm-ende .ticket-stub { padding: 12px 14px 14px; gap: 8px; }
.turm-ende .ticket .code { font-size: max(18px, calc(var(--turm-w) * .05)); padding: 6px 12px; }
.turm-ende .ticket .meta { font-size: 12px; }
.turm-ende-text { padding: 10px 14px; border-radius: 14px; background: rgba(255, 255, 255, .08); font-size: 14px; line-height: 1.4; color: rgba(255, 255, 255, .9); }
.turm-ende-text.is-fehler { background: rgba(227, 36, 27, .22); box-shadow: inset 0 0 0 1px rgba(255, 138, 128, .5); color: #FFE1DE; }
.turm-ende-warten { font-weight: 700; color: rgba(255, 255, 255, .85); }
.turm-lader { display: inline-block; width: 14px; height: 14px; margin-right: 8px; vertical-align: -2px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .3); border-top-color: #fff; animation: turm-drehen .8s linear infinite; }
.turm-ende-fortschritt .turm-fortschritt-balken { background: rgba(255, 255, 255, .16); }
.turm-details { text-align: center; }
.turm-details summary { cursor: pointer; font-weight: 700; color: var(--highlight); padding: 4px; }
.turm-details[open] summary { margin-bottom: 10px; }
.turm-ende-knoepfe { position: sticky; bottom: 0; z-index: 1; align-self: stretch; display: flex; flex-direction: column; align-items: center; margin: 0 calc(var(--turm-w) * -.05);
  padding: calc(var(--turm-w) * .055) calc(var(--turm-w) * .05) calc(var(--turm-w) * .03);
  background: linear-gradient(180deg, rgba(30, 22, 19, 0), var(--turm-nacht) calc(var(--turm-w) * .055)); }
.turm-ende-knoepfe .btn { min-width: min(100%, 220px); box-shadow: 0 10px 26px rgba(227, 36, 27, .42); }
.turm-ende-klein { display: inline-block; margin-top: 8px; padding: 3px 8px; font-size: 12.5px; line-height: 1.3; color: rgba(255, 255, 255, .72); }
.turm-ende-klein:hover { color: #fff; }
/* Rahmen schmaler als 440 px (Handy, Laptop): alles etwas dichter, damit Punkte und Gutscheincode ohne Rollen zu sehen sind */
.turm-buehne.is-kompakt .turm-ende { gap: calc(var(--turm-w) * .024); padding-top: calc(var(--turm-w) * .045); }
.turm-buehne.is-kompakt .turm-ende-kopf { gap: 3px; }
.turm-buehne.is-kompakt .turm-ende-punkte b { font-size: max(40px, calc(var(--turm-w) * .13)); }
.turm-buehne.is-kompakt .turm-ende-abzeichen { padding: 3px 11px; font-size: 13px; }
.turm-buehne.is-kompakt .turm-ende-werte li { padding: 4px 2px 5px; border-radius: 10px; }
.turm-buehne.is-kompakt .turm-ende .ticket-main { padding: 8px 14px 7px; }
.turm-buehne.is-kompakt .turm-ende .ticket-kicker { font-size: 12px; }
.turm-buehne.is-kompakt .turm-ende .ticket-amount { font-size: 34px; margin: 1px 0 3px; }
.turm-buehne.is-kompakt .turm-ende .ticket-text { font-size: 12.5px; line-height: 1.35; }
.turm-buehne.is-kompakt .turm-ende .ticket-stub { padding: 9px 12px 11px; gap: 5px; }
.turm-buehne.is-kompakt .turm-ende .ticket-label { font-size: 11px; }
.turm-buehne.is-kompakt .turm-ende .ticket .code { font-size: 17px; padding: 4px 12px; }
.turm-buehne.is-kompakt .turm-ende .ticket .meta { font-size: 11.5px; line-height: 1.3; }
.turm-buehne.is-kompakt .turm-ende .ticket .row { gap: 6px; }
.turm-buehne.is-kompakt .turm-ende .ticket .btn-small { min-height: 38px; padding: 0 13px; font-size: 13.5px; }
.turm-buehne.is-kompakt .turm-ende-knoepfe { padding-top: calc(var(--turm-w) * .04); padding-bottom: calc(var(--turm-w) * .022); }
.turm-buehne.is-kompakt .turm-ende-klein { margin-top: 7px; }
.turm-buehne.is-kompakt .turm-ende-knoepfe .btn-large { min-height: 50px; }

/* Namensfeld für die Bestenliste */
.turm-rang { width: 100%; display: flex; flex-direction: column; gap: 8px; padding: 12px 14px 14px; border-radius: 16px; text-align: left;
  background: linear-gradient(135deg, rgba(255, 197, 49, .22), rgba(255, 197, 49, .06)); box-shadow: inset 0 0 0 1.5px rgba(255, 197, 49, .55); }
.turm-rang-titel, .turm-rang-ok { display: flex; align-items: center; gap: 8px; font-size: max(15px, calc(var(--turm-w) * .04)); font-weight: 800; line-height: 1.2; color: #fff; }
.turm-rang-titel svg, .turm-rang-ok svg { width: 26px; height: 26px; flex: none; }
.turm-rang-ok { justify-content: center; padding: 10px; border-radius: 14px; background: rgba(111, 224, 154, .14); box-shadow: inset 0 0 0 1px rgba(111, 224, 154, .45); }
.turm-rang-label { font-size: 13px; font-weight: 700; color: rgba(255, 255, 255, .8); }
.turm-rang-zeile { display: flex; gap: 8px; }
.turm-rang-zeile input { flex: 1 1 auto; min-width: 0; height: 44px; padding: 0 12px; border: 0; border-radius: 12px; background: #fff; color: #161616; caret-color: #161616;
  font: inherit; font-size: 16px; font-weight: 700; box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .08); -webkit-user-select: text; user-select: text; }
.turm-rang-zeile input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--accent), 0 0 0 3px rgba(255, 197, 49, .6); }
.turm-rang-zeile .btn { flex: none; height: 44px; min-height: 0; padding: 0 16px; background: #fff; color: #161616; }
.turm-rang-zeile .btn:hover { background: var(--highlight); color: #161616; }
.turm-rang-fehler { padding: 7px 10px; border-radius: 10px; background: rgba(227, 36, 27, .25); box-shadow: inset 0 0 0 1px rgba(255, 138, 128, .6); font-size: 13px; font-weight: 700; line-height: 1.35; color: #FFD9D6; }

/* ---------- Infos neben dem Spiel ---------- */
.turm-block { background: var(--soft); border-radius: var(--r-m); padding: 18px; }
.turm-block-titel { margin-bottom: 10px; font-size: 16px; font-weight: 800; letter-spacing: -.01em; }
.turm-werte { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.turm-wert { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.turm-wert span { font-size: 13px; font-weight: 700; color: var(--muted); }
.turm-wert b { font-size: 26px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.turm-stufen-liste { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.turm-stufe { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2px 10px; padding: 10px 12px; border-radius: 14px; background: var(--card); box-shadow: inset 0 0 0 1.5px var(--line); }
.turm-stufe-punkte { font-size: 14px; }
.turm-stufe-punkte b { font-size: 17px; font-weight: 800; }
.turm-stufe-wert { padding: 3px 11px; border-radius: 99px; background: var(--highlight); color: #161616; font-size: 16px; font-weight: 800; white-space: nowrap; }
.turm-stufe-hinweis { grid-column: 1 / -1; font-size: 12.5px; color: var(--muted); }
.turm-stufe.is-geschafft { box-shadow: inset 0 0 0 2px #2E9E54; }
.turm-stufe.is-geschafft .turm-stufe-punkte::after { content: " ✓"; color: #1E7E44; font-weight: 800; }
.turm-fortschritt-balken { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; }
.turm-fortschritt-balken i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), #FF8A3D); transform-origin: left center; transform: scaleX(0); transition: transform .6s ease; }
.turm-fortschritt p { margin-top: 8px; font-size: 13.5px; font-weight: 600; line-height: 1.4; }
.turm-mein-gutschein { --metal: var(--soft); }
.turm-mein-gutschein .ticket-main { padding: 14px 14px 12px; }
.turm-mein-gutschein .ticket-amount { font-size: 40px; }
.turm-mein-gutschein .ticket-stub { padding: 14px 12px 16px; gap: 10px; }
.turm-mein-gutschein .ticket .code { font-size: 18px; letter-spacing: .05em; padding: 6px 10px; overflow-wrap: normal; white-space: nowrap; }
.turm-hilfe-liste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 11px; font-size: 14px; line-height: 1.4; }
.turm-hilfe-liste li { display: grid; grid-template-columns: 62px minmax(0, 1fr); align-items: center; gap: 10px; }
.turm-tasten-bild { display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 3px; }
.turm-tasten-bild kbd { display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 6px; border-radius: 7px; background: var(--card);
  box-shadow: inset 0 0 0 1.5px var(--line), 0 2px 0 var(--line); font: inherit; font-size: 12px; font-weight: 800; }
.turm-hilfe-icon { justify-self: center; display: grid; place-items: center; width: 40px; height: 28px; border-radius: 8px; }
.turm-hilfe-icon svg { width: 26px; height: 26px; }
.turm-hilfe-gold { width: 34px; height: 16px; border-radius: 3px; background: linear-gradient(180deg, #FFE07A, #F5B92A 55%, #C98A0C); box-shadow: inset 0 0 0 1px #9A6A08, 0 2px 0 rgba(0, 0, 0, .12); }
.turm-hilfe-herz { color: #E3241B; }

/* Bestenliste */
.turm-besten-titel { display: flex; align-items: center; gap: 8px; }
.turm-besten-titel svg { width: 22px; height: 22px; flex: none; }
.turm-besten-titel small { margin-left: auto; padding: 2px 9px; border-radius: 99px; background: var(--card); box-shadow: inset 0 0 0 1.5px var(--line); font-size: 12px; font-weight: 800; color: var(--muted); }
.turm-besten-liste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.turm-besten-zeile { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; align-items: center; column-gap: 8px; padding: 6px 10px 6px 6px; border-radius: 12px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
.turm-besten-platz { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--soft); font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; }
.turm-besten-name { display: flex; align-items: center; gap: 5px; min-width: 0; font-size: 14px; font-weight: 700; line-height: 1.2; }
.turm-besten-name > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.turm-besten-name svg { width: 17px; height: 17px; flex: none; }
.turm-besten-name em { flex: none; padding: 1px 6px; border-radius: 99px; background: var(--accent); color: #fff; font-size: 10.5px; font-style: normal; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.turm-besten-punkte { font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; }
.turm-besten-zeile.is-platz1 { padding-top: 9px; padding-bottom: 9px; background: linear-gradient(135deg, #FFF3C4, #FFE08A); box-shadow: inset 0 0 0 1.5px #E9B21A, 0 6px 16px rgba(233, 178, 26, .22); color: #161616; }
.turm-besten-zeile.is-platz1 .turm-besten-platz { background: #FFC531; box-shadow: inset 0 0 0 1.5px #A66A06; color: #161616; }
.turm-besten-zeile.is-platz2 .turm-besten-platz { background: #E4E7EB; box-shadow: inset 0 0 0 1.5px #A3AAB3; color: #161616; }
.turm-besten-zeile.is-platz3 .turm-besten-platz { background: #F3D2B3; box-shadow: inset 0 0 0 1.5px #B9773D; color: #161616; }
.turm-besten-zeile.is-ich { box-shadow: inset 0 0 0 2px var(--accent); }
.turm-besten-leer { padding: 14px; border-radius: 14px; background: var(--card); border: 1.5px dashed var(--line); font-size: 14px; font-weight: 600; line-height: 1.4; text-align: center; }

@media (max-width: 560px) {
  .card.turm { padding-left: 12px; padding-right: 12px; }
  .turm-kopf { padding: 0 8px; }
  .turm-block { padding: 16px; }
}

/* Dunkelmodus: Spielfeld bleibt bunt, nur Ränder, Gelb-Flächen und die Bestenliste angepasst */
html[data-thema="dunkel"] .turm-rahmen { background: #2A2652; box-shadow: 0 18px 44px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .07); }
html[data-thema="dunkel"] .turm-rahmen:focus-visible { box-shadow: 0 0 0 3px var(--card), 0 0 0 6px var(--accent), 0 18px 44px rgba(0, 0, 0, .55); }
html[data-thema="dunkel"] .turm-stufe.is-geschafft { box-shadow: inset 0 0 0 2px #3FAE66; }
html[data-thema="dunkel"] .turm-stufe.is-geschafft .turm-stufe-punkte::after { color: #6FD394; }
html[data-thema="dunkel"] .turm-besten-zeile.is-platz1 { background: linear-gradient(135deg, #3D3112, #4A3A0E); box-shadow: inset 0 0 0 1.5px #C9971A, 0 6px 16px rgba(0, 0, 0, .35); color: var(--ink); }
html[data-thema="dunkel"] .turm-besten-zeile.is-platz1.is-ich { box-shadow: inset 0 0 0 2px var(--accent), 0 6px 16px rgba(0, 0, 0, .35); }

@keyframes turm-meldung {
  0% { opacity: 0; transform: translate(-50%, -10px) scale(.92); }
  10% { opacity: 1; transform: translate(-50%, 0) scale(1); }
  82% { opacity: 1; transform: translate(-50%, 0) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -6px) scale(.98); }
}
@keyframes turm-herz-weg { 0% { transform: scale(1); } 30% { transform: scale(1.45); color: #FF4D42; } 100% { transform: scale(1); } }
@keyframes turm-herz-neu { 0% { transform: scale(.2); } 100% { transform: scale(1); } }
@keyframes turm-zahl { from { transform: scale(1.6); opacity: 0; } 40% { opacity: 1; } to { transform: scale(1); opacity: 1; } }
@keyframes turm-los { from { transform: scale(.6); opacity: 0; } 60% { opacity: 1; } to { transform: scale(1); opacity: 1; } }
@keyframes turm-pokal { from { transform: scale(.4) rotate(-10deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes turm-drehen { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .turm-kachel-wolke, .turm-kachel-fall, .turm-kachel-turm, .turm-kachel-striche { animation: none; }
  .turm-kachel-striche { opacity: 0; }
  .turm-kachel-knopf span, .turm-los span, .turm-rund, .turm-ziel-spur i, .turm-fortschritt-balken i { transition: none; }
  .turm-kachel:hover .turm-kachel-knopf span, .turm-kachel:focus-visible .turm-kachel-knopf span, .turm-los:hover span { transform: none; }
  .turm-herz.is-weg, .turm-herz.is-neu, .turm-countdown, .turm-countdown.is-los, .turm-ende-abzeichen { animation: none; }
  .turm-meldung.is-an { animation: turm-meldung-ruhig 2.2s linear both; }
  .turm-lader { animation-duration: 2.4s; }
}
@keyframes turm-meldung-ruhig { 0%, 88% { opacity: 1; transform: translateX(-50%); } 100% { opacity: 0; transform: translateX(-50%); } }
