:root {
  color-scheme: dark;
  --bg: #0b2432;
  --raise: #081d28;
  --card: #143547;
  --card-2: #1a4258;
  --line: rgba(255, 255, 255, 0.1);
  --text: #f4f7fc;
  --text-2: #dbe3ef;
  --muted: #bfc6df;
  --accent: #18c5f5;
  --accent-bg: linear-gradient(90deg, #18c5f5, #5ca7ec);
  --accent-ink: #06202c;
  --accent-soft: rgba(24, 197, 245, 0.12);
  --accent-line: rgba(24, 197, 245, 0.4);
  --ok: #8ef0b8;
  --danger: #ff8b98;
  --header: 76px;
  --header-bg: rgba(8, 29, 40, 0.95);
  --side: 268px;
  --side-bg: #081d28;
  --main-bg: radial-gradient(900px 300px at 50% -80px, rgba(24, 197, 245, 0.12), transparent 60%), var(--bg);
  --footer-bg: #081d28;
  --modal-bg: #143547;
  --logo-h: 52px;
  --radius: 20px;
  --radius-sm: 12px;
  --radius-btn: 999px;
  --font: "Montserrat", Arial, sans-serif;
  --nav-transform: uppercase;
  --nav-spacing: 0.04em;
  --nav-size: 13px;
  --btn-transform: uppercase;
  --btn-spacing: 0.04em;
  --h-spacing: 0;
  --h1-transform: uppercase;
  --h2-transform: uppercase;
  --ghost-border: rgba(255,255,255,0.22);
  --ghost-bg: rgba(255,255,255,0.04);
  --ghost-text: #f4f7fc;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header) + 16px); }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}
img { max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.skip {
  position: absolute;
  left: 12px;
  top: -40px;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 8px 12px;
  border-radius: 8px;
  z-index: 80;
}
.skip:focus { top: 12px; }

.header {
  position: sticky;
  top: 0;
  z-index: 45;
  height: var(--header);
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 0 22px;
  background: var(--header-bg);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}
.logo { display: flex; align-items: center; margin-right: auto; }
.logo img { height: var(--logo-h); width: auto; }
.primary-nav { display: flex; gap: 6px; }
.primary-nav a, .side-link, .sub a, .group summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-weight: 600;
  text-transform: var(--nav-transform);
  letter-spacing: var(--nav-spacing);
  font-size: var(--nav-size);
}
.primary-nav a[aria-current="page"], .side-link[aria-current="page"], .sub a[aria-current="page"] {
  color: var(--text);
  background: var(--accent-soft);
}
.primary-nav a:hover, .side-link:hover, .sub a:hover, .group summary:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.header-actions { display: flex; align-items: center; gap: 8px; }

.btn, .icon-btn, .chip, .odds, .amount, .menu-btn, .balance, .play, .fav {
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  appearance: none;
}
.btn, .chip, .amount, .balance, .play {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  vertical-align: middle;
}
.btn {
  min-height: 44px;
  padding: 0 18px;
  border-radius: var(--radius-btn);
  font-weight: 700;
  text-transform: var(--btn-transform);
  letter-spacing: var(--btn-spacing);
}
.btn.primary { background: var(--accent-bg); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { border-color: var(--ghost-border); color: var(--ghost-text); background: var(--ghost-bg); }
.btn.ghost:hover { filter: brightness(1.08); }
.btn:disabled, .odds:disabled { opacity: 0.45; cursor: not-allowed; }
.balance {
  min-height: 44px;
  padding: 0 14px;
  border-radius: var(--radius-btn);
  border: 1px solid var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent);
  cursor: pointer;
  font-weight: 700;
}
.account { position: relative; }
.account-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 200px;
  padding: 8px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: grid;
  gap: 4px;
  z-index: 50;
}
.account-menu a, .account-menu button {
  text-align: left;
  background: transparent;
  border: 0;
  color: var(--text);
  min-height: 40px;
  border-radius: var(--radius-sm);
  padding: 0 10px;
  cursor: pointer;
}
.account-menu a:hover, .account-menu button:hover { background: rgba(255,255,255,0.05); }

.backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 34;
  border: 0;
  padding: 0;
  color: transparent;
  font-size: 0;
}

