/* ==========================================================================
   BetKing — design system

   Identity: regalia. Obsidian-violet ground, champagne gold as the metal, and
   a crown motif that appears as structure (rank markers, section rules, the
   confidence arc) rather than as a sticker in the corner.

   Everything that moves does so for a reason: a score changing, a match going
   live, a value counting up on first paint. All of it is suppressed under
   prefers-reduced-motion.
   ========================================================================== */

:root {
  /* Ground — deep violet-black, not a tinted grey */
  --void:        #080511;
  --night:       #0E0A1C;
  --surface:     #150F28;
  --raised:      #1D1535;
  --raised-2:    #261C44;
  --line:        #2E2350;
  --line-soft:   #221935;
  --line-bright: #40318F;

  /* Metal */
  --gold:        #F0C46A;
  --gold-bright: #FFE1A3;
  --gold-deep:   #B98A2E;
  --gold-grad:   linear-gradient(135deg, #FFE1A3 0%, #F0C46A 45%, #C9962B 100%);
  --gold-glow:   rgba(240, 196, 106, 0.28);

  /* Royal */
  --royal:       #7C4DFF;
  --royal-soft:  #A78BFA;
  --royal-deep:  #4C1D95;
  --royal-glow:  rgba(124, 77, 255, 0.35);

  /* Outcomes */
  --win:         #34D8A6;
  --win-soft:    rgba(52, 216, 166, 0.13);
  --loss:        #FF5C77;
  --loss-soft:   rgba(255, 92, 119, 0.13);
  --live:        #FF8A3D;
  --live-soft:   rgba(255, 138, 61, 0.14);
  --void-c:      #7A6F99;
  --void-soft:   rgba(122, 111, 153, 0.13);

  /* Ink */
  --ink:         #F6F2FF;
  --ink-2:       #BCB2D9;
  --ink-3:       #8478A6;

  --glass:       rgba(29, 21, 53, 0.62);
  --glass-line:  rgba(255, 255, 255, 0.07);

  --font:    "Barlow", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --display: "Outfit", var(--font);

  --r-sm: 8px;
  --r:    14px;
  --r-lg: 22px;
  --r-xl: 30px;
  --r-pill: 999px;

  --rail: 244px;
  --pad: 30px;

  --lift:  0 18px 44px rgba(0, 0, 0, 0.5);
  --lift-2: 0 28px 70px rgba(0, 0, 0, 0.62);
  --ring-gold:  0 0 0 1px rgba(240, 196, 106, 0.34), 0 12px 40px var(--gold-glow);
  --ring-royal: 0 0 0 1px rgba(124, 77, 255, 0.38), 0 14px 44px var(--royal-glow);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

/* ------------------------------------------------------------------ reset */

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  background: var(--void);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: var(--gold); text-decoration: none; transition: color 0.16s var(--ease); }
a:hover { color: var(--gold-bright); }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection { background: rgba(124, 77, 255, 0.4); color: #fff; }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: var(--void); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--raised-2), var(--line));
  border-radius: var(--r-pill);
  border: 2px solid var(--void);
}
::-webkit-scrollbar-thumb:hover { background: var(--line-bright); }

/* ------------------------------------------- the aurora behind everything */

.aurora {
  position: fixed;
  inset: -30% -20%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(46rem 34rem at 12% 8%,  rgba(124, 77, 255, 0.20), transparent 62%),
    radial-gradient(38rem 30rem at 88% 2%,  rgba(240, 196, 106, 0.11), transparent 60%),
    radial-gradient(52rem 38rem at 68% 92%, rgba(76, 29, 149, 0.26),  transparent 64%),
    radial-gradient(30rem 26rem at 30% 78%, rgba(52, 216, 166, 0.07), transparent 60%);
  filter: blur(18px);
  animation: drift 34s var(--ease-in-out) infinite alternate;
}
@keyframes drift {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(-2.5%, 2%, 0) scale(1.07); }
  100% { transform: translate3d(2%, -2.5%, 0) scale(1.03); }
}

/* A faint grid, so the ground reads as a surface rather than a void. */
.aurora::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.021) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.021) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(70% 60% at 50% 40%, #000 20%, transparent 100%);
}

/* -------------------------------------------------------------- typography */

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.025em;
}
h1 { font-size: 1.9rem; }
h2 { font-size: 1.32rem; }
h3 { font-size: 1.06rem; }

