/* ==========================================================================
   max-finish-games – Großes Design-Update (2026-11-09/10): der gemeinsame Rahmen aller Spiele.
   Letzte Schicht für das Spiel-Overlay (#gameOverlay), lädt nach max-finish.css und vor den
   Brett-Schichten (max-finish-boards.css, max-finish-tables.css). Datei weglassen = Stand davor.

   Bereiche: Auftritt beim Öffnen, Tafel mit Erzader in der Farbe des Spiels (--world aus
   max-games.css), Kopfzeile (Titel, Knöpfe, Guthaben), eingelassene Spielfläche (nur Rahmenlicht,
   nichts im Brett), Steuerpult (Einsatz-Platte, Erz-Jetons, Optionen, Hauptknopf, Auszahlen),
   Statuszeile samt Gewinn-/Verlust-Rückmeldung, Gewinn-Tafel (js/max-fx.js), Rundenkarte,
   Spielregeln-Dialog, schmale Bildschirme.

   Regeln: keine spielspezifischen Selektoren, keine Größen am Brett (#gameBoard behält Maße und
   Innenabstand – js/immersive.js fitStage rechnet damit), Hintergründe mit Schneekante (Kopf,
   Pult, Felder) bleiben unberührt: hier nur Licht (box-shadow), Adern, Schrift und Bewegung.
   Farben nur aus Tokens. Bewegung über translate/scale/opacity (die älteren Schichten setzen
   transform mit !important – die Einzel-Eigenschaften laufen daran vorbei), Keyframes „fg…“.
   :not(#_) schließt nichts aus, es hebt die Regel über die ID-Ketten der älteren Schichten.
   ========================================================================== */

/* ------------------------------------------------------------ 0. Eigene Werte */
body.tc-redesign.tc-max:not(.tc-v3):not(#_) #gameOverlay .theater-table {
  --fg-ore: var(--world, var(--mx-gold));
  --fg-hi: color-mix(in srgb, white 13%, transparent);
  --fg-ring: color-mix(in srgb, black 52%, transparent);
  --fg-stone-lo: var(--wtg-stone-lo, color-mix(in srgb, var(--mx-bg) 78%, black));
}

/* ------------------------------------------------------------ 1. Auftritt und Tafel
   Der Hintergrund dunkelt tief ab, die Tafel kommt kurz und kräftig herein, Kopf und Pult rücken nach. */
body.tc-redesign.tc-max:not(.tc-v3):not(#_) #gameOverlay {
  background:
    radial-gradient(90% 55% at 50% 0%, color-mix(in srgb, var(--mx-gold) 7%, transparent), transparent 72%),
    color-mix(in srgb, color-mix(in srgb, var(--mx-bg) 42%, black) 97%, transparent) !important;
}
body.tc-redesign.tc-max:not(.tc-v3):not(#_) #gameOverlay:not([hidden]) .theater-table {
  animation: fgTableIn .46s var(--mx-ease) backwards !important;
}
body.tc-redesign.tc-max:not(.tc-v3):not(#_) #gameOverlay:not([hidden]) .table-head {
  animation: fgHeadIn .5s var(--mx-ease) backwards;
}
body.tc-redesign.tc-max:not(.tc-v3):not(#_) #gameOverlay:not([hidden]) .tc-control-dock {
  animation: fgDockIn .52s .06s var(--mx-ease) backwards;
}
@keyframes fgTableIn {
  0% { opacity: 0; scale: .935; translate: 0 28px; }
  55% { opacity: 1; }
  78% { scale: 1.006; translate: 0 0; }
  100% { opacity: 1; scale: 1; translate: 0 0; }
}
@keyframes fgHeadIn {
  0% { opacity: 0; translate: 0 -100%; }
  100% { opacity: 1; translate: 0 0; }
}
@keyframes fgDockIn {
  0% { opacity: 0; translate: 44px 0; }
  100% { opacity: 1; translate: 0 0; }
}
@keyframes fgDockUp {
  0% { opacity: 0; translate: 0 56px; }
  100% { opacity: 1; translate: 0 0; }
}

/* Tafel als Block: dunkler Ring, Unterkante in der Erzfarbe des Spiels, deren Licht fällt nach unten.
   Nur am Schreibtisch – schmal füllt die Tafel den Schirm (max-games.css Abschnitt 8). */
@media (min-width: 821px) {
  body.tc-redesign.tc-max:not(.tc-v3):not(#_) #gameOverlay .theater-table {
    border-color: color-mix(in srgb, black 62%, transparent) !important;
    box-shadow:
      0 0 0 1px color-mix(in srgb, var(--fg-ore) 24%, transparent),
      0 4px 0 0 color-mix(in srgb, var(--fg-ore) 50%, black),
      0 5px 0 1px color-mix(in srgb, black 62%, transparent),
      0 44px 90px -30px black,
      0 30px 100px -30px color-mix(in srgb, var(--fg-ore) 58%, transparent) !important;
  }
}

