html {
  --radius: 18px;
  --radius-sm: 12px;
  --font-display: "Outfit", "Source Sans 3", sans-serif;
  --font-body: "Source Sans 3", "Segoe UI", sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  /* default = dark (overridden by data-theme) */
  --bg0: #050b12;
  --bg1: #0b1822;
  --ink: #eef6f8;
  --muted: #8fa3b0;
  --line: rgba(140, 210, 220, 0.14);
  --frost: #6fd8e8;
  --frost-strong: #9aecf5;
  --frost-dim: rgba(111, 216, 232, 0.14);
  --amber: #e4b45a;
  --amber-dim: rgba(228, 180, 90, 0.16);
  --panel: rgba(8, 18, 26, 0.78);
  --panel-solid: #0c1720;
  --topbar: rgba(5, 11, 18, 0.72);
  --danger: #ff7b72;
  --crest-bg: rgba(255, 255, 255, 0.08);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  --atmosphere-1: rgba(111, 216, 232, 0.18);
  --atmosphere-2: rgba(90, 140, 210, 0.14);
  --atmosphere-3: rgba(228, 180, 90, 0.08);
  --atmosphere-base: linear-gradient(160deg, #050b12 0%, #0b1822 46%, #071018 100%);
  --grid-line: rgba(255, 255, 255, 0.028);
  --drawer-bg: linear-gradient(160deg, rgba(18, 36, 48, 0.98), rgba(10, 22, 32, 0.98));
  --drawer-scrim: rgba(2, 6, 10, 0.55);
  --toast-bg: rgba(12, 24, 32, 0.95);
  --chip-bg: rgba(255, 255, 255, 0.04);
  --surface-soft: rgba(255, 255, 255, 0.03);
  --btn-primary-bg: linear-gradient(135deg, rgba(111, 216, 232, 0.22), rgba(78, 156, 255, 0.16));
  --btn-primary-border: rgba(111, 216, 232, 0.45);
  color-scheme: dark;
}

html[data-theme="dark"] {
  color-scheme: dark;
}

html[data-theme="light"] {
  --bg0: #eef3f6;
  --bg1: #dde7ee;
  --ink: #0f1b24;
  --muted: #3f5563;
  --line: rgba(18, 45, 60, 0.18);
  --frost: #0b6474;
  --frost-strong: #084f5c;
  --frost-dim: rgba(11, 100, 116, 0.14);
  --amber: #7a520c;
  --amber-dim: rgba(122, 82, 12, 0.14);
  --panel: rgba(255, 255, 255, 0.92);
  --panel-solid: #ffffff;
  --topbar: rgba(238, 243, 246, 0.94);
  --danger: #b33a32;
  --crest-bg: #ffffff;
  --shadow: 0 14px 32px rgba(15, 35, 50, 0.12);
  --atmosphere-1: rgba(11, 100, 116, 0.16);
  --atmosphere-2: rgba(55, 105, 165, 0.12);
  --atmosphere-3: rgba(122, 82, 12, 0.1);
  --atmosphere-base: linear-gradient(160deg, #f5f8fa 0%, #e3ecf2 48%, #eef3f6 100%);
  --grid-line: rgba(15, 35, 50, 0.07);
  --drawer-bg: linear-gradient(160deg, #ffffff, #eef3f6);
  --drawer-scrim: rgba(15, 30, 40, 0.4);
  --toast-bg: rgba(255, 255, 255, 0.98);
  --chip-bg: rgba(15, 40, 55, 0.05);
  --surface-soft: rgba(15, 40, 55, 0.04);
  --btn-primary-bg: linear-gradient(135deg, rgba(11, 100, 116, 0.18), rgba(40, 110, 180, 0.14));
  --btn-primary-border: rgba(11, 100, 116, 0.45);
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  background: var(--bg0);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  position: relative;
  overflow-x: hidden;
}

body.ticket-open {
  overflow: hidden;
}

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(980px 560px at 8% -8%, var(--atmosphere-1), transparent 58%),
    radial-gradient(720px 480px at 92% 6%, var(--atmosphere-2), transparent 55%),
    radial-gradient(760px 520px at 70% 110%, var(--atmosphere-3), transparent 50%),
    var(--atmosphere-base);
  animation: atmosphere-shift 18s ease-in-out infinite alternate;
}

.atmosphere::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.45;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(circle at 40% 20%, black 20%, transparent 78%);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 1.35rem;
  border-bottom: 1px solid var(--line);
  background: var(--topbar);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.12rem;
  letter-spacing: -0.03em;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 3px;
  background: linear-gradient(135deg, var(--frost), #4e9cff);
  box-shadow: 0 0 18px rgba(111, 216, 232, 0.55);
  animation: mark-glow 2.8s ease-in-out infinite;
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-size: 0.92rem;
}

.nav a {
  color: var(--frost);
  text-decoration: none;
}

.nav-ticket,
.btn-primary,
.btn-ghost,
.m-add,
.icon-btn,
.mode-switch button,
.ticket-fab,
.theme-switch {
  font-family: var(--font-body);
  cursor: pointer;
}

.theme-switch {
  appearance: none;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--frost-strong);
}

.theme-switch__track {
  position: relative;
  display: block;
  width: 3.1rem;
  height: 1.7rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--frost-dim);
  transition: background 200ms ease, border-color 200ms ease;
}

