/* The `hidden` attribute must beat any class-level display rule. */
[hidden] { display: none !important; }

/* iOS paints a grey box over every tapped control; we supply our own :active states. */
button, a, input, [role="button"] { -webkit-tap-highlight-color: transparent; }

/* ============================================================
   NOVA Casino — design tokens
   ============================================================ */
:root {
  --bg:        #0F212E;
  --surface:   #1A2C38;
  --surface-2: #213743;
  --surface-3: #2F4553;
  --line:      #2F4553;
  --line-2:    #4A6274;
  --text:      #FFFFFF;
  --muted:     #B1BAD3;
  --dim:       #5B7385;
  --accent:    #00E701;
  --accent-hi: #1FFF20;
  --blue:      #4391E7;
  --blue-hi:   #1475E1;
  --orange:    #FF9D00;
  --red:       #E9113C;
  --btc:       #F7931A;

  --r-xs: 3px;
  --r-sm: 4px;
  --r-md: 6px;
  --r-lg: 8px;

  --nav-w: 240px;
  --topbar-h: 60px;
  --tabbar-h: 0px;

  --pad-x: clamp(10px, 1.6vw, 24px);
  --pad-y: clamp(12px, 1.4vw, 20px);
  --gap: clamp(16px, 2vw, 24px);

  --ease: cubic-bezier(.2, .7, .3, 1);
  --t-fast: 130ms var(--ease);
  --t: 180ms var(--ease);

  --shadow-pop: 0 12px 32px rgba(0, 0, 0, .45);
  --shadow-card: 0 8px 18px rgba(0, 0, 0, .55);
}

