/* ==========================================================================
   LAN Casino — shared dark casino theme
   Used by index.html, admin.html and all game renderers.
   ========================================================================== */

:root {
  --bg: #0b0e1a;
  --panel: #171d33;
  --panel2: #222a4a;
  --gold: #f5c542;
  --accent: #7c5cff;
  --green: #2ecc71;
  --red: #e74c3c;
  --text: #f2f4fb;

  /* Kontrast angehoben (Tim, 12.08.2026: "mach einfach etwas mehr kontrast
     rein ... ist voll scheisse so"). Die alten Werte waren so blass, dass
     Trennlinien und Nebentexte auf einem hellen Bildschirm praktisch
     verschwanden: --muted lag bei #9aa3c0, die Linien bei 10–14 % Deckung. */
  --muted: #ccd4e8;
  --line: rgba(245, 197, 66, 0.46);
  --line-soft: rgba(232, 234, 242, 0.32);
  --field-bg: #0e1226;
  --field-border: #4a5788;
  --shadow: 0 12px 34px rgba(0, 0, 0, 0.45);
  --radius: 14px;
}

/* ---------- Themes (switchable via <html data-theme="…">) ---------- */

/* Light */
:root[data-theme="light"] {
  --bg: #eaeef8;
  --panel: #ffffff;
  --panel2: #f2f5fc;
  --gold: #b9860b;
  --accent: #6a4cff;
  --green: #1c9d54;
  --red: #d63b2b;
  --text: #10151f;
  --muted: #414863;
  --line: rgba(185, 134, 11, 0.44);
  --line-soft: rgba(26, 32, 48, 0.24);
  --field-bg: #f4f7fd;
  --field-border: #a4b1d2;
  --shadow: 0 12px 30px rgba(20, 30, 60, 0.14);
}
:root[data-theme="light"] body {
  background:
    radial-gradient(1100px 700px at 50% -12%, #dbe4ff 0%, rgba(219, 228, 255, 0) 60%),
    radial-gradient(900px 600px at 100% 110%, rgba(124, 92, 255, 0.08) 0%, rgba(124, 92, 255, 0) 55%),
    var(--bg);
}

/* Green felt classic */
:root[data-theme="greenfelt"] {
  --bg: #08281a;
  --panel: #0e3626;
  --panel2: #124a31;
  --gold: #f0c94a;
  --accent: #e0b64a;
  --green: #3ad07f;
  --red: #e8564a;
  --text: #f3fbf5;
  --muted: #bfdfcc;
  --line: rgba(240, 201, 74, 0.44);
  --line-soft: rgba(234, 245, 236, 0.28);
  --field-bg: #0a2c1c;
  --field-border: #2f8055;
  --shadow: 0 12px 34px rgba(0, 0, 0, 0.50);
}
:root[data-theme="greenfelt"] body {
  background:
    radial-gradient(1100px 700px at 50% -12%, #16613f 0%, rgba(22, 97, 63, 0) 60%),
    radial-gradient(900px 600px at 100% 110%, rgba(240, 201, 74, 0.08) 0%, rgba(240, 201, 74, 0) 55%),
    var(--bg);
}

/* Midnight blue */
:root[data-theme="midnight"] {
  --bg: #060a1c;
  --panel: #0c1330;
  --panel2: #141d47;
  --gold: #ffd76e;
  --accent: #4f7cff;
  --green: #2ecc71;
  --red: #e74c3c;
  --text: #f0f3ff;
  --muted: #b4bfe8;
  --line: rgba(255, 215, 110, 0.42);
  --line-soft: rgba(230, 236, 255, 0.28);
  --field-bg: #0a1130;
  --field-border: #3b4b86;
  --shadow: 0 12px 34px rgba(0, 0, 0, 0.55);
}
:root[data-theme="midnight"] body {
  background:
    radial-gradient(1100px 700px at 50% -12%, #1b2a6b 0%, rgba(27, 42, 107, 0) 60%),
    radial-gradient(900px 600px at 100% 110%, rgba(79, 124, 255, 0.12) 0%, rgba(79, 124, 255, 0) 55%),
    var(--bg);
}

/* ---------- Reset / base ---------- */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(1100px 700px at 50% -12%, #202a55 0%, rgba(32, 42, 85, 0) 60%),
    radial-gradient(900px 600px at 100% 110%, rgba(124, 92, 255, 0.10) 0%, rgba(124, 92, 255, 0) 55%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

[hidden] { display: none !important; }

h1, h2, h3, h4 {
  margin: 0 0 0.5em;
  line-height: 1.2;
  font-weight: 700;
}

a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }

code {
  font-family: Consolas, "Cascadia Mono", Menlo, monospace;
  font-size: 0.85em;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.3);
  padding: 1px 6px;
  border-radius: 6px;
}

::selection { background: rgba(245, 197, 66, 0.35); }

/* Slim dark scrollbars (cosmetic) */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--panel2); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: #2a3460; }

/* ---------- Panels & layout ---------- */

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px 20px 64px;
}

.panel {
  background: linear-gradient(165deg, var(--panel2) 0%, var(--panel) 70%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.section-title {
  font-size: 1.5rem;
  margin: 18px 0 16px;
  color: var(--text);
  letter-spacing: 0.02em;
}

.section-title::after {
  content: "";
  display: block;
  width: 64px;
  height: 3px;
  margin-top: 8px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--gold), rgba(245, 197, 66, 0));
}

/* ---------- Gold glow titles ---------- */

.casino-title {
  font-size: clamp(2.2rem, 6vw, 3.4rem);
  text-align: center;
  color: var(--gold);
  letter-spacing: 0.04em;
  margin-bottom: 0.15em;
  text-shadow:
    0 0 10px rgba(245, 197, 66, 0.55),
    0 0 34px rgba(245, 197, 66, 0.30),
    0 2px 2px rgba(0, 0, 0, 0.6);
}

.tagline {
  text-align: center;
  color: var(--muted);
  margin: 0 0 28px;
  letter-spacing: 0.06em;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 10px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  color: var(--text);
  background: var(--panel2);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.18s ease, background 0.18s ease,
    border-color 0.18s ease, filter 0.18s ease;
  user-select: none;
}

.btn:hover { filter: brightness(1.12); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  filter: grayscale(0.4);
  transform: none;
}

.btn-gold {
  background: linear-gradient(180deg, #ffdf7a 0%, var(--gold) 45%, #d9a520 100%);
  color: #221a04;
  border-color: rgba(255, 235, 170, 0.6);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.25);
  box-shadow: 0 4px 14px rgba(245, 197, 66, 0.22);
}

.btn-gold:hover {
  box-shadow: 0 6px 22px rgba(245, 197, 66, 0.40);
}

.btn-ghost {
  background: transparent;
  border-color: var(--line-soft);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--gold);
  color: var(--gold);
  filter: none;
}

.btn-danger {
  background: transparent;
  border-color: rgba(231, 76, 60, 0.5);
  color: #ff8d80;
}

.btn-danger:hover {
  background: rgba(231, 76, 60, 0.14);
  filter: none;
}

.btn-block { width: 100%; }

.btn-small { padding: 5px 12px; font-size: 0.85rem; border-radius: 8px; }

/* ---------- Forms ---------- */

label {
  display: block;
  margin: 14px 0 6px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--muted);
  text-transform: uppercase;
}

input[type="text"],
input[type="password"],
input[type="number"],
input:not([type]),
textarea,
select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 9px;
  border: 1px solid var(--field-border);
  background: var(--field-bg);
  color: var(--text);
  font: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.25);
}