.theme-switch__thumb {
  position: absolute;
  top: 50%;
  left: 0.18rem;
  width: 1.28rem;
  height: 1.28rem;
  border-radius: 50%;
  background: var(--panel-solid);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
  transform: translateY(-50%);
  transition: transform 220ms var(--ease);
}

.theme-switch__icon {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.55;
  pointer-events: none;
}

.theme-switch__icon--moon { left: 0.38rem; }
.theme-switch__icon--sun { right: 0.38rem; }

html[data-theme="light"] .theme-switch__thumb {
  transform: translate(1.35rem, -50%);
}

html[data-theme="light"] .theme-switch__track {
  background: color-mix(in srgb, var(--frost) 18%, white);
  border-color: color-mix(in srgb, var(--frost) 35%, transparent);
}

.nav-ticket {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid rgba(111, 216, 232, 0.35);
  background: rgba(111, 216, 232, 0.08);
  color: var(--frost-strong);
  border-radius: 999px;
  padding: 0.4rem 0.75rem;
  transition: transform 180ms var(--ease), background 180ms ease, border-color 180ms ease;
}

.nav-ticket:hover {
  transform: translateY(-1px);
  background: rgba(111, 216, 232, 0.14);
}

.badge {
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: var(--amber);
  color: #1a1205;
  font-size: 0.72rem;
  font-weight: 700;
  display: inline-grid;
  place-items: center;
}

.nav-meta { color: var(--muted); }

.shell {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 6.5rem;
}

.hero, .league-hero {
  margin-bottom: 2.2rem;
}

.hero-kicker,
.eyebrow {
  margin: 0 0 0.55rem;
  color: var(--frost);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.7rem;
  font-weight: 600;
}

.hero-brand {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 750;
  font-size: clamp(2.4rem, 6.5vw, 4.2rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.league-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2rem, 5vw, 3.25rem);
  letter-spacing: -0.035em;
}

.league-hero__row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.hero-lead {
  margin: 0.95rem 0 0;
  max-width: 38rem;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.55;
}

.hero-note {
  margin: 0.75rem 0 0;
  max-width: 42rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.3rem;
}

.sync-form { margin: 0; }

.sync-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background: color-mix(in srgb, var(--bg0) 72%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.sync-overlay[hidden] {
  display: none !important;
}

.sync-overlay__panel {
  width: min(22rem, 100%);
  padding: 1.25rem 1.35rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--panel);
  box-shadow: var(--shadow);
  text-align: center;
}

.sync-overlay__title {
  margin: 0;
  font-family: Outfit, sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.sync-overlay__hint {
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.4;
}

.sync-overlay__track {
  position: relative;
  margin-top: 1rem;
  height: 0.42rem;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--line) 80%, transparent);
}

.sync-overlay__bar {
  position: absolute;
  inset: 0 auto 0 0;
  width: 42%;
  border-radius: inherit;
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--frost) 55%, transparent),
    var(--frost-strong),
    color-mix(in srgb, var(--frost) 55%, transparent)
  );
  animation: sync-slide 1.15s var(--ease) infinite;
}

body.is-syncing {
  overflow: hidden;
  cursor: progress;
}

body.is-syncing .btn-primary:disabled,
body.is-syncing .btn-ghost:disabled {
  opacity: 0.65;
  cursor: wait;
  transform: none;
}

