/* =====================================================================
   BETROX Shop · shared design tokens + base components
   ---------------------------------------------------------------------
   Used by all five apps (terminal, kasse, wettschein, live-zeit, live-liga)
   and the setup page. Same family as the chosen TV look "Variant A"
   (screens/variant-a/styles.css): the odds-change blink, SPIELSITUATION and
   TOR! styles below are taken from it 1:1 (keyframes prefixed with bx-).

   Load in every page (after the Google Fonts link, before the app CSS):
     <link rel="preconnect" href="https://fonts.googleapis.com">
     <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
     <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Barlow:wght@500;600;700&family=Barlow+Condensed:wght@500;600;700;800&display=swap">
     <link rel="stylesheet" href="../shared/tokens.css">

   Naming: every shared class starts with "bx-". State classes are
   "is-*" (is-active, is-selected, is-locked, is-open) plus the Variant A
   change classes "chg up" / "chg down". Components size with the
   --bx-tap custom property (kiosk = 64px, set lower for staff tools).
   ===================================================================== */

:root {
  /* ---- ground & surfaces ---- */
  --bg: #0B0D12;          /* page ground */
  --bar: #0F121A;         /* header / footer / tab bars */
  --card: #141824;        /* cards, panels */
  --tile: #1C2030;        /* odds tiles, inputs */
  --tile-hover: #242940;
  --tile-off: #151925;    /* locked tile */
  --board: #10131B;       /* TV list ground */
  --board-alt: #131722;
  --board-head: #161A25;
  --line: #1F2433;
  --line-2: #232838;
  --line-3: #2A3042;

  /* ---- text ---- */
  --ink: #F2F3F5;
  --ink-2: #C9CFDB;
  --ink-dim: #9AA3B5;
  --ink-lose: #B5BCCB;
  --muted: #8A93A6;
  --muted-2: #6B7489;
  --on-accent: #0B0D12;   /* text on yellow */

  /* ---- brand & signal colours ---- */
  --accent: #FFC700;      /* Betrox yellow: prices, brand, primary action */
  --accent-hover: #FFD43D;
  --accent-press: #E6B300;
  --accent-tint: #17150C; /* yellow-tinted card ground (Variant A "top") */
  --accent-line: #4A3E10;
  --live: #FF4545;
  --live-ink: #FF6B6B;
  --live-tag: #3A1518;
  --ht: #FFB020;          /* half-time / SPIELSITUATION amber */
  --ht-tag: #3A2A0C;
  --red-card: #E5383B;

  /* odds up (green) / down (red): solid, tint, line */
  --up-solid: #16A34A;
  --up-tint: #123B24;
  --up: #4ADE80;
  --down-solid: #DC2626;
  --down-tint: #3F1616;
  --down: #FF7A5C;

  --ok: #4ADE80;
  --ok-tint: #123B24;
  --error: #FF6B6B;
  --error-tint: #3A1518;
  --warn: #FFB020;
  --warn-tint: #3A2A0C;

  /* SPIELSITUATION band */
  --sus-a: #FFB020;
  --sus-b: #F59E0B;
  --sus-ink: #170F02;

  /* ---- type ---- */
  --cond: 'Barlow Condensed', 'Arial Narrow', sans-serif;   /* numbers, headings */
  --sans: 'Barlow', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: ui-monospace, 'Cascadia Mono', Consolas, 'Courier New', monospace;

  /* ---- shape, spacing, motion ---- */
  --bx-tap: 64px;         /* minimum touch target (kiosk). Kasse may set 44px. */
  --r-sm: 8px;
  --r: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --gap: 16px;
  --shadow: 0 18px 48px rgba(0, 0, 0, .55);
  --focus: 0 0 0 3px var(--bg), 0 0 0 6px var(--accent);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --chg-ms: 8s;           /* odds-change animation length (matches BX.ui.oddsTracker) */
}

/* phones: slightly smaller targets, still >= 48px */
@media (max-width: 760px) {
  :root { --bx-tap: 52px; --gap: 12px; }
}

