/* =====================================================================
   BETROX booking terminal · themes + shape (terminal/css/theme.css)
   Loaded LAST. Two colour themes, chosen in the header ("Farbe"):
     <html data-theme="betrox">  default: dark + Betrox yellow
     <html data-theme="gold">    warm black + metallic gold
   Preset per terminal with ?theme=gold (remembered on the device).
   ===================================================================== */

/* ---- shape: a bit rounder everywhere (tokens are used by all views) ---- */
:root {
  --r-sm: 10px;
  --r: 14px;
  --r-lg: 18px;
  --r-xl: 26px;
}

/* ---- colour switcher in the header ---- */
.theme-sw { display: inline-flex; gap: 4px; padding: 4px; border-radius: var(--r-lg); background: var(--tile); }
.theme-sw button {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 56px; padding: 0 16px; border: 0; border-radius: var(--r);
  background: transparent; color: var(--ink-2);
  font-family: var(--cond); font-weight: 700; font-size: 18px; letter-spacing: .04em; text-transform: uppercase;
}
.theme-sw button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: inset 0 0 0 2px var(--accent); }
.theme-sw .sw {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .18);
}
.theme-sw .sw--betrox { background: linear-gradient(135deg, #0B0D12 0 48%, #FFC700 52% 100%); }
.theme-sw .sw--gold { background: linear-gradient(135deg, #0A0907 0 44%, #F6DC8B 50%, #C99A3A 72%, #8A6418 100%); }
@media (max-width: 760px) {
  .theme-sw button { min-height: 44px; padding: 0 10px; }
  .theme-sw .lbl { display: none; }
}

/* =====================================================================
   GOLD theme
   ===================================================================== */
:root[data-theme="gold"] {
  --bg: #0A0907;
  --bar: #110F0A;
  --card: #17140E;
  --tile: #221D13;
  --tile-hover: #2C2618;
  --tile-off: #16130D;
  --board: #0F0D09;
  --board-alt: #13110B;
  --board-head: #1A160E;
  --line: #2A2416;
  --line-2: #302919;
  --line-3: #3B321E;

  --ink: #F8F2E4;
  --ink-2: #DED1B4;
  --ink-dim: #B9AC8E;
  --ink-lose: #C9BC9F;
  --muted: #A8997A;
  --muted-2: #7F7259;
  --on-accent: #140F04;

  --accent: #E2B44C;          /* gold: prices, brand, primary action */
  --accent-hover: #F0C866;
  --accent-press: #C3962F;
  --accent-tint: #1F190B;
  --accent-line: #5C4818;

  --gold-grad: linear-gradient(180deg, #F8E3A0 0%, #E2B44C 46%, #B9862A 100%);
  --gold-grad-h: linear-gradient(135deg, #F8E3A0 0%, #E2B44C 45%, #A9781F 100%);
}

/* header: warm black */
:root[data-theme="gold"] .hdr,
:root[data-theme="gold"] header.hdr,
:root[data-theme="gold"] #hdr { background: linear-gradient(180deg, #1A160E 0%, var(--bar) 100%); }

/* metallic gold on the big surfaces: home tiles, primary buttons, selected odds, yellow chips */
:root[data-theme="gold"] .home-tile,
:root[data-theme="gold"] .tiles8 > *,
:root[data-theme="gold"] .bx-btn--primary,
:root[data-theme="gold"] .bx-odd.is-selected,
:root[data-theme="gold"] .bx-chip[aria-pressed="true"],
:root[data-theme="gold"] .bx-seg [aria-pressed="true"] {
  background: var(--gold-grad);
  color: var(--on-accent);
}
:root[data-theme="gold"] .bx-btn--primary:hover { background: var(--gold-grad-h); }
:root[data-theme="gold"] .bx-odd.is-selected .v,
:root[data-theme="gold"] .bx-odd.is-selected .k { color: var(--on-accent); }

/* hard-coded yellows in the views -> gold */
:root[data-theme="gold"] .cat-ic--top { background: linear-gradient(180deg, #2C2410, #18130A); }
:root[data-theme="gold"] .theme-sw button[aria-pressed="true"] { box-shadow: inset 0 0 0 2px #E2B44C; }

/* =====================================================================
   LIGHT theme: cream / white surfaces, gold + rose gold (reddish gold)
   ===================================================================== */
.theme-sw .sw--rose { background: linear-gradient(135deg, #FBF5EA 0 44%, #E8C27A 52%, #C9733F 76%, #9A4620 100%); box-shadow: 0 0 0 2px rgba(0, 0, 0, .25); }

:root[data-theme="rose"] {
  color-scheme: light;
  --bg: #F6EFE2;
  --bar: #FFFDF9;
  --card: #FFFFFF;
  --tile: #F4EADA;
  --tile-hover: #ECDDC5;
  --tile-off: #EFE7DA;
  --board: #FFFDF8;
  --board-alt: #FBF5EA;
  --board-head: #F2E7D4;
  --line: #E8DCC6;
  --line-2: #E1D2B8;
  --line-3: #D5C3A3;

  --ink: #231910;
  --ink-2: #4A3A29;
  --ink-dim: #5E4C38;
  --ink-lose: #6B5A45;
  --muted: #74634D;
  --muted-2: #9C8B73;
  --on-accent: #FFFFFF;

  --accent: #A3501C;          /* rose gold / copper: prices + brand (readable on light) */
  --accent-hover: #B65F27;
  --accent-press: #8A4114;
  --accent-tint: #FBEBD8;
  --accent-line: #E7C49B;

  --up: #15803D;
  --down: #C2410C;
  --ok: #15803D;
  --ok-tint: #DCF2E3;
  --error: #B91C1C;
  --error-tint: #FBE3E0;
  --warn: #B45309;
  --warn-tint: #FCEBD3;
  --live-tag: #FCE1E1;
  --ht-tag: #FCEBD3;

  --shadow: 0 14px 36px rgba(90, 60, 25, .16);
  --focus: 0 0 0 3px var(--bg), 0 0 0 6px #C9733F;

  /* gold -> rose gold, dark enough for white text in the middle */
  --rose-grad: linear-gradient(180deg, #EBC07A 0%, #D48A4C 42%, #B85C2D 72%, #97431D 100%);
  --rose-grad-h: linear-gradient(135deg, #F0CD8E 0%, #D9925A 45%, #A44E22 100%);
  --gold-text: linear-gradient(90deg, #C9962E 0%, #D17C3C 55%, #A8471F 100%);
}

/* header + logo */
:root[data-theme="rose"] .hdr { background: linear-gradient(180deg, #FFFFFF 0%, #FBF4E8 100%); }
:root[data-theme="rose"] .bx-brand .bet { color: #231910; }
:root[data-theme="rose"] .bx-brand .rox { background: var(--gold-text); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* big surfaces in rose gold with white text */
:root[data-theme="rose"] .home-tile,
:root[data-theme="rose"] .bx-btn--primary,
:root[data-theme="rose"] .hdr-check,
:root[data-theme="rose"] .bx-odd.is-selected,
:root[data-theme="rose"] .bx-chip[aria-pressed="true"],
:root[data-theme="rose"] .bx-seg [aria-pressed="true"] {
  background: var(--rose-grad);
  color: #FFFFFF;
  text-shadow: 0 1px 1px rgba(80, 30, 5, .35);
}
:root[data-theme="rose"] .home-tile { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), 0 8px 20px rgba(150, 80, 30, .25); }
:root[data-theme="rose"] .home-tile::before { background: radial-gradient(120% 70% at 20% 0%, rgba(255, 255, 255, .35), transparent 60%); }
:root[data-theme="rose"] .bx-btn--primary:hover { background: var(--rose-grad-h); }
:root[data-theme="rose"] .bx-odd.is-selected .v,
:root[data-theme="rose"] .bx-odd.is-selected .k,
:root[data-theme="rose"] .ev-odd.is-selected .k { color: #FFFFFF; }

/* hard-coded dark spots in the views -> light */
:root[data-theme="rose"] .cat-ic--top { background: linear-gradient(180deg, #FFF3DE, #F4DDB8); color: #A3501C; }
:root[data-theme="rose"] .cat-tile-ic .cat-ic { box-shadow: 0 6px 16px rgba(120, 80, 30, .18); }
:root[data-theme="rose"] .home-promo,
:root[data-theme="rose"] .home-ak { background: linear-gradient(125deg, #FBE3C4 0%, #FBEBD8 45%, #FFFFFF 100%); }
:root[data-theme="rose"] .ftr-links .sep { color: #C9B898; }
:root[data-theme="rose"] .theme-sw button[aria-pressed="true"] { box-shadow: inset 0 0 0 2px #C9733F; }
:root[data-theme="rose"] .tl-bar { background: linear-gradient(to top, var(--bg) 72%, rgba(246, 239, 226, 0)); }

/* ---- header room: portrait has no header menu (like BetRoxR: bottom bar + tiles),
        the switcher collapses to colour dots where space is short ---- */
body.is-portrait .hdr-nav { display: none; }
body:not(.is-landscape) .theme-sw .lbl { display: none; }
body:not(.is-landscape) .theme-sw button { padding: 0 12px; }
@media (max-width: 1760px) {
  .theme-sw .lbl { display: none; }
  .theme-sw button { padding: 0 12px; }
}
@media (max-width: 1500px) {
  body.is-landscape .hdr-check-l { display: none; }
}

/* carousel arrow in the light theme */
:root[data-theme="rose"] .home-arr { background: #FFFFFF; color: var(--accent); box-shadow: 0 6px 16px rgba(120, 70, 25, .22); border: 1px solid var(--line-2); }
/* portrait: 8 tiles in one row are narrow -> long labels must not break mid-word */
body.is-portrait .home-tile-l { font-size: 17px; letter-spacing: .01em; overflow-wrap: normal; word-break: normal; hyphens: manual; }
