/* ═══════════════════════════════════════════════════════════
   Ball Games Hub — design system
   Liquid glass · glossy balls · springy motion
   ═══════════════════════════════════════════════════════════ */

:root {
  /* season hues (overridden by seasons.js) */
  --h1: 330; --h2: 262; --h3: 195; --h4: 42;

  --bg: #f5f3ff;
  --bg-2: #ffffff;
  --ink: #1a1433;
  --ink-2: #554f72;
  --ink-3: #8a85a3;
  --line: rgba(40, 20, 110, .08);

  --glass-top: rgba(255, 255, 255, .62);
  --glass-bot: rgba(255, 255, 255, .22);
  --glass-rim: rgba(255, 255, 255, .95);
  --glass-rim-2: rgba(255, 255, 255, .25);
  --glass-shadow: 0 1px 2px rgba(40, 20, 110, .06), 0 18px 50px -18px rgba(60, 30, 150, .32);
  --glass-tint: rgba(255, 255, 255, .0);
  --sheen: rgba(255, 255, 255, .75);

  --a1: hsl(var(--h1) 95% 62%);
  --a2: hsl(var(--h2) 90% 64%);
  --a3: hsl(var(--h3) 92% 52%);
  --a4: hsl(var(--h4) 98% 56%);
  --grad: linear-gradient(120deg, var(--a1), var(--a2) 50%, var(--a3));

  --r-sm: 14px; --r: 24px; --r-lg: 34px; --r-pill: 999px;
  --font-display: 'Fredoka', ui-rounded, system-ui, sans-serif;
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, Segoe UI, sans-serif;

  --spring: linear(0, .009, .035 2.1%, .141, .281 6.7%, .723 12.9%, .938 16.7%, 1.017, 1.077, 1.121, 1.149 24.3%, 1.159, 1.163, 1.161, 1.154 29.9%, 1.129 32.8%, 1.051 39.6%, 1.017 43.1%, .991, .977 51%, .974 53.8%, .975 57.1%, .997 69.8%, 1.003 76.9%, 1);
  --spring-soft: linear(0, .006, .025 2.8%, .101 6.1%, .539 18.9%, .721 25.3%, .849 31.5%, .937 38.1%, .968 41.8%, .991 45.7%, 1.006 50.1%, 1.015 55%, 1.017 63.9%, 1.001 85.9%, 1);
  --out: cubic-bezier(.22, 1, .36, 1);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0b0918;
  --bg-2: #141028;
  --ink: #f3f0ff;
  --ink-2: #bdb6dc;
  --ink-3: #8b84ad;
  --line: rgba(255, 255, 255, .08);
  --glass-top: rgba(255, 255, 255, .12);
  --glass-bot: rgba(255, 255, 255, .03);
  --glass-rim: rgba(255, 255, 255, .38);
  --glass-rim-2: rgba(255, 255, 255, .04);
  --glass-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 24px 60px -20px rgba(0, 0, 0, .7);
  --sheen: rgba(255, 255, 255, .22);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100dvh;
  font: 500 16px/1.6 var(--font);
  color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color .6s var(--out), color .4s var(--out);
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
:focus-visible { outline: 3px solid hsl(var(--h2) 90% 60% / .6); outline-offset: 3px; border-radius: 12px; }
::selection { background: hsl(var(--h1) 95% 70% / .35); }

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.05; letter-spacing: -.015em; margin: 0; }
h1 { font-size: clamp(2.6rem, 7vw, 5.4rem); }
h2 { font-size: clamp(2rem, 4.4vw, 3.2rem); }
h3 { font-size: 1.35rem; }
p { margin: 0; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; background-size: 200% 100%; animation: gradShift 8s ease-in-out infinite alternate; }
@keyframes gradShift { to { background-position: 100% 0; } }
.muted { color: var(--ink-2); }
.eyebrow { font: 700 .78rem/1 var(--font); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); display: inline-flex; align-items: center; gap: .5rem; }
.eyebrow::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--grad); box-shadow: 0 0 12px var(--a1); }