/* ============================================================
   Reset
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font: 400 14px/1.45 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  overscroll-behavior-y: none;
}

body.is-locked { overflow: hidden; }

h1, h2, h3, p { margin: 0; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
input { font: inherit; }

a { color: var(--blue); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: #6CA9EE; }

::-webkit-scrollbar { width: 8px; height: 6px; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: var(--r-sm); }
::-webkit-scrollbar-thumb:hover { background: var(--line-2); }
::-webkit-scrollbar-track { background: transparent; }

:where(button, a, input, [tabindex]):focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 200;
  padding: 10px 14px;
  background: var(--accent);
  color: var(--bg);
  font-weight: 600;
  border-radius: var(--r-sm);
  transform: translateY(-200%);
  transition: transform var(--t);
}
.skip-link:focus-visible { transform: none; color: var(--bg); }

.num { font-variant-numeric: tabular-nums; }
.truncate { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ============================================================
   Keyframes
   ============================================================ */
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(233, 17, 60, .7); }
  70%  { box-shadow: 0 0 0 6px rgba(233, 17, 60, 0); }
  100% { box-shadow: 0 0 0 0 rgba(233, 17, 60, 0); }
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes shimmer { 0% { background-position: -320px 0; } 100% { background-position: 320px 0; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes dropIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes sheetIn { from { transform: translateY(100%); } to { transform: none; } }

/* ============================================================
   Shell / layout
   ============================================================ */
.shell {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
}

.frame {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.main { flex: 1; min-width: 0; }

.page {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: var(--pad-y) var(--pad-x) 0;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

.view { display: flex; flex-direction: column; gap: var(--gap); }

/* ============================================================
   Sidebar
   ============================================================ */
.sidebar {
  flex: 0 0 var(--nav-w);
  width: var(--nav-w);
  background: var(--surface);
  border-right: 1px solid var(--line);
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  transition: width var(--t), flex-basis var(--t);
}

.sidebar__inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.sidebar__head {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-bottom: 1px solid var(--line);
}

.sidebar__headrow { display: flex; align-items: center; gap: 6px; }

.sidebar__nav {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 8px 8px 0;
}

.navgroup {
  padding: 4px 0 8px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 8px;
}
.navgroup:last-child { border-bottom: 0; }

.nav-item {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 10px;
  margin-bottom: 2px;
  background: transparent;
  border: 0;
  border-radius: var(--r-sm);
  color: var(--muted);
  font: 600 13px Inter, system-ui;
  text-align: left;
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
}
.nav-item:hover { background: var(--surface-3); color: var(--text); }
.nav-item.is-active { background: var(--surface-3); color: var(--text); }

.nav-item__bar {
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: transparent;
  transition: background var(--t-fast);
}
.nav-item.is-active .nav-item__bar { background: var(--accent); }

.nav-item svg { flex: 0 0 20px; width: 20px; height: 20px; }
.nav-item__label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.nav-item__badge {
  background: var(--surface-3);
  color: var(--muted);
  font: 600 11px Inter, system-ui;
  font-variant-numeric: tabular-nums;
  padding: 2px 6px;
  border-radius: var(--r-sm);
}

.sidebar__foot {
  padding: 10px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 8px;
}

/* --- rail mode (icons only) --- */
[data-nav="rail"] { --nav-w: 60px; }
[data-nav="rail"] .collapsible { display: none !important; }
[data-nav="rail"] .nav-item { justify-content: center; padding: 10px 0; }
[data-nav="rail"] .nav-item__label,
[data-nav="rail"] .nav-item__badge { display: none; }
[data-nav="rail"] .sidebar__head { padding: 10px 8px; }
[data-nav="rail"] .sidebar__headrow { justify-content: center; }

/* --- drawer mode (off-canvas) --- */
[data-nav="drawer"] .sidebar {
  position: fixed;
  z-index: 75;
  left: 0;
  top: 0;
  width: min(288px, 86vw);
  flex-basis: auto;
  height: 100vh;
  height: 100dvh;
  transform: translateX(-101%);
  transition: transform 220ms var(--ease);
  box-shadow: var(--shadow-pop);
  padding-bottom: env(safe-area-inset-bottom);
}
[data-nav="drawer"].drawer-open .sidebar { transform: none; }

.scrim {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(15, 33, 46, .72);
  backdrop-filter: blur(2px);
  animation: fadeIn 150ms var(--ease);
}

/* ============================================================
   Search results (sidebar)
   ============================================================ */
.searchres {
  display: flex;
  flex-direction: column;
  max-height: 220px;
  overflow-y: auto;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}
.searchres__item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(47, 69, 83, .5);
  color: var(--text);
  font: 500 12px Inter, system-ui;
  text-align: left;
  cursor: pointer;
  transition: background var(--t-fast);
}
.searchres__item:last-child { border-bottom: 0; }
.searchres__item:hover { background: var(--surface-2); }
.searchres__item span:last-child { margin-left: auto; color: var(--dim); font-size: 11px; }
.searchres__empty { padding: 10px; color: var(--muted); font: 500 12px Inter, system-ui; }

/* ============================================================
   Topbar
   ============================================================ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  padding-top: env(safe-area-inset-top);
}

.topbar__burger { display: none; }
[data-nav="drawer"] .topbar__burger { display: inline-flex; }

.topbar__spacer { flex: 1; }
.topbar__actions { display: flex; align-items: center; gap: 2px; }

.brand {
  display: flex;
  align-items: center;
  gap: 1px;
  font: 700 clamp(16px, 2vw, 19px) Inter, system-ui;
  letter-spacing: -.5px;
  padding-right: 4px;
  background: transparent;
  border: 0;
  cursor: pointer;
}
.brand__name { color: var(--text); }
.brand__dot { color: var(--accent); }

.balance {
  display: flex;
  align-items: stretch;
  background: var(--bg);
  border-radius: var(--r-sm);
  height: 38px;
  overflow: hidden;
}
.balance__value {
  display: flex;
  align-items: center;
  padding: 0 clamp(8px, 1.2vw, 12px);
  font: 600 clamp(12px, 1.3vw, 14px) Inter, system-ui;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  white-space: nowrap;
}
.balance__ccy {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 6px;
  padding: 0 10px;
  background: var(--surface-2);
  border: 0;
  color: var(--muted);
  cursor: pointer;
  transition: background var(--t-fast);
}
.balance__ccy:hover { background: var(--surface-3); }
.balance__ccy svg { width: 12px; height: 12px; }

.coin {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  border-radius: 50%;
  background: var(--btc);
  display: flex;
  align-items: center;
  justify-content: center;
  font: 700 10px Inter, system-ui;
  color: var(--bg);
}

.avatar {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  margin-left: 4px;
  border-radius: 50%;
  background: var(--surface-3);
  border: 1px solid var(--line-2);
  color: var(--muted);
  font: 600 12px Inter, system-ui;
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
}
.avatar:hover { background: var(--line-2); color: var(--text); }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 clamp(12px, 1.6vw, 18px);
  border: 0;
  border-radius: var(--r-sm);
  font: 600 13px Inter, system-ui;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--t-fast), color var(--t-fast), transform var(--t-fast);
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 14px; height: 14px; flex: 0 0 14px; }

.btn--primary { background: var(--accent); color: var(--bg); }
.btn--primary:hover { background: var(--accent-hi); }

.btn--blue { background: var(--blue-hi); color: var(--text); }
.btn--blue:hover { background: var(--blue); }

.btn--soft { background: var(--surface-2); color: var(--text); }
.btn--soft:hover { background: var(--surface-3); }

.btn--ghost { background: var(--surface-2); color: var(--muted); }
.btn--ghost:hover { background: var(--surface-3); color: var(--text); }

.btn--outline { background: transparent; border: 1px solid var(--line); color: var(--muted); }
.btn--outline:hover { background: var(--surface-3); color: var(--text); }

.btn--lg { height: 44px; font-size: 15px; }
.btn--sm { height: 34px; font-size: 12px; padding: 0 14px; }
.btn--square { padding: 0; width: 40px; flex: 0 0 40px; }
.btn--block { width: 100%; }
.btn[disabled], .btn.is-disabled { background: var(--surface-2); color: var(--dim); cursor: not-allowed; }
.btn[disabled]:active, .btn.is-disabled:active { transform: none; }

.iconbtn {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  border-radius: var(--r-sm);
  color: var(--muted);
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
}
.iconbtn:hover, .iconbtn.is-active { background: var(--surface-3); color: var(--text); }
.iconbtn svg { width: 20px; height: 20px; }
.iconbtn--sm { width: 30px; height: 30px; flex: 0 0 30px; }
.iconbtn--sm svg { width: 16px; height: 16px; }
.iconbtn--xs { width: 30px; height: 30px; flex: 0 0 30px; background: var(--surface-2); }
.iconbtn--xs svg { width: 16px; height: 16px; }

.linkbtn {
  background: transparent;
  border: 0;
  color: var(--blue);
  font: 600 12px Inter, system-ui;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: var(--r-sm);
  transition: background var(--t-fast);
}
.linkbtn:hover { background: var(--surface-3); }

.notifwrap { position: relative; display: flex; }

.badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: var(--red);
  border: 2px solid var(--surface);
  border-radius: 9px;
  font: 600 10px/12px Inter, system-ui;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
}
.badge[hidden] { display: none; }

/* ============================================================
   Segmented / chips / tabs
   ============================================================ */
.seg {
  display: flex;
  background: var(--bg);
  border-radius: var(--r-sm);
  padding: 3px;
  gap: 2px;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}
.seg::-webkit-scrollbar { display: none; }
.seg--mode { flex: 1; padding: 2px; }
.seg--fill .seg__btn { flex: 1; }

.seg__btn {
  background: transparent;
  border: 0;
  border-radius: var(--r-sm);
  color: var(--muted);
  font: 600 12px Inter, system-ui;
  padding: 8px 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--t-fast), color var(--t-fast);
}
.seg--mode .seg__btn { flex: 1; padding: 7px 0; }
.seg__btn:hover { color: var(--text); }
.seg__btn.is-active { background: var(--surface-3); color: var(--text); }

.chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.chips::-webkit-scrollbar { display: none; }

.chip {
  background: var(--surface-2);
  color: var(--muted);
  border: 0;
  border-radius: var(--r-sm);
  padding: 8px 14px;
  font: 600 12px Inter, system-ui;
  cursor: pointer;
  white-space: nowrap;
  scroll-snap-align: start;
  transition: background var(--t-fast), color var(--t-fast);
}
.chip:hover { background: var(--surface-3); color: var(--text); }
.chip.is-active { background: var(--accent); color: var(--bg); }

/* ============================================================
   Inputs
   ============================================================ */
.field { position: relative; display: flex; align-items: center; }
.field__icon {
  position: absolute;
  left: 9px;
  width: 16px;
  height: 16px;
  color: var(--muted);
  pointer-events: none;
}
.input, .field input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--text);
  font: 500 13px Inter, system-ui;
  padding: 9px 10px;
  outline: none;
  transition: border-color var(--t-fast);
}
.input:focus, .field input:focus { border-color: var(--blue); }
.input::placeholder, .field input::placeholder { color: var(--dim); }
.field--search input { padding-left: 31px; }

