/* AURUM Markets — Polymarket-inspired discovery × fintech density × spatial chrome */

:root {
  --bg: #07080c;
  --bg-2: #0c0e14;
  --panel: rgba(16, 18, 26, 0.82);
  --panel-2: rgba(22, 24, 34, 0.9);
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  --fill: rgba(255, 255, 255, 0.04);
  --fill-2: rgba(255, 255, 255, 0.07);
  --ink: rgba(255, 255, 255, 0.94);
  --muted: rgba(255, 255, 255, 0.55);
  --faint: rgba(255, 255, 255, 0.34);
  --blue: #0a84ff;
  --blue-2: #409cff;
  --blue-soft: rgba(10, 132, 255, 0.18);
  --green: #30d158;
  --red: #ff453a;
  --live: #ff453a;
  --r: 16px;
  --r-lg: 22px;
  --r-pill: 999px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.3, 0.5, 1);
  /* Modern type scale (fluid) */
  --fs-display: clamp(1.35rem, 1.05rem + 1.1vw, 1.9rem);
  --fs-h2: clamp(1.05rem, 0.95rem + 0.5vw, 1.3rem);
  --fs-odds: 1.02rem;
  --tracking-tight: -0.03em;
  /* Layout rhythm (theme.css overrides max width, gaps, ticket width) */
  --layout-max: 1400px;
  --ticket-width: 320px;
  --card-gap: 12px;
  --section-gap: 24px;
  --gutter-x: 1.25rem;
  --page-pad-top: 1rem;
  --page-pad-bottom: 3rem;
  --shell-gap: 1rem;
  --fab-clearance: 5.5rem;
  --topbar-height: 57px;
  --filter-sticky-top: var(--topbar-height);
  --ticket-sticky-top: calc(var(--topbar-height) + 1rem);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