.btn-primary,
.btn-ghost {
  appearance: none;
  border-radius: 999px;
  padding: 0.72rem 1.15rem;
  font-weight: 600;
  font-size: 0.92rem;
  transition: transform 180ms var(--ease), background 180ms ease, border-color 180ms ease;
}

.btn-primary {
  border: 1px solid var(--btn-primary-border);
  background: var(--btn-primary-bg);
  color: var(--frost-strong);
}

.btn-ghost {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
}

.btn-primary:hover,
.btn-ghost:hover {
  transform: translateY(-1px);
}

.flash {
  margin: 0.9rem 0 0;
  color: var(--amber);
  font-size: 0.92rem;
}

.back {
  display: inline-block;
  margin-bottom: 1rem;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
}

.back:hover { color: var(--frost); }

.panel-head h2,
.ticket-drawer h2,
.ticket-summary h3,
.market-group h3 {
  margin: 0;
  font-family: var(--font-display);
  letter-spacing: -0.02em;
}

.panel-sub {
  color: var(--muted);
  font-size: 0.84rem;
}

.sport-tree {
  display: grid;
  gap: 1rem;
}

.sport-node {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
}

.sport-summary {
  list-style: none;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.9rem;
  align-items: center;
  padding: 1rem 1.15rem;
  cursor: pointer;
  user-select: none;
}

.sport-summary::-webkit-details-marker { display: none; }

.sport-icon {
  width: 3.25rem;
  height: 3.25rem;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: var(--frost-strong);
  background: var(--crest-bg);
  border: 1px solid var(--line);
  flex-shrink: 0;
  overflow: hidden;
  padding: 0.15rem;
}

.sport-icon img,
.sport-icon svg {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
}

.sport-copy {
  display: grid;
  gap: 0.15rem;
}

.sport-copy strong {
  font-family: var(--font-display);
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.sport-copy span,
.sport-count {
  color: var(--muted);
  font-size: 0.86rem;
}

.league-tree {
  list-style: none;
  margin: 0;
  padding: 0 0.85rem 0.95rem 3.2rem;
  display: grid;
  gap: 0.55rem;
  position: relative;
}

.league-tree::before {
  content: "";
  position: absolute;
  left: 1.55rem;
  top: 0.1rem;
  bottom: 1.1rem;
  width: 2px;
  background: linear-gradient(180deg, var(--frost), transparent);
  opacity: 0.45;
}

.league-tree li {
  position: relative;
  animation: rise 650ms var(--ease) both;
  animation-delay: calc(var(--i, 0) * 70ms);
}

.league-tree li::before {
  content: "";
  position: absolute;
  left: -1.35rem;
  top: 50%;
  width: 0.9rem;
  height: 2px;
  background: var(--frost);
  opacity: 0.35;
}

.league-link {
  position: relative;
  display: grid;
  grid-template-columns: 2.75rem minmax(0, 1fr) auto;
  grid-template-areas:
    "crest name go"
    "crest meta go";
  gap: 0.15rem 0.8rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-solid);
  color: inherit;
  text-decoration: none;
  transition: border-color 180ms ease, transform 220ms var(--ease), box-shadow 220ms ease;
}