/* ── Ambient background ───────────────────────────────────── */
.ambient { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.ambient .blob { position: absolute; width: 60vmax; height: 60vmax; border-radius: 50%; filter: blur(80px); opacity: .55; mix-blend-mode: multiply; animation: drift 28s ease-in-out infinite alternate; }
:root[data-theme="dark"] .ambient .blob { mix-blend-mode: screen; opacity: .28; }
.ambient .b1 { background: hsl(var(--h1) 95% 75%); top: -25vmax; left: -15vmax; }
.ambient .b2 { background: hsl(var(--h2) 90% 78%); top: -10vmax; right: -25vmax; animation-delay: -7s; animation-duration: 34s; }
.ambient .b3 { background: hsl(var(--h3) 90% 75%); bottom: -30vmax; left: 10vmax; animation-delay: -14s; }
.ambient .b4 { background: hsl(var(--h4) 98% 75%); bottom: -20vmax; right: -10vmax; animation-delay: -3s; animation-duration: 40s; opacity: .4; }
@keyframes drift {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(6vmax, 4vmax) scale(1.1); }
  100% { transform: translate(-4vmax, 7vmax) scale(.95); }
}
.ambient .grain { position: absolute; inset: -50%; opacity: .05; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
.ambient .particle { position: absolute; top: -10vh; font-size: 22px; opacity: .7; animation: fall linear infinite; }
@keyframes fall { to { transform: translate3d(var(--dx, 40px), 115vh, 0) rotate(var(--rot, 360deg)); } }

/* ── Liquid glass ─────────────────────────────────────────── */
.glass {
  position: relative; isolation: isolate;
  background: linear-gradient(165deg, var(--glass-top), var(--glass-bot)), var(--glass-tint);
  -webkit-backdrop-filter: blur(22px) saturate(1.9);
  backdrop-filter: blur(22px) saturate(1.9);
  border-radius: var(--r);
  box-shadow:
    inset 0 1px 0 var(--glass-rim),
    inset 0 -1px 0 var(--glass-rim-2),
    inset 0 0 18px -6px rgba(255, 255, 255, .35),
    var(--glass-shadow);
}
/* gradient rim that catches light */
.glass::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none; z-index: 2;
  background: linear-gradient(140deg, var(--glass-rim), transparent 38%, transparent 62%, var(--glass-rim) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: .8;
}
/* pointer-following specular sheen */
.glass::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: -1;
  background: radial-gradient(420px circle at var(--mx, 20%) var(--my, -20%), var(--sheen), transparent 45%);
  opacity: .55; transition: opacity .5s var(--out);
}
.glass.lit::before { opacity: 1; }
.glass-strong { --glass-top: rgba(255, 255, 255, .78); --glass-bot: rgba(255, 255, 255, .42); }
:root[data-theme="dark"] .glass-strong { --glass-top: rgba(255, 255, 255, .16); --glass-bot: rgba(255, 255, 255, .06); }

/* ── Glossy balls ─────────────────────────────────────────── */
.ball {
  --h: 330; --s: 64px;
  width: var(--s); height: var(--s); flex: none; border-radius: 50%;
  display: grid; place-items: center; position: relative;
  font: 700 calc(var(--s) * .3)/1 var(--font-display); color: #fff; letter-spacing: -.02em;
  text-shadow: 0 2px 0 hsl(var(--h) 80% 30% / .45), 0 0 12px hsl(var(--h) 80% 30% / .3);
  background:
    radial-gradient(circle at 32% 26%, rgba(255, 255, 255, .95) 0 5%, rgba(255, 255, 255, 0) 22%),
    radial-gradient(circle at 70% 85%, hsl(var(--h) 100% 85% / .7), transparent 40%),
    radial-gradient(circle at 40% 35%, hsl(var(--h) 100% 72%), hsl(var(--h) 88% 56%) 50%, hsl(var(--h) 80% 38%) 100%);
  box-shadow:
    inset -6px -10px 18px hsl(var(--h) 80% 25% / .35),
    inset 4px 6px 12px rgba(255, 255, 255, .35),
    0 calc(var(--s) * .18) calc(var(--s) * .35) -6px hsl(var(--h) 80% 40% / .45);
  user-select: none;
}
.ball.sm { --s: 36px; }
.ball.lg { --s: 120px; }
.ball[data-long] { font-size: calc(var(--s) * .22); }