.lede { color: var(--ink-2); font-size: 1.05rem; max-width: 60ch; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.small { font-size: 0.84rem; }
.tiny  { font-size: 0.75rem; }

.num {
  font-family: var(--display);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  letter-spacing: -0.03em;
}
.num-xl { font-family: var(--display); font-size: clamp(1.6rem, 2.9vw, 2.7rem); font-weight: 700; letter-spacing: -0.045em; line-height: 0.95; font-variant-numeric: tabular-nums; }
.num-lg { font-family: var(--display); font-size: 1.85rem; font-weight: 700; letter-spacing: -0.035em; font-variant-numeric: tabular-nums; }

.gold-text {
  background: var(--gold-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.win-fg  { color: var(--win); }
.loss-fg { color: var(--loss); }
.live-fg { color: var(--live); }
.gold-fg { color: var(--gold); }

/* ------------------------------------------------------------------ crown */

.crown { display: inline-block; vertical-align: -0.12em; }
.crown path { fill: url(#crownGold); }

.mark {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-family: var(--display);
  font-size: 1.34rem;
  font-weight: 700;
  letter-spacing: -0.035em;
}
.mark .bet { color: var(--ink); }
.mark .king {
  background: var(--gold-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
/* One slow sweep of light across the wordmark. It is the only purely
   decorative motion in the product, and it is on the logo. */
.mark .sheen {
  position: relative;
  overflow: hidden;
}
.mark .sheen::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 38%, rgba(255,255,255,0.55) 50%, transparent 62%);
  transform: translateX(-120%);
  animation: sheen 7s var(--ease-in-out) infinite;
}
@keyframes sheen {
  0%, 72% { transform: translateX(-120%); }
  86%, 100% { transform: translateX(120%); }
}

/* ------------------------------------------------------------------ shell */

.shell { position: relative; z-index: 1; display: flex; min-height: 100vh; }

.rail {
  width: var(--rail);
  flex: 0 0 var(--rail);
  background: linear-gradient(180deg, rgba(21,15,40,0.94), rgba(8,5,17,0.97));
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border-right: 1px solid var(--line-soft);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 0 16px;
  z-index: 40;
}
.rail-mark { padding: 0 20px 20px; }

.nav { display: flex; flex-direction: column; gap: 3px; padding: 0 12px; overflow-y: auto; }
.nav-sep {
  margin: 18px 8px 10px;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  position: relative;
  padding-top: 14px;
}
.nav-sep::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, var(--line), transparent);
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  color: var(--ink-2);
  font-size: 0.92rem;
  font-weight: 500;
  overflow: hidden;
  transition: color 0.18s var(--ease), transform 0.18s var(--ease);
}
.nav-item::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(124,77,255,0.20), rgba(124,77,255,0.02));
  opacity: 0;
  transition: opacity 0.2s var(--ease);
}
.nav-item::after {
  content: "";
  position: absolute; left: 0; top: 50%;
  width: 3px; height: 0;
  background: var(--gold-grad);
  border-radius: 0 3px 3px 0;
  transform: translateY(-50%);
  transition: height 0.26s var(--ease);
}
.nav-item > * { position: relative; z-index: 1; }
.nav-item:hover { color: var(--ink); transform: translateX(2px); }
.nav-item:hover::before { opacity: 0.55; }
.nav-item.on { color: var(--ink); font-weight: 600; }
.nav-item.on::before { opacity: 1; }
.nav-item.on::after { height: 58%; }

.nav-ico { width: 17px; text-align: center; opacity: 0.85; font-size: 0.95rem; }
.nav-item.on .nav-ico { opacity: 1; }

.pip {
  margin-left: auto;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  background: var(--raised-2);
  color: var(--ink-2);
}
.pip.hot {
  background: var(--live-soft);
  color: var(--live);
  box-shadow: 0 0 0 1px rgba(255,138,61,0.3);
  animation: breathe 2.4s var(--ease-in-out) infinite;
}
.pip.alert { background: var(--loss-soft); color: var(--loss); }
@keyframes breathe {
  0%, 100% { box-shadow: 0 0 0 1px rgba(255,138,61,0.3), 0 0 0 0 rgba(255,138,61,0.34); }
  60%      { box-shadow: 0 0 0 1px rgba(255,138,61,0.3), 0 0 0 7px rgba(255,138,61,0); }
}

.rail-foot { margin-top: auto; padding: 16px 16px 0; }

.plan-card {
  display: block;
  position: relative;
  padding: 14px;
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: linear-gradient(150deg, rgba(124,77,255,0.14), rgba(29,21,53,0.5));
  overflow: hidden;
  transition: transform 0.22s var(--ease), box-shadow 0.22s var(--ease);
}
.plan-card:hover { transform: translateY(-2px); box-shadow: var(--ring-royal); }
.plan-card.crowned {
  border-color: rgba(240,196,106,0.36);
  background: linear-gradient(150deg, rgba(240,196,106,0.16), rgba(29,21,53,0.55));
}
.plan-card.crowned:hover { box-shadow: var(--ring-gold); }
.plan-card .pc-title {
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.95rem;
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 3px;
}
.plan-card .pc-sub { font-size: 0.78rem; color: var(--ink-2); }

/* ------------------------------------------------------------------- main */

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

.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 16px;
  padding: 17px var(--pad);
  background: rgba(8, 5, 17, 0.72);
  backdrop-filter: blur(20px) saturate(1.3);
  -webkit-backdrop-filter: blur(20px) saturate(1.3);
  border-bottom: 1px solid var(--line-soft);
}
.topbar h1 { font-size: 1.34rem; }
.topbar-sub { color: var(--ink-3); font-size: 0.83rem; margin-top: 1px; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 9px; }