input::placeholder, textarea::placeholder { color: #5c668c; }

.form-error {
  margin: 14px 0 0;
  padding: 10px 14px;
  border-radius: 9px;
  background: rgba(231, 76, 60, 0.13);
  border: 1px solid rgba(231, 76, 60, 0.45);
  color: #ff9a8d;
  font-size: 0.92rem;
}

.msg-ok { color: var(--green); font-weight: 600; }
.msg-err { color: var(--red); font-weight: 600; }

/* ---------- Top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 22px;
  background: rgba(11, 14, 26, 0.88);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.brand {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--gold);
  text-shadow: 0 0 12px rgba(245, 197, 66, 0.45);
  white-space: nowrap;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.user-name { color: var(--muted); font-weight: 600; }

.btn-icon {
  padding: 6px 9px;
  min-width: 0;
  font-size: 1rem;
  line-height: 1;
}
.btn-icon.sound-off { opacity: 0.45; }

.admin-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  vertical-align: middle;
  color: #1a1405;
  background: linear-gradient(180deg, #ffdf7a, #d9a520);
}

/* Owner badge: distinct from the admin badge, with a subtle crown-like sheen. */
.owner-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  vertical-align: middle;
  color: #24120a;
  background: linear-gradient(180deg, #ffe9a8, #c07b1e);
  box-shadow: 0 0 10px rgba(245, 197, 66, 0.4);
}

.protected-note {
  color: var(--muted);
  font-size: 0.85rem;
  font-style: italic;
}

/* Frei oder belegt. Gruen/rot, weil das die einzige Frage ist, die ein Admin
   an ein Testkonto hat: kann ich es gerade jemandem geben? */
.test-frei {
  font-size: 0.78rem;
  font-weight: 700;
  color: #58c47a;
}

.test-frei.ist-belegt {
  color: #e07a5f;
}

.test-pw {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}

/* Testkonto: bewusst nuechtern, nicht golden wie der Besitzer — es soll als
   Werkzeug erkennbar sein, nicht als Auszeichnung. */
.test-badge {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #0d1b2a;
  background: #7fb8d8;
}

/* Spalte "Betreut von". Schmal halten — sie steht zwischen zwei breiten
   Spalten und soll die Aktionen nicht an den Rand druecken. */
.betreuer-cell {
  font-size: 0.88rem;
  white-space: nowrap;
}

.betreuer-herkunft {
  font-size: 0.78rem;
}

/* "Mir zuweisen" steht unter dem Wort "niemand", nicht daneben — sonst wird
   die Spalte doppelt so breit wie alle anderen.

   Rot hinterlegt, weil der Klick nicht rueckgaengig zu machen ist: der Spieler
   gehoert danach dir und verschwindet bei allen anderen Admins. Zurueckgeben
   kann ihn nur das Besitzerkonto. Ein Knopf mit dieser Wirkung soll nicht
   aussehen wie "Details anzeigen". */
.betreuer-holen {
  display: block;
  margin-top: 0.25rem;
  white-space: nowrap;
  background: var(--red);
  border-color: var(--red);
  color: #fff;
  font-weight: 700;
}

.betreuer-holen:hover {
  filter: brightness(1.12);
}

.betreuer-holen:disabled {
  opacity: .55;
}

.betreuer-edit {
  margin-left: 0.4rem;
  padding: 0.1rem 0.35rem;
  line-height: 1;
}

.betreuer-edit-box {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 11rem;
}

/* Die globale Regel fuer <label> schreibt alles gross und sperrt es — bei
   Beschriftungen wie "BETRAG IN $" richtig, bei einem NAMEN albern: aus
   "Nadia" wurde "NADIA". Hier also zurueckgedreht. */
.betreuer-opt {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  margin: 0;
  text-transform: none;
  letter-spacing: normal;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text);
}

.balance-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  border-radius: 999px;
  border: 1px solid rgba(245, 197, 66, 0.45);
  background: rgba(245, 197, 66, 0.08);
  font-size: 0.95rem;
  color: var(--text);
  white-space: nowrap;
}

.balance-chip strong {
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}

/* ---------- Auth view ---------- */

.auth-wrap {
  max-width: 420px;
  margin: 7vh auto 0;
}

.auth-card { padding: 26px 28px 30px; }

.tabs {
  display: flex;
  margin: -4px 0 10px;
  border-bottom: 1px solid var(--line-soft);
}

.tab {
  flex: 1;
  padding: 12px 8px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.tab:hover { color: var(--text); }

.tab.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
  text-shadow: 0 0 10px rgba(245, 197, 66, 0.4);
}

.auth-card .btn-block { margin-top: 22px; }

.auth-hint {
  margin: 14px 0 0;
  font-size: 0.82rem;
  color: var(--muted);
  text-align: center;
}

/* ---------- Lobby ---------- */

.lobby-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: 20px;
}

.game-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 22px 20px 20px;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.game-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, rgba(245, 197, 66, 0), var(--gold), rgba(245, 197, 66, 0));
  opacity: 0.35;
  transition: opacity 0.22s ease;
}

.game-card:hover,
.game-card:focus-visible {
  transform: translateY(-6px);
  border-color: rgba(245, 197, 66, 0.55);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55), 0 0 24px rgba(245, 197, 66, 0.18);
  outline: none;
}

.game-card:hover::before { opacity: 1; }

.game-card-icon {
  font-size: 54px;
  line-height: 1;
  margin-bottom: 12px;
  filter: drop-shadow(0 0 12px rgba(245, 197, 66, 0.35));
  transition: transform 0.22s ease;
}

.game-card:hover .game-card-icon { transform: scale(1.12) rotate(-4deg); }

.game-card h3 {
  font-size: 1.2rem;
  color: var(--gold);
  margin-bottom: 6px;
}

.game-card p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.92rem;
  flex: 1;
}

.game-card .game-card-meta {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 14px;
  letter-spacing: 0.02em;
}

.game-card .btn { align-self: flex-start; }

.state-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #06230f;
  background: var(--green);
  box-shadow: 0 0 12px rgba(46, 204, 113, 0.55);
  animation: winPulse 1.6s ease-in-out infinite;
}

/* ---------- History ---------- */

.history-panel {
  margin-top: 34px;
  padding: 20px 22px;
}

.history-panel h3 { color: var(--text); font-size: 1.05rem; }

/* Totals over the player's whole ledger, above the table. Wraps on a phone
   instead of squeezing four numbers into one unreadable line. */
.history-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin: 10px 0 14px;
}
.history-stat { display: flex; flex-direction: column; gap: 2px; }
.history-stat-lbl {
  font-size: .68rem;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
}
.history-stat-val {
  font-size: 1.02rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.history-stat-val.win-pos { color: var(--green); }
.history-stat-val.win-neg { color: var(--red, #ff6b6b); }
.history-stat-val.win-zero { color: var(--muted); }

.history-more {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

/* ---------- Tables ---------- */

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.93rem;
}

.table th {
  text-align: left;
  padding: 8px 10px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #cfd6ea;
  border-bottom: 2px solid rgba(245, 197, 66, 0.35);
}

.table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
  color: var(--text);
}

.table tbody tr:hover { background: rgba(124, 92, 255, 0.06); }

.table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.table .win-pos { color: var(--green); font-weight: 700; }
.table .win-zero { color: var(--muted); }

/* ---------- Game view ---------- */

.game-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 18px;
  margin-bottom: 20px;
}

.game-header .game-title {
  flex: 1;
  margin: 0;
  text-align: center;
  font-size: 1.35rem;
  color: var(--gold);
  text-shadow: 0 0 12px rgba(245, 197, 66, 0.4);
}

.game-header-controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.game-header-controls .btn { white-space: nowrap; }
.auto-counts { display: flex; gap: 4px; }
.auto-counts .auto-count { min-width: 0; padding: 6px 9px; font-size: 0.82rem; font-variant-numeric: tabular-nums; }
.game-header-controls .btn.auto-on {
  background: linear-gradient(180deg, #ffdf7a, #d9a520);
  border-color: rgba(255, 235, 170, 0.7);
  color: #221a04;
  box-shadow: 0 0 12px rgba(245, 197, 66, 0.4);
}

#game-root { min-height: 300px; }

.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 60px 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.loading::before {
  content: "";
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 3px solid var(--panel2);
  border-top-color: var(--gold);
  animation: spinLoader 0.8s linear infinite;
}

@keyframes spinLoader { to { transform: rotate(360deg); } }

/* ==========================================================================
   Generic game helpers (contract: .reel, .sym, .spin-btn, .bet-controls,
   .win-flash, @keyframes winPulse) — used by the game renderers.
   ========================================================================== */

.reel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 8px;
  background: linear-gradient(180deg, #0a0e20 0%, var(--field-bg) 18%, var(--field-bg) 82%, #0a0e20 100%);
  border: 1px solid var(--field-border);
  border-radius: 12px;
  overflow: hidden;
}

.sym {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 76px;
  height: 76px;
  font-size: 50px;
  line-height: 1;
  user-select: none;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
}

.spin-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 48px;
  border-radius: 999px;
  border: 1px solid rgba(255, 235, 170, 0.65);
  background: linear-gradient(180deg, #ffdf7a 0%, var(--gold) 45%, #d9a520 100%);
  color: #221a04;
  font: inherit;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(245, 197, 66, 0.30), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: transform 0.12s ease, box-shadow 0.18s ease, filter 0.18s ease;
  user-select: none;
}

.spin-btn:hover { filter: brightness(1.08); box-shadow: 0 8px 28px rgba(245, 197, 66, 0.45); }
.spin-btn:active { transform: translateY(2px); }
.spin-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.spin-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(0.6);
  transform: none;
  box-shadow: none;
}

.bet-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.bet-controls button {
  min-width: 58px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--field-border);
  background: var(--field-bg);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, transform 0.12s ease;
}

.bet-controls button:hover { border-color: var(--gold); color: var(--gold); }
.bet-controls button:active { transform: translateY(1px); }