/* Szene hinter dem Brett: mehr Farbe und Licht (steht still, wird einmal gerechnet; immersive.css setzt filter: none !important) */
body.tc-redesign.tc-max:not(.tc-v3):not(#_) #gameOverlay .theater-table::before { filter: saturate(1.35) brightness(1.1) !important; }
/* Lichtkegel in der Erzfarbe des Spiels: fällt vom Kopf aufs Brett, liegt zwischen Szene und Brett
   (Kinder der Tafel haben z-index ≥ 1). Steht still. */
body.tc-redesign.tc-max:not(.tc-v3):not(#_) #gameOverlay .theater-table::after {
  content: "" !important;
  display: block !important;
  position: absolute;
  inset: var(--head-h) var(--dock-w) 0 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(64% 44% at 50% 0%, color-mix(in srgb, var(--fg-ore) 30%, transparent), transparent 72%),
    radial-gradient(38% 30% at 0% 100%, color-mix(in srgb, var(--fg-ore) 16%, transparent), transparent 72%),
    radial-gradient(38% 30% at 100% 100%, color-mix(in srgb, var(--fg-ore) 16%, transparent), transparent 72%);
}

/* ------------------------------------------------------------ 2. Kopfzeile: schwere Platte
   Helle Oberkante, Ader in der Erzfarbe des Spiels, Schatten fällt auf Brett und Pult. Der Hintergrund
   bleibt (Winter legt dort Schnee auf); das farbige Licht liegt in ::after zwischen Fläche und Inhalt. */
body.tc-redesign.tc-max:not(.tc-v3):not(#_) #gameOverlay .table-head {
  border-bottom-color: color-mix(in srgb, black 58%, transparent) !important;
  box-shadow:
    inset 0 1px 0 var(--fg-hi),
    inset 0 -3px 0 color-mix(in srgb, var(--fg-ore) 78%, transparent),
    0 18px 30px -16px color-mix(in srgb, black 92%, transparent),
    0 14px 40px -14px color-mix(in srgb, var(--fg-ore) 62%, transparent) !important;
}
body.tc-redesign.tc-max:not(.tc-v3):not(#_) #gameOverlay .table-head::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(760px 220% at 0% 0%, color-mix(in srgb, var(--fg-ore) 34%, transparent), transparent 72%),
    radial-gradient(460px 200% at 100% 0%, color-mix(in srgb, var(--mx-gold) 13%, transparent), transparent 72%);
}
/* Lebenszeichen: alle paar Sekunden läuft ein Lichtpunkt die Ader entlang (3 px hoch, nur translate/opacity) */
body.tc-redesign.tc-max:not(.tc-v3):not(#_) #gameOverlay .table-head::before {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 22%;
  height: 3px;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--fg-ore) 34%, white) 50%, transparent);
  opacity: 0;
  animation: fgVeinRun 7.5s var(--mx-ease) .7s infinite;
}
/* Endet bündig an der rechten Kante (22 % × 3,55 = 78 %), damit nichts über den Kopf hinausragt */
@keyframes fgVeinRun {
  0% { opacity: 0; translate: -100% 0; }
  3% { opacity: 1; }
  15% { opacity: 1; }
  20%, 100% { opacity: 0; translate: 354% 0; }
}
body.tc-redesign.tc-max:not(.tc-v3):not(#_) #gameOverlay .table-head #gameTitle {
  text-shadow:
    0 2px 0 color-mix(in srgb, black 55%, transparent),
    0 0 30px color-mix(in srgb, var(--fg-ore) 60%, transparent) !important;
}

/* Knöpfe: Steinblöcke mit klarer Kante; beim Zeigen leuchtet die Ader des Spiels, beim Drücken sinkt der Block. */
body.tc-redesign.tc-max:not(.tc-v3):not(#_) #gameOverlay :is(.icon-btn-table, .back-lobby-btn) {
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, white 17%, transparent),
    inset 0 -1px 0 color-mix(in srgb, black 30%, transparent),
    0 0 0 1px var(--fg-ring),
    0 3px 0 var(--fg-stone-lo),
    0 4px 0 1px color-mix(in srgb, black 38%, transparent),
    0 12px 16px -8px color-mix(in srgb, black 85%, transparent) !important;
}
@media (hover: hover) {
  body.tc-redesign.tc-max:not(.tc-v3):not(#_) #gameOverlay :is(.icon-btn-table, .back-lobby-btn):hover {
    box-shadow:
      inset 0 1px 0 color-mix(in srgb, white 24%, transparent),
      inset 0 -2px 0 var(--fg-ore),
      0 0 0 1px var(--fg-ring),
      0 4px 0 var(--fg-stone-lo),
      0 5px 0 1px color-mix(in srgb, black 38%, transparent),
      0 14px 22px -8px color-mix(in srgb, var(--fg-ore) 55%, transparent) !important;
  }
  body.tc-redesign.tc-max:not(.tc-v3):not(#_) #gameOverlay #gameClose:hover {
    box-shadow:
      inset 0 1px 0 color-mix(in srgb, white 26%, transparent),
      0 0 0 1px var(--fg-ring),
      0 4px 0 color-mix(in srgb, var(--mx-redstone) 40%, black),
      0 14px 22px -8px color-mix(in srgb, var(--mx-redstone) 60%, transparent) !important;
  }
}
body.tc-redesign.tc-max:not(.tc-v3):not(#_) #gameOverlay :is(.icon-btn-table, .back-lobby-btn):active {
  box-shadow:
    inset 0 2px 4px color-mix(in srgb, black 45%, transparent),
    0 0 0 1px var(--fg-ring),
    0 1px 0 var(--fg-stone-lo) !important;
}
body.tc-redesign.tc-max:not(.tc-v3):not(#_) #gameOverlay #tcGameChat[aria-expanded="true"] {
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, white 17%, transparent),
    inset 0 -2px 0 var(--mx-amethyst),
    0 0 0 1px var(--fg-ring),
    0 3px 0 var(--fg-stone-lo),
    0 12px 20px -8px color-mix(in srgb, var(--mx-amethyst) 55%, transparent) !important;
}