.shell {
  display: grid;
  grid-template-columns: var(--side) minmax(0, 1fr);
  align-items: start;
}
.side {
  position: sticky;
  top: var(--header);
  height: calc(100vh - var(--header));
  overflow: auto;
  padding: 16px 12px 20px;
  border-right: 1px solid var(--line);
  background: var(--side-bg);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.search input, .toolbar input, .field input, .field textarea, .field select, .stake input {
  width: 100%;
  min-height: 44px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--raise);
  padding: 0 12px;
}
.field textarea { min-height: 120px; padding: 12px; resize: vertical; }
.side-nav { display: grid; gap: 4px; }
.group { border-radius: var(--radius-sm); }
.group summary { cursor: pointer; list-style: none; font-weight: 700; color: var(--text); }
.group summary::-webkit-details-marker { display: none; }
.group summary::after {
  content: "";
  margin-left: auto;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg) translateY(-2px);
}
.group[open] summary::after { transform: rotate(225deg) translateY(-2px); }
.sub { display: grid; padding: 0 0 6px 12px; }
.sub a { min-height: 36px; font-weight: 500; text-transform: none; letter-spacing: 0; font-size: 14px; }
.side-foot { margin-top: auto; padding-top: 12px; color: var(--muted); font-size: 12px; line-height: 1.4; }