html, body { min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  max-width: 100vw;
}
.ambient {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  filter: var(--ambient-filter, none);
  background:
    radial-gradient(90% 60% at 10% -10%, rgba(64,156,255,0.14), transparent 55%),
    radial-gradient(70% 50% at 100% 0%, rgba(94,92,230,0.08), transparent 50%),
    linear-gradient(180deg, #0b0d13, var(--bg) 40%);
}
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* —— Header —— */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.75rem 1rem;
  align-items: center;
  padding: 0.75rem var(--gutter-x);
  padding-top: calc(0.75rem + env(safe-area-inset-top, 0px));
  padding-left: max(var(--gutter-x), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter-x), env(safe-area-inset-right, 0px));
  background: var(--header-bg, rgba(8, 9, 13, 0.72));
  backdrop-filter: var(--chrome-blur, blur(22px) saturate(1.4));
  -webkit-backdrop-filter: var(--chrome-blur, blur(22px) saturate(1.4));
  border-bottom: 1px solid var(--surface-border, var(--line));
}
.brand { display: flex; align-items: center; gap: 0.6rem; }
.logo {
  width: 26px; height: 26px; border-radius: 9px;
  background: linear-gradient(145deg, var(--blue-2), var(--blue));
  box-shadow: var(--logo-shadow, 0 6px 18px var(--blue-soft)), inset 0 1px 0 rgba(255,255,255,0.35);
  position: relative;
}
.logo::after {
  content: ""; position: absolute; inset: 6px; border-radius: 5px;
  background: rgba(255,255,255,0.9); mask: radial-gradient(circle at 50% 42%, #000 38%, transparent 40%);
  -webkit-mask: radial-gradient(circle at 50% 42%, #000 38%, transparent 40%);
  opacity: 0.85;
}
.word {
  font-weight: 800; letter-spacing: 0.16em; font-size: 0.92rem; color: var(--ink);
  background: linear-gradient(180deg, var(--ink), var(--blue-2));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.tag {
  font-size: 0.62rem; color: var(--muted); letter-spacing: 0.14em; text-transform: uppercase;
  border: 1px solid var(--line); border-radius: var(--r-pill); padding: 0.15rem 0.55rem;
}
.search { display: block; width: min(560px, 100%); justify-self: center; position: relative; }
.search::before {
  content: ""; position: absolute; left: 0.95rem; top: 50%; width: 15px; height: 15px;
  transform: translateY(-50%); pointer-events: none; opacity: 0.5;
  background: currentColor; color: var(--muted);
  -webkit-mask: no-repeat center / contain url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2.2" stroke-linecap="round"><circle cx="11" cy="11" r="7"/><path d="m21 21-4.3-4.3"/></svg>');
  mask: no-repeat center / contain url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2.2" stroke-linecap="round"><circle cx="11" cy="11" r="7"/><path d="m21 21-4.3-4.3"/></svg>');
}
.search input {
  width: 100%; height: 42px; border-radius: var(--btn-radius, var(--r-pill));
  border: 1px solid var(--surface-border, var(--line));
  background: var(--fill);
  color: var(--ink); padding: 0 1rem 0 2.5rem; font: 500 0.9rem var(--font); outline: none;
  transition: border-color var(--dur, 160ms) var(--ease), box-shadow var(--dur, 160ms) var(--ease), background var(--dur, 160ms) var(--ease);
}
.search input::placeholder { color: var(--faint); }
.search input:focus { border-color: rgba(10,132,255,0.5); box-shadow: 0 0 0 4px var(--blue-soft); background: var(--fill-2); }
.top-meta { display: flex; align-items: center; gap: 0.55rem; flex-wrap: wrap; justify-content: flex-end; }
.lang-switcher {
  display: flex; gap: 0.25rem; flex-wrap: wrap; max-width: 100%;
}
.lang-btn {
  height: 32px; padding: 0 0.55rem; border-radius: var(--r-pill);
  border: 1px solid var(--line); background: var(--fill);
  color: var(--muted); font: 600 0.68rem var(--font); cursor: pointer;
  white-space: nowrap;
}
.lang-btn:hover { color: var(--ink); border-color: var(--line-2); }
.lang-btn.is-active {
  color: #fff; background: var(--blue); border-color: transparent;
}
.live-chip {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-size: 0.75rem; color: var(--muted);
  border: 1px solid var(--line); border-radius: var(--r-pill); padding: 0.35rem 0.7rem;
}
.live-chip i {
  width: 6px; height: 6px; border-radius: 50%; background: var(--live);
  box-shadow: 0 0 0 0 rgba(255,69,58,0.5); animation: pulse 2s ease-out infinite;
}
.live-chip b { color: var(--ink); font-weight: 650; }
@keyframes pulse { to { box-shadow: 0 0 0 8px transparent; } }

.icon-btn, .text-btn, .primary, .chip, .mkt-btn {
  font-family: var(--font); cursor: pointer;
  border: 1px solid var(--surface-border, var(--line));
  background: var(--fill); color: var(--ink);
  border-radius: var(--btn-radius, var(--r-pill));
}
.icon-btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  height: 36px; padding: 0 0.85rem; font-size: 0.78rem; font-weight: 600;
}
.icon-btn .badge, .fab span {
  min-width: 1.3rem; height: 1.3rem; border-radius: var(--r-pill);
  display: inline-grid; place-items: center; background: var(--blue); color: #fff;
  font-size: 0.68rem; padding: 0 0.3rem;
}
.text-btn { border: 0; background: transparent; color: var(--muted); font-size: 0.78rem; }
.text-btn:hover { color: var(--ink); }

/* —— Sport nav —— */
.sport-nav {
  display: flex; gap: 0.35rem;
  padding: 0.65rem var(--gutter-x) 0.4rem;
  padding-left: max(var(--gutter-x), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter-x), env(safe-area-inset-right, 0px));
  overflow-x: auto; scrollbar-width: none;
  border-bottom: 1px solid transparent;
}
.sport-nav::-webkit-scrollbar { display: none; }
.sport-nav button {
  flex: 0 0 auto; height: 34px; padding: 0 0.9rem;
  border-radius: var(--r-pill); border: 1px solid transparent;
  background: transparent; color: var(--muted); font: 600 0.8rem var(--font);
  letter-spacing: -0.01em; white-space: nowrap; cursor: pointer;
  transition: 160ms var(--ease);
}
.sport-nav button:hover { color: var(--ink); background: var(--fill); }
.sport-nav button.is-active {
  color: var(--ink); background: var(--fill-2); border-color: var(--line-2);
}

/* —— Date range —— */
.date-rail-wrap {
  border-bottom: 1px solid var(--surface-border, var(--line));
  background: var(--chrome-bg-light, rgba(8, 9, 13, 0.55));
}
.date-rail {
  display: flex; gap: 0.35rem;
  padding: 0.45rem var(--gutter-x) 0.55rem;
  padding-left: max(var(--gutter-x), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter-x), env(safe-area-inset-right, 0px));
  overflow-x: auto; scrollbar-width: none;
}
.date-rail::-webkit-scrollbar { display: none; }
.date-rail button {
  flex: 0 0 auto; height: 30px; padding: 0 0.75rem;
  border-radius: var(--r-pill); border: 1px solid var(--line);
  background: transparent; color: var(--muted);
  font: 600 0.74rem var(--font); cursor: pointer;
  transition: 150ms var(--ease);
}
.date-rail button:hover { color: var(--ink); background: var(--fill); }
.date-rail button.is-active {
  color: #fff; background: var(--blue); border-color: transparent;
}