.league-link:hover {
  border-color: color-mix(in srgb, var(--frost) 55%, transparent);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.league-name {
  grid-area: name;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.08rem;
}

.league-meta {
  grid-area: meta;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  color: var(--muted);
  font-size: 0.86rem;
}

.league-go {
  grid-area: go;
  align-self: center;
  color: var(--frost);
  opacity: 0.7;
  transition: transform 200ms var(--ease), opacity 200ms ease;
}

.league-link:hover .league-go {
  transform: translateX(4px);
  opacity: 1;
}

.crest {
  grid-area: crest;
  box-sizing: border-box;
  width: 2.5rem;
  height: 2.5rem;
  max-width: 2.5rem;
  max-height: 2.5rem;
  object-fit: contain;
  object-position: center;
  border-radius: 8px;
  background: var(--crest-bg);
  padding: 0.2rem;
  align-self: center;
  justify-self: center;
  overflow: hidden;
}

.crest--sm {
  width: 1.55rem;
  height: 1.55rem;
  max-width: 1.55rem;
  max-height: 1.55rem;
  border-radius: 6px;
  padding: 0.12rem;
}
.crest--xs {
  width: 1.15rem;
  height: 1.15rem;
  max-width: 1.15rem;
  max-height: 1.15rem;
  border-radius: 4px;
  padding: 0.05rem;
}
.crest--fallback {
  display: grid;
  place-items: center;
  color: var(--frost-strong);
  font-size: 0.8rem;
  font-weight: 700;
}

.league-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.league-crest {
  box-sizing: border-box;
  width: 2.75rem;
  height: 2.75rem;
  max-width: 2.75rem;
  max-height: 2.75rem;
  object-fit: contain;
  object-position: center;
  border-radius: 10px;
  background: var(--crest-bg);
  padding: 0.2rem;
  overflow: hidden;
  flex-shrink: 0;
}

.pred-match--crests {
  grid-template-columns: 3.1rem minmax(0, 1fr) auto minmax(0, 1fr);
}

.team-line,
.team--crest,
.teams--crest {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}

.source-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.source-pill.live {
  background: rgba(111, 216, 232, 0.14);
  color: var(--frost-strong);
}

.source-pill.sample {
  background: rgba(228, 180, 90, 0.14);
  color: var(--amber);
}

.panel {
  margin-top: 1.25rem;
  padding: 1.15rem 1.2rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

.panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.pred-list {
  display: grid;
  gap: 1rem;
}

.match-card {
  padding: 1.05rem 0.15rem 0.35rem;
  border-top: 1px solid var(--line);
  animation: rise 700ms var(--ease) both;
  animation-delay: calc(var(--i, 0) * 55ms);
}

.match-card__head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: baseline;
  flex-wrap: wrap;
}

.pred-match {
  display: grid;
  grid-template-columns: 3.1rem 1fr auto 1fr;
  gap: 0.4rem;
  align-items: baseline;
}

.pred-match time,
.pred-match .vs,
.xg {
  color: var(--muted);
  font-size: 0.86rem;
}

.lineups-toggle {
  color: var(--frost);
  font-size: 0.86rem;
  text-decoration: none;
  border-bottom: 1px dotted color-mix(in srgb, var(--frost) 50%, transparent);
}

.lineups-toggle:hover { color: var(--frost-strong); }

.match-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin: 0.15rem 0 0.45rem;
}

.inline-form { display: inline; margin: 0; }

.btn-compact {
  padding: 0.42rem 0.75rem !important;
  font-size: 0.8rem !important;
}

.lineup-source {
  margin: 0 0 0.35rem;
  font-size: 0.8rem;
  color: var(--muted);
  width: 100%;
}

.lineup-source a { color: var(--frost); }

.lineup-box {
  display: grid;
  gap: 0.65rem;
  margin: 0.15rem 0 0.35rem;
  padding: 0.7rem 0.8rem;
  border-radius: var(--radius-sm);
  border: 1px dashed color-mix(in srgb, var(--amber) 45%, var(--line));
  background: var(--amber-dim);
}

.lineup-side {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.55rem;
  align-items: center;
}

.lineup-side strong {
  font-size: 0.9rem;
  margin-right: 0.15rem;
}

.lineup-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel-solid);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
}

.lineup-pill.is-neg { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); }
.lineup-pill.is-pos { color: var(--frost-strong); border-color: color-mix(in srgb, var(--frost) 35%, var(--line)); }

.lineup-absences {
  list-style: none;
  margin: 0.15rem 0 0;
  padding: 0;
  width: 100%;
  display: grid;
  gap: 0.2rem;
}

.lineup-absences li {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.6rem;
  font-size: 0.8rem;
}

.abs-name { font-weight: 600; }
.abs-meta { color: var(--muted); }

.top-tips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.9rem 0 0.75rem;
}

.tip-chip {
  appearance: none;
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(228, 180, 90, 0.28);
  background: var(--amber-dim);
  color: var(--amber);
  font-size: 0.78rem;
  transition: transform 180ms var(--ease), background 180ms ease, border-color 180ms ease;
}

.tip-chip:hover {
  transform: translateY(-1px);
  border-color: rgba(228, 180, 90, 0.5);
}

.tip-chip.is-on-ticket {
  background: rgba(111, 216, 232, 0.14);
  border-color: rgba(111, 216, 232, 0.4);
  color: var(--frost-strong);
}

.tip-code { font-weight: 700; }
.tip-stats { opacity: 0.85; font-variant-numeric: tabular-nums; }
.tip-add {
  padding-left: 0.35rem;
  border-left: 1px solid rgba(255,255,255,0.15);
  font-weight: 600;
}

.market-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.market-group h3 {
  margin-bottom: 0.45rem;
  font-size: 0.92rem;
}