/* ── Layout ───────────────────────────────────────────────── */
.wrap { width: min(1200px, 100% - 32px); margin-inline: auto; }
main { padding-top: 112px; min-height: 80vh; }
section { padding-block: clamp(48px, 8vw, 96px); }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 32px; flex-wrap: wrap; }
.section-head p { max-width: 520px; margin-top: 12px; }
.grid { display: grid; gap: 20px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.stack > * + * { margin-top: 12px; }
.center { text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── Buttons & chips ──────────────────────────────────────── */
.btn {
  --bh: var(--h2);
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  height: 48px; padding: 0 22px; border-radius: var(--r-pill);
  font: 700 .98rem/1 var(--font); white-space: nowrap;
  transition: transform .5s var(--spring), box-shadow .3s var(--out), background-color .3s;
  will-change: transform;
}
.btn:hover { transform: translateY(-2px) scale(1.03); }
.btn:active { transform: scale(.94); transition-duration: .12s; }
.btn-primary {
  color: #fff;
  background: linear-gradient(180deg, hsl(var(--bh) 95% 68%), hsl(var(--bh) 85% 54%));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), inset 0 -2px 6px hsl(var(--bh) 80% 35% / .4), 0 10px 26px -8px hsl(var(--bh) 90% 50% / .7);
}
.btn-yt { --bh: 0; }
.btn.glass { border-radius: var(--r-pill); }
.btn-sm { height: 38px; padding: 0 16px; font-size: .88rem; }
.btn-icon { width: 44px; padding: 0; }
.btn svg { width: 18px; height: 18px; }

.chip {
  height: 38px; padding: 0 16px; border-radius: var(--r-pill);
  display: inline-flex; align-items: center; gap: 8px;
  font: 600 .88rem/1 var(--font); color: var(--ink-2);
  transition: transform .45s var(--spring), color .2s, background .3s;
}
.chip .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c, var(--a2)); }
.chip:hover { transform: translateY(-2px); color: var(--ink); }
.chip[aria-pressed="true"] { color: #fff; background: var(--c, hsl(var(--h2) 85% 60%)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 8px 20px -8px var(--c, hsl(var(--h2) 85% 60%)); }
.chip[aria-pressed="true"] .dot { background: #fff; }

.tag { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: var(--r-pill); font: 700 .72rem/1 var(--font); letter-spacing: .02em; background: hsl(var(--h2) 90% 60% / .12); color: hsl(var(--h2) 70% 45%); }
:root[data-theme="dark"] .tag { color: hsl(var(--h2) 90% 78%); }

/* ── Inputs ───────────────────────────────────────────────── */
.field { display: grid; gap: 8px; }
.field label { font: 700 .85rem/1 var(--font); color: var(--ink-2); }
.input {
  width: 100%; min-height: 50px; padding: 13px 18px; border-radius: 16px; border: 0; outline: 0;
  background: var(--glass-top); color: var(--ink);
  box-shadow: inset 0 1px 3px rgba(40, 20, 110, .12), inset 0 0 0 1px var(--line);
  transition: box-shadow .3s var(--out), background .3s;
}
.input:focus { box-shadow: inset 0 1px 3px rgba(40, 20, 110, .12), 0 0 0 4px hsl(var(--h2) 90% 65% / .25), inset 0 0 0 1.5px hsl(var(--h2) 90% 65%); }
textarea.input { resize: vertical; min-height: 120px; }
.input::placeholder { color: var(--ink-3); }

/* ── Nav ──────────────────────────────────────────────────── */
.nav {
  position: fixed; top: 16px; left: 50%; z-index: 50;
  transform: translateX(-50%);
  width: min(1200px, calc(100% - 24px));
  display: flex; align-items: center; gap: 10px;
  padding: 8px; border-radius: var(--r-pill);
  transition: transform .6s var(--spring), padding .4s var(--out);
}
.nav.tucked { transform: translateX(-50%) translateY(-8px) scale(.985); }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 10px 0 4px; flex: none; }
.brand-logo {
  width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: none;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .8), 0 6px 16px -4px hsl(var(--h1) 80% 45% / .55);
  transition: transform .7s var(--spring);
}
.brand-logo.lg { width: 52px; height: 52px; }
.brand:hover .brand-logo { transform: rotate(-12deg) scale(1.1); }
.brand b { font: 600 1.15rem/1 var(--font-display); letter-spacing: -.01em; }
.nav-links { position: relative; display: flex; gap: 2px; margin: 0 auto; }
.nav-links a {
  position: relative; z-index: 1; height: 42px; padding: 0 15px; border-radius: var(--r-pill);
  display: inline-flex; align-items: center; font: 600 .92rem/1 var(--font); color: var(--ink-2);
  transition: color .25s;
}
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--ink); }
.nav-pill {
  position: absolute; top: 0; left: 0; height: 42px; border-radius: var(--r-pill); z-index: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, .95), rgba(255, 255, 255, .6));
  box-shadow: inset 0 1px 0 #fff, 0 4px 14px -4px rgba(60, 30, 150, .3), inset 0 0 0 1px rgba(255, 255, 255, .7);
  transition: transform .65s var(--spring), width .65s var(--spring), opacity .3s;
}
:root[data-theme="dark"] .nav-pill { background: linear-gradient(180deg, rgba(255, 255, 255, .2), rgba(255, 255, 255, .08)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 4px 14px -4px rgba(0, 0, 0, .5); }
.nav-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.me-ball { --s: 40px; font-size: 11px; transition: transform .6s var(--spring); }
.me-ball:hover { transform: scale(1.12) rotate(12deg); }
.menu-btn { display: none; }

.mobile-sheet {
  position: fixed; inset: 76px 12px auto; z-index: 49; padding: 12px; border-radius: 28px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
  transform-origin: top right; transform: scale(.9) translateY(-10px); opacity: 0; pointer-events: none;
  transition: transform .55s var(--spring), opacity .25s;
}
.mobile-sheet.open { transform: none; opacity: 1; pointer-events: auto; }
.mobile-sheet a { padding: 14px 16px; border-radius: 18px; font: 600 1rem/1.2 var(--font); display: flex; align-items: center; gap: 10px; }
.mobile-sheet a[aria-current="page"] { background: rgba(255, 255, 255, .55); }
.mobile-sheet .sheet-sub { grid-column: 1 / -1; justify-content: center; height: 52px; margin-top: 4px; color: #fff; }
:root[data-theme="dark"] .mobile-sheet a[aria-current="page"] { background: rgba(255, 255, 255, .1); }

@media (max-width: 1080px) {
  .nav-links, .nav-actions .hide-m { display: none; }
  .menu-btn { display: inline-flex; }
  .nav-actions { margin-left: auto; }
}

/* ── Live banner ──────────────────────────────────────────── */
.live-banner {
  position: absolute; top: 84px; left: 50%; z-index: 40; transform: translate(-50%, -20px); opacity: 0;
  display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 16px; border-radius: var(--r-pill);
  max-width: calc(100% - 24px); transition: transform .7s var(--spring), opacity .4s;
}
.live-banner.show { transform: translate(-50%, 0); opacity: 1; }
.live-dot { width: 10px; height: 10px; border-radius: 50%; background: #ff2b4a; box-shadow: 0 0 0 0 rgba(255, 43, 74, .6); animation: ping 1.6s infinite; flex: none; }
@keyframes ping { 70% { box-shadow: 0 0 0 12px rgba(255, 43, 74, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 43, 74, 0); } }
.live-banner span { font-weight: 700; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.is-live main { padding-top: 160px; }

/* ── Footer ───────────────────────────────────────────────── */
footer { padding: 40px 0 32px; }
.foot { padding: 32px; display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 28px; }
.foot h4 { font-size: 1rem; margin-bottom: 12px; }
.foot a { display: block; padding: 4px 0; color: var(--ink-2); font-weight: 600; font-size: .92rem; transition: color .2s, transform .4s var(--spring); }
.foot a:hover { color: var(--ink); transform: translateX(4px); }
.foot small { color: var(--ink-3); font-size: .8rem; line-height: 1.5; display: block; }
.mode-pill { display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; font: 700 .75rem/1 var(--font); color: var(--ink-3); }
.mode-pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
@media (max-width: 760px) { .foot { grid-template-columns: 1fr 1fr; } .foot > :first-child { grid-column: 1 / -1; } }

/* ── Motion: reveal, view transitions ─────────────────────── */
[data-reveal] { opacity: 0; transform: translateY(28px) scale(.97); filter: blur(8px); transition: opacity .8s var(--out), transform 1s var(--spring-soft), filter .8s var(--out); transition-delay: calc(var(--i, 0) * 70ms); }
[data-reveal].in { opacity: 1; transform: none; filter: none; }

::view-transition-old(page) { animation: pageOut .32s var(--out) both; }
::view-transition-new(page) { animation: pageIn .6s var(--spring-soft) both; }
@keyframes pageOut { to { opacity: 0; transform: translateY(-12px) scale(.985); filter: blur(10px); } }
@keyframes pageIn { from { opacity: 0; transform: translateY(24px) scale(.985); filter: blur(10px); } }
#app { view-transition-name: page; }

/* ── Toasts, modal, confetti ──────────────────────────────── */
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 90; display: grid; gap: 10px; justify-items: center; pointer-events: none; width: calc(100% - 24px); }
.toast { display: flex; align-items: center; gap: 12px; padding: 10px 20px 10px 10px; border-radius: var(--r-pill); font-weight: 700; animation: toastIn .7s var(--spring) both; pointer-events: auto; max-width: 100%; }
.toast .ball { --s: 40px; font-size: 12px; }
.toast small { display: block; font-weight: 600; color: var(--ink-2); }
.toast.out { animation: toastOut .4s var(--out) forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(30px) scale(.8); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(20px) scale(.9); } }

.modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; }
.modal-bg { position: absolute; inset: 0; background: rgba(15, 8, 40, .45); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); animation: fadeIn .4s var(--out) both; }
.modal-card { position: relative; width: min(1000px, 100%); padding: 12px; border-radius: var(--r-lg); animation: modalIn .7s var(--spring) both; }
.modal.closing .modal-bg { animation: fadeOut .3s forwards; }
.modal.closing .modal-card { animation: modalOut .3s var(--out) forwards; }
.player { aspect-ratio: 16/9; border-radius: 24px; overflow: hidden; background: #000; }
.player iframe { width: 100%; height: 100%; border: 0; display: block; }
.modal-meta { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 10px 6px; flex-wrap: wrap; }
.modal-close { position: absolute; top: -14px; right: -14px; z-index: 3; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(40px) scale(.9); } }
@keyframes modalOut { to { opacity: 0; transform: translateY(20px) scale(.95); } }
@media (max-width: 600px) { .modal-close { top: -52px; right: 0; } }

.confetti { position: fixed; inset: 0; z-index: 100; pointer-events: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  [data-reveal] { opacity: 1; transform: none; filter: none; }
}