.page { padding: var(--pad); max-width: none; width: 100%; }
.stack > * + * { margin-top: 30px; }

/* Section headings carry a small crown rule rather than an all-caps label. */
.sec {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 15px;
}
.sec h2 { font-size: 1.12rem; }
.sec .rule {
  flex: 1; height: 1px;
  background: linear-gradient(90deg, var(--line), transparent);
}
.sec .note { color: var(--ink-3); font-size: 0.8rem; }

/* ------------------------------------------------------- entrance motion */

[data-rise] {
  opacity: 0;
  transform: translateY(16px);
}
.ready [data-rise] {
  animation: rise 0.62s var(--ease) forwards;
  animation-delay: calc(var(--i, 0) * 65ms);
}
@keyframes rise {
  to { opacity: 1; transform: translateY(0); }
}

/* ----------------------------------------------------------------- glass */

.glass {
  position: relative;
  border-radius: var(--r-lg);
  background: var(--glass);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  border: 1px solid var(--glass-line);
  box-shadow: var(--lift);
  overflow: hidden;
}
/* A hairline of light along the top edge — the thing that stops a dark panel
   from reading as a flat rectangle. */
.glass::before {
  content: "";
  position: absolute; top: 0; left: 12%; right: 12%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
}

.panel { position: relative; border-radius: var(--r-lg); background: var(--surface);
         border: 1px solid var(--line-soft); overflow: hidden; }
.panel-head {
  display: flex; align-items: center; gap: 11px;
  padding: 15px 19px;
  border-bottom: 1px solid var(--line-soft);
  background: linear-gradient(180deg, rgba(255,255,255,0.035), transparent);
}
.panel-head h3 { font-size: 1rem; }
.panel-head .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.panel-body { padding: 19px; }
.panel-body.flush { padding: 0; }

.grid { display: grid; gap: 20px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(285px, 1fr)); }
.g4 { grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); }

/* ----------------------------------------------------------- stat blocks */

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
@media (min-width: 1200px) {
  .stats { grid-template-columns: repeat(5, 1fr); }
}

/* The running-total chart lives in its own full-width panel so the stat cells
   above can auto-fit to the full row without phantom columns keeping a gap
   open on wide screens. */
.spark-panel {
  margin-top: 16px;
  padding: 20px 22px;
  border-radius: var(--r-lg);
  background: linear-gradient(155deg, rgba(37,28,68,0.6), rgba(21,15,40,0.5));
  border: 1px solid var(--line-soft);
}
.spark-panel .k {
  font-size: 0.76rem; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-3); font-weight: 600;
}

.stat {
  position: relative;
  padding: 20px 22px;
  border-radius: var(--r-lg);
  background: linear-gradient(155deg, rgba(37,28,68,0.8), rgba(21,15,40,0.6));
  border: 1px solid var(--line-soft);
  overflow: hidden;
  transition: transform 0.26s var(--ease), box-shadow 0.26s var(--ease), border-color 0.26s var(--ease);
}
.stat::after {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(18rem 10rem at 100% 0%, rgba(124,77,255,0.16), transparent 70%);
  opacity: 0; transition: opacity 0.3s var(--ease);
}
.stat:hover {
  transform: translateY(-3px);
  border-color: rgba(124,77,255,0.32);
  box-shadow: var(--lift-2);
}
.stat:hover::after { opacity: 1; }
.stat .k { font-size: 0.78rem; color: var(--ink-3); margin-bottom: 7px; position: relative; z-index: 1; }
.stat .v { position: relative; z-index: 1; white-space: nowrap; }
.stat .s { font-size: 0.77rem; color: var(--ink-3); margin-top: 4px; position: relative; z-index: 1; }
.stat.accent { border-color: rgba(240,196,106,0.28); }
.stat.accent::after { background: radial-gradient(18rem 10rem at 100% 0%, rgba(240,196,106,0.16), transparent 70%); }

/* ------------------------------------------------- the scoreboard element */

.board {
  position: relative;
  border-radius: var(--r-lg);
  background:
    radial-gradient(28rem 14rem at 50% -30%, rgba(124,77,255,0.22), transparent 70%),
    linear-gradient(170deg, rgba(37,28,68,0.86), rgba(14,10,28,0.94));
  border: 1px solid var(--line);
  padding: 20px;
  overflow: hidden;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
}
.board:hover { transform: translateY(-4px); box-shadow: var(--lift-2); border-color: rgba(124,77,255,0.4); }
.board.is-live { border-color: rgba(255,138,61,0.42); }
.board.is-live::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(24rem 12rem at 50% 0%, rgba(255,138,61,0.16), transparent 70%);
  animation: pulseGlow 3.4s var(--ease-in-out) infinite;
}
@keyframes pulseGlow { 0%,100% { opacity: 0.45; } 50% { opacity: 1; } }
.board > * { position: relative; z-index: 1; }