.market-group ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
}

.market-row {
  display: grid;
  grid-template-columns: 1.35fr 1fr auto auto;
  grid-template-areas:
    "main bar stats add"
    "hint hint hint add";
  gap: 0.28rem 0.5rem;
  align-items: center;
  padding: 0.5rem 0.55rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.02);
  transition: border-color 160ms ease, background 160ms ease, transform 180ms var(--ease);
}

.market-row:hover {
  transform: translateY(-1px);
  border-color: rgba(111, 216, 232, 0.2);
}

.market-row.hot {
  border-color: rgba(228, 180, 90, 0.24);
  background: rgba(228, 180, 90, 0.05);
}

.m-main { grid-area: main; display: flex; gap: 0.4rem; align-items: baseline; }
.m-code {
  min-width: 2.35rem;
  font-weight: 700;
  color: var(--frost);
  font-variant-numeric: tabular-nums;
}
.m-label { font-size: 0.86rem; }
.m-bar {
  grid-area: bar;
  height: 6px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  overflow: hidden;
}
.m-bar span {
  display: block;
  height: 100%;
  width: var(--w);
  border-radius: inherit;
  background: linear-gradient(90deg, var(--frost), #b7f3ff);
  transform-origin: left center;
  animation: grow 750ms var(--ease) both;
}
.m-stats {
  grid-area: stats;
  display: grid;
  justify-items: end;
  font-variant-numeric: tabular-nums;
  font-size: 0.84rem;
}
.m-stats .odds { color: var(--muted); font-size: 0.76rem; }
.m-hint {
  grid-area: hint;
  color: var(--muted);
  font-size: 0.72rem;
}
.m-add {
  grid-area: add;
  appearance: none;
  border: 1px solid rgba(111, 216, 232, 0.28);
  background: rgba(111, 216, 232, 0.08);
  color: var(--frost-strong);
  border-radius: 999px;
  padding: 0.42rem 0.65rem;
  font-size: 0.74rem;
  font-weight: 600;
  white-space: nowrap;
  transition: background 160ms ease, transform 160ms var(--ease), border-color 160ms ease;
}

.m-add:hover {
  transform: scale(1.03);
  background: rgba(111, 216, 232, 0.16);
}

.m-add.is-on-ticket {
  border-color: rgba(228, 180, 90, 0.45);
  background: rgba(228, 180, 90, 0.14);
  color: var(--amber);
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
}

.elo-list, .result-list {
  list-style: none;
  margin: 0;
  padding: 0 0 0.55rem;
}

.elo-list li,
.result-list li {
  display: grid;
  gap: 0.6rem;
  align-items: center;
  padding: 0.55rem 0;
  border-top: 1px solid var(--line);
  font-size: 0.94rem;
}

.elo-list li { grid-template-columns: 1.5rem 1fr auto; }
.result-list li { grid-template-columns: 3rem 1fr auto; }

.rank, .result-list time { color: var(--muted); font-variant-numeric: tabular-nums; }
.elo, .score { font-variant-numeric: tabular-nums; font-weight: 600; }
.empty { color: var(--muted); font-size: 0.9rem; }

/* Ticket drawer */
.ticket-fab {
  position: fixed;
  right: 1.2rem;
  bottom: 1.2rem;
  z-index: 45;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--btn-primary-border);
  background: var(--drawer-bg);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.85rem 1.1rem;
  box-shadow: var(--shadow);
  transition: transform 200ms var(--ease), box-shadow 200ms ease;
}

.ticket-fab:hover { transform: translateY(-2px); }

.ticket-fab.pulse {
  animation: fab-pulse 650ms var(--ease);
}

.ticket-fab__icon {
  width: 0.85rem;
  height: 1.05rem;
  border: 1.5px solid var(--frost);
  border-radius: 3px;
  position: relative;
}

.ticket-fab__icon::before {
  content: "";
  position: absolute;
  left: 2px;
  right: 2px;
  top: 3px;
  height: 1.5px;
  background: var(--frost);
  box-shadow: 0 3px 0 var(--frost), 0 6px 0 var(--frost);
}

.ticket-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: var(--drawer-scrim);
  opacity: 0;
  pointer-events: none;
  transition: opacity 240ms ease;
}

body.ticket-open .ticket-backdrop {
  opacity: 1;
  pointer-events: auto;
}