/* —— Filter chips —— */
.filter-rail-wrap {
  position: sticky;
  top: var(--filter-sticky-top);
  z-index: 30;
  background: var(--chrome-bg, rgba(8, 9, 13, 0.78));
  backdrop-filter: var(--chrome-blur, blur(16px));
  -webkit-backdrop-filter: var(--chrome-blur, blur(16px));
  border-bottom: 1px solid var(--surface-border, var(--line));
}
.filter-rail {
  display: flex; gap: 0.4rem;
  padding: 0.65rem var(--gutter-x);
  padding-left: max(var(--gutter-x), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter-x), env(safe-area-inset-right, 0px));
  overflow-x: auto; scrollbar-width: none;
}
.filter-rail::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; height: 30px; padding: 0 0.75rem;
  font-size: 0.75rem; font-weight: 600; color: var(--muted);
  transition: 150ms var(--ease);
}
.chip:hover { color: var(--ink); }
.chip.is-active {
  color: #fff; background: var(--blue); border-color: transparent;
  box-shadow: 0 6px 18px var(--blue-soft);
}

/* —— Layout —— */
.page-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--ticket-width, 320px);
  gap: var(--shell-gap);
  align-items: start;
  max-width: min(var(--layout-max, 1400px), 100%);
  margin: 0 auto;
  padding: var(--page-pad-top) var(--gutter-x) var(--page-pad-bottom);
  padding-left: max(var(--gutter-x), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter-x), env(safe-area-inset-right, 0px));
  width: 100%;
  box-sizing: border-box;
}
.layout {
  display: block;
  min-width: 0;
  width: 100%;
  grid-column: 1;
}
body.layout-wide .page-shell {
  grid-template-columns: minmax(0, 1fr) calc(var(--ticket-width, 320px) + 40px);
}
body.hide-ticket .page-shell,
body.layout-feed .page-shell {
  grid-template-columns: minmax(0, 1fr);
}
.feed {
  min-width: 0;
  width: 100%;
  overflow: hidden;
}
.market-feed { margin-top: 0.25rem; }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
  margin-bottom: 0.9rem; position: relative; padding-left: 0.85rem;
}
.section-head::before {
  content: ""; position: absolute; left: 0; top: 0.15rem; bottom: 0.15rem; width: 3px;
  border-radius: 3px; background: linear-gradient(180deg, var(--blue-2), var(--blue));
}
.section-head h2 { font-size: var(--fs-h2); font-weight: 750; letter-spacing: var(--tracking-tight); }
.muted { color: var(--muted); font-size: 0.8rem; }

/* Featured horizontal */
.featured { margin-bottom: 1.5rem; }
.featured-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(260px, 300px);
  gap: var(--card-gap, 0.75rem);
  align-items: stretch;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 0.35rem;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.featured-track::-webkit-scrollbar,