.board-top {
  display: flex; align-items: center; gap: 10px;
  font-size: 0.76rem; color: var(--ink-3);
  margin-bottom: 16px;
}
.board-top .comp { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.board-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 14px;
}
.board-team { display: flex; flex-direction: column; gap: 8px; align-items: center; text-align: center; }
.board-team .badge {
  width: 46px; height: 46px;
  border-radius: 14px;
  display: grid; place-items: center;
  font-family: var(--display);
  font-weight: 700; font-size: 1.06rem;
  color: var(--ink);
  background: linear-gradient(145deg, var(--raised-2), var(--surface));
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.07);
}

/* Small team flags next to fixture names; initials badge when we cannot
   place the team (tennis, unknown leagues). */
.crest {
  width: 17px; height: 12px;
  border-radius: 2px;
  object-fit: cover;
  vertical-align: -1px;
  margin-right: 6px;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.12);
  display: inline-block;
}
.crest-fallback {
  display: inline-flex; align-items: center; justify-content: center;
  width: 17px; height: 17px;
  margin-right: 6px;
  border-radius: 50%;
  font-family: var(--display);
  font-size: 0.6rem; font-weight: 700; line-height: 1;
  color: var(--ink-2);
  background: linear-gradient(145deg, var(--raised-2), var(--surface));
  border: 1px solid var(--line);
  vertical-align: -3px;
}
.board-team .crest, .board-team .crest-fallback {
  width: 40px; height: 40px;
  margin-right: 0;
}
.board-team .crest { border-radius: 10px; object-fit: contain; }
.board-team .crest-fallback { width: 40px; height: 40px; font-size: 0.9rem; vertical-align: 0; }
/* Real team crest from the tracked provider page; the flag/initials badge is
   the fallback when the provider carries no image (or the image fails). */
.team-crest {
  width: 18px; height: 18px;
  border-radius: 4px;
  object-fit: contain;
  padding: 1px;
  vertical-align: -4px;
  background: rgba(255,255,255,0.92);
}
.board-team .team-crest {
  width: 40px; height: 40px;
  border-radius: 10px;
  padding: 3px;
  vertical-align: 0;
}
.board-team .nm {
  font-size: 0.88rem; font-weight: 600;
  line-height: 1.25;
  max-width: 13ch;
}

.board-score {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 4px;
}
a.score-link {
  text-decoration: none; color: inherit;
  display: inline-flex; align-items: center;
  border-radius: 12px;
  transition: background .18s var(--ease), box-shadow .18s var(--ease);
}
a.score-link:hover { background: var(--gold-soft); }
a.score-link .board-score { box-shadow: inset 0 0 0 1px transparent; border-radius: 12px; }
a.score-link:hover .board-score { box-shadow: inset 0 0 0 1px var(--gold); }
a.score-link .score-pill { box-shadow: inset 0 0 0 1px transparent; }
a.score-link:hover .score-pill { box-shadow: inset 0 0 0 1px var(--gold); }
.board-score .d {
  font-family: var(--display);
  font-size: 2.5rem; font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  min-width: 1.1ch;
  text-align: center;
}
.board-score .sep { color: var(--ink-3); font-size: 1.5rem; font-weight: 300; }
.board.is-live .board-score .d { color: var(--live); animation: scorePulse 2.2s var(--ease-in-out) infinite; }
@keyframes scorePulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.55; }
}

/* A goal is the single most important event in this product. When a digit
   changes it gets one decisive pop, not a subtle fade. */
.board-score .d.bumped { animation: bump 0.62s var(--ease); }
@keyframes bump {
  0%   { transform: scale(1); }
  32%  { transform: scale(1.34); color: var(--gold-bright); text-shadow: 0 0 22px var(--gold-glow); }
  100% { transform: scale(1); }
}

.board-clock {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 4px 11px;
  border-radius: var(--r-pill);
  font-size: 0.78rem; font-weight: 600;
  background: var(--raised);
  color: var(--ink-2);
  border: 1px solid var(--line);
}
.board-clock.ticking {
  background: var(--live-soft);
  color: var(--live);
  border-color: rgba(255,138,61,0.35);
}
.board-foot {
  margin-top: 16px; padding-top: 14px;
  border-top: 1px solid var(--line-soft);
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}

.dot-live {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--live); flex: 0 0 7px;
  position: relative;
}
.dot-live::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(255,138,61,0.6);
  animation: ripple 1.9s var(--ease-in-out) infinite;
}
@keyframes ripple {
  0%   { box-shadow: 0 0 0 0 rgba(255,138,61,0.6); }
  100% { box-shadow: 0 0 0 10px rgba(255,138,61,0); }
}
.live-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px 3px 8px; border-radius: 999px;
  background: var(--live-soft);
  border: 1px solid rgba(255,138,61,0.55);
  color: var(--live);
  font-size: 12px; font-weight: 800; letter-spacing: 1.2px;
  text-transform: uppercase;
}
.live-badge-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--live);
  animation: livePulse 1.1s var(--ease-in-out) infinite;
}
@keyframes livePulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.5); opacity: 0.55; }
}