.ticket-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 60;
  width: min(420px, 100vw);
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1.15rem 1.15rem 1.25rem;
  background: var(--panel-solid);
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow);
  transform: translateX(104%);
  transition: transform 320ms var(--ease);
  overflow: auto;
}

body.ticket-open .ticket-drawer {
  transform: translateX(0);
}

.ticket-drawer__head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 1rem;
}

.ticket-drawer h2 {
  font-size: 1.55rem;
}

.icon-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 999px;
  font-size: 1.3rem;
  line-height: 1;
}

.mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
  padding: 0.3rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
}

.mode-switch button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 0.55rem 0.7rem;
  font-weight: 600;
  transition: background 180ms ease, color 180ms ease;
}

.mode-switch button.is-active {
  background: rgba(111, 216, 232, 0.16);
  color: var(--frost-strong);
}

.mode-help,
.stake-note,
.summary-note,
.ticket-empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.auto-fill {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.55rem;
  align-items: end;
}

.auto-fill__count {
  display: grid;
  gap: 0.3rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.auto-fill__count input {
  width: 4.2rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(0,0,0,0.18);
  color: var(--ink);
  padding: 0.55rem 0.55rem;
  font: inherit;
}

.stake-field {
  display: grid;
  gap: 0.35rem;
  font-size: 0.84rem;
  color: var(--muted);
}

.stake-input {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.45rem 0.7rem;
  background: rgba(0,0,0,0.18);
}

.stake-input input {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 1.05rem;
  outline: none;
}

.slip-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.slip-item {
  position: relative;
  display: grid;
  gap: 0.25rem;
  padding: 0.75rem 2rem 0.75rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.03);
  animation: slip-in 280ms var(--ease) both;
}

.slip-item__match {
  display: grid;
  gap: 0.15rem;
}

.slip-item__match time {
  color: var(--muted);
  font-size: 0.75rem;
}

.slip-item__pick {
  display: flex;
  gap: 0.4rem;
  align-items: baseline;
  font-size: 0.9rem;
}

.slip-code {
  color: var(--frost);
  font-weight: 700;
}

.slip-item__meta {
  display: flex;
  gap: 0.7rem;
  color: var(--muted);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}

.slip-remove {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.2rem;
  cursor: pointer;
}

.slip-remove:hover { color: var(--danger); }

.ticket-summary {
  margin-top: auto;
  padding: 0.9rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(111, 216, 232, 0.22);
  background: rgba(111, 216, 232, 0.06);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.55rem;
  margin: 0.7rem 0;
}

.summary-label {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  margin-bottom: 0.2rem;
}

.ticket-drawer__actions {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 0.55rem;
}

.ticket-toast {
  position: fixed;
  left: 50%;
  bottom: 1.4rem;
  z-index: 80;
  transform: translateX(-50%) translateY(20px);
  padding: 0.7rem 1rem;
  border-radius: 999px;
  background: var(--toast-bg);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 0.86rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease, transform 220ms var(--ease);
  box-shadow: var(--shadow);
}

.ticket-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.reveal { animation: rise 650ms var(--ease) both; }
.reveal.delay { animation-delay: 120ms; }

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes grow {
  from { transform: scaleX(0.12); opacity: 0.35; }
  to { transform: scaleX(1); opacity: 1; }
}

@keyframes slip-in {
  from { opacity: 0; transform: translateX(12px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes fab-pulse {
  0% { transform: scale(1); }
  40% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

@keyframes mark-glow {
  0%, 100% { box-shadow: 0 0 12px rgba(111, 216, 232, 0.35); }
  50% { box-shadow: 0 0 22px rgba(111, 216, 232, 0.7); }
}

@keyframes atmosphere-shift {
  from { filter: hue-rotate(0deg) saturate(1); }
  to { filter: hue-rotate(8deg) saturate(1.08); }
}

@keyframes sync-slide {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(280%); }
}

@media (max-width: 860px) {
  .split,
  .market-grid {
    grid-template-columns: 1fr;
  }

  .league-tree { padding-left: 1.2rem; }
  .league-tree::before { left: 0.35rem; }
  .league-tree li::before { left: -0.55rem; width: 0.45rem; }

  .pred-match,
  .pred-match--crests {
    grid-template-columns: 3rem 1fr;
  }

  .pred-match .vs { display: none; }

  .market-row {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "main add"
      "stats add"
      "bar bar"
      "hint hint";
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }

  .ticket-fab span:nth-child(2) {
    display: none;
  }
}

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