.ticket-body::-webkit-scrollbar { width: 8px; height: 8px; }
.featured-track::-webkit-scrollbar-track,
.ticket-body::-webkit-scrollbar-track { background: transparent; }
.featured-track::-webkit-scrollbar-thumb,
.ticket-body::-webkit-scrollbar-thumb {
  background: var(--scroll-thumb, rgba(255, 255, 255, 0.16));
  border-radius: 999px;
}
.featured-track > .card {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}
.featured-track .markets {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.featured-track .market-rows .market-row:nth-child(n + 2) {
  display: none;
}

/* Feed groups */
.groups { display: flex; flex-direction: column; gap: 1.35rem; }
.group-head {
  display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.55rem;
  width: 100%; border: 0; background: transparent; color: inherit;
  text-align: left; cursor: pointer; padding: 0.15rem 0;
}
.group-head img { width: 18px; height: 18px; border-radius: 50%; }
.group-head h3 { font-size: 0.82rem; font-weight: 650; color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase; }
.group-head .chev { margin-left: auto; color: var(--faint); font-size: 0.7rem; transition: transform 160ms var(--ease); }
.group-section.is-collapsed .cards { display: none; }
.group-section.is-collapsed .chev { transform: rotate(-90deg); }
.fav-btn {
  border: 0; background: transparent; color: var(--faint); cursor: pointer;
  font-size: 0.85rem; line-height: 1; padding: 0.15rem;
}
.fav-btn.is-on { color: #ffd60a; }
.market-rows { display: flex; flex-direction: column; gap: 0.45rem; }
.market-row-label {
  font-size: 0.62rem; font-weight: 650; color: var(--faint);
  letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 0.2rem;
}
.cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--card-gap, 0.75rem);
  align-items: stretch;
}
.group-section {
  min-width: 0;
}