.bet-controls button.active,
.bet-controls button[aria-pressed="true"] {
  background: linear-gradient(180deg, #ffdf7a, #d9a520);
  border-color: rgba(255, 235, 170, 0.7);
  color: #221a04;
  box-shadow: 0 0 14px rgba(245, 197, 66, 0.35);
}

.bet-controls button:disabled { opacity: 0.5; cursor: not-allowed; }

@keyframes winPulse {
  0%, 100% {
    transform: scale(1);
    filter: brightness(1);
  }
  50% {
    transform: scale(1.14);
    filter: brightness(1.65) drop-shadow(0 0 12px rgba(245, 197, 66, 0.85));
  }
}

.win-flash {
  animation: winPulse 0.75s ease-in-out 0s 4;
}

/* ==========================================================================
   Admin panel
   ========================================================================== */

.admin-section {
  padding: 22px 24px 26px;
  margin-bottom: 28px;
}

.admin-section > h2 {
  font-size: 1.25rem;
  color: var(--gold);
  text-shadow: 0 0 10px rgba(245, 197, 66, 0.3);
  margin-bottom: 16px;
}

.status-panel {
  padding: 26px;
  text-align: center;
  color: var(--muted);
  font-size: 1.05rem;
}

.chip-input { width: 130px !important; }

.inline-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.action-msg { font-size: 0.85rem; min-width: 90px; }

.game-admin {
  padding: 18px 20px 22px;
  margin-bottom: 20px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.18);
}

.game-admin:last-child { margin-bottom: 0; }

.game-admin-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.game-admin-head h3 { margin: 0; font-size: 1.1rem; color: var(--text); }
.game-admin-id {
  font-family: Consolas, "Cascadia Mono", Menlo, monospace;
  font-size: 0.78rem;
  color: var(--muted);
  opacity: 0.8;
}

/* Friendly (beginner) controls */
.friendly-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 14px;
}
.friendly-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
  padding: 12px 14px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
}
.friendly-label { display: flex; flex-direction: column; min-width: 190px; flex: 1 1 190px; }
.friendly-label strong { color: var(--gold); font-size: 0.96rem; }
.friendly-hint { color: var(--muted); font-size: 0.8rem; margin-top: 2px; }
.friendly-ctl { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.friendly-unit { color: var(--muted); font-size: 0.82rem; }
.level-slider { width: 180px; accent-color: var(--gold); }
.level-val {
  min-width: 54px; text-align: center; font-weight: 700; color: var(--gold);
  font-variant-numeric: tabular-nums;
}
.rtp-input, .bet-input {
  width: 84px; padding: 7px 9px; border-radius: 8px;
  border: 1px solid var(--field-border); background: var(--field-bg);
  color: var(--text); font: inherit; font-variant-numeric: tabular-nums;
}
.expert-toggle { margin-bottom: 10px; }
.expert-wrap { margin-top: 4px; }

.config-editor {
  font-family: Consolas, "Cascadia Mono", Menlo, monospace;
  font-size: 0.84rem;
  line-height: 1.45;
  min-height: 240px;
  resize: vertical;
  background: #0a0e1f;
  color: #cfe0ff;
  white-space: pre;
  tab-size: 2;
}

.row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.error-list {
  margin: 12px 0 0;
  padding: 12px 16px;
  border-radius: 9px;
  border-left: 4px solid var(--red);
  background: rgba(231, 76, 60, 0.12);
}

.error-list ul {
  margin: 0;
  padding-left: 18px;
  color: #ff9a8d;
  font-size: 0.9rem;
}

.error-list li { margin: 2px 0; }

.sim-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed var(--line-soft);
}

.sim-row .field { display: flex; flex-direction: column; }
.sim-row .field label { margin: 0 0 5px; }
.sim-row .field input { width: 140px; }

.sim-results {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.sim-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid var(--line-soft);
  background: var(--field-bg);
  min-width: 120px;
}

.sim-stat .sim-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.sim-stat .sim-value {
  font-size: 1.08rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.sim-stat .sim-value.ok { color: var(--green); }
.sim-stat .sim-value.warn { color: var(--red); }

.settings-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.settings-row .field { display: flex; flex-direction: column; }
.settings-row .field label { margin: 0 0 5px; }
.settings-row .field input { width: 180px; }

.settings-announce { margin-top: 20px; max-width: 640px; }
.settings-announce .row { margin-top: 10px; }
.settings-backup {
  margin-top: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.section-hint { color: var(--muted); font-size: 0.9rem; margin: 0 0 12px; }

/* ---------- Online indicator ---------- */

.online-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: middle;
  background: var(--muted);
  opacity: 0.4;
}
.online-dot.is-online {
  background: var(--green);
  opacity: 1;
  box-shadow: 0 0 8px rgba(46, 204, 113, 0.7);
}

/* ---------- Support (Spielerseite) ---------- */

/* Roter Punkt am Support-Knopf, sobald eine Meldung offen ist. */
.badge-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  height: 17px;
  margin-left: 6px;
  padding: 0 4px;
  border-radius: 9px;
  background: #e33;
  color: #fff;
  font-size: .68rem;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 0 10px rgba(230, 50, 50, .7);
}