/* Guthaben: eingelassenes Feld, Zahl in Gold, goldene Ader und Schein nach unten */
body.tc-redesign.tc-max:not(.tc-v3):not(#_) #gameOverlay #tableBalance {
  border-color: color-mix(in srgb, black 60%, transparent) !important;
  color: var(--mx-gold) !important;
  text-shadow:
    0 1px 0 color-mix(in srgb, black 60%, transparent),
    0 0 18px color-mix(in srgb, var(--mx-gold) 42%, transparent);
  box-shadow:
    inset 0 2px 0 color-mix(in srgb, black 52%, transparent),
    inset 0 -2px 0 color-mix(in srgb, var(--mx-gold) 70%, transparent),
    0 1px 0 color-mix(in srgb, white 9%, transparent),
    0 12px 22px -12px color-mix(in srgb, var(--mx-gold) 60%, transparent) !important;
}
body.tc-redesign.tc-max:not(.tc-v3):not(#_) #gameOverlay #tableBalance::before { text-shadow: none; }
@media (min-width: 821px) {
  body.tc-redesign.tc-max:not(.tc-v3):not(#_) #gameOverlay #tableBalance { font-size: 24px !important; padding-top: 1px !important; }
}
body.tc-redesign.tc-max:not(.tc-v3):not(#_) #gameOverlay #tableBalance.balance-win-pulse {
  color: var(--mx-emerald) !important;
  border-color: color-mix(in srgb, var(--mx-emerald) 55%, transparent) !important;
  text-shadow: 0 0 20px color-mix(in srgb, var(--mx-emerald) 60%, transparent);
  box-shadow:
    inset 0 2px 0 color-mix(in srgb, black 52%, transparent),
    inset 0 -2px 0 var(--mx-emerald),
    0 0 0 3px color-mix(in srgb, var(--mx-emerald) 18%, transparent),
    0 12px 28px -8px color-mix(in srgb, var(--mx-emerald) 65%, transparent) !important;
}

/* ------------------------------------------------------------ 3. Spielfläche: eingelassen
   Nur Licht am Rand – Maße, Innenabstand und Inhalt des Bretts bleiben, wie sie sind. */
body.tc-redesign.tc-max:not(.tc-v3):not(#_) #gameOverlay #gameBoard {
  box-shadow:
    inset 0 30px 46px -30px black,
    inset 0 -26px 40px -30px black,
    inset 26px 0 40px -30px color-mix(in srgb, black 80%, transparent),
    inset -26px 0 40px -30px color-mix(in srgb, black 80%, transparent) !important;
}
/* Erzader verloren (max-fx.js .mx-shake / CasinoFX .shake-anim): Redstone glimmt am Rand */
body.tc-redesign.tc-max:not(.tc-v3):not(#_) #gameOverlay #gameBoard:is(.shake-anim, .mx-shake) {
  box-shadow:
    inset 0 0 0 2px color-mix(in srgb, var(--mx-redstone) 55%, transparent),
    inset 0 0 110px color-mix(in srgb, var(--mx-redstone) 30%, transparent) !important;
}

/* ------------------------------------------------------------ 4. Steuerpult */
body.tc-redesign.tc-max:not(.tc-v3):not(#_) #gameOverlay .tc-control-dock {
  border-left-color: color-mix(in srgb, black 58%, transparent) !important;
  box-shadow:
    inset 2px 0 0 color-mix(in srgb, var(--fg-ore) 55%, transparent),
    inset 22px 0 30px -22px color-mix(in srgb, var(--fg-ore) 30%, transparent),
    -20px 0 32px -20px color-mix(in srgb, black 92%, transparent) !important;
}
/* Licht in der Spielfarbe von oben; liegt zwischen Pult-Grund und Inhalt */
body.tc-redesign.tc-max:not(.tc-v3):not(#_) #gameOverlay .tc-control-dock::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: min(240px, 100%); /* nie höher als das Pult – sonst ließe es sich schmal ins Leere rollen */
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(120% 100% at 50% 0%, color-mix(in srgb, var(--fg-ore) 20%, transparent), transparent 72%);
}
/* Wechsel Einsatz ↔ Züge: die neue Reihe rückt kurz herein */
body.tc-redesign.tc-max:not(.tc-v3):not(#_) #gameOverlay :is(#betRow, #actionRow):not([hidden]) {
  animation: fgSwap .26s var(--mx-ease) backwards;
}
@keyframes fgSwap {
  0% { opacity: .2; translate: 0 10px; }
  100% { opacity: 1; translate: 0 0; }
}

/* Einsatz als eigene Platte mit Gold-Ader (Geld). Sie ragt je 10 px in den Pult-Rand (die Innenbreite bleibt)
   und oben/unten in die Abstände, damit das Pult kaum höher wird (Lawine füllt es bei 900 px Höhe genau). */
@media (min-width: 821px) {
  body.tc-redesign.tc-max:not(.tc-v3):not(#_) #gameOverlay #betRow .bet {
    width: calc(100% + 20px) !important;
    margin: -6px -10px -5px !important;
    padding: 10px 10px 11px !important;
    border-radius: var(--mx-r-lg) !important;
    background:
      linear-gradient(180deg, color-mix(in srgb, white 6%, transparent), transparent 44%),
      color-mix(in srgb, var(--mx-raised) 58%, transparent) !important;
    box-shadow:
      inset 0 1px 0 var(--fg-hi),
      inset 0 -2px 0 color-mix(in srgb, var(--mx-gold) 46%, transparent),
      0 0 0 1px var(--fg-ring),
      0 18px 28px -20px black,
      0 16px 30px -22px color-mix(in srgb, var(--mx-gold) 45%, transparent) !important;
  }
}
body.tc-redesign.tc-max:not(.tc-v3):not(#_) #gameOverlay .quick-limits-tag {
  border-color: transparent !important;
  border-radius: 7px !important;
  background: color-mix(in srgb, black 32%, transparent) !important;
  box-shadow: inset 0 1px 0 color-mix(in srgb, black 40%, transparent), 0 1px 0 color-mix(in srgb, white 7%, transparent);
}

/* Betragsfeld: tief eingelassen, große Zahl; im Fokus Gold (Ring, Ader, Schein) */
body.tc-redesign.tc-max:not(.tc-v3):not(#_) #gameOverlay .bet-input {
  border-color: color-mix(in srgb, black 62%, transparent) !important;
  box-shadow:
    inset 0 3px 0 color-mix(in srgb, black 55%, transparent),
    inset 0 -2px 0 color-mix(in srgb, var(--mx-gold) 30%, transparent),
    0 1px 0 color-mix(in srgb, white 9%, transparent) !important;
}
body.tc-redesign.tc-max:not(.tc-v3):not(#_) #gameOverlay .bet-input:focus-within {
  border-color: var(--mx-gold) !important;
  box-shadow:
    inset 0 3px 0 color-mix(in srgb, black 55%, transparent),
    inset 0 -2px 0 var(--mx-gold),
    0 0 0 3px color-mix(in srgb, var(--mx-gold) 24%, transparent),
    0 14px 26px -12px color-mix(in srgb, var(--mx-gold) 62%, transparent) !important;
}
body.tc-redesign.tc-max:not(.tc-v3):not(#_) #gameOverlay .bet-input input { caret-color: var(--mx-gold); }
body.tc-redesign.tc-max:not(.tc-v3):not(#_) #gameOverlay .bet-input:focus-within input {
  color: var(--mx-gold-hi) !important;
  -webkit-text-fill-color: var(--mx-gold-hi) !important;
}

/* Jetons: kantige Erz-Chips. Ring in der Erzfarbe mit vier hellen Kerben, Fläche als Block,
   helle Oberkante, sichtbare Dicke; beim Zeigen hebt er sich, beim Drücken sinkt er, beim Loslassen federt er. */
body.tc-redesign.tc-max:not(.tc-v3):not(#_) #gameOverlay .chips .chip {
  border-radius: 10px !important;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--c-face) 78%, white) 0%, var(--c-face) 44%, color-mix(in srgb, var(--c-face) 82%, black) 100%) center / calc(100% - 12px) calc(100% - 12px) no-repeat,
    linear-gradient(color-mix(in srgb, black 36%, transparent), color-mix(in srgb, black 36%, transparent)) center / calc(100% - 10px) calc(100% - 10px) no-repeat,
    linear-gradient(90deg, transparent calc(50% - 5px), var(--c-stripe) calc(50% - 5px) calc(50% + 5px), transparent calc(50% + 5px)),
    linear-gradient(0deg, transparent calc(50% - 5px), var(--c-stripe) calc(50% - 5px) calc(50% + 5px), transparent calc(50% + 5px)),
    var(--c) !important;
  box-shadow:
    inset 0 2px 0 color-mix(in srgb, white 36%, transparent),
    inset 0 -2px 0 color-mix(in srgb, black 26%, transparent),
    0 0 0 1px color-mix(in srgb, black 55%, transparent),
    0 4px 0 var(--c-lo),
    0 5px 0 1px color-mix(in srgb, black 45%, transparent),
    0 12px 14px -7px color-mix(in srgb, black 88%, transparent) !important;
}
body.tc-redesign.tc-max:not(.tc-v3):not(#_) #gameOverlay .chips .chip:not(:active) {
  animation: fgChipPop .34s var(--mx-ease-spring) !important;
}
@keyframes fgChipPop {
  0% { scale: .86; }
  100% { scale: 1; }
}
@media (hover: hover) {
  body.tc-redesign.tc-max:not(.tc-v3):not(#_) #gameOverlay .chips .chip:hover {
    box-shadow:
      inset 0 2px 0 color-mix(in srgb, white 44%, transparent),
      inset 0 -2px 0 color-mix(in srgb, black 26%, transparent),
      0 0 0 1px color-mix(in srgb, black 55%, transparent),
      0 6px 0 var(--c-lo),
      0 7px 0 1px color-mix(in srgb, black 45%, transparent),
      0 16px 20px -8px var(--c) !important;
  }
}
body.tc-redesign.tc-max:not(.tc-v3):not(#_) #gameOverlay .chips .chip:active {
  animation: none !important;
  box-shadow:
    inset 0 3px 5px color-mix(in srgb, black 40%, transparent),
    0 0 0 1px color-mix(in srgb, black 55%, transparent),
    0 1px 0 var(--c-lo) !important;
}