/* ------------------------------------------------------------- pick cards */

.pick-card {
  position: relative;
  display: flex; flex-direction: column; gap: 14px;
  padding: 19px;
  border-radius: var(--r-lg);
  background: linear-gradient(160deg, rgba(37,28,68,0.72), rgba(14,10,28,0.86));
  border: 1px solid var(--line-soft);
  overflow: hidden;
  transition: transform 0.28s var(--ease), box-shadow 0.28s var(--ease), border-color 0.28s var(--ease);
}
.pick-card::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--gold-grad);
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.4s var(--ease);
}
.pick-card:hover { transform: translateY(-5px); box-shadow: var(--ring-gold); border-color: rgba(240,196,106,0.3); }
.pick-card:hover::before { transform: scaleX(1); }
.pick-card.crowned::before { transform: scaleX(1); }

.pc-fixture { font-size: 0.82rem; color: var(--ink-2); }
.pc-fixture strong { color: var(--ink); font-weight: 600; }
.pc-call {
  font-family: var(--display);
  font-size: 1.42rem; font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
}
.pc-row { display: flex; align-items: center; gap: 12px; }
.pc-foot {
  margin-top: auto; padding-top: 13px;
  border-top: 1px solid var(--line-soft);
  display: flex; align-items: center; gap: 10px;
  font-size: 0.78rem; color: var(--ink-3);
}

.odds-chip {
  display: inline-flex; align-items: baseline; gap: 3px;
  padding: 7px 13px;
  border-radius: var(--r-sm);
  background: linear-gradient(145deg, rgba(240,196,106,0.18), rgba(240,196,106,0.05));
  border: 1px solid rgba(240,196,106,0.32);
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.14rem;
  color: var(--gold-bright);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.odds-chip .at { font-size: 0.7rem; font-weight: 500; color: var(--gold-deep); }

/* Confidence is a proportion, so it reads as an arc. */
.ring { position: relative; width: 46px; height: 46px; flex: 0 0 46px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .track { fill: none; stroke: var(--raised-2); stroke-width: 4; }
.ring .arc {
  fill: none; stroke: url(#ringGold); stroke-width: 4; stroke-linecap: round;
  transition: stroke-dashoffset 1.1s var(--ease);
}
.ring.win .arc { stroke: var(--win); }
.ring.loss .arc { stroke: var(--loss); }
.ring .val {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-family: var(--display);
  font-size: 0.8rem; font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* ----------------------------------------------------------------- rows */

.rows { border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line-soft); background: var(--surface); }
.row {
  position: relative;
  display: grid;
  gap: 14px;
  align-items: center;
  padding: 15px 19px 15px 22px;
  border-bottom: 1px solid var(--line-soft);
  transition: background 0.2s var(--ease), transform 0.2s var(--ease);
}
.row:last-child { border-bottom: 0; }
.row::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--line);
  transition: box-shadow 0.24s var(--ease);
}
.row:hover { background: rgba(124,77,255,0.07); }
.row.won::before  { background: var(--win);  box-shadow: 0 0 14px rgba(52,216,166,0.45); }
.row.lost::before { background: var(--loss); box-shadow: 0 0 14px rgba(255,92,119,0.45); }
.row.voided::before { background: var(--void-c); }
.row.livey::before  { background: var(--live); box-shadow: 0 0 16px rgba(255,138,61,0.55); }
.row.open::before { background: var(--gold-deep); }

.r-pick { grid-template-columns: 62px minmax(0,2fr) minmax(0,1.3fr) 84px 100px; }
.r-result { grid-template-columns: 78px minmax(0,2fr) minmax(0,1.4fr) 78px 106px; }
.rows-head {
  display: grid; gap: 14px;
  padding: 11px 19px 11px 22px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(255,255,255,0.028);
  font-size: 0.74rem; color: var(--ink-3); font-weight: 500;
}

.fix { min-width: 0; }
.fix .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 0.95rem; }
.fix .t .v { color: var(--ink-3); font-weight: 400; margin: 0 6px; font-size: 0.85em; }
.fix .l { font-size: 0.76rem; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.call { min-width: 0; }
.call .w { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.call .m { font-size: 0.75rem; color: var(--ink-3); }

.kick { font-size: 0.86rem; color: var(--ink-2); font-variant-numeric: tabular-nums; font-weight: 500; }

.score-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 11px;
  border-radius: var(--r-sm);
  background: var(--raised);
  border: 1px solid var(--line);
  font-family: var(--display);
  font-weight: 700; font-size: 0.98rem;
  font-variant-numeric: tabular-nums;
}
.score-pill.won  { background: var(--win-soft);  border-color: rgba(52,216,166,0.3);  color: var(--win); }
.score-pill.lost { background: var(--loss-soft); border-color: rgba(255,92,119,0.3);  color: var(--loss); }

/* ------------------------------------------------------------------ tags */

.tag {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.73rem; font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  white-space: nowrap;
}
.t-won   { background: var(--win-soft);  color: var(--win);    border-color: rgba(52,216,166,0.32); }
.t-lost  { background: var(--loss-soft); color: var(--loss);   border-color: rgba(255,92,119,0.32); }
.t-void  { background: var(--void-soft); color: var(--void-c); border-color: rgba(122,111,153,0.3); }
.t-live  { background: var(--live-soft); color: var(--live);   border-color: rgba(255,138,61,0.36); }
.t-open  { background: var(--raised);    color: var(--ink-2);  border-color: var(--line); }
.t-gold  { background: rgba(240,196,106,0.13); color: var(--gold); border-color: rgba(240,196,106,0.32); }
.t-royal { background: rgba(124,77,255,0.16); color: var(--royal-soft); border-color: rgba(124,77,255,0.34); }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.82rem; font-weight: 500;
  padding: 7px 14px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  color: var(--ink-2);
  background: var(--surface);
  transition: all 0.2s var(--ease);
}
.chip:hover { color: var(--ink); border-color: var(--line-bright); transform: translateY(-1px); }
.chip.on {
  color: #17102A;
  background: var(--gold-grad);
  border-color: transparent;
  font-weight: 600;
  box-shadow: 0 6px 18px var(--gold-glow);
}