/* Safari draws its own magnifier and clear button inside type=search, which would
   sit next to our .field__icon. Strip the native chrome so only our icon shows. */
.field input[type="search"] { -webkit-appearance: none; appearance: none; }
.field input[type="search"]::-webkit-search-decoration,
.field input[type="search"]::-webkit-search-results-button,
.field input[type="search"]::-webkit-search-results-decoration,
.field input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}

.input--num { font-weight: 600; font-variant-numeric: tabular-nums; }
.input--err { border-color: var(--red); }

.inputgroup {
  display: flex;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  overflow: hidden;
}
.inputgroup input, .inputgroup > .inputgroup__text {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  color: var(--text);
  font: 600 13px Inter, system-ui;
  font-variant-numeric: tabular-nums;
  padding: 10px 12px;
  outline: none;
}
.inputgroup__text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
  font-size: 12px;
}
.inputgroup__btn {
  padding: 0 12px;
  background: var(--surface-2);
  border: 0;
  border-left: 1px solid var(--line);
  color: var(--muted);
  font: 600 12px Inter, system-ui;
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
}
.inputgroup__btn:hover { background: var(--surface-3); color: var(--text); }

.slider {
  width: 100%;
  accent-color: var(--accent);
  height: 24px;
  cursor: pointer;
}

.label { font: 600 12px Inter, system-ui; color: var(--muted); }
.stack { display: flex; flex-direction: column; gap: 6px; }

.readout {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--text);
  font: 600 13px Inter, system-ui;
  font-variant-numeric: tabular-nums;
  padding: 10px 12px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.statbox {
  flex: 1;
  min-width: 0;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.statbox__k { font: 600 11px Inter, system-ui; color: var(--muted); }
.statbox__v { font: 600 13px Inter, system-ui; font-variant-numeric: tabular-nums; color: var(--text); }

/* ============================================================
   Cards & panels
   ============================================================ */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
}
.panel--pad { padding: 14px; }

.section { display: flex; flex-direction: column; gap: 10px; }

.section__head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.section__head > svg { flex: 0 0 18px; width: 18px; height: 18px; color: var(--muted); }
.section__title {
  font: 600 clamp(14px, 1.5vw, 15px) Inter, system-ui;
  color: var(--text);
  cursor: pointer;
  background: transparent;
  border: 0;
  padding: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}
.section__title:hover { color: var(--accent); }
.section__count { font: 600 12px Inter, system-ui; font-variant-numeric: tabular-nums; color: var(--muted); }
.section__nav { display: flex; gap: 4px; margin-left: auto; }

.page__title { font: 600 clamp(16px, 2.2vw, 18px) Inter, system-ui; color: var(--text); }
.page__head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.page__head > svg { width: 20px; height: 20px; color: var(--muted); }

.livedot {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: var(--red);
  animation: pulse 1.8s var(--ease) infinite;
}
.livedot--sm { width: 6px; height: 6px; flex: 0 0 6px; }

/* ============================================================
   Hero
   ============================================================ */