/* Auswahlfelder der Spiele (Lava, Strecke, Risiko): eingelassen wie das Betragsfeld, Ader in der Spielfarbe */
body.tc-redesign.tc-max:not(.tc-v3):not(#_) #gameOverlay #gameOptions select {
  border-color: color-mix(in srgb, black 62%, transparent) !important;
  box-shadow:
    inset 0 3px 0 color-mix(in srgb, black 50%, transparent),
    inset 0 -2px 0 color-mix(in srgb, var(--fg-ore) 40%, transparent),
    0 1px 0 color-mix(in srgb, white 9%, transparent) !important;
  transition: box-shadow var(--mx-fast) var(--mx-ease), border-color var(--mx-fast);
}
@media (hover: hover) {
  body.tc-redesign.tc-max:not(.tc-v3):not(#_) #gameOverlay #gameOptions select:hover {
    box-shadow:
      inset 0 3px 0 color-mix(in srgb, black 50%, transparent),
      inset 0 -2px 0 var(--fg-ore),
      0 1px 0 color-mix(in srgb, white 9%, transparent),
      0 12px 22px -14px color-mix(in srgb, var(--fg-ore) 60%, transparent) !important;
  }
}
body.tc-redesign.tc-max:not(.tc-v3):not(#_) #gameOverlay #gameOptions select:focus-visible {
  border-color: var(--mx-gold) !important;
  box-shadow:
    inset 0 3px 0 color-mix(in srgb, black 50%, transparent),
    inset 0 -2px 0 var(--mx-gold),
    0 0 0 3px color-mix(in srgb, var(--mx-gold) 24%, transparent) !important;
}

/* ------------------------------------------------------------ 5. Knöpfe im Pult
   Stein-Züge bekommen eine klare Kante; die Hauptaktion ist ein Gold-Block, Auszahlen ein Smaragd-Block. */
body.tc-redesign.tc-max:not(.tc-v3):not(#_) #gameOverlay :is(#againBtn, #gameActions .btn):not(.gold, .cash) {
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, white 20%, transparent),
    inset 0 -1px 0 color-mix(in srgb, black 28%, transparent),
    0 0 0 1px var(--fg-ring),
    0 4px 0 var(--b-lo, var(--fg-stone-lo)),
    0 5px 0 1px color-mix(in srgb, black 40%, transparent),
    0 16px 22px -12px color-mix(in srgb, black 85%, transparent) !important;
}
@media (hover: hover) {
  body.tc-redesign.tc-max:not(.tc-v3):not(#_) #gameOverlay :is(#againBtn, #gameActions .btn):not(.gold, .cash):hover:not(:disabled) {
    box-shadow:
      inset 0 1px 0 color-mix(in srgb, white 26%, transparent),
      inset 0 -2px 0 var(--fg-ore),
      0 0 0 1px var(--fg-ring),
      0 5px 0 var(--b-lo, var(--fg-stone-lo)),
      0 6px 0 1px color-mix(in srgb, black 40%, transparent),
      0 18px 26px -12px color-mix(in srgb, var(--fg-ore) 50%, transparent) !important;
  }
}