/* --------------------------------------------------------------- buttons */

.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font);
  font-size: 0.9rem; font-weight: 600;
  padding: 10px 18px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--raised);
  color: var(--ink);
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease),
              border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.btn:hover { transform: translateY(-2px); border-color: var(--line-bright); background: var(--raised-2); color: var(--ink); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.42; cursor: not-allowed; transform: none; }

.btn-gold {
  background: var(--gold-grad);
  border-color: transparent;
  color: #1A1206;
  box-shadow: 0 8px 24px var(--gold-glow);
}
.btn-gold:hover { background: var(--gold-grad); color: #1A1206; box-shadow: 0 14px 34px var(--gold-glow); }
/* One sweep of light on hover — the button is the thing you want clicked. */
.btn-gold::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,0.55) 50%, transparent 60%);
  transform: translateX(-130%);
}
.btn-gold:hover::after { transition: transform 0.7s var(--ease); transform: translateX(130%); }

.btn-royal { background: linear-gradient(135deg, var(--royal), var(--royal-deep)); border-color: transparent; color: #fff; box-shadow: 0 8px 24px var(--royal-glow); }
.btn-royal:hover { color: #fff; box-shadow: 0 14px 34px var(--royal-glow); }
.btn-ghost { background: transparent; }
.btn-win  { background: var(--win-soft);  color: var(--win);  border-color: rgba(52,216,166,0.32); }
.btn-loss { background: var(--loss-soft); color: var(--loss); border-color: rgba(255,92,119,0.32); }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-block { width: 100%; }
.btn-row { display: flex; gap: 9px; flex-wrap: wrap; }
form.inline { display: inline; }

/* ----------------------------------------------------------------- forms */

label { display: block; font-size: 0.84rem; color: var(--ink-2); margin-bottom: 6px; font-weight: 500; }

input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="date"], input[type="search"], select, textarea {
  width: 100%;
  background: rgba(8,5,17,0.7);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--ink);
  padding: 11px 13px;
  font-family: inherit;
  font-size: 0.94rem;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--royal);
  box-shadow: 0 0 0 4px rgba(124,77,255,0.16);
}
input::placeholder { color: var(--ink-3); }
select { cursor: pointer; }
input[type="file"] { font-size: 0.86rem; color: var(--ink-2); padding: 9px; }

.field + .field { margin-top: 16px; }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 0.88rem; color: var(--ink-2); }
.check input { width: auto; margin-top: 3px; accent-color: var(--gold); }

/* ---------------------------------------------------------------- flashes */

.flashes { padding: 0 var(--pad); margin-top: 18px; display: flex; flex-direction: column; gap: 9px; }
.flash {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 13px 17px;
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 0.9rem;
  animation: slideIn 0.45s var(--ease);
  border-left: 3px solid var(--line-bright);
}
@keyframes slideIn {
  from { opacity: 0; transform: translateX(-14px); }
  to   { opacity: 1; transform: translateX(0); }
}
.flash-success { border-left-color: var(--win);  background: linear-gradient(90deg, var(--win-soft), var(--surface)); }
.flash-error   { border-left-color: var(--loss); background: linear-gradient(90deg, var(--loss-soft), var(--surface)); }
.flash-info    { border-left-color: var(--royal); background: linear-gradient(90deg, rgba(124,77,255,0.13), var(--surface)); }
.flash-warning { border-left-color: var(--live); background: linear-gradient(90deg, var(--live-soft), var(--surface)); }