.main {
  min-width: 0;
  overflow-x: clip;
  padding: 22px;
  background: var(--main-bg);
}
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(240px, 360px);
  gap: 16px;
}
.hero-art, .strip, .frame {
  display: block;
  min-width: 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--card);
}
.hero-art { position: relative; }
.hero-art img { width: 100%; aspect-ratio: 11 / 6; object-fit: cover; display: block; }
.hero-art span {
  position: absolute;
  left: 14px;
  bottom: 12px;
  font-weight: 800;
  font-size: 18px;
  text-shadow: 0 2px 10px rgba(0,0,0,0.6);
}
.panel, .card, .slip, .event, .note, .faq {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.panel { min-width: 0; padding: 26px; display: flex; flex-direction: column; justify-content: center; gap: 10px; }
.panel h1 { font-size: clamp(28px, 3vw, 40px); }
.panel p { margin: 0; color: var(--text-2); }
.eyebrow {
  margin: 0;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
h1 { margin: 0; font-size: clamp(32px, 4vw, 48px); line-height: 1.02; letter-spacing: var(--h-spacing); text-transform: var(--h1-transform); }
h2 { margin: 0; font-size: 26px; letter-spacing: var(--h-spacing); text-transform: var(--h2-transform); }
h3 { margin: 0; font-size: 19px; }
.lede { margin: 0; color: var(--muted); font-size: 16px; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.hero-side { display: grid; gap: 16px; }
.strip { margin-top: 16px; position: relative; }
.strip img { width: 100%; display: block; object-fit: cover; max-height: 220px; }
.strip .strip-text {
  position: absolute;
  left: 28px;
  top: 50%;
  transform: translateY(-50%);
  max-width: 55%;
  display: grid;
  gap: 6px;
}
.strip h2 { font-size: clamp(22px, 2.6vw, 34px); text-shadow: 0 2px 12px rgba(0,0,0,0.5); }
.strip p { margin: 0; color: var(--text-2); text-shadow: 0 1px 8px rgba(0,0,0,0.6); }

.toolbar { margin-top: 22px; display: grid; gap: 12px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  min-height: 40px;
  padding: 0 14px;
  border-radius: var(--radius-btn);
  border-color: var(--line);
  color: var(--muted);
  background: rgba(255,255,255,0.03);
  font-weight: 700;
  text-transform: var(--btn-transform);
  letter-spacing: var(--btn-spacing);
}
.chip[aria-current="page"] { color: var(--accent-ink); background: var(--accent-bg); border-color: transparent; }
.tool-row { display: flex; gap: 10px; align-items: center; }
.tool-row .search { flex: 1; }
.tool-row select { max-width: 220px; }

.section-head {
  margin: 18px 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.section-head p { margin: 4px 0 0; color: var(--muted); }
.pager { display: flex; gap: 8px; align-items: center; }
.icon-btn, .fav { display: inline-flex; align-items: center; justify-content: center; padding: 0; line-height: 0; }
.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  border-color: var(--line);
  background: var(--card);
  color: var(--text);
}
.menu-btn { display: none; }

.games {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 12px;
}
.game {
  position: relative;
  display: grid;
  align-content: end;
  min-height: 230px;
  padding: 14px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background:
    radial-gradient(120px 80px at 20% 15%, rgba(255,255,255,0.18), transparent 60%),
    linear-gradient(165deg, var(--a), var(--b));
}
.game.tile { padding: 0; background: var(--card); align-content: stretch; }
.game.tile img { width: 100%; aspect-ratio: 427 / 575; object-fit: cover; display: block; background: var(--card-2); }
.game.tile.wide img { aspect-ratio: 3 / 2; }
.game.tile .tile-meta { padding: 10px 12px 12px; display: grid; gap: 4px; }
.game.tile h3 { font-size: 15px; }
.game.tile .studio { margin: 0 0 6px; color: var(--muted); font-size: 12px; }
.game.cat { color: #fff; }
.game.cat p { position: relative; margin: 4px 0 0; color: rgba(255,255,255,0.82); font-size: 13px; }
.game .motif { position: absolute; right: -8px; top: 28px; width: 120px; height: 120px; opacity: 0.9; }
.game .motif svg { width: 100%; height: 100%; fill: rgba(255,255,255,0.88); }
.fav {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 1;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: rgba(0,0,0,0.35);
  color: white;
}
.fav[aria-pressed="true"] { color: #ffb4c0; background: rgba(0,0,0,0.55); }
.badge {
  position: absolute;
  top: 12px;
  left: 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--accent-bg);
  color: var(--accent-ink);
  border-radius: 999px;
  padding: 4px 8px;
}
.game h3 { position: relative; margin: 0; font-size: 18px; }
.game .studio { position: relative; margin: 2px 0 8px; color: rgba(255,255,255,0.8); font-size: 13px; }
.play {
  position: relative;
  justify-self: start;
  min-height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--radius-btn);
  background: var(--accent-bg);
  color: var(--accent-ink);
  font-weight: 700;
}

.empty { padding: 28px; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); }

.page-head { display: grid; gap: 8px; margin-bottom: 18px; max-width: 760px; }
.stack { display: grid; gap: 14px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: 22px; align-items: center; }
.card, .note, .event { padding: 18px; }
.card h2, .event h2 { font-size: 22px; }
.card p, .note p, .event p { margin: 8px 0 0; color: var(--text-2); }
.list { margin: 0; padding-left: 18px; color: var(--text-2); }
.list li + li { margin-top: 6px; }

.prose { max-width: 820px; }
.prose h2 { margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--line); }
.prose h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.prose h3 { margin-top: 22px; }
.prose p { margin: 10px 0 0; color: var(--text-2); font-size: 16px; }
.prose ul, .prose ol { margin: 10px 0 0; padding-left: 20px; color: var(--text-2); }
.prose li + li { margin-top: 6px; }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.prose .note { margin-top: 14px; }
.prose table { width: 100%; border-collapse: collapse; margin-top: 12px; color: var(--text-2); font-size: 15px; }
.prose th, .prose td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { color: var(--text); }
.prose td a { overflow-wrap: anywhere; }
.faq { margin-top: 10px; padding: 0 18px; }
.faq summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 12px; min-height: 56px; font-weight: 700; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  margin-left: auto;
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(45deg);
  flex: none;
}
.faq[open] summary::after { transform: rotate(225deg); }
.faq p { margin: 0 0 16px; color: var(--text-2); }
.disclosure {
  margin-top: 28px;
  padding: 16px 18px;
  border-left: 3px solid var(--accent);
  background: var(--raise);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--muted);
  font-size: 14px;
}
.notice {
  display: grid;
  gap: 6px;
  padding: 16px 18px;
  border: 1px solid var(--accent-line);
  background: var(--accent-soft);
  border-radius: var(--radius);
  margin-bottom: 18px;
}
.notice p { margin: 0; color: var(--text-2); }
.badge-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-top: 14px; }
.badge-row img { height: 34px; width: auto; opacity: 0.85; }
.badge-row a { display: inline-flex; }