/* Event / market card */
.card {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  min-width: 0;
  max-width: 100%;
  padding: 1rem 1.1rem;
  border-radius: var(--r-lg);
  background: var(--surface-bg, var(--panel));
  border: 1px solid var(--surface-border, var(--line));
  box-shadow: var(--surface-shadow, var(--shadow));
  backdrop-filter: var(--surface-blur-filter, blur(18px));
  -webkit-backdrop-filter: var(--surface-blur-filter, blur(18px));
  transition: border-color 160ms var(--ease), transform 160ms var(--ease);
  overflow: hidden;
  position: relative;
  z-index: 0;
  container-type: inline-size;
  container-name: event-card;
}
.card:hover {
  border-color: var(--surface-border-strong, var(--line-2));
  transform: var(--card-hover-transform, translateY(-1px));
  z-index: 1;
}
@container event-card (max-width: 360px) {
  .markets:not(.markets-2up) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.card-top {
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
  font-size: 0.72rem; color: var(--faint);
}
.card-top .left { display: flex; align-items: center; gap: 0.4rem; min-width: 0; }
.card-top-actions { display: flex; align-items: center; gap: 0.45rem; }
.card-top img { width: 14px; height: 14px; border-radius: 50%; }
.pill-live {
  display: inline-flex; align-items: center; gap: 0.3rem;
  color: var(--live); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
}
.pill-live i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.teams { display: flex; flex-direction: column; gap: 0.55rem; }
.team {
  display: grid; grid-template-columns: 30px minmax(0, 1fr) auto;
  gap: 0.6rem; align-items: center;
}
.crest, .crest-ph {
  width: 30px; height: 30px; border-radius: 9px; object-fit: contain;
  background: var(--fill); border: 1px solid var(--line);
}
.crest-ph {
  display: grid; place-items: center; font-size: 0.68rem; font-weight: 800; color: var(--blue-2);
  background: var(--blue-soft);
}
.team strong { font-size: 0.95rem; font-weight: 650; letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team b {
  font-variant-numeric: tabular-nums; font-size: 1.08rem; font-weight: 750; min-width: 1.2ch; text-align: right;
}
.markets {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.4rem;
  width: 100%;
}
.markets.markets-2up {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.mkt-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  min-width: 0;
  max-width: 100%;
  min-height: 58px;
  padding: 0.5rem 0.55rem;
  border-radius: var(--mkt-radius, 12px);
  text-align: center;
  transition: transform var(--dur-fast, 130ms) var(--ease), background var(--dur, 160ms) var(--ease), box-shadow var(--dur, 160ms) var(--ease), border-color var(--dur, 160ms) var(--ease);
  touch-action: manipulation;
}
.mkt-btn span {
  font-size: 0.66rem;
  color: var(--muted);
  font-weight: 650;
  letter-spacing: 0.02em;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mkt-btn strong {
  font-size: var(--fs-odds);
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  max-width: 100%;
}
.market-rows,
.markets {
  min-width: 0;
  max-width: 100%;
}
.mkt-btn:hover:not(:disabled) { border-color: rgba(10,132,255,0.45); background: var(--blue-soft); transform: translateY(-1px); }
.mkt-btn:active:not(:disabled) { transform: translateY(0) scale(var(--active-scale, 0.98)); }
.mkt-btn.is-on {
  background: var(--blue); border-color: transparent; color: #fff;
  box-shadow: 0 8px 20px var(--blue-soft);
}
.mkt-btn.is-on span { color: rgba(255,255,255,0.78); }
.mkt-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.mkt-btn.flash-up { box-shadow: 0 0 0 1.5px var(--green); }
.mkt-btn.flash-down { box-shadow: 0 0 0 1.5px var(--red); }
/* directional odds tick */
.mkt-btn strong::after {
  content: ""; display: inline-block; width: 0; height: 0; margin-left: 0.28rem;
  vertical-align: middle; opacity: 0; transition: opacity var(--dur, 160ms) var(--ease);
}
.mkt-btn.flash-up strong::after {
  opacity: 1; border-left: 4px solid transparent; border-right: 4px solid transparent;
  border-bottom: 5px solid var(--green);
}
.mkt-btn.flash-down strong::after {
  opacity: 1; border-left: 4px solid transparent; border-right: 4px solid transparent;
  border-top: 5px solid var(--red);
}
.card-foot {
  display: flex; justify-content: space-between; align-items: center; gap: 0.5rem;
}
.more-btn {
  border: 0; background: transparent; color: var(--blue-2);
  font: 600 0.75rem var(--font); cursor: pointer;
}
.more-btn:hover { color: var(--ink); }
.status-line { font-size: 0.72rem; color: var(--faint); }

/* Ticket */
.ticket-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 44;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
body.hide-ticket .fab { display: none !important; }
body.hide-ticket .ticket { display: none !important; }
.ticket-head-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.ticket {
  grid-column: 2;
  position: sticky;
  top: var(--ticket-sticky-top);
  align-self: start;
  width: 100%;
  min-width: 0;
  max-height: calc(100vh - var(--ticket-sticky-top) - 1.5rem);
  border-radius: var(--r-lg);
  background: var(--surface-bg-2, var(--panel-2));
  border: 1px solid var(--surface-border-strong, var(--line-2));
  box-shadow: var(--surface-shadow, var(--shadow));
  backdrop-filter: var(--surface-blur-filter, blur(22px));
  -webkit-backdrop-filter: var(--surface-blur-filter, blur(22px));
  overflow: hidden;
  z-index: 1;
  display: flex;
  flex-direction: column;
}
.ticket-body {
  padding: 0.75rem 1rem;
  max-height: min(42vh, calc(100vh - var(--ticket-sticky-top) - 280px));
  overflow: auto;
  flex: 1 1 auto;
  min-height: 0;
}
.ticket-close {
  display: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem;
}
.ticket-head, .ticket-foot { padding: 0.9rem 1rem; }
.ticket-head {
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid var(--line);
}
.ticket-head h2 { font-size: 0.95rem; }
.ticket-empty { color: var(--muted); font-size: 0.85rem; line-height: 1.45; }
.pick {
  display: grid; gap: 0.2rem; padding: 0.7rem 0;
  border-bottom: 1px solid var(--line);
}
.pick:last-child { border-bottom: 0; }
.pick .meta { font-size: 0.7rem; color: var(--faint); }
.pick .sel { font-size: 0.88rem; font-weight: 650; }
.pick .row { display: flex; justify-content: space-between; align-items: center; }
.pick button {
  border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 0.85rem;
}
.stake {
  display: flex; justify-content: space-between; align-items: center; gap: 0.75rem;
  margin-bottom: 0.75rem; font-size: 0.8rem; color: var(--muted);
}
.stake input {
  width: 110px; height: 36px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--fill); color: var(--ink); padding: 0 0.7rem; font: 600 0.9rem var(--font);
}
.returns {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.9rem;
  padding: 0.6rem 0.75rem; border-radius: 12px;
  background: var(--fill); border: 1px solid var(--line);
  font-size: 0.8rem; color: var(--muted);
}
.returns strong {
  color: var(--ink); font-size: 1.15rem; font-weight: 800; font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.primary {
  width: 100%; height: 46px; border: 0; border-radius: var(--r-pill);
  background: linear-gradient(180deg, var(--blue-2), var(--blue));
  color: #fff; font-weight: 750; font-size: 0.9rem; letter-spacing: 0.01em;
  box-shadow: 0 10px 24px var(--blue-soft);
  transition: transform var(--dur, 160ms) var(--ease), box-shadow var(--dur, 160ms) var(--ease), filter var(--dur, 160ms) var(--ease);
}
.primary:hover:not(:disabled) { filter: brightness(1.06); transform: translateY(-1px); }
.primary:active:not(:disabled) { transform: translateY(0) scale(var(--active-scale, 0.98)); }
.primary:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; }
.fine { margin-top: 0.55rem; font-size: 0.68rem; color: var(--faint); line-height: 1.4; }

/* Skeletons / empty */
.skeletons { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--card-gap, 0.75rem); }
.sk {
  height: 176px; border-radius: var(--r-lg); border: 1px solid var(--line);
  background:
    linear-gradient(100deg, transparent 30%, var(--fill-2) 50%, transparent 70%),
    var(--fill);
  background-size: 220% 100%, 100% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}
@keyframes shimmer { to { background-position: -220% 0, 0 0; } }
.empty {
  text-align: center; padding: 3.25rem 1rem; color: var(--muted);
  border: 1px dashed var(--line); border-radius: var(--r-lg);
  background: var(--fill);
}
.empty h3 { color: var(--ink); margin-bottom: 0.4rem; font-size: 1.05rem; font-weight: 750; letter-spacing: var(--tracking-tight); }

/* Desk sheet */
.desk[hidden] { display: none; }
.desk { position: fixed; inset: 0; z-index: 80; }
.desk-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.55); backdrop-filter: blur(6px); }
.desk-panel {
  position: absolute; right: 0; top: 0; bottom: 0; width: min(720px, 100%);
  background: #0b0d13; border-left: 1px solid var(--line-2);
  display: flex; flex-direction: column; box-shadow: -20px 0 60px rgba(0,0,0,0.45);
  animation: slide 220ms var(--ease);
}
@keyframes slide { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.desk-bar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.85rem 1rem; border-bottom: 1px solid var(--line);
}
.desk-kicker { font-size: 0.68rem; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; }
.desk-bar h3 { font-size: 1rem; margin-top: 0.15rem; }
#deskFrame { flex: 1; width: 100%; border: 0; background: #000; }