/* ------------------------------------------------------------------ lock */

/* A locked pick shows its shape and nothing else. The prediction was never
   sent to the browser — this is a placeholder, not a blur over real text. */
.locked {
  position: relative;
  border-radius: var(--r-lg);
  border: 1px dashed rgba(240,196,106,0.34);
  background: linear-gradient(150deg, rgba(240,196,106,0.07), rgba(21,15,40,0.6));
  padding: 20px;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  overflow: hidden;
}
.locked::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(105deg, transparent 42%, rgba(240,196,106,0.09) 50%, transparent 58%);
  transform: translateX(-100%);
  animation: shimmer 3.6s linear infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }
.locked > * { position: relative; z-index: 1; }
.locked .lk-copy { flex: 1; min-width: 220px; }
.locked .lk-title { font-family: var(--display); font-weight: 700; font-size: 1.05rem; margin-bottom: 3px; }
.locked .lk-sub { font-size: 0.86rem; color: var(--ink-2); }

.ghost-bar {
  height: 10px; border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--raised-2), var(--raised), var(--raised-2));
  background-size: 200% 100%;
  animation: slide 1.9s linear infinite;
}
@keyframes slide { to { background-position: -200% 0; } }

/* ---------------------------------------------------------------- tables */

table.data { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
table.data th {
  text-align: left; font-size: 0.74rem; font-weight: 600;
  color: var(--ink-3); padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,0.028);
  position: sticky; top: 0; z-index: 2;
}
table.data td { padding: 12px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr { transition: background 0.16s var(--ease); }
table.data tbody tr:hover { background: rgba(124,77,255,0.07); }
table.data td.n, table.data th.n { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }

.rank-badge {
  width: 26px; height: 26px;
  display: inline-grid; place-items: center;
  border-radius: 8px;
  font-family: var(--display); font-weight: 700; font-size: 0.78rem;
  background: var(--raised-2); color: var(--ink-2);
}
.rank-badge.first {
  background: var(--gold-grad); color: #1A1206;
  box-shadow: 0 4px 14px var(--gold-glow);
}

/* ------------------------------------------------------------ pagination */

.pager { display: flex; align-items: center; gap: 10px; justify-content: center; padding: 20px; }
.pager .at { font-size: 0.84rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.pager .off { opacity: 0.3; pointer-events: none; }

.filters {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
  padding: 15px 18px;
  border-radius: var(--r-lg);
  border: 1px solid var(--line-soft);
  background: var(--surface);
}
.filters .spacer { flex: 1; }

/* ----------------------------------------------------------------- empty */

.empty { padding: 60px 26px; text-align: center; }
.empty .ico { font-size: 2.6rem; margin-bottom: 14px; opacity: 0.5; }
.empty h3 { margin-bottom: 8px; }
.empty p { max-width: 44ch; margin: 0 auto 20px; font-size: 0.92rem; color: var(--ink-2); }

/* ---------------------------------------------------------------- public */

.public { position: relative; z-index: 1; max-width: 1180px; margin: 0 auto; padding: 0 26px 90px; }
.public-bar {
  display: flex; align-items: center; gap: 18px;
  padding: 24px 0; margin-bottom: 40px;
}
.public-bar nav { margin-left: auto; display: flex; gap: 10px; align-items: center; }

.hero { padding: 42px 0 62px; text-align: center; }
.hero h1 {
  font-size: clamp(2.5rem, 7vw, 4.7rem);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1.02;
  max-width: 17ch;
  margin: 0 auto 22px;
}
.hero p { max-width: 54ch; margin: 0 auto 32px; color: var(--ink-2); font-size: 1.1rem; }
.hero-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; align-items: center; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 16px;
  border-radius: var(--r-pill);
  border: 1px solid rgba(240,196,106,0.3);
  background: rgba(240,196,106,0.08);
  font-size: 0.82rem; color: var(--gold);
  margin-bottom: 26px;
}

.prose { max-width: 66ch; }
.prose h2 { margin: 36px 0 12px; }
.prose p, .prose li { color: var(--ink-2); margin-bottom: 13px; }
.prose ul, .prose ol { padding-left: 24px; margin-bottom: 16px; }

.rg {
  border-radius: var(--r);
  border: 1px solid var(--line);
  border-left: 3px solid var(--live);
  background: linear-gradient(90deg, var(--live-soft), var(--surface));
  padding: 15px 19px;
  font-size: 0.87rem; color: var(--ink-2);
}
.rg strong { color: var(--ink); }

.foot {
  border-top: 1px solid var(--line-soft);
  padding: 26px var(--pad);
  color: var(--ink-3); font-size: 0.82rem;
  display: flex; gap: 18px; flex-wrap: wrap; align-items: center;
}
.foot .spacer { flex: 1; }

/* ------------------------------------------------------------------ auth */

.auth-wrap { position: relative; z-index: 1; min-height: 100vh; display: grid; place-items: center; padding: 46px 20px; }
.auth-card { width: 100%; max-width: 420px; }

/* ----------------------------------------------------------------- admin */

.admin .topbar { border-bottom-color: rgba(240,196,106,0.22); }
.mini-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); gap: 12px; }
.mini {
  padding: 14px 16px; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--line-soft);
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.mini:hover { transform: translateY(-2px); border-color: var(--line-bright); }
.mini .k { font-size: 0.74rem; color: var(--ink-3); }
.mini .v { font-family: var(--display); font-size: 1.5rem; font-weight: 700; margin-top: 3px; font-variant-numeric: tabular-nums; }
.mini.warn .v { color: var(--live); }
.mini.bad .v  { color: var(--loss); }
.mini.good .v { color: var(--win); }
.mini a { color: inherit; }