.hero {
  position: relative;
  border-radius: var(--r-md);
  overflow: hidden;
  min-height: clamp(180px, 22vw, 250px);
  display: flex;
  align-items: center;
  transition: background 250ms var(--ease);
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(15, 33, 46, .94) 0%, rgba(15, 33, 46, .6) 50%, rgba(15, 33, 46, 0) 100%);
}
.hero__body {
  position: relative;
  z-index: 1;
  padding: clamp(16px, 4vw, 48px);
  padding-bottom: clamp(30px, 4vw, 48px);
  max-width: 580px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.hero__kicker { font: 600 11px Inter, system-ui; color: var(--accent); letter-spacing: .08em; }
.hero__title { font: 700 clamp(19px, 3vw, 30px)/1.15 Inter, system-ui; color: var(--text); text-wrap: balance; }
.hero__text { font: 400 clamp(12px, 1.4vw, 13px)/1.5 Inter, system-ui; color: var(--muted); text-wrap: pretty; }
.hero__actions { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.hero__dots {
  position: absolute;
  right: 16px;
  bottom: 12px;
  z-index: 1;
  display: flex;
  gap: 6px;
}
.hero__dot {
  width: 6px;
  height: 6px;
  padding: 0;
  border: 0;
  border-radius: 3px;
  background: var(--line-2);
  cursor: pointer;
  transition: width 220ms var(--ease), background 220ms var(--ease);
}
.hero__dot.is-active { width: 20px; background: var(--accent); }

/* ============================================================
   Quick tiles
   ============================================================ */
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}
.tile {
  position: relative;
  background: var(--surface-2);
  border: 0;
  border-radius: var(--r-md);
  padding: 12px 14px;
  height: 72px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  cursor: pointer;
  overflow: hidden;
  text-align: left;
  transition: background var(--t-fast), transform var(--t-fast);
}
.tile:hover { background: var(--surface-3); transform: translateY(-2px); }
.tile__label { font: 600 14px Inter, system-ui; color: var(--text); }
.tile__meta { font: 500 12px Inter, system-ui; font-variant-numeric: tabular-nums; color: var(--muted); }
.tile svg {
  position: absolute;
  right: -6px;
  bottom: -6px;
  width: 46px;
  height: 46px;
  opacity: .35;
}

/* ============================================================
   Game cards
   ============================================================ */
.rail {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scroll-snap-type: x proximity;
  padding-bottom: 4px;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.rail > .gamecard {
  flex: 0 0 auto;
  width: clamp(116px, 15vw, 152px);
  scroll-snap-align: start;
}

.grid-games {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(clamp(104px, 13vw, 148px), 1fr));
  gap: 10px;
}

.gamecard {
  display: flex;
  flex-direction: column;
  transition: transform var(--t), filter var(--t);
}
.gamecard:hover { transform: translateY(-6px); filter: drop-shadow(var(--shadow-card)); }

.gamecard__art {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: var(--r-md);
  overflow: hidden;
  border: 0;
  padding: 0;
  cursor: pointer;
  display: block;
  transition: transform var(--t-fast);
}
.gamecard__inner {
  position: absolute;
  inset: 0;
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: left;
}
.gamecard__provider { font: 600 10px Inter, system-ui; color: rgba(255, 255, 255, .55); letter-spacing: .06em; }
.gamecard__name { font: 700 clamp(13px, 1.5vw, 16px)/1.15 Inter, system-ui; color: var(--text); text-wrap: balance; }

.gamecard__hot {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--orange);
  color: var(--bg);
  font: 600 9px Inter, system-ui;
  padding: 3px 5px;
  border-radius: var(--r-sm);
}

.gamecard__over {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(15, 33, 46, .72);
  opacity: 0;
  transition: opacity var(--t-fast);
}
.gamecard__art:hover .gamecard__over,
.gamecard__art:focus-visible .gamecard__over { opacity: 1; }
.gamecard__play {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}
.gamecard__play svg { width: 18px; height: 18px; }
.gamecard__cta { font: 600 12px Inter, system-ui; color: var(--text); }

.gamecard__foot {
  padding-top: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font: 500 11px Inter, system-ui;
  color: var(--muted);
}
.gamecard__players {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.dot-green { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

/* ============================================================
   Live tables
   ============================================================ */
.grid-live {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 244px), 1fr));
  gap: 10px;
}
.livecard {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  padding: 0;
  transition: background var(--t-fast), border-color var(--t-fast);
}
.livecard:hover { background: var(--surface-2); border-color: var(--line-2); }
.livecard__art {
  position: relative;
  height: 104px;
  display: flex;
  align-items: flex-end;
  padding: 10px;
}
.livecard__name { font: 700 15px Inter, system-ui; color: var(--text); }
.pill {
  position: absolute;
  top: 8px;
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(15, 33, 46, .75);
  border-radius: var(--r-sm);
  padding: 4px 7px;
  font: 600 10px Inter, system-ui;
  color: var(--text);
}
.pill--l { left: 8px; }
.pill--r { right: 8px; color: var(--muted); font-variant-numeric: tabular-nums; }