/* =====================================================================
   Base
   ===================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 500;
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img, svg { display: block; }
a { color: var(--accent); }
:focus-visible { outline: none; box-shadow: var(--focus); }
[hidden] { display: none !important; }

.num { font-variant-numeric: tabular-nums; }
.cond { font-family: var(--cond); }
.muted { color: var(--muted); }
.bx-sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
/* kiosk screens: no text selection, no long-press menus */
.bx-kiosk, .bx-kiosk * { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.bx-kiosk input, .bx-kiosk textarea { user-select: text; -webkit-user-select: text; }

/* =====================================================================
   Brand wordmark: BET (white) + ROX (yellow)
   <span class="bx-brand" aria-label="BETROX"><span class="bet">BET</span><span class="rox">ROX</span></span>
   ===================================================================== */
.bx-brand {
  display: inline-flex; align-items: baseline;
  font-family: var(--cond); font-weight: 800; font-size: 44px; line-height: 1; letter-spacing: .02em;
}
.bx-brand .bet { color: #FFF; }
.bx-brand .rox { color: var(--accent); }
.bx-brand--sm { font-size: 30px; }
.bx-brand--lg { font-size: 72px; }

/* =====================================================================
   Buttons: .bx-btn + --primary | --secondary | --ghost | --danger
   sizes: --sm | --lg | --block ; icon-only: .bx-icon-btn
   ===================================================================== */
.bx-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 24px; border-radius: var(--r);
  border: 1px solid transparent; background: var(--tile); color: var(--ink);
  font-family: var(--cond); font-weight: 700; font-size: 22px; letter-spacing: .03em; line-height: 1;
  text-decoration: none; white-space: nowrap;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .08s ease;
  touch-action: manipulation;
}
.bx-btn:active:not(:disabled) { transform: scale(.98); }
.bx-btn:disabled, .bx-btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.bx-btn svg { flex-shrink: 0; }

.bx-btn--primary { background: var(--accent); color: var(--on-accent); }
.bx-btn--primary:hover:not(:disabled) { background: var(--accent-hover); }
.bx-btn--primary:active:not(:disabled) { background: var(--accent-press); }

.bx-btn--secondary { background: var(--tile); border-color: var(--line-3); color: var(--ink); }
.bx-btn--secondary:hover:not(:disabled) { background: var(--tile-hover); }

.bx-btn--ghost { background: transparent; color: var(--ink-2); }
.bx-btn--ghost:hover:not(:disabled) { background: var(--tile); color: var(--ink); }

.bx-btn--danger { background: var(--error-tint); border-color: #5A2328; color: var(--error); }
.bx-btn--danger:hover:not(:disabled) { background: #4A1B20; }

.bx-btn--sm { min-height: 40px; padding: 0 14px; font-size: 18px; border-radius: var(--r-sm); }
.bx-btn--lg { min-height: var(--bx-tap); padding: 0 32px; font-size: 26px; }
.bx-btn--xl { min-height: 84px; padding: 0 40px; font-size: 32px; border-radius: var(--r-lg); }
.bx-btn--block { display: flex; width: 100%; }

.bx-icon-btn {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 44px; height: 44px; border-radius: var(--r-sm);
  border: 0; background: transparent; color: var(--muted);
  transition: background-color .15s ease, color .15s ease;
  touch-action: manipulation;
}
.bx-icon-btn:hover { background: var(--tile); color: var(--ink); }
.bx-icon-btn--lg { width: var(--bx-tap); height: var(--bx-tap); }

/* =====================================================================
   Inputs
   ===================================================================== */
.bx-input {
  width: 100%; min-height: 52px; padding: 0 16px; border-radius: var(--r);
  background: var(--tile); border: 1px solid var(--line-3); color: var(--ink);
  font-size: 20px; font-weight: 600;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.bx-input::placeholder { color: var(--muted); font-weight: 500; }
.bx-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 199, 0, .25); }
.bx-input.is-error { border-color: var(--error); box-shadow: 0 0 0 3px rgba(255, 107, 107, .2); }
.bx-input--lg { min-height: 72px; font-size: 30px; font-family: var(--cond); font-weight: 700; letter-spacing: .06em; }
.bx-field { display: flex; flex-direction: column; gap: 8px; }
.bx-label { font-size: 15px; font-weight: 700; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.bx-search { position: relative; }
.bx-search .bx-input { padding-left: 48px; }
.bx-search > svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }

/* =====================================================================
   Odds button (the core control)
   <button class="bx-odd" aria-pressed="false">
     <span class="k">1</span><span class="vv"><span class="v">1.67</span></span>
   </button>
   states: .is-selected | .is-locked (or :disabled) | .chg.up | .chg.down
   Change state (Variant A): 3 solid green/red blinks, then a fading tint over
   8 s; BX.ui.oddsTracker() returns the classes + --chg-delay so a re-render
   continues the animation instead of restarting it. The background is read
   from --odd-bg so a selected odd blinks and then returns to yellow.
   ===================================================================== */
.bx-odd {
  --odd-bg: var(--tile);
  --odd-ink: var(--accent);
  --odd-k: var(--muted);
  position: relative;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  min-width: 0; min-height: var(--bx-tap); padding: 0 14px;
  border: 0; border-radius: var(--r); background: var(--odd-bg); color: var(--ink);
  text-align: left; touch-action: manipulation;
  transition: background-color .6s ease, box-shadow .6s ease, transform .08s ease;
}
.bx-odd .k {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 18px; font-weight: 700; color: var(--odd-k);
}
.bx-odd .vv { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; }
.bx-odd .v {
  font-family: var(--cond); font-weight: 700; font-size: 28px; line-height: 1;
  color: var(--odd-ink); font-variant-numeric: tabular-nums;
}
.bx-odd--center { justify-content: center; }       /* value only, no label */
.bx-odd--center .vv { margin-left: 0; }
.bx-odd--lg { min-height: 76px; }
.bx-odd--lg .v { font-size: 34px; }
.bx-odd--sm { min-height: 44px; padding: 0 10px; }
.bx-odd--sm .v { font-size: 22px; }
.bx-odd--sm .k { font-size: 15px; }

@media (hover: hover) {
  .bx-odd:hover:not(:disabled):not(.is-locked):not(.is-selected) { --odd-bg: var(--tile-hover); transition: none; }
}
.bx-odd:active:not(:disabled):not(.is-locked) { transform: scale(.97); }
.bx-odd.is-selected { --odd-bg: var(--accent); --odd-ink: var(--on-accent); --odd-k: #3B3000; }
.bx-odd.is-locked, .bx-odd:disabled {
  --odd-bg: var(--tile-off); --odd-k: var(--muted-2);
  cursor: not-allowed; color: var(--muted-2);
}
.bx-odd.is-locked .v, .bx-odd:disabled .v { display: none; }
.bx-odd .bx-lock { color: var(--muted-2); margin-left: auto; }

.bx-arr { flex-shrink: 0; fill: currentColor; width: 14px; height: 12px; }

/* --- odds change (taken from Variant A, prefixed) --- */
.chg { --chg-delay: 0s; }
.bx-odd.chg, .bx-tile.chg {
  transition: none;
  animation: var(--chg-anim) var(--chg-ms) linear var(--chg-delay, 0s) forwards;
}
.bx-odd.chg .arr, .bx-odd.chg .bx-arr, .bx-tile.chg .bx-arr {
  animation: var(--chg-ink) var(--chg-ms) linear var(--chg-delay, 0s) forwards;
}
.bx-odd.chg .v, .bx-tile.chg .v {
  animation: var(--chg-ink-v) var(--chg-ms) linear var(--chg-delay, 0s) forwards;
}
.chg.up   { --chg-anim: bx-chg-up;   --chg-ink: bx-ink-up;   --chg-ink-v: bx-v-up;   color: var(--up); }
.chg.down { --chg-anim: bx-chg-down; --chg-ink: bx-ink-down; --chg-ink-v: bx-v-down; color: var(--down); }

@keyframes bx-chg-up {
  0%, 9%, 19%    { background: #16A34A; box-shadow: inset 0 0 0 2px #4ADE80, 0 0 18px rgba(74, 222, 128, .55); }
  4.5%, 14%, 24% { background: #123B24; box-shadow: inset 0 0 0 2px #4ADE80, 0 0 0 rgba(74, 222, 128, 0); }
  30%            { background: #123B24; box-shadow: inset 0 0 0 2px #4ADE80; }
  100%           { background: var(--odd-bg, var(--tile)); box-shadow: inset 0 0 0 2px rgba(74, 222, 128, 0); }
}
@keyframes bx-chg-down {
  0%, 9%, 19%    { background: #DC2626; box-shadow: inset 0 0 0 2px #FF7A5C, 0 0 18px rgba(255, 122, 92, .55); }
  4.5%, 14%, 24% { background: #3F1616; box-shadow: inset 0 0 0 2px #FF7A5C, 0 0 0 rgba(255, 122, 92, 0); }
  30%            { background: #3F1616; box-shadow: inset 0 0 0 2px #FF7A5C; }
  100%           { background: var(--odd-bg, var(--tile)); box-shadow: inset 0 0 0 2px rgba(255, 122, 92, 0); }
}
/* arrow: white on the solid blinks, then its colour, then fades out */
@keyframes bx-ink-up {
  0%, 9%, 19%    { color: #FFFFFF; opacity: 1; }
  4.5%, 14%, 24% { color: #4ADE80; opacity: 1; }
  30%  { opacity: 1; }
  100% { opacity: 0; }
}
@keyframes bx-ink-down {
  0%, 9%, 19%    { color: #FFFFFF; opacity: 1; }
  4.5%, 14%, 24% { color: #FF7A5C; opacity: 1; }
  30%  { opacity: 1; }
  100% { opacity: 0; }
}
/* the price never disappears: it ends in its normal colour (yellow, or dark when selected) */
@keyframes bx-v-up   { 0%, 9%, 19% { color: #FFFFFF; } 4.5%, 14%, 24% { color: #B9F5CF; } 30%, 100% { color: var(--odd-ink, var(--accent)); } }
@keyframes bx-v-down { 0%, 9%, 19% { color: #FFFFFF; } 4.5%, 14%, 24% { color: #FFD3C8; } 30%, 100% { color: var(--odd-ink, var(--accent)); } }

/* Static (non-animated) change marker, e.g. in a slip: "1.80 -> 1.95" */
.bx-delta { display: inline-flex; align-items: center; gap: 6px; font-family: var(--cond); font-weight: 700; font-variant-numeric: tabular-nums; }
.bx-delta .old { color: var(--muted); text-decoration: line-through; }
.bx-delta.up .new { color: var(--up); }
.bx-delta.down .new { color: var(--down); }

/* Variant A tile (label left, value right) and locked bar, for TV lists */
.bx-tile {
  --odd-bg: var(--tile); --odd-ink: var(--accent);
  position: relative; height: 56px; padding: 0 14px; border-radius: var(--r); background: var(--odd-bg);
  display: flex; align-items: center; justify-content: space-between;
}
.bx-tile .k { font-size: 20px; font-weight: 700; color: var(--muted); }
.bx-tile .v { font-family: var(--cond); font-weight: 700; font-size: 32px; color: var(--odd-ink); font-variant-numeric: tabular-nums; }
.bx-tile.is-locked { --odd-bg: var(--tile-off); }
.bx-locked-bar {
  flex: 1; min-height: 46px; border-radius: var(--r-sm); background: var(--tile-off); border: 1px dashed var(--line-3);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 16px; font-weight: 600; color: var(--muted); letter-spacing: .06em; text-transform: uppercase;
}

/* =====================================================================
   Chips (filters):  <button class="bx-chip is-active">Heute <span class="n">12</span></button>
   ===================================================================== */
.bx-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.bx-chips--scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.bx-chips--scroll::-webkit-scrollbar { display: none; }
.bx-chip {
  display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0;
  min-height: 48px; padding: 0 20px; border-radius: 999px;
  border: 1px solid var(--line-3); background: var(--tile); color: var(--ink-2);
  font-size: 18px; font-weight: 700; white-space: nowrap; touch-action: manipulation;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.bx-chip:hover { color: var(--ink); }
.bx-chip .n {
  min-width: 26px; padding: 2px 8px; border-radius: 999px; background: var(--line-3);
  font-size: 14px; color: var(--ink-2); text-align: center; font-variant-numeric: tabular-nums;
}
.bx-chip.is-active, .bx-chip[aria-pressed="true"], .bx-chip[aria-selected="true"] {
  background: var(--accent); border-color: var(--accent); color: var(--on-accent);
}
.bx-chip.is-active .n, .bx-chip[aria-pressed="true"] .n, .bx-chip[aria-selected="true"] .n { background: rgba(11, 13, 18, .16); color: var(--on-accent); }
.bx-chip--sm { min-height: 36px; padding: 0 14px; font-size: 15px; }

/* =====================================================================
   Cards
   ===================================================================== */
.bx-card {
  background: var(--card); border: 1px solid var(--line-2); border-radius: var(--r-lg);
  padding: 20px;
}
.bx-card--flat { border-color: transparent; }
.bx-card--top { background: var(--accent-tint); border-color: var(--accent-line); }   /* Variant A "Topspiel" card */
.bx-card--button { display: block; width: 100%; text-align: left; color: inherit; transition: border-color .15s ease, background-color .15s ease; }
.bx-card--button:hover { border-color: var(--line-3); background: #171B28; }
.bx-card-title { margin: 0; font-family: var(--cond); font-weight: 700; font-size: 28px; line-height: 1.1; letter-spacing: .02em; }
.bx-card-meta { font-size: 16px; font-weight: 600; color: var(--muted); }

.bx-tag {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 6px;
  background: var(--tile); color: var(--ink-2);
  font-size: 14px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; line-height: 1.3;
}
.bx-tag--accent { background: var(--accent); color: var(--on-accent); }
.bx-tag--live { background: var(--live-tag); color: var(--live-ink); }
.bx-tag--ht { background: var(--ht-tag); color: var(--ht); }

.bx-section-title {
  margin: 0; font-family: var(--cond); font-weight: 700; font-size: 32px; letter-spacing: .03em; line-height: 1.1;
  display: flex; align-items: center; gap: 12px;
}

/* =====================================================================
   Segmented control (Einzel | Kombi, DE | EN)
   <div class="bx-seg" role="group"><button aria-pressed="true">Einzel</button><button aria-pressed="false">Kombi</button></div>
   ===================================================================== */
.bx-seg {
  display: inline-flex; padding: 4px; gap: 4px; border-radius: var(--r);
  background: var(--tile); border: 1px solid var(--line-2);
}
.bx-seg > button {
  flex: 1; min-height: 44px; padding: 0 18px; border: 0; border-radius: 7px;
  background: transparent; color: var(--ink-2);
  font-family: var(--cond); font-weight: 700; font-size: 20px; letter-spacing: .04em;
  transition: background-color .15s ease, color .15s ease; touch-action: manipulation;
}
.bx-seg > button:hover { color: var(--ink); }
.bx-seg > button.is-active, .bx-seg > button[aria-pressed="true"], .bx-seg > button[aria-selected="true"] {
  background: var(--accent); color: var(--on-accent);
}
.bx-seg > button:disabled { opacity: .4; cursor: not-allowed; }
.bx-seg--block { display: flex; width: 100%; }
.bx-seg--lg > button { min-height: 56px; font-size: 24px; }

/* =====================================================================
   Toggle switch
   <label class="bx-toggle"><input type="checkbox"><span class="track"></span><span>Quotenänderungen akzeptieren</span></label>
   ===================================================================== */
.bx-toggle { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; font-size: 18px; font-weight: 600; color: var(--ink-2); }
.bx-toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.bx-toggle .track {
  position: relative; flex-shrink: 0; width: 52px; height: 30px; border-radius: 999px;
  background: var(--line-3); transition: background-color .15s ease;
}
.bx-toggle .track::after {
  content: ''; position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; border-radius: 50%;
  background: #FFF; transition: transform .18s var(--ease);
}
.bx-toggle input:checked + .track { background: var(--accent); }
.bx-toggle input:checked + .track::after { transform: translateX(22px); background: var(--on-accent); }
.bx-toggle input:focus-visible + .track { box-shadow: var(--focus); }
.bx-toggle input:disabled + .track { opacity: .45; }

/* =====================================================================
   Live bits: live dot, minute tag, red card, progress
   ===================================================================== */
.bx-live-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--live); display: inline-block; flex-shrink: 0; }
.bx-pulse { animation: bx-pulse 1.6s ease-out infinite; }
@keyframes bx-pulse { 0% { box-shadow: 0 0 0 0 rgba(255, 69, 69, .7); } 100% { box-shadow: 0 0 0 12px rgba(255, 69, 69, 0); } }
.bx-min {
  display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 6px;
  background: var(--live-tag); color: var(--live-ink);
  font-family: var(--cond); font-weight: 700; font-size: 22px; line-height: 1.1; font-variant-numeric: tabular-nums;
}
.bx-min.ht { background: var(--ht-tag); color: var(--ht); }
.bx-redcard { width: 11px; height: 15px; border-radius: 2px; background: var(--red-card); display: inline-block; flex-shrink: 0; }
.bx-redcard + .bx-redcard { margin-left: -4px; }
.bx-prog { width: 72px; height: 4px; border-radius: 2px; background: #262B3A; overflow: hidden; }
.bx-prog i { display: block; height: 4px; background: var(--live-ink); }
.bx-prog.ht i { background: var(--ht); }

/* =====================================================================
   SPIELSITUATION (from Variant A): the whole match is briefly locked.
   Never claims a goal. Row heartbeat: .bx-sus-row (set --sus-delay to the
   negative age to continue the animation after a re-render).
   Band: <div class="bx-sus"><span class="dot"></span><span class="title">SPIELSITUATION</span>
         <span class="sub">Märkte kurz gesperrt</span><span class="t">0:04</span></div>
   ===================================================================== */
.bx-sus-row {
  position: relative; z-index: 1;
  background: #221A08 !important;
  animation: bx-sus-beat 1.4s ease-in-out var(--sus-delay, 0s) infinite;
}
@keyframes bx-sus-beat {          /* heartbeat: two quick beats, then rest */
  0%, 100% { box-shadow: inset 0 0 0 2px rgba(255, 176, 32, .5), 0 0 0 rgba(255, 176, 32, 0); }
  14%      { box-shadow: inset 0 0 0 3px #FFB020, 0 0 30px rgba(255, 176, 32, .5); }
  28%      { box-shadow: inset 0 0 0 2px rgba(255, 176, 32, .6), 0 0 6px rgba(255, 176, 32, .15); }
  42%      { box-shadow: inset 0 0 0 3px #FFB020, 0 0 24px rgba(255, 176, 32, .4); }
}
.bx-sus-row .bx-min, .bx-sus-row .mlabel { color: #FFB020; animation: bx-sus-fade 1.4s ease-in-out var(--sus-delay, 0s) infinite; }
.bx-sus-row .bx-prog i { background: #FFB020; }
@keyframes bx-sus-fade { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }

.bx-sus {
  min-height: 46px; border-radius: var(--r-sm); padding: 0 20px;
  display: flex; align-items: center; gap: 16px; color: var(--sus-ink); overflow: hidden;
  background: repeating-linear-gradient(-45deg, #FFB020 0 18px, #F59E0B 18px 36px);
  background-size: 50.91px 50.91px;
  animation: bx-sus-stripes .9s linear infinite;
}
@keyframes bx-sus-stripes { from { background-position: 0 0; } to { background-position: 50.91px 0; } }
.bx-sus .dot { width: 14px; height: 14px; border-radius: 50%; background: var(--sus-ink); flex-shrink: 0; animation: bx-sus-fade .7s ease-in-out infinite; }
.bx-sus .title { font-family: var(--cond); font-weight: 800; font-size: 28px; letter-spacing: .06em; line-height: 1; white-space: nowrap; }
.bx-sus .sub { font-size: 18px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bx-sus .t { margin-left: auto; font-family: var(--cond); font-weight: 800; font-size: 28px; font-variant-numeric: tabular-nums; }
.bx-sus--sm { min-height: 36px; padding: 0 12px; gap: 10px; }
.bx-sus--sm .title { font-size: 20px; }
.bx-sus--sm .sub { font-size: 15px; }
.bx-sus--sm .t { font-size: 20px; }
.bx-sus--sm .dot { width: 10px; height: 10px; }
/* small static swatch (legend) */
.bx-sus-swatch { width: 26px; height: 22px; border-radius: 5px; display: inline-block; background: repeating-linear-gradient(-45deg, #FFB020 0 5px, #F59E0B 5px 10px); }

/* =====================================================================
   TOR! (from Variant A): the score really changed -> 12 s celebration.
   Row: .bx-goal-row (+ --goal-delay), badge: <span class="bx-goal-badge">TOR!</span>,
   new score digit: <span class="bx-gnew">2</span>
   ===================================================================== */
.bx-goal-row { position: relative; z-index: 1; animation: bx-goal-row 12s linear var(--goal-delay, 0s) forwards; }
@keyframes bx-goal-row {
  0%, 4%, 8%   { background: #FFC700; }
  2%, 6%, 10%  { background: #3A3210; }
  12%          { background: #2A240C; box-shadow: inset 0 0 0 2px #FFC700; }
  100%         { background: var(--row-bg, var(--board)); box-shadow: inset 0 0 0 2px rgba(255, 199, 0, 0); }
}
.bx-goal-badge {
  display: inline-block; margin-left: 4px; padding: 1px 10px; border-radius: 6px; flex-shrink: 0;
  background: #FFC700; color: #0B0D12;
  font-family: var(--cond); font-weight: 800; font-size: 20px; letter-spacing: .06em; line-height: 24px;
  animation: bx-badge-pop .6s cubic-bezier(.2, 1.6, .4, 1) var(--goal-delay, 0s) both;
}
@keyframes bx-badge-pop { from { transform: scale(0); } to { transform: scale(1); } }
.bx-gnew { color: #FFC700; display: inline-block; animation: bx-gnew-pop 1.2s cubic-bezier(.2, 1.4, .4, 1) var(--goal-delay, 0s) both; }
@keyframes bx-gnew-pop { 0% { transform: scale(2.4); } 100% { transform: scale(1); } }

/* =====================================================================
   Legal strip (every customer screen)
   <div class="bx-legal"><span class="age">18+</span><span>Spiel mit Verantwortung</span><span class="sep">·</span>
     <span>Quoten ohne Gewähr</span><span class="sep">·</span><span class="domain">betrox.at</span></div>
   BX.ui.legalHtml(lang) renders exactly this.
   ===================================================================== */
.bx-legal {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px;
  font-size: 16px; font-weight: 600; color: var(--muted);
}
.bx-legal .age { padding: 1px 8px; border: 2px solid var(--muted); border-radius: 6px; font-weight: 700; color: var(--ink-2); }
.bx-legal .sep { color: #3A4052; }
.bx-legal .domain { color: var(--ink); font-weight: 700; }
.bx-legal--lg { font-size: 18px; gap: 8px 20px; }

/* =====================================================================
   Booking code + barcode display
   ===================================================================== */
.bx-code {
  font-family: var(--cond); font-weight: 800; font-size: 96px; line-height: 1; letter-spacing: .08em;
  color: var(--accent); font-variant-numeric: tabular-nums; white-space: nowrap;
}
.bx-code--md { font-size: 56px; }
@media (max-width: 760px) { .bx-code { font-size: 56px; } }
.bx-barcode { display: inline-block; padding: 14px 18px; border-radius: var(--r); background: #FFF; line-height: 0; }
.bx-barcode svg { max-width: 100%; height: auto; }

/* =====================================================================
   Dialog (native <dialog class="bx-dialog">; open with dialog.showModal())
   <dialog class="bx-dialog bx-dialog--error">
     <div class="bx-dialog-icon">svg</div><h2 class="bx-dialog-title">…</h2>
     <p class="bx-dialog-text">…</p><div class="bx-dialog-actions">buttons</div>
   </dialog>
   ===================================================================== */
.bx-dialog {
  width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow: auto;
  padding: 32px; border-radius: var(--r-xl);
  background: var(--card); color: var(--ink); border: 1px solid var(--line-3);
  box-shadow: var(--shadow);
}
.bx-dialog::backdrop { background: rgba(5, 6, 9, .74); backdrop-filter: blur(3px); }
.bx-dialog[open] { animation: bx-pop .22s var(--ease); }
.bx-dialog-icon {
  width: 64px; height: 64px; border-radius: 50%; margin-bottom: 18px;
  display: flex; align-items: center; justify-content: center;
  background: var(--tile); color: var(--accent);
}
.bx-dialog--error .bx-dialog-icon { background: var(--error-tint); color: var(--error); }
.bx-dialog--warn .bx-dialog-icon { background: var(--warn-tint); color: var(--warn); }
.bx-dialog-title { margin: 0 0 10px; font-family: var(--cond); font-weight: 800; font-size: 36px; line-height: 1.1; letter-spacing: .02em; }
.bx-dialog-text { margin: 0 0 20px; font-size: 20px; color: var(--ink-2); }
.bx-dialog-body { margin: 0 0 24px; }
.bx-dialog-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.bx-dialog-actions .bx-btn { flex: 1 1 auto; }
.bx-dialog a.bx-link { display: inline-flex; align-items: center; gap: 8px; font-size: 20px; font-weight: 700; color: var(--accent); }
@keyframes bx-pop { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
@media (max-width: 760px) {
  .bx-dialog { padding: 22px; }
  .bx-dialog-title { font-size: 28px; }
  .bx-dialog-text { font-size: 17px; }
}

/* =====================================================================
   Toast (BX.ui.toast(text, {kind:'ok'|'error'|'info'}) creates these)
   ===================================================================== */
.bx-toasts {
  position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%); z-index: 1000;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  width: max-content; max-width: calc(100vw - 32px); pointer-events: none;
}
.bx-toast {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 20px; border-radius: var(--r);
  background: #232838; border: 1px solid var(--line-3); border-left: 4px solid var(--accent);
  box-shadow: var(--shadow); color: var(--ink); font-size: 18px; font-weight: 600;
  animation: bx-toast-in .25s var(--ease);
}
.bx-toast--ok { border-left-color: var(--ok); }
.bx-toast--error { border-left-color: var(--error); }
.bx-toast.is-leaving { opacity: 0; transform: translateY(8px); transition: opacity .25s ease, transform .25s ease; }
@keyframes bx-toast-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (max-width: 760px) { .bx-toasts { bottom: calc(var(--bx-sheet-bar-h, 72px) + 16px); } }

/* =====================================================================
   Bottom sheet (phone slip)
   <div class="bx-sheet-backdrop"></div>
   <section class="bx-sheet is-open" role="dialog" aria-modal="true">
     <div class="bx-sheet-handle"></div><div class="bx-sheet-body">…</div>
   </section>
   Sticky summary bar: <div class="bx-sheet-bar">…</div> (sits above the tab bar)
   ===================================================================== */
.bx-sheet-backdrop {
  position: fixed; inset: 0; z-index: 900; background: rgba(5, 6, 9, .6);
  opacity: 0; pointer-events: none; transition: opacity .2s ease;
}
.bx-sheet-backdrop.is-open { opacity: 1; pointer-events: auto; }
.bx-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 901;
  display: flex; flex-direction: column; max-height: 88vh; max-height: 88dvh;
  background: var(--bar); border-top: 1px solid var(--line-3);
  border-radius: var(--r-xl) var(--r-xl) 0 0; box-shadow: 0 -18px 48px rgba(0, 0, 0, .5);
  transform: translateY(100%); transition: transform .28s var(--ease);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.bx-sheet.is-open { transform: translateY(0); }
.bx-sheet-handle { width: 44px; height: 5px; border-radius: 3px; background: var(--line-3); margin: 10px auto 6px; flex-shrink: 0; }
.bx-sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 16px 12px; flex-shrink: 0; }
.bx-sheet-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 16px 16px; }
.bx-sheet-foot { flex-shrink: 0; padding: 12px 16px 16px; border-top: 1px solid var(--line); background: var(--bar); }
.bx-sheet-bar {
  position: fixed; left: 0; right: 0; bottom: var(--bx-tabbar-h, 0px); z-index: 800;
  min-height: var(--bx-sheet-bar-h, 72px); padding: 10px 16px;
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border-top: 1px solid var(--line-3);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, .4);
}

/* Bottom tab bar (phone navigation) */
.bx-tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 810;
  height: calc(var(--bx-tabbar-h, 64px) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0);
  display: flex; background: var(--bar); border-top: 1px solid var(--line);
}
.bx-tabbar > a, .bx-tabbar > button {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  border: 0; background: transparent; color: var(--muted); text-decoration: none;
  font-size: 12px; font-weight: 700; letter-spacing: .04em;
}
.bx-tabbar > .is-active, .bx-tabbar > [aria-current="page"] { color: var(--accent); }

/* =====================================================================
   Misc: spinner, empty state, badges, connection pill
   ===================================================================== */
.bx-spinner {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  border: 3px solid var(--line-3); border-top-color: var(--accent);
  animation: bx-spin .8s linear infinite;
}
.bx-spinner--lg { width: 56px; height: 56px; border-width: 5px; }
@keyframes bx-spin { to { transform: rotate(360deg); } }
.bx-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 40px 20px; text-align: center; color: var(--muted); font-size: 18px; }
.bx-empty svg { color: var(--line-3); }
.bx-badge {
  display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 24px; padding: 0 7px;
  border-radius: 999px; background: var(--accent); color: var(--on-accent);
  font-family: var(--cond); font-weight: 800; font-size: 16px; font-variant-numeric: tabular-nums;
}
.bx-conn {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px;
  background: var(--warn-tint); color: var(--warn); font-size: 15px; font-weight: 700;
}
.bx-conn::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: bx-sus-fade 1s ease-in-out infinite; }
.bx-conn.is-online { background: var(--ok-tint); color: var(--ok); }
.bx-conn.is-online::before { animation: none; }
.bx-notice {
  display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border-radius: var(--r);
  background: var(--warn-tint); color: #FFD891; font-size: 16px; font-weight: 600;
}
.bx-notice--error { background: var(--error-tint); color: #FFC2C2; }
.bx-notice--ok { background: var(--ok-tint); color: #B9F5CF; }
.bx-notice svg { flex-shrink: 0; margin-top: 1px; }

/* yellow "just added" flash and fade-out (used by the slip displays) */
.bx-flash { animation: bx-flash 1.6s ease-out; }
@keyframes bx-flash { 0% { box-shadow: inset 0 0 0 3px var(--accent), 0 0 28px rgba(255, 199, 0, .45); background-color: #2A240C; } 100% { box-shadow: inset 0 0 0 0 rgba(255, 199, 0, 0); } }
.bx-leave { animation: bx-leave .45s ease-in forwards; pointer-events: none; }
@keyframes bx-leave { to { opacity: 0; transform: translateX(24px); } }

/* =====================================================================
   Reduced motion: no blinking, show the settled state instead
   ===================================================================== */
@media (prefers-reduced-motion: reduce) {
  .bx-pulse, .bx-spinner { animation-duration: 2.4s; }
  .bx-pulse { animation: none; }
  .bx-odd, .bx-tile, .bx-btn { transition: none; }
  .bx-sus-row, .bx-sus-row .bx-min, .bx-sus-row .mlabel, .bx-sus, .bx-sus .dot,
  .bx-goal-row, .bx-goal-badge, .bx-gnew, .bx-dialog[open], .bx-toast, .bx-flash, .bx-conn::before { animation: none; }
  .bx-sus-row { box-shadow: inset 0 0 0 3px #FFB020; }
  .bx-goal-row { background: #2A240C; box-shadow: inset 0 0 0 2px #FFC700; }
  .bx-odd.chg, .bx-tile.chg, .bx-odd.chg .v, .bx-tile.chg .v, .bx-odd.chg .bx-arr, .bx-tile.chg .bx-arr { animation: none; }
  .bx-odd.chg.up, .bx-tile.chg.up { background: #123B24 !important; box-shadow: inset 0 0 0 2px #4ADE80; }
  .bx-odd.chg.down, .bx-tile.chg.down { background: #3F1616 !important; box-shadow: inset 0 0 0 2px #FF7A5C; }
  .bx-sheet, .bx-sheet-backdrop { transition: none; }
}