.hrow { display: flex; align-items: center; gap: 11px; padding: 12px 15px; border-bottom: 1px solid var(--line-soft); font-size: 0.87rem; }
.hrow:last-child { border-bottom: 0; }
.led { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 9px; background: var(--void-c); }
.led.healthy  { background: var(--win);  box-shadow: 0 0 10px rgba(52,216,166,0.6); }
.led.degraded { background: var(--live); box-shadow: 0 0 10px rgba(255,138,61,0.6); }
.led.failing  { background: var(--loss); box-shadow: 0 0 10px rgba(255,92,119,0.6); }
.led.cooling  { background: var(--gold); box-shadow: 0 0 10px var(--gold-glow); }
.led.idle, .led.off { background: var(--line-bright); }

.jrow { display: flex; align-items: center; gap: 13px; padding: 14px 16px; border-bottom: 1px solid var(--line-soft); }
.jrow:last-child { border-bottom: 0; }
.jrow .jn { font-weight: 600; }
.jrow .jd { font-size: 0.79rem; color: var(--ink-3); }
.jrow .jm { margin-left: auto; text-align: right; font-size: 0.77rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- mobile */

.tabbar { display: none; }
.rail-btn { display: none; }

@media (max-width: 960px) {
  :root { --pad: 17px; }

  .shell { flex-direction: column; }
  .rail {
    position: fixed; inset: 0 auto 0 0; z-index: 80;
    transform: translateX(-101%);
    transition: transform 0.34s var(--ease);
    box-shadow: var(--lift-2);
  }
  .rail.open { transform: translateX(0); }
  .scrim {
    position: fixed; inset: 0; z-index: 25;
    background: rgba(4,2,10,0.72);
    animation: fadeIn 0.26s var(--ease);
  }
  @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

  .rail-btn { display: inline-flex; }
  .main { padding-bottom: 72px; }
  .topbar { padding: 13px var(--pad); }
  .topbar h1 { font-size: 1.1rem; }
  .topbar-actions { flex-shrink: 0; }
  .topbar-actions .btn, .topbar-actions .chip { padding: 7px 11px; font-size: 0.79rem; white-space: nowrap; }

  .r-pick, .r-result, .rows-head { grid-template-columns: 1fr auto; gap: 7px 12px; }
  .rows-head { display: none; }
  .row { padding: 14px 16px 14px 19px; }
  .row .kick { grid-column: 1; font-size: 0.79rem; }
  .row .st { grid-column: 2; grid-row: 1; justify-self: end; }
  .row .fix { grid-column: 1 / -1; }
  .row .call { grid-column: 1; }
  .row .od { grid-column: 2; justify-self: end; }
  .row .sc { grid-column: 2; justify-self: end; }

  .tabbar {
    display: flex;
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 60;
    background: rgba(14,10,28,0.92);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    border-top: 1px solid var(--line-soft);
    padding: 7px 5px calc(7px + env(safe-area-inset-bottom));
  }
  .tabbar a {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 6px 2px; font-size: 0.67rem; color: var(--ink-3); font-weight: 500;
    position: relative;
    transition: color 0.2s var(--ease);
  }
  .tabbar a.on { color: var(--gold); }
  .tabbar a.on::before {
    content: ""; position: absolute; top: -7px; left: 50%;
    width: 22px; height: 2px; margin-left: -11px;
    background: var(--gold-grad); border-radius: var(--r-pill);
  }
  .tabbar .ti { font-size: 1.1rem; line-height: 1; }

  .board-score .d { font-size: 2rem; }
  .board-team .badge { width: 40px; height: 40px; font-size: 0.95rem; }
  .hero { padding: 26px 0 44px; }
  .sec .note { display: none; }
  .stats { grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: 12px; }
  .stat { padding: 16px 17px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  [data-rise] { opacity: 1; transform: none; }
  .aurora { animation: none; }
}

@media print {
  .rail, .topbar-actions, .tabbar, .filters, .pager, .aurora { display: none !important; }
  body { background: #fff; color: #000; }
}