.fab {
  display: none;
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 45;
  height: 48px;
  padding: 0 1rem;
  gap: 0.45rem;
  align-items: center;
  border-radius: var(--btn-radius, var(--r-pill));
  border: 0;
  background: linear-gradient(180deg, var(--blue-2), var(--blue));
  color: #fff;
  font-weight: 700;
  box-shadow: var(--fab-shadow, 0 12px 30px var(--blue-soft));
  transition: opacity 180ms var(--ease), transform 180ms var(--ease);
}

@media (min-width: 1101px) {
  body:not(.hide-ticket):not(.layout-feed) #ticketToggle {
    display: none;
  }
  .ticket-backdrop,
  .fab {
    display: none !important;
  }
  body:not(.hide-ticket):not(.layout-feed) .ticket {
    display: flex !important;
    position: sticky !important;
    top: var(--ticket-sticky-top) !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    grid-column: 2 !important;
    width: 100% !important;
    max-width: 100% !important;
    max-height: calc(100vh - var(--ticket-sticky-top) - 1.5rem) !important;
    z-index: 1 !important;
    border-radius: var(--r-lg) !important;
    transform: none !important;
    box-shadow: var(--surface-shadow, var(--shadow)) !important;
  }
}

@media (max-width: 1100px) {
  .page-shell {
    grid-template-columns: minmax(0, 1fr) !important;
    padding-bottom: calc(var(--fab-clearance) + env(safe-area-inset-bottom, 0px));
  }
  .layout {
    padding-bottom: 0;
  }
  .ticket {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    grid-column: auto;
    align-self: auto;
    width: 100%;
    max-width: none;
    z-index: 46;
    border-radius: 22px 22px 0 0;
    max-height: min(75dvh, 520px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    box-shadow: 0 -16px 48px rgba(0, 0, 0, 0.45);
    transform: none;
  }
  .ticket.is-open {
    display: flex;
    flex-direction: column;
  }
  .ticket.is-open .ticket-body {
    flex: 1;
    min-height: 0;
  }
  .ticket-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    min-height: 32px;
  }
  .ticket-backdrop {
    display: block;
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms var(--ease);
  }
  body.is-ticket-open .ticket-backdrop {
    opacity: 1;
    pointer-events: auto;
  }
  body.is-ticket-open {
    overflow: hidden;
  }
  .fab {
    display: inline-flex;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    right: calc(16px + env(safe-area-inset-right, 0px));
  }
  body.is-ticket-open .fab {
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px);
  }
  .cards { grid-template-columns: 1fr; }
  .skeletons { grid-template-columns: 1fr; }
  .filter-rail-wrap {
    position: relative;
    top: auto;
  }
  .featured-track {
    grid-auto-columns: minmax(240px, min(300px, 82vw));
    scroll-snap-type: x mandatory;
  }
  .featured-track .card { scroll-snap-align: start; }
  .desk-panel {
    width: 100%;
    max-width: 100%;
    border-left: 0;
    border-radius: 0;
  }
}