.livecard__body { padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.livecard__row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dealer { display: flex; align-items: center; gap: 6px; font: 500 12px Inter, system-ui; color: var(--muted); min-width: 0; }
.dealer__av {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  border-radius: 50%;
  background: var(--surface-3);
  display: flex;
  align-items: center;
  justify-content: center;
  font: 600 9px Inter, system-ui;
  color: var(--text);
}
.limits { font: 600 12px Inter, system-ui; font-variant-numeric: tabular-nums; color: var(--text); white-space: nowrap; }
.results { display: flex; align-items: center; gap: 4px; overflow: hidden; }
.result {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  border-radius: var(--r-sm);
  font: 600 11px Inter, system-ui;
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ============================================================
   Bets table
   ============================================================ */
.bets__head, .bets__row {
  display: grid;
  grid-template-columns: 1.4fr 1fr .7fr 1fr .7fr 1fr;
  gap: 8px;
  padding: 10px 14px;
  align-items: center;
}
.bets__head {
  border-bottom: 1px solid var(--line);
  font: 600 12px Inter, system-ui;
  color: var(--muted);
}
.bets__row {
  border-bottom: 1px solid rgba(47, 69, 83, .5);
  font: 500 13px Inter, system-ui;
  color: var(--text);
  padding-block: 9px;
  animation: fadeIn 300ms var(--ease);
  transition: background var(--t-fast);
}
.bets__row:hover { background: var(--surface-2); }
.bets__row:last-child { border-bottom: 0; }

.bets__game { display: flex; align-items: center; gap: 8px; min-width: 0; }
.bets__swatch { width: 18px; height: 18px; flex: 0 0 18px; border-radius: var(--r-sm); }
.bets__user { color: var(--muted); }
.ta-r { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.c-muted { color: var(--muted); }
.c-accent { color: var(--accent); }

@media (max-width: 899px) {
  .bets__head, .bets__row { grid-template-columns: 1.3fr 1fr 1fr 1fr; }
  .col-time, .col-mult { display: none; }
}
@media (max-width: 519px) {
  .bets__head, .bets__row { grid-template-columns: 1.4fr 1fr 1fr; padding-inline: 10px; }
  .col-user { display: none; }
}

/* ============================================================
   Game view (Dice / Limbo / Mines)
   ============================================================ */
.gameboard {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
}
.gameboard__controls {
  background: var(--surface);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}
.gameboard__stage {
  background: var(--bg);
  padding: clamp(18px, 3vw, 28px) clamp(12px, 2vw, 28px);
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: clamp(280px, 40vh, 420px);
}

@media (max-width: 859px) {
  .gameboard { grid-template-columns: 1fr; }
  .gameboard__stage { order: -1; }
}

.dice { width: 100%; max-width: 560px; display: flex; flex-direction: column; gap: 26px; align-items: center; }
.dice__roll {
  font: 700 clamp(34px, 6vw, 46px) Inter, system-ui;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  transition: color var(--t-fast);
}
.dice__roll.is-win { color: var(--accent); }
.dice__roll.is-loss { color: var(--red); }
.dice__bar { position: relative; width: 100%; height: 10px; border-radius: 5px; }
.dice__marker {
  position: absolute;
  top: -9px;
  transform: translateX(-50%);
  width: 12px;
  height: 28px;
  border-radius: var(--r-xs);
  background: #fff;
  transition: left 220ms var(--ease);
}
.dice__scale {
  width: 100%;
  display: flex;
  justify-content: space-between;
  font: 600 12px Inter, system-ui;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.limbo {
  font: 700 clamp(40px, 9vw, 62px) Inter, system-ui;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  transition: color var(--t-fast);
}
.limbo.is-win { color: var(--accent); }
.limbo.is-loss { color: var(--red); }

.mines { width: 100%; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.mines__grid {
  width: 100%;
  max-width: 380px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: clamp(6px, 1.5vw, 8px);
}
.mines__tile {
  width: 100%;
  aspect-ratio: 1;
  background: var(--surface-2);
  color: var(--surface-2);
  border: 0;
  border-radius: var(--r-sm);
  font: 700 clamp(14px, 3.4vw, 18px) Inter, system-ui;
  cursor: pointer;
  transition: background var(--t-fast), transform var(--t-fast), color var(--t-fast);
}
.mines__tile:hover:not(:disabled) { background: var(--surface-3); transform: translateY(-2px); }
.mines__tile.is-gem { color: var(--accent); }
.mines__tile.is-bomb { background: var(--red); color: #fff; }
.mines__tile:disabled { cursor: default; }
.mines__mult { font: 600 13px Inter, system-ui; font-variant-numeric: tabular-nums; color: var(--muted); }
.mines__mult b { color: var(--text); }

/* ============================================================
   Sports
   ============================================================ */
.sports {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 10px;
  align-items: start;
}
.matchlist { display: flex; flex-direction: column; gap: 8px; min-width: 0; }

.match {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color var(--t-fast);
}
.match:hover { border-color: var(--line-2); }
.match__meta { display: flex; align-items: center; gap: 8px; font: 500 11px Inter, system-ui; color: var(--muted); }
.match__live { display: flex; align-items: center; gap: 5px; color: var(--red); font-weight: 600; }
.match__start { margin-left: auto; font-variant-numeric: tabular-nums; }
.match__teams { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.match__names { display: flex; flex-direction: column; gap: 4px; min-width: 0; font: 600 clamp(13px, 1.5vw, 14px) Inter, system-ui; }
.match__scores {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: right;
  font: 600 14px Inter, system-ui;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}
.match__odds { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }

.odd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  background: var(--surface-2);
  border: 0;
  border-radius: var(--r-sm);
  padding: 10px 12px;
  cursor: pointer;
  transition: background var(--t-fast);
}
.odd:hover { background: var(--surface-3); }
.odd__label { font: 600 12px Inter, system-ui; color: var(--muted); }
.odd__price { font: 600 13px Inter, system-ui; font-variant-numeric: tabular-nums; color: var(--text); }
.odd.is-active { background: var(--surface-3); }
.odd.is-active .odd__price { color: var(--accent); }

.slip { position: sticky; top: calc(var(--topbar-h) + 12px); }
.slip__head { padding: 12px 14px; border-bottom: 1px solid var(--line); font: 600 14px Inter, system-ui; }
.slip__body { padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.slip__row { display: flex; justify-content: space-between; gap: 8px; font: 600 12px Inter, system-ui; color: var(--muted); }
.slip__row b { color: var(--text); font-variant-numeric: tabular-nums; }
.slip__empty { padding: 28px 16px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.slip__empty svg { width: 26px; height: 26px; color: var(--line-2); }
.slip__close { display: none; }

@media (max-width: 1023px) {
  .sports { grid-template-columns: 1fr; }
  .slip {
    position: fixed;
    left: 0;
    right: 0;
    bottom: var(--tabbar-h);
    z-index: 60;
    border-radius: var(--r-lg) var(--r-lg) 0 0;
    border-bottom: 0;
    box-shadow: var(--shadow-pop);
    animation: sheetIn 220ms var(--ease);
    padding-bottom: env(safe-area-inset-bottom);
    max-height: 70dvh;
    overflow-y: auto;
  }
  .slip.is-empty { display: none; }
  .slip__head { display: flex; align-items: center; justify-content: space-between; }
  .slip__close { display: inline-flex; }
}

/* ============================================================
   Promotions / VIP / Challenges / Providers / Affiliate
   ============================================================ */
.grid-promos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 268px), 1fr));
  gap: 10px;
}
.promo { display: flex; flex-direction: column; transition: border-color var(--t-fast); }
.promo:hover { border-color: var(--line-2); }
.promo__art { height: 110px; display: flex; align-items: flex-end; padding: 12px; }
.promo__tag {
  background: rgba(15, 33, 46, .72);
  border-radius: var(--r-sm);
  padding: 4px 8px;
  font: 600 10px Inter, system-ui;
  letter-spacing: .06em;
}
.promo__body { padding: 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.promo__title { font: 600 15px Inter, system-ui; }
.promo__text { font: 400 13px/1.5 Inter, system-ui; color: var(--muted); flex: 1; text-wrap: pretty; }
.promo__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 4px; }
.promo__ends { font: 500 11px Inter, system-ui; font-variant-numeric: tabular-nums; color: var(--dim); }

.grid-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 160px), 1fr));
  gap: 10px;
}
.stat { padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.stat__k { font: 600 12px Inter, system-ui; color: var(--muted); }
.stat__v { font: 600 18px Inter, system-ui; font-variant-numeric: tabular-nums; }

.grid-benefits {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr));
  gap: 10px;
}
.benefit { padding: 14px; display: flex; gap: 10px; align-items: flex-start; }
.benefit svg { flex: 0 0 18px; width: 18px; height: 18px; margin-top: 1px; color: var(--accent); }
.benefit__t { font: 600 13px Inter, system-ui; }
.benefit__b { font: 400 12px/1.5 Inter, system-ui; color: var(--muted); text-wrap: pretty; }