/* Gold-Block: Start und goldene Züge */
body.tc-redesign.tc-max:not(.tc-v3):not(#_) #gameOverlay :is(#startBtn, #gameActions .btn.gold):not(:disabled) {
  background: linear-gradient(180deg, var(--mx-gold-hi) 0%, var(--mx-gold) 44%, color-mix(in srgb, var(--mx-gold) 78%, var(--mx-gold-lo)) 100%) !important;
  color: var(--mx-gold-ink) !important;
  -webkit-text-fill-color: var(--mx-gold-ink) !important;
  box-shadow:
    inset 0 2px 0 color-mix(in srgb, white 60%, transparent),
    inset 0 -2px 0 color-mix(in srgb, var(--mx-gold-lo) 55%, transparent),
    0 0 0 1px color-mix(in srgb, black 55%, transparent),
    0 6px 0 var(--mx-gold-lo),
    0 7px 0 1px color-mix(in srgb, black 50%, transparent),
    0 24px 34px -14px color-mix(in srgb, var(--mx-gold) 70%, transparent) !important;
}
/* Smaragd-Block: Auszahlen */
body.tc-redesign.tc-max:not(.tc-v3):not(#_) #gameOverlay :is(#cashoutBtn, #gameActions .btn.cash):not(:disabled) {
  background: linear-gradient(180deg, color-mix(in srgb, var(--mx-emerald) 62%, white) 0%, var(--mx-emerald) 44%, color-mix(in srgb, var(--mx-emerald) 70%, var(--mx-emerald-lo)) 100%) !important;
  color: var(--mx-emerald-ink) !important;
  -webkit-text-fill-color: var(--mx-emerald-ink) !important;
  box-shadow:
    inset 0 2px 0 color-mix(in srgb, white 55%, transparent),
    inset 0 -2px 0 color-mix(in srgb, var(--mx-emerald-lo) 55%, transparent),
    0 0 0 1px color-mix(in srgb, black 55%, transparent),
    0 6px 0 var(--mx-emerald-lo),
    0 7px 0 1px color-mix(in srgb, black 50%, transparent),
    0 24px 34px -14px color-mix(in srgb, var(--mx-emerald) 70%, transparent) !important;
}
@media (hover: hover) {
  body.tc-redesign.tc-max:not(.tc-v3):not(#_) #gameOverlay :is(#startBtn, #gameActions .btn.gold):hover:not(:disabled) {
    box-shadow:
      inset 0 2px 0 color-mix(in srgb, white 70%, transparent),
      inset 0 -2px 0 color-mix(in srgb, var(--mx-gold-lo) 55%, transparent),
      0 0 0 1px color-mix(in srgb, black 55%, transparent),
      0 7px 0 var(--mx-gold-lo),
      0 8px 0 1px color-mix(in srgb, black 50%, transparent),
      0 28px 40px -12px color-mix(in srgb, var(--mx-gold) 85%, transparent) !important;
  }
  body.tc-redesign.tc-max:not(.tc-v3):not(#_) #gameOverlay :is(#cashoutBtn, #gameActions .btn.cash):hover:not(:disabled) {
    box-shadow:
      inset 0 2px 0 color-mix(in srgb, white 66%, transparent),
      inset 0 -2px 0 color-mix(in srgb, var(--mx-emerald-lo) 55%, transparent),
      0 0 0 1px color-mix(in srgb, black 55%, transparent),
      0 7px 0 var(--mx-emerald-lo),
      0 8px 0 1px color-mix(in srgb, black 50%, transparent),
      0 28px 40px -12px color-mix(in srgb, var(--mx-emerald) 85%, transparent) !important;
  }
}
/* Gedrückt: der Block sinkt in seine Dicke */
body.tc-redesign.tc-max:not(.tc-v3):not(#_) #gameOverlay :is(#startBtn, #cashoutBtn, #againBtn, #gameActions .btn):active:not(:disabled) {
  transform: translateY(5px) !important;
  box-shadow:
    inset 0 3px 6px color-mix(in srgb, black 30%, transparent),
    0 0 0 1px color-mix(in srgb, black 55%, transparent),
    0 1px 0 var(--b-lo, var(--fg-stone-lo)) !important;
}
/* Gesperrt: flacher Stein, ruhig */
body.tc-redesign.tc-max:not(.tc-v3):not(#_) #gameOverlay :is(#startBtn, #cashoutBtn, #againBtn, #gameActions .btn):disabled {
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, white 7%, transparent),
    0 0 0 1px var(--fg-ring),
    0 2px 0 var(--fg-stone-lo) !important;
}

/* Hauptknöpfe: Schild-Schrift, groß. Ein Lichtstreif zieht alle paar Sekunden über den Block. */
body.tc-redesign.tc-max:not(.tc-v3):not(#_) #gameOverlay :is(#startBtn, #cashoutBtn) {
  overflow: hidden;
  font: 800 23px/1.02 var(--mx-font-display) !important;
  letter-spacing: .012em !important;
  text-wrap: balance;
  padding-top: 11px !important;
}
/* Auszahlen trägt Betrag und Faktor und bricht oft um: etwas kleiner, mit Luft zwischen den Zeilen */
body.tc-redesign.tc-max:not(.tc-v3):not(#_) #gameOverlay #cashoutBtn { font-size: 20px !important; line-height: 1.16 !important; padding-top: 9px !important; padding-bottom: 9px !important; }
body.tc-redesign.tc-max:not(.tc-v3):not(#_) #gameOverlay :is(#startBtn, #cashoutBtn):not(:disabled)::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 38%;
  pointer-events: none;
  background: linear-gradient(100deg, transparent 0%, color-mix(in srgb, white 62%, transparent) 50%, transparent 100%);
  translate: -140% 0;
  animation: fgSheen 4.6s var(--mx-ease) 1.1s infinite;
}
@keyframes fgSheen {
  0% { translate: -140% 0; }
  26%, 100% { translate: 420% 0; }
}
/* Lädt (Runde läuft, Knopf gesperrt): ein Goldläufer an der Unterkante */
body.tc-redesign.tc-max:not(.tc-v3):not(#_) #gameOverlay #startBtn:disabled::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 34%;
  height: 3px;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--mx-gold), transparent);
  animation: fgBusy 1.05s linear infinite;
}
@keyframes fgBusy {
  0% { translate: -100% 0; }
  100% { translate: 300% 0; }
}