.sup-wrap { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.sup-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; font-size: .8rem; color: var(--muted); }
.sup-field input, .sup-field select, .sup-field textarea { font: inherit; width: 100%; }
.sup-field textarea { resize: vertical; }
.sup-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.sup-list { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.sup-card {
  text-align: left;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 12px;
  padding: 12px 14px;
  cursor: pointer;
  font: inherit;
  color: var(--text);
}
.sup-card:hover { border-color: var(--gold); }
.sup-card-top { font-weight: 700; margin-bottom: 3px; }

/* Eine Meldung mit ungelesener Antwort. Der Rand traegt es, damit man die
   Karte auch beim Ueberfliegen findet — die Zahl am Knopf sagt nur, DASS es
   eine gibt, nicht welche. */
.sup-card.hat-antwort {
  border-color: var(--gold);
  background: rgba(245, 197, 66, .07);
}

.sup-neu {
  margin-left: .5rem;
  padding: .05rem .45rem;
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: #24120a;
  background: var(--gold);
  vertical-align: middle;
}
.sup-card-sub { color: var(--muted); font-size: .8rem; margin-bottom: 6px; }

.sup-status {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 700;
}
.sup-st-offen { background: rgba(255, 180, 60, .18); color: #ffc94f; }
.sup-st-wartet { background: rgba(80, 160, 255, .18); color: #7dbcff; }
.sup-st-hold { background: rgba(190, 120, 255, .18); color: #cf9dff; }
.sup-st-fertig { background: rgba(120, 220, 150, .16); color: #7de0a4; }

/* Ablagefeld für Bilder */
.sup-drop {
  border: 2px dashed rgba(255, 255, 255, .22);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  color: var(--muted);
  font-size: .84rem;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  transition: border-color .15s, background .15s;
}
.sup-drop-on { border-color: var(--gold); background: rgba(255, 200, 80, .07); }

.sup-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.sup-thumb { position: relative; width: 74px; height: 74px; border-radius: 8px; overflow: hidden; background: #000; }
.sup-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sup-thumb-x {
  position: absolute;
  top: 2px; right: 2px;
  width: 20px; height: 20px;
  border: 0; border-radius: 50%;
  background: rgba(0, 0, 0, .7);
  color: #fff; cursor: pointer;
  font-size: .7rem; line-height: 1;
}

.sup-thread-head { margin-bottom: 12px; }
.sup-thread-head h2 { margin: 8px 0 4px; }
.sup-thread { display: flex; flex-direction: column; gap: 10px; max-height: 440px; overflow: auto; margin-bottom: 16px; }
.sup-msg { padding: 10px 13px; border-radius: 12px; max-width: 88%; }
.sup-msg-ich { align-self: flex-end; background: rgba(255, 200, 80, .1); border: 1px solid rgba(255, 200, 80, .25); }
.sup-msg-casino { align-self: flex-start; background: rgba(120, 180, 255, .1); border: 1px solid rgba(120, 180, 255, .25); }
.sup-msg-head { font-size: .72rem; color: var(--muted); margin-bottom: 4px; }
.sup-msg-text { white-space: pre-wrap; word-break: break-word; }
.sup-log { font-size: .72rem; color: var(--muted); text-align: center; font-style: italic; }

/* ---------- WhatsApp-/Telegram-Einladung ---------- */

.wa-box {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(37, 211, 102, .07);
  border: 1px solid rgba(37, 211, 102, .28);
}
.wa-box h4 {
  margin: 0 0 8px;
  font-size: .74rem;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: #4fe08a;
}
.wa-row { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-end; margin-bottom: 8px; }
.wa-row label, .wa-full {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: .72rem;
  color: var(--muted);
}
.wa-full { margin-bottom: 8px; }
.wa-full textarea {
  width: 100%;
  resize: vertical;
  font: inherit;
  font-size: .86rem;
}

/* ---------- Administratoren (admin, owner only) ---------- */

.adm-sub {
  margin: 18px 0 8px;
  font-size: .78rem;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
}
.adm-list { display: flex; flex-wrap: wrap; gap: 12px; }
.adm-card {
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 12px;
  padding: 11px 14px;
  min-width: 210px;
}
.adm-name { font-weight: 700; color: var(--gold); margin-bottom: 2px; }

.adm-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: flex-end;
  margin-bottom: 12px;
}
.adm-filters label {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: .72rem;
  color: var(--muted);
}
.adm-filters select, .adm-filters input { min-width: 130px; }

.adm-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-bottom: 10px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
/* The book can be long — scroll it instead of the page. */
.adm-scroll { max-height: 460px; overflow: auto; }

/* ---------- Player detail (admin) ---------- */

/* The name is a button so it is reachable by keyboard, but it must still read
   as a name in the table — no button chrome, just a hint that it can be opened. */
.user-open {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--text);
  cursor: pointer;
  border-bottom: 1px dotted rgba(255, 255, 255, .35);
}
.user-open:hover { color: var(--gold); border-bottom-color: var(--gold); }
.user-open.is-open { color: var(--gold); font-weight: 700; }

.user-detail {
  background: rgba(0, 0, 0, .28);
  padding: 16px 18px 18px;
  border-left: 3px solid var(--gold);
}
.ud-head { margin-bottom: 14px; }
.ud-headline { font-weight: 700; color: var(--text); margin-bottom: 3px; }
.ud-sums { color: var(--muted); font-variant-numeric: tabular-nums; margin-bottom: 3px; }
.ud-block { margin-top: 16px; }
.ud-block h4 {
  margin: 0 0 6px;
  font-size: .74rem;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
}
/* These tables can get long — keep the detail row from stretching the page. */
.ud-table { font-size: .86rem; }
.ud-block { max-height: 340px; overflow: auto; }
.table .win-neg { color: var(--red, #ff6b6b); font-weight: 700; }

/* ---------- Messaging (admin compose) ---------- */

.msg-text {
  width: 100%;
  max-width: 640px;
  resize: vertical;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--field-border);
  background: var(--field-bg);
  color: var(--text);
  font: inherit;
}
.msg-recipients { margin: 14px 0; display: flex; flex-direction: column; gap: 8px; }
.msg-radio { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.msg-user-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-top: 6px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--line-soft);
  background: var(--field-bg);
  max-height: 180px;
  overflow-y: auto;
}
.msg-pick { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }

/* ---------- Game enable/disable ---------- */

.game-status {
  margin-left: 10px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.game-status.on { color: var(--green); background: rgba(46, 204, 113, 0.12); }
.game-status.off { color: var(--red); background: rgba(231, 76, 60, 0.14); }
.game-toggle { margin-left: auto; }
.game-admin.is-disabled { opacity: 0.62; }

/* ---------- Player: lobby announcement + admin messages ---------- */

.lobby-announce {
  margin-bottom: 18px;
  padding: 12px 18px;
  border-radius: 12px;
  border: 1px solid rgba(245, 197, 66, 0.5);
  background: rgba(245, 197, 66, 0.1);
  color: var(--gold);
  font-weight: 600;
}

.message-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 340px;
}
.message-card {
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--accent);
  background: var(--panel2);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.5);
  animation: winPulse 0.4s ease-out;
}
.message-head { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.05em; color: var(--accent); margin-bottom: 6px; }
.message-body { color: var(--text); margin-bottom: 12px; white-space: pre-wrap; word-break: break-word; }

/* ---------- Tagesbonus / Rangliste / Statistik (Lobby) ---------- */

.bonus-box {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  border: 1px solid var(--gold);
  box-shadow: 0 0 22px rgba(245, 197, 66, 0.18);
  animation: winPulse 0.5s ease-out;
}
.bonus-icon { font-size: 1.8rem; }
.bonus-text { flex: 1 1 200px; font-weight: 600; color: var(--gold); }

.lobby-panels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  margin-top: 22px;
}
.lobby-panels .panel h3 { margin-top: 0; }
.lb-rank { width: 42px; }
.lb-me { color: var(--gold); font-weight: 700; }
.table-scroll { overflow-x: auto; }
.table td.net-neg { color: var(--red); font-weight: 700; }
.topwin-line {
  margin-top: 10px;
  font-size: 0.85rem;
  color: var(--gold);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 10px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}
.stat-tile {
  background: var(--panel2);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 10px 12px;
}
.stat-label {
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(232, 234, 242, 0.55);
  margin-bottom: 4px;
}
.stat-value { font-weight: 700; }
.stat-neg { color: var(--red); }

/* ---------- Responsive ---------- */

@media (max-width: 640px) {
  .container { padding: 16px 12px 48px; }
  /* Compact top bar: the right-hand controls flow directly into the header's
     flex rows (display: contents) instead of stacking into a tall column. */
  .topbar { padding: 8px 10px; flex-wrap: wrap; justify-content: flex-start; gap: 6px 8px; }
  .topbar-right { display: contents; }
  .topbar .balance-chip > span:first-child { display: none; } /* drop the "Guthaben:" label */
  .topbar .lang-picker { max-width: 92px; }
  .topbar .user-name { max-width: 92px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .brand { font-size: 1.05rem; }
  .sym { width: 56px; height: 56px; font-size: 40px; }
  .game-header { flex-wrap: wrap; }
  .game-header .game-title { order: 3; flex-basis: 100%; }
  .auth-wrap { margin-top: 3vh; }
}

/* ---------- Letzter Gewinn (persistent last-win chip in the game header) ---------- */

.lastwin-chip {
  border-color: rgba(46, 204, 113, 0.5);
  background: rgba(46, 204, 113, 0.08);
}
.lastwin-chip strong { color: var(--green); }
.lastwin-chip.lastwin-pop { animation: winPulse 0.7s ease-in-out 0s 2; }

/* ---------- Themed lobby cards ---------- */

.game-card.themed {
  border-top: 3px solid var(--tc1, var(--gold));
  overflow: hidden;
}
.game-card.themed > :not(.card-deco) { position: relative; z-index: 1; }
.game-card.themed .game-card-icon {
  filter: drop-shadow(0 0 12px var(--tc1, var(--gold)));
}
.game-card.themed h3 { color: var(--tc1, var(--text)); }

/* Floating, semi-transparent theme emojis inside a lobby card. */
.card-deco {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.18;
}
.card-deco span {
  position: absolute;
  font-size: 42px;
  animation: decoFloat 9s ease-in-out infinite;
}
.card-deco span:nth-child(1) { top: 6%; right: 5%; transform: rotate(-14deg); animation-delay: 0s; }
.card-deco span:nth-child(2) { bottom: 26%; right: 16%; transform: rotate(10deg); animation-delay: -3s; font-size: 34px; }
.card-deco span:nth-child(3) { top: 38%; left: 58%; transform: rotate(-6deg); animation-delay: -6s; font-size: 28px; }
.card-deco span:nth-child(4) { bottom: 6%; right: 40%; transform: rotate(16deg); animation-delay: -1.5s; font-size: 30px; }

@keyframes decoFloat {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -9px; }
}

/* ---------- Themed game backdrop (floating emojis behind the game view) ---------- */

.game-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.game-backdrop span {
  position: absolute;
  font-size: clamp(44px, 8vw, 96px);
  opacity: 0.09;
  animation: backdropFloat 16s ease-in-out infinite;
}

@keyframes backdropFloat {
  0%, 100% { translate: 0 0; rotate: 0deg; }
  33% { translate: 8px -18px; rotate: 6deg; }
  66% { translate: -10px 10px; rotate: -5deg; }
}

/* Game view content must sit above the backdrop. */
#view-game .game-header,
#view-game #game-error,
#view-game #game-root { position: relative; z-index: 1; }

@media (prefers-reduced-motion: reduce) {
  .card-deco span, .game-backdrop span { animation: none; }
}

/* ---------- Bonus-Ende: Feuerwerk-Popup mit Gesamtgewinn ---------- */
/* Non-blocking: pointer-events none, so gamble offers / spins stay clickable. */

.bonus-pop {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  pointer-events: none;
  transition: opacity 0.45s ease;
}

.bonus-pop.bonus-pop-out { opacity: 0; }

.bonus-pop-card {
  text-align: center;
  padding: 26px 44px 30px;
  border-radius: 20px;
  background: linear-gradient(165deg, rgba(42, 20, 51, 0.96), rgba(13, 10, 30, 0.96));
  border: 1px solid rgba(255, 210, 90, 0.55);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7), 0 0 44px rgba(255, 180, 60, 0.3);
  animation: bonusPopIn 0.45s cubic-bezier(0.2, 1.3, 0.4, 1);
}