.vipcard { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.vipcard__head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.vipcard__tier {
  width: 40px;
  height: 40px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font: 700 13px Inter, system-ui;
  color: var(--orange);
}
.vipcard__pct { margin-left: auto; font: 600 13px Inter, system-ui; font-variant-numeric: tabular-nums; color: var(--accent); }

.progress { height: 8px; border-radius: var(--r-sm); background: var(--bg); overflow: hidden; }
.progress--thin { height: 6px; border-radius: 3px; }
.progress__fill { height: 100%; background: var(--accent); transition: width 250ms var(--ease); }

.tierline { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.tierline::-webkit-scrollbar { display: none; }
.tierpill {
  background: var(--surface-2);
  color: var(--muted);
  border-radius: var(--r-sm);
  padding: 7px 12px;
  font: 600 12px Inter, system-ui;
  white-space: nowrap;
}
.tierpill.is-current { background: var(--surface-3); color: var(--text); }

.challenge {
  padding: 14px;
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  transition: border-color var(--t-fast);
}
.challenge:hover { border-color: var(--line-2); }
.challenge__art { width: 36px; height: 36px; flex: 0 0 36px; border-radius: var(--r-sm); }
.challenge__main { flex: 1; min-width: 180px; display: flex; flex-direction: column; gap: 6px; }
.challenge__row { display: flex; justify-content: space-between; gap: 8px; font: 600 13px Inter, system-ui; }
.challenge__row span:last-child { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.challenge__end { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.challenge__prize { font: 600 13px Inter, system-ui; font-variant-numeric: tabular-nums; color: var(--accent); }

.grid-providers {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr));
  gap: 10px;
}
.provcard {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 16px 14px;
  height: 92px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  cursor: pointer;
  text-align: left;
  transition: background var(--t-fast), transform var(--t-fast);
}
.provcard:hover { background: var(--surface-2); transform: translateY(-2px); }
.provcard__n { font: 600 14px Inter, system-ui; }
.provcard__c { font: 500 12px Inter, system-ui; font-variant-numeric: tabular-nums; color: var(--muted); }

.aff__head, .aff__row {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 8px;
  padding: 10px 14px;
  align-items: center;
}
.aff__head { border-bottom: 1px solid var(--line); font: 600 12px Inter, system-ui; color: var(--muted); }
.aff__row { border-bottom: 1px solid rgba(47, 69, 83, .5); font: 500 13px Inter, system-ui; transition: background var(--t-fast); }
.aff__row:last-child { border-bottom: 0; }
.aff__row:hover { background: var(--surface-2); }

.empty {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: clamp(28px, 6vw, 48px) 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}
.empty svg { width: 34px; height: 34px; color: var(--line-2); }
.empty__t { font: 600 14px Inter, system-ui; }
.empty__b { font: 400 13px Inter, system-ui; color: var(--muted); max-width: 360px; text-wrap: pretty; }

/* ============================================================
   UI kit page
   ============================================================ */
.grid-kit {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: 10px;
}
.kit { padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.kit__t { font: 600 13px Inter, system-ui; color: var(--muted); }
.kit__row { display: flex; flex-wrap: wrap; gap: 8px; }
.err { font: 400 12px Inter, system-ui; color: var(--red); }

.tooltipwrap { display: flex; justify-content: center; padding-top: 26px; }
.tooltip { position: relative; }
.tooltip__bubble {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 6px 10px;
  font: 500 12px Inter, system-ui;
}
.tooltip__anchor { border-bottom: 1px dashed var(--line-2); font: 500 13px Inter, system-ui; color: var(--muted); }

.alertline {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface-2);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  font: 600 13px Inter, system-ui;
}
.alertline span { font: 500 12px Inter, system-ui; font-variant-numeric: tabular-nums; color: var(--muted); }

.sk {
  border-radius: var(--r-sm);
  background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 50%, var(--surface-2) 100%);
  background-size: 320px 100%;
  animation: shimmer 1.2s linear infinite;
}
.sk--art { width: 76px; height: 101px; flex: 0 0 76px; border-radius: var(--r-md); }
.sk--line { height: 12px; }

/* ============================================================
   Footer
   ============================================================ */
.sitefoot {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 22px var(--pad-x) 32px;
  margin-top: var(--gap);
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.provrow { display: flex; flex-wrap: wrap; gap: 8px; }
.provrow span {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 9px 14px;
  font: 600 12px Inter, system-ui;
  color: var(--muted);
  transition: color var(--t-fast);
}
.provrow span:hover { color: var(--text); }

.footcols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 18px;
}
.footcol { display: flex; flex-direction: column; gap: 8px; }
.footcol > span { font: 600 13px Inter, system-ui; }
.footcol a { font: 400 13px Inter, system-ui; color: var(--muted); }
.footcol a:hover { color: var(--text); }

.fairbox {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px;
}
.fairbox > svg { flex: 0 0 20px; width: 20px; height: 20px; color: var(--accent); }
.fairbox__txt { display: flex; flex-direction: column; gap: 2px; min-width: 180px; flex: 1; }
.fairbox__txt b { font: 600 13px Inter, system-ui; }
.fairbox__txt span { font: 400 12px Inter, system-ui; color: var(--muted); text-wrap: pretty; }

.legal {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}
.legal__l { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.legal__age {
  border: 1px solid var(--line);
  border-radius: 50%;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  font: 700 11px Inter, system-ui;
  color: var(--muted);
}
.legal__txt { font: 400 12px/1.5 Inter, system-ui; color: var(--muted); max-width: 620px; text-wrap: pretty; }
.socials { display: flex; gap: 6px; }
.socials span {
  width: 32px;
  height: 32px;
  border-radius: var(--r-sm);
  background: var(--surface);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font: 600 11px Inter, system-ui;
  color: var(--muted);
  transition: background var(--t-fast), color var(--t-fast);
}
.socials span:hover { background: var(--surface-3); color: var(--text); }

/* ============================================================
   Mobile tab bar
   ============================================================ */
.tabbar { display: none; }

[data-nav="drawer"] {
  --tabbar-h: calc(58px + env(safe-area-inset-bottom));
}
[data-nav="drawer"] .tabbar {
  position: sticky;
  bottom: 0;
  z-index: 45;
  display: flex;
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar__btn {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 9px 0 10px;
  background: transparent;
  border: 0;
  color: var(--muted);
  font: 600 10px Inter, system-ui;
  cursor: pointer;
  transition: color var(--t-fast);
}
.tabbar__btn svg { width: 20px; height: 20px; }
.tabbar__btn.is-active { color: var(--text); }
.tabbar__btn:active { background: var(--surface-2); }

/* ============================================================
   Popover / modal / toasts
   ============================================================ */
.popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 85;
  width: 340px;
  max-width: calc(100vw - 20px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-pop);
  animation: dropIn 150ms var(--ease);
}
.popover__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  font: 600 14px Inter, system-ui;
}
.popover__body { max-height: min(360px, 50dvh); overflow-y: auto; }
.popover__foot { padding: 10px 14px; border-top: 1px solid var(--line); }

.notif {
  width: 100%;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  text-align: left;
  padding: 12px 14px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(47, 69, 83, .6);
  cursor: pointer;
  transition: background var(--t-fast);
}
.notif:hover { background: var(--surface-3); }
.notif.is-unread { background: var(--surface); }
.notif__ico {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  border-radius: var(--r-sm);
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
}
.notif__ico svg { width: 15px; height: 15px; }
.notif__txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.notif__t { font: 600 13px Inter, system-ui; }
.notif__b { font: 400 12px/1.45 Inter, system-ui; color: var(--muted); text-wrap: pretty; }
.notif__time { font: 500 11px Inter, system-ui; font-variant-numeric: tabular-nums; color: var(--dim); }
.notif__dot { flex: 0 0 7px; width: 7px; height: 7px; margin-top: 6px; border-radius: 50%; background: var(--accent); }

@media (max-width: 559px) {
  .popover {
    position: fixed;
    top: auto;
    left: 8px;
    right: 8px;
    bottom: calc(var(--tabbar-h) + 8px);
    width: auto;
    max-width: none;
    animation: sheetIn 220ms var(--ease);
  }
}

.modal { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal__scrim { position: absolute; inset: 0; background: rgba(15, 33, 46, .74); backdrop-filter: blur(2px); }
.modal__box {
  position: relative;
  width: 100%;
  max-width: 440px;
  max-height: min(90dvh, 720px);
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-pop);
  animation: dropIn 180ms var(--ease);
}
.modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  font: 600 15px Inter, system-ui;
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 1;
}
.modal__body { padding: 14px 16px; display: flex; flex-direction: column; gap: 14px; }