@media (max-width: 720px) {
  :root {
    --gutter-x: 0.85rem;
    --page-pad-top: 0.85rem;
    --page-pad-bottom: 2.5rem;
    --fab-clearance: 5rem;
  }
  .topbar {
    grid-template-columns: 1fr auto;
    gap: 0.6rem;
    padding: 0.65rem var(--gutter-x);
    padding-top: calc(0.65rem + env(safe-area-inset-top, 0px));
    padding-left: max(var(--gutter-x), env(safe-area-inset-left, 0px));
    padding-right: max(var(--gutter-x), env(safe-area-inset-right, 0px));
  }
  .search { grid-column: 1 / -1; justify-self: stretch; width: 100%; min-width: 0; }
  .brand .tag { display: none; }
  .sport-nav,
  .filter-rail,
  .date-rail {
    padding-left: max(var(--gutter-x), env(safe-area-inset-left, 0px));
    padding-right: max(var(--gutter-x), env(safe-area-inset-right, 0px));
  }
  .page-shell {
    padding-left: max(var(--gutter-x), env(safe-area-inset-left, 0px));
    padding-right: max(var(--gutter-x), env(safe-area-inset-right, 0px));
  }
  .live-chip { font-size: 0.7rem; padding: 0.3rem 0.55rem; }
  .icon-btn { min-height: 40px; }
  .top-meta { width: 100%; justify-content: flex-end; }
}

@media (max-width: 480px) {
  .topbar { gap: 0.45rem; }
  .word { font-size: 0.78rem; }
  .section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }
  .section-head h2 { font-size: 0.98rem; }
  .markets {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.35rem;
  }
  .mkt-btn {
    min-height: 44px;
    padding: 0.4rem 0.45rem;
    border-radius: 10px;
  }
  .mkt-btn span { font-size: 0.62rem; }
  .mkt-btn strong { font-size: 0.88rem; }
  .team strong { font-size: 0.85rem; }
  .card { padding: 0.8rem 0.85rem; gap: 0.7rem; }
  .featured-track { grid-auto-columns: minmax(240px, 88vw); }
  .sport-nav button { height: 36px; padding: 0 0.75rem; }
  .chip { height: 32px; }
  .fab {
    height: 44px;
    min-width: 44px;
    font-size: 0.82rem;
  }
  .desk-bar { padding: 0.75rem 0.85rem; }
  #deskFrame { min-height: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

body.theme-neomorphism .cards,
body.theme-brutalist .cards,
body.theme-cyber .cards {
  gap: calc(var(--card-gap, 0.75rem) + 6px);
}

/* RTL (Persian, Arabic) */
html[dir="rtl"] body { direction: rtl; }
html[dir="rtl"] .topbar,
html[dir="rtl"] .sport-nav,
html[dir="rtl"] .filter-rail,
html[dir="rtl"] .date-rail { direction: rtl; }
html[dir="rtl"] .search input,
html[dir="rtl"] .team strong { text-align: right; }
html[dir="rtl"] .card-top .left,
html[dir="rtl"] .group-head { flex-direction: row-reverse; }
html[dir="rtl"] .card-top-actions { flex-direction: row-reverse; }
html[dir="rtl"] .ticket-head,
html[dir="rtl"] .stake,
html[dir="rtl"] .returns { flex-direction: row-reverse; }