.bonus-pop-card.bonus-pop-quiet {
  border-color: var(--line-soft, rgba(255, 255, 255, 0.15));
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

@keyframes bonusPopIn {
  from { transform: scale(0.6); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.bonus-pop-title {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #ffd76e;
  text-shadow: 0 0 14px rgba(255, 200, 80, 0.8);
}

.bonus-pop-label {
  margin-top: 6px;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted, #9aa3c0);
  font-weight: 700;
}

.bonus-pop-amount {
  margin-top: 4px;
  font-size: 2.2rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  color: #7defff;
  text-shadow: 0 0 18px rgba(33, 230, 255, 0.6);
}

/* firework particle: a dot that explodes into 8 shadow sparks */
.bp-fw {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  pointer-events: none;
  animation: bpFw 0.95s ease-out forwards;
}

@keyframes bpFw {
  0% {
    opacity: 1;
    box-shadow: 0 0 0 0 currentColor, 0 0 0 0 currentColor, 0 0 0 0 currentColor, 0 0 0 0 currentColor,
      0 0 0 0 currentColor, 0 0 0 0 currentColor, 0 0 0 0 currentColor, 0 0 0 0 currentColor;
  }
  65% { opacity: 1; }
  100% {
    opacity: 0;
    box-shadow: 52px 0 0 -2px currentColor, -52px 0 0 -2px currentColor, 0 52px 0 -2px currentColor, 0 -52px 0 -2px currentColor,
      37px 37px 0 -2px currentColor, -37px 37px 0 -2px currentColor, 37px -37px 0 -2px currentColor, -37px -37px 0 -2px currentColor;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bp-fw { animation-duration: 0.01s; }
  .bonus-pop-card { animation: none; }
}

/* ---------- Admin: Gewinn-Schalter ---------- */

.wintoggle-list { max-width: 460px; }

.wintoggle {
  border-color: rgba(46, 204, 113, 0.5);
  color: #7de0a4;
  background: rgba(46, 204, 113, 0.08);
}

.wintoggle.wintoggle-off {
  border-color: rgba(231, 76, 60, 0.55);
  color: #ff8f82;
  background: rgba(231, 76, 60, 0.1);
  text-decoration: line-through;
}

/* ---------- Admin: KI-Spieler ---------- */
.ai-row { display: flex; gap: 8px; align-items: center; margin: 6px 0; flex-wrap: wrap; }
.ai-row input:first-child { width: 200px; }
.ai-row input:nth-child(2) { width: 140px; }
.ai-actions { display: flex; gap: 10px; align-items: center; margin-top: 10px; }
.section-hint { color: var(--muted); font-size: .88rem; margin: 4px 0 14px; }

/* ---------- Admin: Spieler-Statistik (Zeitraum) ---------- */
#playerstats-table td, #playerstats-table th { font-variant-numeric: tabular-nums; white-space: nowrap; }
#playerstats-table td:first-child, #playerstats-table th:first-child { font-variant-numeric: normal; }
.ps-plus { color: var(--green); font-weight: 700; }
.ps-minus { color: var(--red); font-weight: 700; }
.ps-zero { color: var(--muted); }

/* ---------- Ton: getrennte Lautstärke-Regler (Popover) ---------- */
.sound-control { position: relative; display: inline-flex; }
.sound-popover {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 500;
  background: var(--panel2); border: 1px solid rgba(255,255,255,.14); border-radius: 12px;
  padding: 10px 12px; display: flex; flex-direction: column; gap: 10px;
  min-width: 200px; max-width: calc(100vw - 20px);
  box-shadow: 0 12px 34px rgba(0,0,0,.55);
}
.sound-row { display: flex; align-items: center; gap: 10px; }
.sound-slider { flex: 1; accent-color: var(--gold); cursor: pointer; height: 4px; }
.sound-off { opacity: .5; }

/* ---------- Theme switcher ---------- */
.theme-control { position: relative; display: inline-flex; }
.theme-popover {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 500;
  background: var(--panel2); border: 1px solid rgba(255,255,255,.14); border-radius: 12px;
  padding: 6px; display: flex; flex-direction: column; gap: 4px;
  min-width: 190px; max-width: calc(100vw - 20px);
  box-shadow: 0 12px 34px rgba(0,0,0,.55);
}
.theme-opt {
  text-align: left; background: none; border: 1px solid transparent; color: var(--text);
  border-radius: 8px; padding: 8px 12px; cursor: pointer; font-size: .92rem; font-weight: 600;
}
.theme-opt:hover { background: rgba(127,127,127,.16); }
.theme-opt-active { border-color: var(--gold); color: var(--gold); background: rgba(127,127,127,.12); }

/* ---------- Admin: Zugangsadressen ---------- */
.zugang-wrap { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.zugang-side { display: flex; flex-direction: column; gap: 8px; min-width: 220px; flex: 1; }
.zugang-url { font-family: ui-monospace, monospace; font-size: .95rem; color: var(--gold); word-break: break-all; }

/* ---------------------------------------------------- Support-Posteingang
   Zwei Spalten: links die Meldungen, rechts der Verlauf. Auf dem Telefon
   untereinander — dort ist nebeneinander unlesbar. */
.tk-split {
  display: grid;
  grid-template-columns: minmax(240px, 340px) 1fr;
  gap: 14px;
  align-items: start;
}

@media (max-width: 900px) {
  .tk-split { grid-template-columns: 1fr; }
}

.tk-list { display: flex; flex-direction: column; gap: 8px; max-height: 70vh; overflow-y: auto; }

.tk-card {
  text-align: left;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
  font: inherit;
  color: var(--text);
}

.tk-card:hover { border-color: var(--gold); }
.tk-card.ist-offen { border-color: var(--gold); background: rgba(245, 197, 66, .08); }
.tk-card-top { font-weight: 700; margin-bottom: 2px; }
.tk-card-sub { font-size: .78rem; color: var(--muted); margin-bottom: 4px; }

/* "Antwort nötig" — der Spieler hat zuletzt geschrieben. Das ist die einzige
   Frage, die ein Admin an eine Liste von Meldungen hat: wo liegt Arbeit? */
.tk-dran {
  margin-left: .4rem;
  padding: .05rem .4rem;
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 700;
  color: #fff;
  background: var(--red);
}

.tk-detail {
  background: rgba(255, 255, 255, .03);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 12px;
  padding: 14px 16px;
}

.tk-head h3 { margin: 0 0 6px; }
.tk-meta { font-size: .8rem; color: var(--muted); margin-top: 6px; }
.tk-thread { display: flex; flex-direction: column; gap: 10px; margin: 14px 0; }

.tk-msg {
  border-radius: 10px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, .08);
}

.tk-msg.von-spieler { background: rgba(255, 255, 255, .04); }
.tk-msg.von-casino { background: rgba(245, 197, 66, .08); border-color: rgba(245, 197, 66, .25); }
.tk-msg-kopf { font-size: .74rem; color: var(--muted); margin-bottom: 4px; }
.tk-msg-text { white-space: pre-wrap; }
.tk-bild { max-width: 160px; border-radius: 8px; margin: 6px 6px 0 0; display: inline-block; }

.tk-antwort {
  width: 100%;
  border-radius: 10px;
  padding: 8px 10px;
  background: rgba(0, 0, 0, .25);
  border: 1px solid rgba(255, 255, 255, .12);
  color: var(--text);
  font: inherit;
  resize: vertical;
}

/* Rotes Zeichen am Reiter selbst, damit man den Posteingang nicht suchen muss. */
.nav-badge {
  margin-left: .35rem;
  padding: 0 .35rem;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
}

/* Die Anleitung im Adminbereich. Als Rahmen eingebunden, damit es genau EINE
   Quelle gibt: dieselbe Seite wird als Reiter angezeigt und als PDF gedruckt.
   Zwei gepflegte Fassungen laufen sonst garantiert auseinander. */
.anleitung-rahmen {
  width: 100%;
  height: 76vh;
  min-height: 520px;
  margin-top: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: #fff;
}

/* ------------------------------------------------------------- Abrechnung
   Je Admin eine Karte mit den drei Positionen. Der eigene Anteil steht grün
   im Plus, Bonus und Casino rot im Minus — das ist das, was noch abzuliefern
   ist. Ein Klick auf eine Position zeigt, woher die Zahl kommt. */
.abr-buch {
  background: rgba(255, 255, 255, .03);
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 16px;
}

.abr-kopf { display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px; }
.abr-kopf h3 { margin: 0; }
.abr-gesamt { color: var(--muted); font-size: .9rem; }

.abr-positionen {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.abr-pos {
  text-align: left;
  font: inherit;
  color: var(--text);
  background: rgba(0, 0, 0, .22);
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
}

.abr-pos:hover { border-color: var(--gold); }
.abr-pos-titel { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.abr-pos-wert { font-size: 1.35rem; font-weight: 700; margin: 2px 0 4px; }
.abr-pos-unten { display: flex; flex-wrap: wrap; gap: 10px; font-size: .78rem; color: var(--muted); }
.abr-offen { font-weight: 600; }

.abr-detail { margin-top: 8px; }
.abr-detail h4 { margin: 10px 0 6px; }

.abr-eingabe { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.abr-eingabe .chip-input { width: 8rem; }
.abr-eingabe .abr-kommentar { width: 16rem; }

.abr-zahlung { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; font-size: .85rem; padding: 2px 0; }
.abr-z-zeit { color: var(--muted); font-size: .78rem; }
.abr-z-text { font-style: italic; }

.abr-frei { margin-top: 14px; padding-top: 10px; border-top: 1px dashed var(--line-soft); }
.abr-freiliste { margin-top: 6px; }

/* Der Weg zum Support von der Anmeldeseite aus. Bewusst unauffällig, aber
   vorhanden: wer nicht hineinkommt, hatte vorher gar keinen Kanal — das
   Formular lag hinter der Anmeldung. */
.auth-support {
  margin: 14px 0 0;
  text-align: center;
  font-size: .85rem;
  color: var(--muted);
}

.auth-support .btn { margin-left: .4rem; }

/* ---------- Spielerliste: ein Block je Person ----------
   Jede Person besteht aus ZWEI Zeilen — den Daten und darunter den Aktionen
   über die volle Breite. Vorher lagen alle Knöpfe in der letzten Spalte: vorne
   viel Luft, hinten alles ineinandergepresst (Tim, 12.08.2026).

   Die Trennung läuft deshalb nicht mehr über einen Strich unter JEDER Zeile,
   sondern über einen Strich unter jedem BLOCK. Sonst zerschneidet die Linie
   den Spieler in der Mitte. */
/* Spaltenbreiten: die Datenspalten brauchen zusammen weit weniger als die
   volle Breite. Ohne Vorgabe verteilt der Browser sie gleichmässig und lässt
   vorne Löcher. */
#section-users .table th:nth-child(1) { width: 22%; }   /* Name */
#section-users .table th:nth-child(2) { width: 13%; }   /* Guthaben */
#section-users .table th:nth-child(3) { width: 13%; }   /* Rolle */
#section-users .table th:nth-child(4) { width: 14%; }   /* Registriert */
#section-users .table th:nth-child(5) { width: 20%; }   /* Letzter Login */
#section-users .table th:nth-child(6) { width: 18%; }   /* Betreut von */
/* Jede Person ist ein BLOCK aus zwei Zeilen. Damit man das sieht, bekommt der
   Block eine eigene Fläche, die sich vom Panel absetzt, und darunter eine
   deutliche Trennlinie. Vorher lief alles ineinander (Tim: "voll scheisse"). */
#users-body td {
  border-bottom: 0;
  padding-top: 12px;
  padding-bottom: 4px;
  background: rgba(255, 255, 255, 0.035);
}
/* Die Datenzeile oben ausrichten, sonst schiebt die höhere Betreuungszelle
   ("niemand" + Knopf) Name und Guthaben in die Mitte und die Zeile wirkt
   auseinandergerissen. */
#users-body td { vertical-align: top; }
/* Name und Aktionen auf dieselbe Fluchtlinie einrücken. */
#section-users .table th:first-child,
#users-body td:first-child { padding-left: 1.6rem; }
/* Die Betreuungsspalte kompakt halten: Knopf direkt unter den Text. */
.betreuer-cell .betreuer-holen { margin-top: .25rem; }
#users-body tr.user-actions-row > td {
  border-bottom: 2px solid rgba(245, 197, 66, 0.28);
  padding-top: 0;
  padding-bottom: 16px;
}
/* Die Datenzeile bekommt beim Überfahren die Tönung — zusammen mit ihrer
   Aktionszeile, damit der Block als eine Einheit reagiert. */
#users-body tr:hover,
#users-body tr:hover + tr.user-actions-row { background: rgba(124, 92, 255, 0.06); }
#users-body tr.user-actions-row:hover { background: rgba(124, 92, 255, 0.06); }
#users-body tr.user-gruppe:hover { background: rgba(245, 197, 66, .06); }

/* Der Aktionsblock: zwei beschriftete Gruppen nebeneinander, dazwischen eine
   ruhige senkrechte Linie statt eines fetten Balkens. */
.user-actions { padding-left: 1.6rem !important; }
.ua-panel {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.6rem;
  align-items: flex-start;
}
.ua-gruppe {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  padding-left: .9rem;
  border-left: 3px solid rgba(245, 197, 66, 0.38);
}
.ua-titel {
  font-size: .72rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 700;
}
.user-actions .action-msg { display: block; margin: .4rem 0 0 .9rem; }

/* Gruppen-Trennzeilen in der Spielerliste: Spieler / Testkonten / Verwaltung.
   Deutlich abgesetzt, damit auf einen Blick klar ist, dass Test- und
   Verwaltungskonten nichts mit den spielenden Leuten zu tun haben. */
.user-gruppe td {
  padding: 1.5rem .5rem .5rem;
  border-bottom: 2px solid rgba(245, 197, 66, .6) !important;
  background: rgba(245, 197, 66, .10) !important;
}
.user-gruppe-titel {
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--gold);
}
.user-gruppe-hinweis {
  margin-left: .7rem;
  font-size: .85rem;
  color: var(--muted);
  font-style: italic;
}

/* Eine Spielzeile in der Spielerakte lässt sich aufklappen — darunter stehen
   genau die Runden dieses Spiels. */
.ud-spielzeile { cursor: pointer; }
.ud-spielzeile:hover { background: rgba(245, 197, 66, .06); }
.ud-pfeil { display: inline-block; width: .9em; color: var(--gold); }

/* ---------------------------------------------------------------- AGB
   Eine Rechtstext-Seite liest sich anders als eine Spieloberfläche: schmale
   Spalte, ruhige Zeilenabstände, klare Nummerierung. Die offenen Platzhalter
   ([ADRESSE] usw.) werden rot markiert — eine AGB mit Lücken darin ist
   schlimmer als gar keine, also darf man sie nicht übersehen können. */
.agb-wrap { max-width: 46rem; padding-bottom: 3rem; }
.agb-zurueck { margin: 1rem 0 .4rem; }
.agb h1 { font-size: 1.5rem; margin: 0 0 .3rem; }
.agb h2 { font-size: 1.08rem; margin: 1.6rem 0 .5rem; }
.agb .agb-lead { font-weight: 600; margin: 0 0 .2rem; }
.agb .agb-stand { color: var(--muted); margin: 0; }
.agb p { line-height: 1.6; margin: .5rem 0; }
.agb ul { line-height: 1.6; padding-left: 1.3rem; }
.agb li { margin: .3rem 0; }
.agb hr { border: 0; border-top: 1px solid rgba(255, 255, 255, .12); margin: 1.4rem 0; }
.agb .agb-fuss { color: var(--muted); font-size: .9rem; }
.agb-luecke {
  background: rgba(179, 35, 43, .22);
  border-bottom: 2px dashed #b3232b;
  padding: 0 .2rem;
  border-radius: 3px;
  font-weight: 600;
}

/* Der eigene Spielverlauf des Spielers (Ansicht hinter dem Knopf "Verlauf").
   Aufgebaut wie die Spielerakte im Adminbereich, damit beide Seiten bei einer
   Reklamation dasselbe Bild vor sich haben. */
.verlauf-wrap { max-width: 1100px; margin: 0 auto; }
.verlauf-wrap > .panel { margin-top: .8rem; }
.verlauf-table { width: 100%; font-size: .92rem; }
.verlauf-table th,
.verlauf-table td { padding: .35rem .5rem; }
.verlauf-zeile { cursor: pointer; }
.verlauf-zeile:hover { background: rgba(245, 197, 66, .06); }

/* Der ausführliche Rundenbeleg: gefallene Zahl bzw. Karten der Runde. */
.ud-beleg {
  padding: .5rem .6rem;
  border-left: 3px solid var(--gold);
  background: rgba(0, 0, 0, .18);
  border-radius: 0 6px 6px 0;
}
.beleg-kopf { display: flex; align-items: center; gap: .5rem; margin-bottom: .4rem; }
.beleg-zahl {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  padding: 0 .35rem;
  border-radius: 50%;
  font-weight: 700;
  color: #fff;
}
.beleg-rot { background: #b3232b; }
.beleg-schwarz { background: #1b1b1b; border: 1px solid #555; }
.beleg-gruen { background: #12703c; }
.beleg-hand { display: flex; align-items: center; flex-wrap: wrap; gap: .35rem; margin: .25rem 0; }
.beleg-titel { min-width: 7.5rem; color: var(--muted); }
.beleg-karte {
  display: inline-block;
  min-width: 2.1rem;
  padding: .1rem .3rem;
  text-align: center;
  border-radius: 4px;
  background: #f4f1e8;
  color: #111;
  font-weight: 600;
}
.beleg-karte.rot { color: #b3232b; }
.beleg-wert { margin-left: .3rem; color: var(--gold); font-weight: 700; }
.beleg-ausgang { margin-left: .5rem; font-weight: 600; }

/* ==========================================================================
   Mitlaufender Tabellenkopf  (Tim, 13.08.2026)
   --------------------------------------------------------------------------
   "die spalten überschrift sollte unten bei test nochmals kommen und bei
   Admin auch — oder vielleicht noch besser, mitscrollen wäre nett obendran"

   Beides. Der Kopf klebt beim Rollen oben fest UND wird bei jeder Gruppe
   noch einmal ausgeschrieben — wer mitten in der Liste landet (etwa über
   einen Sprung aus dem Protokoll), scrollt nicht erst nach oben, um zu
   wissen, was in welcher Spalte steht.

   Das 61px ist die Höhe der Kopfleiste (.topbar, 12px Polster oben und
   unten plus die Knopfzeile). Ohne diesen Versatz verschwindet der
   Tabellenkopf beim Rollen hinter der Leiste.
   ========================================================================== */

/* WARUM DIESE ZEILE ÜBERHAUPT NÖTIG IST:
   .table-scroll hat overflow-x:auto. Sobald EINE Achse nicht "visible" ist,
   macht der Browser die andere automatisch zu "auto" — der Kasten wird zum
   eigenen Rollbereich, und ein position:sticky darin hält sich an DIESEM
   Kasten fest statt am Fenster. Der Kopf klebte deshalb nirgends: er rollte
   mit der Seite davon, weil der Kasten selbst nie gerollt wurde.

   Ab 900 px Breite passt die Spielerliste ohnehin ins Fenster; dort darf der
   Rollbereich also weg, und der Kopf hält sich am Fenster fest. Darunter
   bleibt das seitliche Rollen wichtiger — dort tragen die wiederholten
   Spaltentitel bei jeder Gruppe die Orientierung. */
@media (min-width: 900px) {
  .admin-section .table-scroll { overflow: visible; }
}

/* Auf den Adminbereich beschraenkt. Eine Tabelle in einem Dialogfenster
   (Spielverlauf, Beleg) rollt in ihrem EIGENEN Kasten — ein Kopf, der sich dort
   an der Fensterkante festhaelt, klebte an der falschen Stelle. */
.admin-section .table thead th {
  position: sticky;
  /* Die Hoehe der Leisten darueber steht nicht fest: die Abschnitts-Knoepfe
     brechen je nach Fensterbreite auf zwei oder drei Zeilen um (gemessen:
     52 px bis 192 px). Ein fester Wert liesse den Kopf mal darunter, mal
     dahinter verschwinden. admin.js misst nach und setzt die Zahl hier ein. */
  top: var(--kopf-oben, 61px);
  z-index: 4;
  /* Deckende Fläche, nicht durchscheinend: die Zeilen laufen darunter
     hindurch, und bei halbdurchsichtigem Kopf sieht man beides übereinander. */
  background: var(--panel2);
  box-shadow: 0 2px 0 0 var(--line), 0 6px 12px -6px rgba(0, 0, 0, 0.55);
}
:root[data-theme="light"] .admin-section .table thead th { box-shadow: 0 2px 0 0 var(--line), 0 6px 12px -8px rgba(20, 30, 60, 0.25); }

/* Der wiederholte Kopf innerhalb der Liste. Bewusst kleiner und ohne
   Schatten — er ordnet, statt zu konkurrieren. */
#users-body tr.user-kopf > th {
  position: static;
  padding: 4px 10px 8px;
  font-size: 0.68rem;
  color: var(--muted);
  background: transparent;
  border-bottom: 1px solid var(--line-soft);
  box-shadow: none;
  text-align: left;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
#users-body tr.user-kopf > th.num { text-align: right; }

/* ==========================================================================
   Wartungsfenster
   ========================================================================== */

/* --- Kasten auf der Anmeldeseite (viersprachig) --- */
.wartung-auth {
  margin: 0 auto 18px;
  max-width: 30rem;
  padding: 16px 18px;
  border: 2px solid var(--gold);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(245, 197, 66, 0.14), rgba(245, 197, 66, 0.05));
}
.wartung-auth.ist-angekuendigt {
  border-color: var(--accent);
  background: linear-gradient(180deg, rgba(124, 92, 255, 0.16), rgba(124, 92, 255, 0.05));
}
.wartung-kopf {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 10px;
}
.wartung-symbol { font-size: 1.5rem; line-height: 1; }
.wartung-zaehler {
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}
.wartung-sprachen { display: flex; flex-direction: column; gap: 7px; }
.wartung-zeile {
  display: flex;
  align-items: baseline;
  gap: 9px;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.45;
}
/* Die eigene Sprache steht hervorgehoben zwischen den anderen — man findet
   sie, ohne alle vier zu lesen. */
.wartung-zeile.ist-eigen { color: var(--text); font-weight: 600; }
.wartung-flagge {
  flex: 0 0 auto;
  min-width: 2.1rem;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--gold);
  opacity: 0.85;
  padding-top: 0.1rem;
}
.wartung-zeile.ist-eigen .wartung-flagge { opacity: 1; }
.wartung-grund {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--text);
}
.wartung-grund-marke { color: var(--gold); font-weight: 800; }

/* Gesperrtes Anmeldeformular: sichtbar aus dem Betrieb genommen, nicht
   einfach nur klickfaul. Wer nicht sieht, DASS gesperrt ist, tippt sein
   Passwort dreimal und glaubt, er habe es vergessen. */
#auth-form.ist-gesperrt { opacity: 0.45; filter: grayscale(0.5); }
#auth-form.ist-gesperrt input,
#auth-form.ist-gesperrt button { cursor: not-allowed; }

/* --- Balken oben in der Mitte (für Angemeldete) --- */
.wartung-balken {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60; /* über der Kopfleiste (z-index 50) */
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: min(92vw, 40rem);
  padding: 9px 20px;
  border: 1px solid var(--gold);
  border-top: 0;
  border-radius: 0 0 14px 14px;
  background: rgba(20, 16, 4, 0.94);
  backdrop-filter: blur(6px);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.55);
  color: #ffe9a8;
  font-size: 0.92rem;
  font-weight: 600;
}
:root[data-theme="light"] .wartung-balken {
  background: rgba(255, 248, 224, 0.97);
  color: #5a4300;
}
.wartung-balken .wartung-zaehler { font-size: 1.15rem; }
.wartung-balken .wb-grund {
  padding-left: 12px;
  border-left: 1px solid var(--line-soft);
  font-weight: 400;
  opacity: 0.9;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 16rem;
}
/* Letzte Minute: das Blinken ist die einzige Stelle im Casino, an der etwas
   von selbst die Aufmerksamkeit zieht — hier zu Recht, denn danach ist die
   Sitzung vorbei. */
.wartung-balken.ist-dringend {
  border-color: var(--red);
  color: #ffd9d2;
  animation: wartung-puls 1s ease-in-out infinite;
}
@keyframes wartung-puls {
  0%, 100% { box-shadow: 0 8px 26px rgba(0, 0, 0, 0.55); }
  50% { box-shadow: 0 8px 30px rgba(231, 76, 60, 0.55); }
}
@media (prefers-reduced-motion: reduce) {
  .wartung-balken.ist-dringend { animation: none; border-width: 2px; }
}

/* --- Steuerung im Adminbereich --- */
.wartung-stand {
  padding: 12px 14px;
  margin-bottom: 14px;
  border-radius: 10px;
  border: 1px solid var(--line-soft);
  background: var(--field-bg);
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.6;
}
.wartung-stand.ist-laeuft {
  border-color: var(--red);
  color: #ffd9d2;
  background: rgba(231, 76, 60, 0.12);
  font-weight: 600;
}
.wartung-stand.ist-angekuendigt {
  border-color: var(--gold);
  color: var(--text);
  background: rgba(245, 197, 66, 0.10);
}
.wartung-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  align-items: flex-end;
  margin-bottom: 12px;
}
.wartung-vorschau {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px dashed var(--line);
  background: var(--field-bg);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Zelle "Betreut von": zwei Zeilen statt einer Schlange.
   OBEN wer betreut (plus Stift zum Ändern), DARUNTER der rote Knopf.
   Vorher stand der Stift hinter dem blockweise gesetzten Knopf und rutschte
   damit auf eine dritte Zeile — dort sah er aus wie ein dunkler Fleck ohne
   Bedeutung. */
.betreuer-oben {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.betreuer-oben .betreuer-edit { margin-left: 0; }
.betreuer-cell .action-msg { display: block; min-width: 0; }
/* Der rote Knopf ist ein Angebot, kein Alarm — etwas kleiner als zuvor, damit
   er die Zeile nicht beherrscht. Die Farbe bleibt: sie ist das Zeichen dafür,
   dass dieser Spieler noch auf jemanden wartet. */
.betreuer-holen { padding: 0.2rem 0.6rem; font-size: 0.78rem; }

/* ==========================================================================
   Monitor — die Betriebsampel  (Tim, 13.08.2026)
   --------------------------------------------------------------------------
   "die grünen und roten bobbels ... sodass man sofort erkennt, wenn etwas
   probleme macht." Vier Gruppen, je Prüfpunkt ein Punkt. Rot pulsiert —
   dieselbe bewusste Ausnahme wie beim Wartungszähler: Aufmerksamkeit ziehen
   darf hier nur, was wirklich Aufmerksamkeit braucht.
   ========================================================================== */

.mon-kopf {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}
.mon-gesamt {
  font-weight: 700;
  font-size: 1.02rem;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--line-soft);
}
.mon-gesamt.ist-gruen { color: var(--green); background: rgba(46, 204, 113, 0.10); border-color: rgba(46, 204, 113, 0.45); }
.mon-gesamt.ist-gelb { color: #ffd76e; background: rgba(245, 197, 66, 0.10); border-color: rgba(245, 197, 66, 0.5); }
.mon-gesamt.ist-rot { color: var(--red); background: rgba(231, 76, 60, 0.12); border-color: var(--red); }

.mon-gruppe {
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--field-bg);
  margin-bottom: 14px;
  overflow: hidden;
}
.mon-gruppe-titel {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 9px 14px;
  background: var(--panel2);
  border-bottom: 1px solid var(--line-soft);
  font-weight: 700;
}
.mon-gruppe-hinweis {
  font-weight: 400;
  font-size: 0.82rem;
  color: var(--muted);
}
.mon-zeile {
  display: grid;
  grid-template-columns: 26px 1fr auto;
  gap: 10px;
  align-items: start;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line-soft);
}
.mon-zeile:last-child { border-bottom: 0; }

/* Der Punkt selbst. Gross genug, um aus zwei Metern Abstand zu wirken. */
.mon-punkt {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  margin-top: 3px;
  justify-self: center;
}
.mon-punkt.ist-gruen { background: var(--green); box-shadow: 0 0 6px rgba(46, 204, 113, 0.55); }
.mon-punkt.ist-gelb { background: #f5c542; box-shadow: 0 0 6px rgba(245, 197, 66, 0.6); }
.mon-punkt.ist-grau { background: #5a6480; }
.mon-punkt.ist-rot {
  background: var(--red);
  box-shadow: 0 0 8px rgba(231, 76, 60, 0.8);
  animation: mon-puls 1.1s ease-in-out infinite;
}
@keyframes mon-puls {
  0%, 100% { box-shadow: 0 0 4px rgba(231, 76, 60, 0.5); }
  50% { box-shadow: 0 0 14px rgba(231, 76, 60, 0.95); }
}
@media (prefers-reduced-motion: reduce) {
  .mon-punkt.ist-rot { animation: none; outline: 2px solid var(--red); }
}

.mon-name { font-weight: 600; font-size: 0.93rem; }
.mon-fehler {
  margin-top: 2px;
  font-size: 0.85rem;
  color: var(--red);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
}
.mon-fehler-meta { color: var(--muted); }
.mon-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
}

/* ==========================================================================
   Leitstand (/dashboard)  — Tim, 13.08.2026
   --------------------------------------------------------------------------
   Eine Seite fuer den Betrieb: grosse Ampel, wer da ist, Wartung, Steuerung,
   und dieselben Pruefpunkte wie im Adminbereich (mon-*-Klassen oben).
   ========================================================================== */

.ls-kopf {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
}
.ls-ampel {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 1.25rem;
  font-weight: 800;
}
.ls-ampel.ist-gruen { color: var(--green); }
.ls-ampel.ist-gelb { color: #f5c542; }
.ls-ampel.ist-rot { color: var(--red); }
.ls-ampel-punkt {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  flex: 0 0 auto;
}
.ls-ampel-punkt.ist-gruen { background: var(--green); box-shadow: 0 0 14px rgba(46, 204, 113, 0.7); }
.ls-ampel-punkt.ist-gelb { background: #f5c542; box-shadow: 0 0 14px rgba(245, 197, 66, 0.7); }
.ls-ampel-punkt.ist-rot {
  background: var(--red);
  animation: mon-puls 1.1s ease-in-out infinite;
}
.ls-betrieb {
  font-size: 0.88rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.ls-kacheln {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 12px;
}
.ls-kachel {
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--field-bg);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ls-kachel b {
  font-size: 2.1rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--gold);
}
.ls-kachel span {
  font-size: 0.78rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}
.ls-kachel small {
  font-size: 0.82rem;
  color: var(--text);
  min-height: 1.1em;
  overflow-wrap: anywhere;
}

.ls-steuerung {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 22px;
  margin: 10px 0;
}
.ls-steuer-gruppe {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.ls-steuer-gruppe .chip-input { width: 4.5rem; text-align: right; }

.ls-weg {
  text-align: center;
  padding: 48px 24px;
}
.ls-weg-symbol { font-size: 3rem; margin-bottom: 8px; }
.ls-weg h2 { margin: 0 0 8px; }
.ls-weg p { color: var(--muted); max-width: 34rem; margin: 0 auto; }

.msg-ok { color: var(--green); }
.msg-err { color: var(--red); }

/* Gewicht-Abzeichen und sichtbare Beschreibung am Monitor-Punkt.
   Die Beschreibung stand vorher nur im title-Tooltip — auf einem Tablet gibt
   es kein Hover, dort war sie unsichtbar. */
.mon-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mon-gewicht {
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  padding: 0.08rem 0.38rem;
  border: 1px solid currentColor;
  border-radius: 4px;
  line-height: 1.3;
}
.mon-gewicht.ist-kritisch { color: var(--red); }
.mon-gewicht.ist-wichtig { color: var(--gold); }
.mon-gewicht.ist-gering { color: var(--muted); }
.mon-hinweis {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 1px;
  max-width: 46rem;
}

/* Hauptbilanz — die vier Balken fuers Abschlussbild der Vorfuehrung.
   Gemeinsame Skala (groesster Wert = volle Breite), weiche Uebergaenge, damit
   das Wachsen beim Live-Spielen sichtbar wird. */
.hb-zeile {
  display: grid;
  grid-template-columns: 12rem 1fr 8.5rem;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}
.hb-label { font-size: 0.9rem; font-weight: 600; }
.hb-bahn {
  height: 26px;
  border-radius: 6px;
  background: var(--field-bg);
  border: 1px solid var(--line-soft);
  overflow: hidden;
}
.hb-fuellung {
  height: 100%;
  border-radius: 5px;
  transition: width 0.8s ease;
  min-width: 2px;
}
.hb-fuellung.ist-einsatz { background: linear-gradient(90deg, #b98a1a, var(--gold)); }
.hb-fuellung.ist-gewinn { background: linear-gradient(90deg, #1d7f4b, var(--green)); }
.hb-fuellung.ist-einzahlung { background: linear-gradient(90deg, #3a55b8, var(--accent)); }
.hb-fuellung.ist-entnahme { background: linear-gradient(90deg, #97352b, var(--red)); }
.hb-wert {
  font-family: inherit;
  font-variant-numeric: tabular-nums;
  text-align: right;
  font-weight: 700;
}
.hb-kennzahlen {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
  font-size: 0.92rem;
  color: var(--muted);
}
@media (max-width: 44rem) {
  .hb-zeile { grid-template-columns: 1fr; gap: 4px; }
  .hb-wert { text-align: left; }
}

/* Verfuegbarkeit (SLA) im Leitstand */
.sla-ziel {
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--muted);
  margin-left: 12px;
  letter-spacing: 0.04em;
}
.sla-zeile {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--line-soft);
  background: var(--field-bg);
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}
.sla-zeile.ist-gruen { color: var(--green); border-color: rgba(46, 204, 113, 0.45); font-weight: 600; }
.sla-zeile.ist-gelb { color: #ffd76e; border-color: rgba(245, 197, 66, 0.5); font-weight: 600; }
.sla-zeile.ist-rot { color: var(--red); border-color: var(--red); font-weight: 700; }