@media (max-width: 559px) {
  .modal { padding: 0; align-items: flex-end; }
  .modal__box {
    max-width: none;
    border-radius: var(--r-lg) var(--r-lg) 0 0;
    border-bottom: 0;
    max-height: 92dvh;
    animation: sheetIn 240ms var(--ease);
    padding-bottom: env(safe-area-inset-bottom);
  }
}

.selectrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  cursor: pointer;
  transition: border-color var(--t-fast);
}
.selectrow:hover { border-color: var(--line-2); }
.selectrow > span:first-child { display: flex; align-items: center; gap: 8px; font: 600 13px Inter, system-ui; }
.selectrow svg { width: 12px; height: 12px; color: var(--muted); }

.qrblock { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.qr {
  flex: 0 0 108px;
  height: 108px;
  border-radius: var(--r-sm);
  background: var(--bg);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.qr svg { width: 42px; height: 42px; color: var(--line-2); }
.qr span { font: 500 10px Inter, system-ui; color: var(--dim); }
.qrblock__side { flex: 1; min-width: 170px; display: flex; flex-direction: column; gap: 6px; }
.hint { font: 400 11px/1.5 Inter, system-ui; color: var(--muted); text-wrap: pretty; }

.toasts {
  position: fixed;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  right: 16px;
  bottom: 16px;
  width: 320px;
}
[data-nav="drawer"] .toasts {
  left: 10px;
  right: 10px;
  width: auto;
  bottom: calc(var(--tabbar-h) + 12px);
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-sm);
  padding: 11px 12px;
  animation: toastIn 200ms var(--ease);
  pointer-events: auto;
  box-shadow: var(--shadow-pop);
}
.toast.is-out { animation: toastIn 160ms var(--ease) reverse forwards; }
.toast > svg { flex: 0 0 16px; width: 16px; height: 16px; margin-top: 1px; }
.toast__msg { flex: 1; min-width: 0; font: 600 13px/1.4 Inter, system-ui; text-wrap: pretty; }
.toast button { flex: 0 0 18px; width: 18px; height: 18px; display: flex; align-items: center; justify-content: center; background: transparent; border: 0; border-radius: var(--r-xs); color: var(--muted); cursor: pointer; transition: background var(--t-fast); }
.toast button:hover { background: var(--surface-3); color: var(--text); }
.toast button svg { width: 11px; height: 11px; }

/* ============================================================
   Responsive rules
   ============================================================ */
@media (max-width: 1023px) {
  .hide-md { display: none !important; }
}
/* Phones: every control is sized to the 44px minimum touch target. */
@media (max-width: 699px) {
  .hide-sm { display: none !important; }
  :root { --topbar-h: 60px; }
  .topbar { gap: 6px; padding: 0 8px; }
  .avatar { margin-left: 0; width: 40px; height: 40px; flex: 0 0 40px; font-size: 13px; }
  .iconbtn { width: 44px; height: 44px; flex: 0 0 44px; }
  .iconbtn svg { width: 23px; height: 23px; }
  .topbar__burger { width: 46px; height: 46px; flex: 0 0 46px; margin-left: -4px; }
  .topbar__burger svg { width: 26px; height: 26px; stroke-width: 2; }
  .btn { height: 44px; }
  .btn--sm { height: 40px; }
  .btn--square { width: 44px; flex: 0 0 44px; }
  .tile { height: 72px; }
  .balance { height: 40px; }
  .nav-item { min-height: 46px; }
  .seg__btn { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; }
  .chip { min-height: 40px; padding-inline: 14px; display: inline-flex; align-items: center; }
  .field input { min-height: 44px; }
  .tabbar__btn svg { width: 22px; height: 22px; }
  .iconbtn--sm, .iconbtn--xs { width: 38px; height: 38px; flex: 0 0 38px; }
  .iconbtn--sm svg, .iconbtn--xs svg { width: 18px; height: 18px; }
  .toast button { flex: 0 0 28px; width: 28px; height: 28px; }
  .toast button svg { width: 13px; height: 13px; }
  .footcol { gap: 2px; }
  .footcol a { min-height: 40px; display: flex; align-items: center; }
}
/* Two columns below 480px: three left names wrapping mid-word. */
@media (max-width: 479px) {
  .grid-games { grid-template-columns: repeat(2, 1fr); }
  .rail > .gamecard { width: clamp(132px, 38vw, 168px); }
  .section__nav { display: none; }
}
@media (max-width: 419px) {
  .topbar__wallet { padding: 0 12px; }
  .balance__value { padding: 0 8px; }
  /* Burger + tabbar cover navigation; the wordmark is what gives way first. */
  .brand { display: none; }
}
/* Next to give way is the avatar, so the balance never has to truncate.
   The account page stays reachable from the drawer. */
@media (max-width: 379px) {
  .avatar { display: none; }
}

/* Coarse pointers: no hover-reveal, no hover transforms. The whole tile is already
   a button, so the play overlay is dropped rather than pinned over the title. */
@media (hover: none) {
  .gamecard__over { display: none; }
  .gamecard:hover { transform: none; filter: none; }
  .tile:hover, .provcard:hover { transform: none; }
  .gamecard__art:active { transform: scale(.97); }
  .tile:active, .provcard:active, .livecard:active { transform: scale(.98); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  .sidebar, .topbar, .tabbar, .toasts, .modal { display: none !important; }
}