.sports-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.event { display: grid; gap: 10px; }
.event header { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 13px; }
.markets { display: flex; gap: 8px; flex-wrap: wrap; }
.odds {
  min-width: 92px;
  min-height: 52px;
  border-radius: var(--radius-sm);
  border-color: var(--line);
  background: var(--raise);
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 2px;
  padding: 6px 10px;
}
.odds span { color: var(--muted); font-size: 12px; }
.odds strong { font-size: 16px; }
.odds[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.slip { position: sticky; top: calc(var(--header) + 16px); padding: 16px; display: grid; gap: 10px; }
.slip h2 { font-size: 20px; }
.pick { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.pick button { border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.pick .studio { color: var(--muted); font-size: 13px; }
.stake { display: grid; gap: 6px; }
.return-line { margin: 0; color: var(--muted); }
.history { display: grid; gap: 8px; }
.history article { padding-top: 8px; border-top: 1px solid var(--line); }

.form { display: grid; gap: 12px; max-width: 520px; }
.field { display: grid; gap: 6px; font-weight: 600; }
.field span { color: var(--muted); font-weight: 500; font-size: 14px; }
.error { margin: 0; color: var(--danger); min-height: 1.2em; }
.ok-text { color: var(--ok); }

.footer {
  display: grid;
  gap: 14px;
  padding: 22px 22px 32px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
  background: var(--footer-bg);
}
.footer p { margin: 0; max-width: 900px; }
.footer nav { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.footer a { text-decoration: underline; text-underline-offset: 3px; }
.footer .foot-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; }
.footer .foot-logos { display: flex; gap: 12px; align-items: center; }
.footer .foot-logos { flex-wrap: wrap; }
.footer .foot-logos img { height: 40px; width: auto; }
.footer .foot-rg { max-width: 900px; }
.footer .foot-licence { display: flex; gap: 18px; align-items: center; padding-top: 16px; border-top: 1px solid var(--line); }
.footer .foot-licence img { height: 56px; width: auto; flex: none; }
.footer .foot-licence p { font-size: 13px; }
@media (max-width: 640px) {
  .footer .foot-licence { flex-direction: column; align-items: flex-start; }
}

dialog { border: 0; padding: 0; background: transparent; color: var(--text); }
dialog::backdrop { background: rgba(0, 0, 0, 0.68); }
.modal {
  width: min(460px, calc(100vw - 28px));
  background: var(--modal-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}
.modal h2 { font-size: 26px; margin-bottom: 6px; }
.modal .close {
  float: right;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  cursor: pointer;
}
.amounts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.amount { min-height: 42px; border-radius: var(--radius-sm); border-color: var(--line); background: var(--raise); }
.amount[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.game-dialog .swatch {
  height: 180px;
  border-radius: var(--radius-sm);
  margin: 8px 0 12px;
  background: var(--raise) center / cover no-repeat;
}

#toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%) translateY(12px);
  background: white;
  color: #111;
  padding: 12px 16px;
  border-radius: 999px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 70;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.tabbar { display: none; }

@media (max-width: 980px) {
  .menu-btn { display: inline-grid; place-items: center; }
  .primary-nav { display: none; }
  .shell { grid-template-columns: 1fr; }
  .side {
    position: fixed;
    z-index: 40;
    left: 0;
    width: min(86vw, 320px);
    transform: translateX(-105%);
    transition: transform 0.2s ease;
  }
  .side.is-open { transform: none; }
  .hero, .grid-2, .sports-layout { grid-template-columns: 1fr; }
  .hero-side { grid-template-columns: 1fr 1fr; }
  .slip { position: static; }
  .strip .strip-text { max-width: 70%; left: 16px; }
}
@media (max-width: 640px) {
  .header { padding: 0 12px; gap: 10px; }
  .main { padding: 14px; }
  .amounts { grid-template-columns: repeat(2, 1fr); }
  .tool-row { flex-direction: column; align-items: stretch; }
  .tool-row select { max-width: none; }
  .games { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-side { grid-template-columns: 1fr; }
  .strip img { max-height: 160px; }
  .strip h2 { font-size: 18px; }
  .strip p { display: none; }
  .prose table, .prose tr, .prose td, .prose th { display: block; }
  .prose tr { padding: 10px 0; border-bottom: 1px solid var(--line); }
  .prose th { display: none; }
  .prose td { padding: 2px 0; border: 0; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}

/* Brand overrides */
h1 { font-weight: 800; }
h2 { font-weight: 800; font-size: 22px; }
h2 .hi, h1 .hi { color: var(--accent); }
.prose h3 { text-transform: none; }
.panel { background: linear-gradient(135deg, #143547, #0d2a3b); }
.chip[aria-current="page"] { color: #fff; }
.badge { color: #fff; background: #b35ff5; }
.play { color: #fff; }
.btn.primary { color: #ffffff; }
.strip h2 { text-transform: uppercase; }
.hero-art img { object-position: right center; }