@media (min-width: 821px) and (min-height: 801px) {
  body.tc-redesign.tc-max:not(.tc-v3):not(#_) #gameOverlay :is(#startBtn, #cashoutBtn) { min-height: 62px !important; font-size: 26px !important; }
  body.tc-redesign.tc-max:not(.tc-v3):not(#_) #gameOverlay #cashoutBtn { font-size: 21px !important; }
}
/* Niedrige Laptops: Platte knapper, das Pult ist dort ohnehin eng */
@media (min-width: 821px) and (max-height: 800px) {
  body.tc-redesign.tc-max:not(.tc-v3):not(#_) #gameOverlay #betRow .bet { margin: -4px -10px -3px !important; padding: 8px 10px 9px !important; }
}
/* Zeiger auf Hauptknopf und Jetons: der Block hebt sich (translate läuft am gesperrten transform vorbei) */
@media (hover: hover) {
  body.tc-redesign.tc-max:not(.tc-v3):not(#_) #gameOverlay :is(#startBtn, #cashoutBtn, #gameActions .btn):hover:not(:disabled):not(:active),
  body.tc-redesign.tc-max:not(.tc-v3):not(#_) #gameOverlay .chips .chip:hover:not(:active) { translate: 0 -2px; }
}

/* ------------------------------------------------------------ 6. Statuszeile und Rückmeldung
   Gewinn: Smaragd-Ader und Schein, der aus der Zeile ins Brett steigt. Verlust: kurzer Redstone-Ruck, dann Ruhe. */
body.tc-redesign.tc-max:not(.tc-v3):not(#_) #gameOverlay #gameStatus {
  border-top-color: color-mix(in srgb, black 58%, transparent) !important;
  box-shadow:
    inset 0 2px 0 color-mix(in srgb, var(--fg-ore) 50%, transparent),
    inset 0 22px 24px -22px color-mix(in srgb, var(--fg-ore) 26%, transparent),
    0 -16px 28px -18px black !important;
}
body.tc-redesign.tc-max:not(.tc-v3):not(#_) #gameOverlay #gameStatus.win {
  box-shadow:
    inset 0 2px 0 var(--mx-emerald),
    inset 0 30px 30px -26px color-mix(in srgb, var(--mx-emerald) 55%, transparent),
    0 -18px 34px -16px color-mix(in srgb, var(--mx-emerald) 60%, transparent) !important;
  text-shadow: 0 0 18px color-mix(in srgb, var(--mx-emerald) 45%, transparent);
}
body.tc-redesign.tc-max:not(.tc-v3):not(#_) #gameOverlay #gameStatus.lose {
  box-shadow:
    inset 0 2px 0 color-mix(in srgb, var(--mx-redstone) 85%, transparent),
    inset 0 26px 28px -26px color-mix(in srgb, var(--mx-redstone) 45%, transparent),
    0 -16px 30px -18px color-mix(in srgb, var(--mx-redstone) 45%, transparent) !important;
}
body.tc-redesign.tc-max:not(.tc-v3):not(#_) #gameOverlay #gameStatus.win:is([data-mx-kind="push"], [data-mx-kind="partial"]) {
  box-shadow:
    inset 0 2px 0 color-mix(in srgb, var(--mx-text-2) 45%, transparent),
    0 -16px 28px -18px black !important;
  text-shadow: none;
}
/* Schein: steigt 1,2 s lang aus der Zeile ins Brett (nur Deckkraft bewegt sich) */
body.tc-redesign.tc-max:not(.tc-v3):not(#_) #gameOverlay #gameStatus::after { inset: -170px 0 0 0; }
body.tc-redesign.tc-max:not(.tc-v3):not(#_) #gameOverlay #gameStatus[data-mx-fx]::after {
  animation: fgWash 1.25s ease-out both !important;
}
body.tc-redesign.tc-max:not(.tc-v3):not(#_) #gameOverlay #gameStatus[data-mx-fx="win"]::after {
  background: radial-gradient(70% 100% at 50% 100%, color-mix(in srgb, var(--mx-emerald) 42%, transparent), transparent 72%);
}
body.tc-redesign.tc-max:not(.tc-v3):not(#_) #gameOverlay #gameStatus[data-mx-fx="loss"]::after {
  background: radial-gradient(70% 100% at 50% 100%, color-mix(in srgb, var(--mx-redstone) 40%, transparent), transparent 72%);
}
body.tc-redesign.tc-max:not(.tc-v3):not(#_) #gameOverlay #gameStatus[data-mx-fx="push"]::after {
  background: radial-gradient(70% 100% at 50% 100%, color-mix(in srgb, var(--mx-text-2) 22%, transparent), transparent 72%);
}
@keyframes fgWash {
  0% { opacity: 0; }
  16% { opacity: 1; }
  100% { opacity: 0; }
}
/* Verlust: die Zeile ruckt einmal */
body.tc-redesign.tc-max:not(.tc-v3):not(#_) #gameOverlay #gameStatus[data-mx-fx="loss"] {
  animation: fgJolt .38s ease-out !important;
}
@keyframes fgJolt {
  0%, 100% { translate: 0 0; }
  18% { translate: -8px 0; }
  42% { translate: 7px 0; }
  66% { translate: -4px 0; }
  84% { translate: 2px 0; }
}
/* Netto-Marke hinter dem Ergebnis: kantig, springt herein */
body.tc-redesign.tc-max:not(.tc-v3):not(#_) #gameOverlay #gameStatus[data-mx-net]:not(:empty)::before {
  border-radius: 7px;
  box-shadow: inset 0 1px 0 color-mix(in srgb, white 14%, transparent), inset 0 -2px 0 color-mix(in srgb, var(--mx-emerald) 60%, transparent), 0 0 0 1px var(--fg-ring);
  text-shadow: none;
  animation: fgPillIn .42s var(--mx-ease-spring) backwards;
}
body.tc-redesign.tc-max:not(.tc-v3):not(#_) #gameOverlay #gameStatus[data-mx-kind="partial"]:not(:empty)::before {
  box-shadow: inset 0 1px 0 color-mix(in srgb, white 14%, transparent), inset 0 -2px 0 color-mix(in srgb, var(--mx-redstone) 60%, transparent), 0 0 0 1px var(--fg-ring);
}
body.tc-redesign.tc-max:not(.tc-v3):not(#_) #gameOverlay #gameStatus[data-mx-kind="push"]:not(:empty)::before {
  box-shadow: inset 0 1px 0 color-mix(in srgb, white 14%, transparent), inset 0 -2px 0 color-mix(in srgb, var(--mx-text-2) 45%, transparent), 0 0 0 1px var(--fg-ring);
}
@keyframes fgPillIn {
  0% { opacity: 0; scale: .5; }
  100% { opacity: 1; scale: 1; }
}

/* ------------------------------------------------------------ 7. Gewinn-Tafel (js/max-fx.js)
   Schwere Platte mit Smaragd-Ader (großer Gewinn: Gold), kräftiges Licht; der Betrag springt herein,
   ein Lichtstreif zieht einmal darüber. Der Grund bleibt (Winter färbt ihn). */
body.tc-redesign.tc-max:not(.tc-v3):not(#_) #gameOverlay .mx-fx-glow {
  background: radial-gradient(80% 75% at 50% 45%, transparent 46%, color-mix(in srgb, var(--mx-emerald) 22%, transparent) 100%);
  box-shadow:
    inset 0 0 0 2px color-mix(in srgb, var(--mx-emerald) 75%, transparent),
    inset 0 0 120px color-mix(in srgb, var(--mx-emerald) 30%, transparent);
}
body.tc-redesign.tc-max:not(.tc-v3):not(#_) #gameOverlay .mx-fx-layer.is-big .mx-fx-glow {
  background: radial-gradient(80% 75% at 50% 45%, transparent 42%, color-mix(in srgb, var(--mx-gold) 24%, transparent) 100%);
  box-shadow:
    inset 0 0 0 2px color-mix(in srgb, var(--mx-gold) 80%, transparent),
    inset 0 0 140px color-mix(in srgb, var(--mx-gold) 30%, transparent);
}
body.tc-redesign.tc-max:not(.tc-v3):not(#_) #gameOverlay .mx-fx-plate {
  --fg-win: var(--mx-emerald);
  overflow: hidden;
  border-color: color-mix(in srgb, black 60%, transparent);
  border-radius: 16px;
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, white 16%, transparent),
    inset 0 -3px 0 var(--fg-win),
    0 0 0 1px color-mix(in srgb, var(--fg-win) 45%, transparent),
    0 0 0 5px color-mix(in srgb, var(--fg-win) 14%, transparent),
    0 26px 60px -14px color-mix(in srgb, var(--fg-win) 70%, transparent),
    0 30px 50px -18px black;
}
body.tc-redesign.tc-max:not(.tc-v3):not(#_) #gameOverlay .mx-fx-layer.is-big .mx-fx-plate {
  --fg-win: var(--mx-gold);
  border-color: color-mix(in srgb, black 60%, transparent);
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, white 18%, transparent),
    inset 0 -3px 0 var(--fg-win),
    0 0 0 1px color-mix(in srgb, var(--fg-win) 55%, transparent),
    0 0 0 6px color-mix(in srgb, var(--fg-win) 16%, transparent),
    0 30px 80px -14px color-mix(in srgb, var(--fg-win) 75%, transparent),
    0 30px 50px -18px black;
}
body.tc-redesign.tc-max:not(.tc-v3):not(#_) #gameOverlay .mx-fx-plate::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 34%;
  pointer-events: none;
  background: linear-gradient(100deg, transparent, color-mix(in srgb, white 26%, transparent) 50%, transparent);
  translate: -120% 0;
  animation: fgPlateSheen .9s .22s var(--mx-ease) both;
}
@keyframes fgPlateSheen {
  0% { translate: -120% 0; }
  100% { translate: 420% 0; }
}
body.tc-redesign.tc-max:not(.tc-v3):not(#_) #gameOverlay .mx-fx-mult {
  border-radius: 7px;
  background: color-mix(in srgb, var(--fg-win) 16%, transparent);
  box-shadow: inset 0 1px 0 color-mix(in srgb, white 12%, transparent), inset 0 -2px 0 color-mix(in srgb, var(--fg-win) 60%, transparent);
}
body.tc-redesign.tc-max:not(.tc-v3):not(#_) #gameOverlay .mx-fx-live {
  transform-origin: 0 60%;
  animation: fgAmountIn .5s .05s var(--mx-ease-spring) backwards;
}
@keyframes fgAmountIn {
  0% { opacity: 0; scale: 1.7; translate: 0 -14px; }
  55% { opacity: 1; }
  100% { opacity: 1; scale: 1; translate: 0 0; }
}

/* ------------------------------------------------------------ 8. Rundenkarte im Pult (max-fx.js)
   Platte mit der Ader des Spiels; der Multiplikator leuchtet in Gold. */
body.tc-redesign.tc-max:not(.tc-v3):not(#_) #gameOverlay .mx-round {
  border-color: transparent;
  box-shadow:
    inset 0 1px 0 var(--fg-hi),
    inset 0 -2px 0 color-mix(in srgb, var(--fg-ore) 58%, transparent),
    0 0 0 1px var(--fg-ring),
    0 18px 28px -20px black,
    0 16px 30px -20px color-mix(in srgb, var(--fg-ore) 50%, transparent);
  animation: fgSwap .3s var(--mx-ease) backwards;
}
body.tc-redesign.tc-max:not(.tc-v3):not(#_) #gameOverlay .mx-round-list [data-row="mult"] dd {
  text-shadow: 0 2px 0 color-mix(in srgb, black 50%, transparent), 0 0 18px color-mix(in srgb, var(--mx-gold) 50%, transparent);
}

/* Hinweis „offene Runde“: Gold-Ader statt Linie */
body.tc-redesign.tc-max:not(.tc-v3):not(#_) #gameOverlay .open-round-hint:not([hidden]) {
  border-top-color: color-mix(in srgb, black 58%, transparent);
  box-shadow: inset 3px 0 0 var(--mx-gold), inset 0 1px 0 color-mix(in srgb, white 8%, transparent);
}

/* ------------------------------------------------------------ 9. Spielregeln-Dialog (immersive.js, liegt im body) */
body.tc-redesign.tc-max:not(.tc-v3):not(#_) .tc-game-help {
  border-color: transparent;
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, white 13%, transparent),
    inset 0 -3px 0 var(--mx-gold),
    0 0 0 1px color-mix(in srgb, black 55%, transparent),
    0 44px 90px -24px black,
    0 34px 90px -30px color-mix(in srgb, var(--mx-gold) 55%, transparent);
}
body.tc-redesign.tc-max:not(.tc-v3):not(#_) .tc-game-help[open] { animation: fgHelpIn .34s var(--mx-ease) backwards; }
body.tc-redesign.tc-max:not(.tc-v3):not(#_) .tc-game-help::backdrop {
  background: color-mix(in srgb, color-mix(in srgb, var(--mx-bg) 42%, black) 88%, transparent);
}
body.tc-redesign.tc-max:not(.tc-v3):not(#_) .tc-game-help > span { color: var(--mx-gold); }
body.tc-redesign.tc-max:not(.tc-v3):not(#_) .tc-game-help .icon-btn-table {
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, white 17%, transparent),
    0 0 0 1px color-mix(in srgb, black 52%, transparent),
    0 3px 0 var(--wtg-stone-lo, color-mix(in srgb, var(--mx-bg) 78%, black)),
    0 10px 14px -8px black;
}
@keyframes fgHelpIn {
  0% { opacity: 0; scale: .92; translate: 0 18px; }
  100% { opacity: 1; scale: 1; translate: 0 0; }
}

/* ------------------------------------------------------------ 10. Schmale Bildschirme (≤ 820 px)
   Brett oben, darunter Status und Pult als ein Block im Daumenbereich. Höhen bleiben (das Brett soll
   so groß wie möglich sein), Ziele bleiben ≥ 44 px. */
@media (max-width: 820px) {
  body.tc-redesign.tc-max:not(.tc-v3):not(#_) #gameOverlay:not([hidden]) .theater-table { animation-duration: .36s !important; }
  body.tc-redesign.tc-max:not(.tc-v3):not(#_) #gameOverlay:not([hidden]) .tc-control-dock { animation-name: fgDockUp; }
  body.tc-redesign.tc-max:not(.tc-v3):not(#_) #gameOverlay .theater-table::after { inset: var(--head-h) 0 0 0; }
  body.tc-redesign.tc-max:not(.tc-v3):not(#_) #gameOverlay .tc-control-dock {
    border-top-color: color-mix(in srgb, black 58%, transparent) !important;
    box-shadow: inset 0 1px 0 color-mix(in srgb, white 9%, transparent) !important;
  }
  body.tc-redesign.tc-max:not(.tc-v3):not(#_) #gameOverlay .tc-control-dock::before { height: min(120px, 100%); background: radial-gradient(90% 100% at 50% 0%, color-mix(in srgb, var(--fg-ore) 14%, transparent), transparent 72%); }
  body.tc-redesign.tc-max:not(.tc-v3):not(#_) #gameOverlay .table-head::after {
    background: radial-gradient(260px 190% at 0% 0%, color-mix(in srgb, var(--fg-ore) 22%, transparent), transparent 72%);
  }
  /* Kante der Hauptknöpfe flacher: darunter liegen gleich die Jetons */
  body.tc-redesign.tc-max:not(.tc-v3):not(#_) #gameOverlay :is(#startBtn, #gameActions .btn.gold):not(:disabled) {
    box-shadow:
      inset 0 2px 0 color-mix(in srgb, white 60%, transparent),
      inset 0 -2px 0 color-mix(in srgb, var(--mx-gold-lo) 55%, transparent),
      0 0 0 1px color-mix(in srgb, black 55%, transparent),
      0 4px 0 var(--mx-gold-lo),
      0 16px 24px -12px color-mix(in srgb, var(--mx-gold) 70%, transparent) !important;
  }
  body.tc-redesign.tc-max:not(.tc-v3):not(#_) #gameOverlay :is(#cashoutBtn, #gameActions .btn.cash):not(:disabled) {
    box-shadow:
      inset 0 2px 0 color-mix(in srgb, white 55%, transparent),
      inset 0 -2px 0 color-mix(in srgb, var(--mx-emerald-lo) 55%, transparent),
      0 0 0 1px color-mix(in srgb, black 55%, transparent),
      0 4px 0 var(--mx-emerald-lo),
      0 16px 24px -12px color-mix(in srgb, var(--mx-emerald) 70%, transparent) !important;
  }
  body.tc-redesign.tc-max:not(.tc-v3):not(#_) #gameOverlay :is(#startBtn, #cashoutBtn, #againBtn, #gameActions .btn):active:not(:disabled) { transform: translateY(3px) !important; }
  /* zweizeilige Beschriftung („Erste Karte aufdecken“) bleibt in der bisherigen Höhe */
  body.tc-redesign.tc-max:not(.tc-v3):not(#_) #gameOverlay #startBtn { font-size: 20px !important; padding: 7px 10px 6px !important; }
  body.tc-redesign.tc-max:not(.tc-v3):not(#_) #gameOverlay #cashoutBtn { font-size: 19px !important; }
  body.tc-redesign.tc-max:not(.tc-v3):not(#_) #gameOverlay #gameStatus::after { inset: -110px 0 0 0; }
}
