/* ─── Design tokens ────────────────────────────────────────────────────────── */
:root {
  --bg:         #111111;
  --surface:    #1c1c1e;
  --surface2:   #252527;
  --border:     #2c2c2e;
  --accent:     #e8ff47;
  --accent-dim: #b8cc20;
  --text:       #f0f0f0;
  --muted:      #636366;
  --danger:     #ff453a;
  --green:      #30d158;

  /* Derived */
  --accent-glow:   0 0 28px rgba(232,255,71,.25);
  --accent-subtle: rgba(232,255,71,.08);
  --gradient:      linear-gradient(135deg, #e8ff47 0%, #30d158 100%);
  --gradient-btn:  linear-gradient(135deg, #e8ff47 0%, #a3e635 100%);
  --text-dim:      #999999;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 26px;

  --shadow: 0 4px 24px rgba(0,0,0,.5);
  --shadow-lg: 0 8px 40px rgba(0,0,0,.6);

  --font-display: 'Rajdhani', system-ui, sans-serif;
  --font-body:    'Inter', system-ui, sans-serif;
}

/* ─── Reset ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg); color: var(--text);
  font-family: var(--font-body); font-size: 16px;
  line-height: 1.6; min-height: 100vh; overflow-x: hidden;
}
a { color: var(--accent); text-decoration: none; transition: opacity .2s; }
a:hover { opacity: .75; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font-family: inherit; }

/* Subtle grid texture */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: -1;
  background-image:
    radial-gradient(ellipse 80% 50% at 10% 5%,  rgba(232,255,71,.05) 0%, transparent 55%),
    radial-gradient(ellipse 60% 40% at 90% 95%, rgba(48,209,88,.05)  0%, transparent 55%);
  pointer-events: none;
}

/* ─── Navbar ─────────────────────────────────────────────────────────────── */
.navbar {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; gap: 12px;
  padding: 0 16px; height: 58px;
  background: rgba(17,17,17,.92);
  backdrop-filter: blur(20px) saturate(1.6);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  margin-bottom: 10px;
}
.nav-brand {
  display: flex; align-items: baseline; gap: 5px;
  color: var(--text); font-family: var(--font-display); flex-shrink: 0;
}
.brand-icon { font-size: 1.25rem; }
.brand-text { font-size: 1.3rem; font-weight: 700; letter-spacing: .03em; }
.brand-sub  { font-size: .62rem; font-weight: 700; color: var(--accent); letter-spacing: .2em; text-transform: uppercase; }

.nav-links { display: none; }

.nav-hamburger {
  display: flex; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer;
  padding: 8px; margin-left: auto; -webkit-tap-highlight-color: transparent;
}
.nav-hamburger span {
  display: block; width: 22px; height: 2px;
  background: var(--muted); border-radius: 2px; transition: .2s;
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-mobile-menu {
  display: none; flex-direction: column;
  position: fixed; top: 58px; left: 0; right: 0;
  background: rgba(17,17,17,.97); border-bottom: 1px solid var(--border);
  padding: 12px 12px 20px; z-index: 99;
}
.nav-mobile-menu.open { display: flex; }
.nav-mobile-menu a {
  color: var(--text-dim); font-size: 1rem; padding: 13px 14px;
  border-radius: var(--r-md); transition: background .15s;
  display: flex; align-items: center; gap: 11px;
}
.nav-mobile-menu a:hover { background: var(--surface); color: var(--accent); opacity: 1; }

@media (min-width: 640px) {
  .navbar { padding: 0 24px; height: 62px; }
  .nav-links { display: flex; align-items: center; gap: 4px; margin-left: auto; }
  .nav-hamburger { display: none; }
  .nav-link {
    color: var(--muted); font-size: .88rem; font-weight: 500;
    padding: 7px 12px; border-radius: var(--r-sm);
    transition: color .15s, background .15s;
  }
  .nav-link:hover, .nav-link.active { color: var(--text); background: var(--surface); opacity: 1; }
  .nav-btn {
    padding: 8px 18px; border-radius: 50px;
    font-size: .86rem; font-weight: 600; transition: all .2s; letter-spacing: .02em;
  }
  .btn-outline { border: 1px solid var(--border); color: var(--muted); background: transparent; }
  .btn-outline:hover { border-color: var(--accent); color: var(--accent); }
  .btn-primary { background: var(--accent); color: #111; font-weight: 700; }
  .btn-primary:hover { background: var(--accent-dim); opacity: 1; }
}

/* ─── Layout ─────────────────────────────────────────────────────────────── */
.container    { max-width: 1100px; margin: 0 auto; padding: 0 10px !important; }
.container-sm { max-width: 560px;  margin: 0 auto; padding: 0 10px; }
.page    { padding: 28px 0 64px; }
.page-sm { padding: 48px 0 64px; }
@media (min-width: 640px) {
  .container { padding: 0 28px; }
  .page    { padding: 40px 0 80px; }
  .page-sm { padding: 60px 0 80px; }
}
@media (min-width: 1024px) {
  .container { padding: 0 32px; }
}

/* ─── Cards ──────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 20px; box-shadow: var(--shadow);
}
.card-sm { padding: 14px 16px; border-radius: var(--r-md); }
.card-hover { transition: border-color .15s, transform .2s; }
.card-hover:hover { border-color: #3c3c3e; transform: translateY(-2px); }
@media (min-width: 640px) { .card { padding: 26px; } }

/* ─── Typography ─────────────────────────────────────────────────────────── */
.display-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 8vw, 4.4rem);
  font-weight: 700; line-height: 1.08; letter-spacing: .01em;
}
.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.section-title {
  font-family: var(--font-display); font-size: 1.3rem; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase; color: var(--text);
}
.label-sm {
  font-size: .7rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted);
}
@media (min-width: 640px) { .section-title { font-size: 1.5rem; } }

/* ─── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 15px 28px; border-radius: 50px;
  font-size: 1rem; font-weight: 700; letter-spacing: .02em;
  border: none; cursor: pointer; transition: all .15s; white-space: nowrap;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.btn:disabled { opacity: .35; cursor: not-allowed; }

.btn-green  { background: var(--accent); color: #111; box-shadow: var(--accent-glow); }
.btn-green:hover:not(:disabled)  { background: var(--accent-dim); }
.btn-green:active:not(:disabled) { transform: scale(.97); }

.btn-ghost  { background: transparent; border: 1px solid var(--border); color: var(--muted); }
.btn-ghost:hover:not(:disabled)  { border-color: var(--accent); color: var(--accent); }

.btn-danger { background: rgba(255,69,58,.12); border: 1px solid var(--danger); color: var(--danger); }
.btn-danger:hover:not(:disabled) { background: rgba(255,69,58,.22); }

.btn-sm   { padding: 11px 20px; font-size: .88rem; }
.btn-lg   { padding: 17px 36px; font-size: 1.05rem; }
.btn-full { width: 100%; }
@media (min-width: 640px) { .btn { padding: 12px 26px; font-size: .95rem; } .btn-sm { padding: 9px 18px; } }

/* ─── Forms ──────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block; font-size: .72rem; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 7px;
}
.form-control {
  width: 100%; background: var(--surface2);
  border: 1px solid var(--border); border-radius: var(--r-sm);
  padding: 14px 14px; color: var(--text); font-size: 1rem;
  outline: none; transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none;
}
.form-control:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(232,255,71,.1); }
.form-control::placeholder { color: var(--muted); }
.form-hint  { font-size: .76rem; color: var(--muted); margin-top: 5px; }
.form-error { color: var(--danger); font-size: .8rem; margin-top: 5px; }
@media (min-width: 640px) { .form-control { padding: 12px 14px; } }

/* ─── Alerts ─────────────────────────────────────────────────────────────── */
.alert { padding: 13px 16px; border-radius: var(--r-sm); font-size: .88rem; margin-bottom: 18px; }
.alert-error   { background: rgba(255,69,58,.1);  border: 1px solid rgba(255,69,58,.3);  color: #ff8c87; }
.alert-success { background: rgba(48,209,88,.08); border: 1px solid rgba(48,209,88,.3);  color: var(--green); }
.alert-info    { background: rgba(232,255,71,.07); border: 1px solid rgba(232,255,71,.25); color: var(--accent); }

/* ─── Hero ───────────────────────────────────────────────────────────────── */
.hero { padding: 56px 16px 44px; text-align: center; }

/* Solid brand yellow on landing — hero .gradient-text would otherwise fade to green */
.hero .display-title .gradient-text {
  background: none;
  -webkit-background-clip: unset;
  background-clip: unset;
  color: var(--accent);
  -webkit-text-fill-color: var(--accent);
}

.hero-badge {
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(232,255,71,.08); border: 1px solid rgba(232,255,71,.25);
  color: var(--accent); border-radius: 50px;
  font-size: .73rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  padding: 6px 16px; margin-bottom: 22px;
}
.hero p {
  font-size: 1.05rem; color: var(--muted); margin: 16px auto 28px;
  max-width: 460px; line-height: 1.65;
}
.hero-actions { display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
@media (min-width: 480px) {
  .hero { padding: 72px 20px 52px; }
  .hero p { font-size: 1.12rem; }
  .hero-actions {
    flex-direction: row;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
  }
}
@media (min-width: 768px) { .hero { padding: 88px 20px 64px; } }

/* ─── Landing / stats ribbon ─────────────────────────────────────────────── */
.public-stats-section {
  padding: 8px 0 36px;
  border-top: 1px solid rgba(255,255,255,.05);
  background: linear-gradient(180deg, rgba(232,255,71,.03) 0%, transparent 42%);
}
.public-stats-head {
  text-align: center;
  max-width: 560px;
  margin: 0 auto 20px;
  padding: 0 18px;
}
.public-stats-title {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 3.5vw, 1.65rem);
  font-weight: 700;
  letter-spacing: .03em;
  color: var(--text);
  margin-top: 8px;
}
.public-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  max-width: 920px;
  margin: 0 auto;
  padding: 0 18px;
}
@media (min-width: 640px) {
  .public-stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
}
.public-stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px 14px;
  text-align: center;
  transition: border-color .15s, box-shadow .2s;
}
.public-stat-card:hover {
  border-color: #3a3a3e;
}
.public-stat-card--pulse {
  border-color: rgba(48,209,88,.35);
  box-shadow: 0 0 0 1px rgba(48,209,88,.12), 0 8px 28px rgba(48,209,88,.08);
  animation: stat-live-glow 2.8s ease-in-out infinite;
}
@keyframes stat-live-glow {
  0%, 100% { box-shadow: 0 0 0 1px rgba(48,209,88,.12), 0 8px 28px rgba(48,209,88,.06); }
  50%      { box-shadow: 0 0 0 1px rgba(48,209,88,.35), 0 10px 36px rgba(48,209,88,.14); }
}
.public-stat-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 10px;
}
.public-stat-icon [data-lucide] {
  width: 22px;
  height: 22px;
  color: var(--accent);
  opacity: .9;
}
.public-stat-value {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 4vw, 1.85rem);
  font-weight: 700;
  color: var(--text);
  line-height: 1.15;
}
.public-stat-label {
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 6px;
}

/* ─── How to play page ─────────────────────────────────────────────────────── */
.how-page { padding-bottom: 72px; }
.how-hero {
  padding: 44px 16px 52px;
  text-align: center;
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(ellipse 70% 80% at 50% -30%, rgba(232,255,71,.09) 0%, transparent 55%),
    radial-gradient(ellipse 50% 50% at 100% 80%, rgba(48,209,88,.06) 0%, transparent 45%);
}
@media (min-width: 640px) {
  .how-hero { padding: 56px 24px 64px; }
}
.how-hero-inner { max-width: 720px; margin: 0 auto; }
.how-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid rgba(232,255,71,.28);
  background: rgba(232,255,71,.06);
  border-radius: 50px;
  padding: 7px 18px;
  margin-bottom: 18px;
}
.how-hero-badge [data-lucide] { width: 15px; height: 15px; }
.how-hero-title { margin-bottom: 14px; }
.how-hero-lead {
  font-size: 1.05rem;
  color: var(--muted);
  line-height: 1.65;
  max-width: 560px;
  margin: 0 auto 26px;
}
.how-hero-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
}
@media (min-width: 480px) {
  .how-hero-actions {
    flex-direction: row;
    justify-content: center;
    flex-wrap: wrap;
  }
}
.how-body { padding-top: 40px; padding-bottom: 24px; }
.how-section { margin-bottom: 44px; }
.how-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  font-size: 1.05rem !important;
}
.how-section-title .ic { width: 22px; height: 22px; flex-shrink: 0; }
.how-split {
  display: grid;
  gap: 14px;
}
@media (min-width: 880px) {
  .how-split { grid-template-columns: 1.25fr 1fr; align-items: stretch; }
}
.how-prose p { margin-bottom: 12px; color: var(--text-dim); font-size: .95rem; line-height: 1.65; }
.how-prose p:last-child { margin-bottom: 0; }
.how-muted { color: var(--muted) !important; font-size: .88rem !important; }
.how-highlight {
  border-color: rgba(232,255,71,.28);
  background: linear-gradient(145deg, rgba(232,255,71,.07) 0%, var(--surface) 48%);
}
.how-highlight-label {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}
.how-highlight-text {
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--text);
}
.how-cards-3 {
  display: grid;
  gap: 12px;
}
@media (min-width: 720px) {
  .how-cards-3 { grid-template-columns: repeat(3, 1fr); gap: 14px; }
}
.how-info-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 22px 18px;
  transition: border-color .15s;
}
.how-info-card:hover { border-color: #3c3c3e; }
.how-info-num {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: rgba(232,255,71,.35);
  line-height: 1;
  margin-bottom: 12px;
}
.how-info-card h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin-bottom: 8px;
  color: var(--text);
}
.how-info-card p {
  font-size: .86rem;
  color: var(--muted);
  line-height: 1.55;
}
.how-diagram {
  display: grid;
  gap: 20px;
  align-items: center;
}
@media (min-width: 720px) {
  .how-diagram { grid-template-columns: auto 1fr; gap: 28px; }
}
.how-diagram-visual {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}
@media (min-width: 720px) {
  .how-diagram-visual { flex-direction: column; align-items: stretch; min-width: 200px; }
}
.how-court {
  background: var(--surface2);
  border: 1px dashed rgba(232,255,71,.35);
  border-radius: var(--r-md);
  padding: 14px 18px;
  text-align: center;
}
.how-court span {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .95rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}
.how-court small {
  font-size: .78rem;
  color: var(--muted);
}
.how-diagram-copy p {
  font-size: .93rem;
  color: var(--text-dim);
  line-height: 1.65;
}
.how-note {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 20px !important;
  border-color: rgba(48,209,88,.22);
  background: rgba(48,209,88,.05);
}
.how-note span { font-size: .92rem; color: var(--text-dim); line-height: 1.6; }
.how-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.how-step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: start;
  padding: 22px 20px !important;
}
.how-step-marker {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--accent);
  opacity: .85;
  line-height: 1;
}
.how-step h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin-bottom: 6px;
  color: var(--text);
}
.how-step p {
  font-size: .88rem;
  color: var(--muted);
  line-height: 1.55;
}
.how-section--cta { margin-bottom: 0; }
.how-cta {
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: flex-start;
  padding: 26px 24px !important;
  border-color: rgba(232,255,71,.22);
  background: linear-gradient(135deg, rgba(232,255,71,.09) 0%, var(--surface) 55%);
}
@media (min-width: 640px) {
  .how-cta {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
  }
}
.how-cta-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin-bottom: 6px;
}
.how-cta-sub {
  font-size: .88rem;
  color: var(--muted);
  max-width: 420px;
}

/* ─── Features ───────────────────────────────────────────────────────────── */
.features-heading {
  text-align: center;
  font-family: var(--font-display); font-size: 1.1rem; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
  margin: 0 0 14px; padding: 0 20px;
}
.features {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  padding: 0 20px 60px; max-width: 1100px; margin: 0 auto;
}
.feature-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 18px 16px; transition: border-color .15s;
}
.feature-card:hover { border-color: #3c3c3e; }
.feature-icon { font-size: 1.7rem; margin-bottom: 10px; }
.feature-card h3 { font-family: var(--font-display); font-size: 1rem; font-weight: 700; margin-bottom: 4px; }
.feature-card p  { color: var(--muted); font-size: .8rem; line-height: 1.5; }
.feature-card--wide { grid-column: 1 / -1; display: flex; align-items: flex-start; gap: 16px; }
.feature-card--wide .feature-icon { margin-bottom: 0; flex-shrink: 0; }
@media (min-width: 640px) {
  .features { grid-template-columns: repeat(4, 1fr); gap: 14px; padding: 0 24px 80px; }
  .feature-icon { font-size: 2rem; } .feature-card { padding: 24px 20px; }
  .feature-card h3 { font-size: 1.15rem; } .feature-card p { font-size: .85rem; }
  .feature-card--wide { gap: 22px; }
}

/* ─── Create form ────────────────────────────────────────────────────────── */
.create-form-wrap { padding: 16px 0 64px; }
.create-form { max-width: 700px; margin: 0 auto; padding: 0 20px; }
.settings-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 460px) { .settings-grid { grid-template-columns: repeat(3, 1fr); } }
.player-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 6px; }
@media (min-width: 560px) { .player-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .player-grid { grid-template-columns: repeat(4, 1fr); } }
.player-input-wrap { position: relative; }
.player-input-wrap .player-num {
  position: absolute; left: 9px; top: 50%; transform: translateY(-50%);
  font-size: .66rem; font-weight: 700; color: var(--accent);
  background: rgba(232,255,71,.1); border-radius: 50px;
  padding: 2px 6px; pointer-events: none; z-index: 1;
}
.player-input-wrap .form-control { padding-left: 40px; }

/* ─── Match page ─────────────────────────────────────────────────────────── */
.match-page { padding: 24px 0px 80px; }

/* Mobile: stack everything. Desktop: two columns */
.match-layout { display: flex; flex-direction: column-reverse; gap: 20px; }
@media (min-width: 900px) {
  .match-layout {
    display: grid;
    grid-template-columns: 1fr 310px;
    grid-template-rows: auto;
    gap: 24px;
    align-items: start;
  }
  /* On desktop, main content first, sidebar second */
  .match-main    { order: 1; }
  .match-sidebar { order: 2; }
}
/* On mobile: leaderboard first (top), courts below */
.match-main    { order: 2; }
.match-sidebar { order: 1; }

/* Sticky sidebar on desktop */
.leaderboard-sticky { position: static; }
@media (min-width: 900px) { .leaderboard-sticky { position: sticky; top: 74px; } }

/* Match header */
.match-header { display: flex; flex-direction: column; gap: 10px; margin-bottom: 22px; }
@media (min-width: 600px) {
  .match-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin-bottom: 12px;
  }
  .match-header .match-title-row {
    margin-bottom: 4px;
  }
  .match-title-display {
    font-size: 1.28rem;
    line-height: 1.15;
  }
  .match-meta {
    margin-top: 4px;
    gap: 5px;
  }
  .meta-pill {
    padding: 3px 9px;
    font-size: .67rem;
  }
}
.match-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 7px; }
.meta-pill {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 50px; padding: 4px 11px;
  font-size: .72rem; font-weight: 600; color: var(--muted);
  display: flex; align-items: center; gap: 4px;
}
.meta-pill span { color: var(--accent); }

.match-title-display { font-size: 1.75rem; margin-bottom: 0; line-height: 1.2; }

/* Match header: round + TV — compact on narrow screens */
.match-header-tools {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: nowrap;
  width: 100%;
}
.match-round-stack {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.match-round-heading {
  flex-shrink: 0;
}
.match-round-scores {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  gap: 4px;
  flex-shrink: 0;
}
.match-round-num {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  flex-shrink: 0;
}
.match-round-slash {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--muted);
  line-height: 1;
  flex-shrink: 0;
}
.match-round-total {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--muted);
  line-height: 1;
  flex-shrink: 0;
}
.match-progress-inline {
  flex: 1;
  min-width: 48px;
  max-width: 140px;
  margin: 0;
}
.match-header .match-progress-inline.progress-bar-wrap {
  margin: 0;
}
.match-bigscreen-btn {
  flex-shrink: 0;
  gap: 6px;
}
.match-bigscreen-label {
  font-weight: 700;
}

@media (max-width: 599px) {
  .match-page { padding-top: 16px; }
  .match-header { gap: 8px; margin-bottom: 14px; }
  .match-title-display { font-size: 1.32rem; }
  .match-meta { margin-top: 4px; gap: 5px; }
  .meta-pill {
    font-size: .66rem;
    padding: 3px 9px;
  }
  .match-header-tools {
    justify-content: space-between;
    gap: 8px;
    width: 100%;
  }
  .match-round-stack {
    flex: 1;
    min-width: 0;
  }
  .match-round-heading {
    display: none;
  }
  .match-round-num { font-size: 1.28rem; }
  .match-round-slash,
  .match-round-total { font-size: .88rem; }
  .match-progress-inline {
    flex: 1;
    min-width: 48px;
    max-width: none;
    height: 5px;
  }
  .match-bigscreen-btn.match-bigscreen-btn {
    padding: 8px 10px;
    font-size: .74rem;
  }
  .match-bigscreen-label { display: none; }
  .round-indicator {
    margin-bottom: 14px;
    gap: 5px;
    row-gap: 5px;
  }
  .round-dot {
    width: 28px;
    height: 28px;
    font-size: .66rem;
  }
}

@media (min-width: 600px) {
  /* Single horizontal toolbar — avoids tall stacked block on desktop */
  .match-header-tools {
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    width: auto;
    flex-shrink: 0;
    flex-wrap: wrap;
  }
  .match-round-stack {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    flex: 0 1 auto;
    min-width: 0;
  }
  .match-round-heading {
    line-height: 1;
    margin: 0;
  }
  .match-round-num {
    font-size: 1.28rem;
  }
  .match-round-slash,
  .match-round-total {
    font-size: .88rem;
  }
  .match-progress-inline {
    flex: 0 0 auto;
    width: 56px;
    min-width: 48px;
    max-width: 72px;
  }
  .match-bigscreen-btn.match-bigscreen-btn {
    padding: 7px 12px;
    font-size: .78rem;
  }
  .match-page .round-indicator {
    margin-bottom: 14px;
  }
}

/* Round dots */
.round-indicator {
  display: flex; align-items: center; gap: 7px;
  flex-wrap: wrap; row-gap: 7px; margin-bottom: 22px;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
}
.round-dot {
  width: 32px; height: 32px; border-radius: 50%;
  border: 1.5px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: .72rem; font-weight: 700; color: var(--muted);
  transition: all .25s; flex-shrink: 0;
}
.round-dot.completed { background: var(--accent); border-color: var(--accent); color: #111; }
.round-dot.current   { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 3px rgba(232,255,71,.15); }

/* Courts */
.courts-grid { display: flex; flex-direction: column; gap: 14px; margin-bottom: 24px; }
@media (min-width: 580px) {
  .courts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
}
.court-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); overflow: hidden; transition: border-color .2s;
}
.court-card.scored { border-color: rgba(48,209,88,.4); }
.court-card.scored .court-header { background: rgba(48,209,88,.06); }
.court-header {
  background: var(--surface2); border-bottom: 1px solid var(--border);
  padding: 11px 16px;
  display: flex; align-items: center; justify-content: space-between;
}
.court-number {
  font-family: var(--font-display); font-size: .9rem; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}
.court-round-timer {
  font-size: .75rem; font-weight: 700; letter-spacing: .06em;
  color: var(--muted); font-variant-numeric: tabular-nums;
  margin-right: auto; margin-left: 10px;
}
.court-status-badge {
  font-size: .65rem; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; padding: 3px 9px; border-radius: 50px;
}
.badge-pending { background: rgba(255,165,2,.1);  color: #ffa502; border: 1px solid rgba(255,165,2,.25); }
.badge-scored  { background: rgba(48,209,88,.1);  color: var(--green); border: 1px solid rgba(48,209,88,.3); }
.court-body { padding: 16px; }
.court-match {
  display: grid; grid-template-columns: 1fr 28px 1fr;
  align-items: center; gap: 8px; margin-bottom: 14px;
}
.court-team { text-align: center; }
.team-players { display: flex; flex-direction: column; gap: 5px; margin-bottom: 8px; }
.team-player-name {
  font-size: .86rem; font-weight: 600;
  background: var(--surface2); border-radius: var(--r-sm);
  padding: 6px 8px;
}
.court-vs {
  font-family: var(--font-display); font-size: 1rem; font-weight: 700;
  color: var(--muted); text-align: center;
}
.court-score-display {
  font-family: var(--font-display); font-size: 2rem; font-weight: 700;
  text-align: center; color: var(--accent); line-height: 1;
}

/* Score form */
.score-form { display: flex; flex-direction: column; gap: 10px; }
.score-inputs {
  display: grid; grid-template-columns: 1fr 24px 1fr; align-items: center; gap: 6px;
}
.score-input-wrap { display: flex; flex-direction: column; gap: 4px; text-align: center; }
.score-input-label {
  font-size: .65rem; font-weight: 700; color: var(--muted); letter-spacing: .06em;
  line-height: 1.3; min-height: 26px;
  display: flex; align-items: center; justify-content: center;
}
.score-input {
  width: 100%; text-align: center;
  font-size: 2rem; font-weight: 700; font-family: var(--font-display);
  padding: 12px 4px; background: var(--surface2);
  border: 1.5px solid var(--border); border-radius: var(--r-sm);
  color: var(--text); outline: none; transition: border-color .15s;
  -webkit-appearance: none; -moz-appearance: textfield;
}
.score-input::-webkit-inner-spin-button,
.score-input::-webkit-outer-spin-button { opacity: 0; }
.score-input:focus { border-color: var(--accent); background: #1a1a1a; }
.score-separator { font-size: 1.2rem; color: var(--border); font-weight: 700; text-align: center; }
.score-total-hint { text-align: center; font-size: .76rem; color: var(--muted); }

/* Tap-to-score circles (≤48 pts / game) */
.score-inputs--pick {
  grid-template-columns: 1fr;
}
.score-picker-inner {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.score-pick-hint {
  text-align: center;
  font-size: .74rem;
  color: var(--muted);
  line-height: 1.45;
  margin: 0;
}
.score-pick-hint strong { color: var(--accent); font-weight: 700; }
.score-pick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  gap: 8px;
  justify-items: center;
  padding: 4px 2px 8px;
  /* Grow with all buttons (0–num_points); no inner scroll — court card grows instead */
}
.score-pick-btn {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color .12s, background .12s, transform .1s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.score-pick-btn:hover:not(.score-pick--selected) {
  border-color: var(--muted);
  background: var(--surface);
}
.score-pick-btn:active { transform: scale(0.94); }
.score-pick-btn.score-pick--selected {
  border-color: var(--accent);
  background: rgba(232,255,71,.14);
  color: var(--accent);
  box-shadow: 0 0 0 2px rgba(232,255,71,.15);
}
.score-pick-submit {
  grid-column: span 2;
  justify-self: stretch;
  align-self: stretch;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 12px;
  font-size: .76rem;
  font-weight: 700;
  border-radius: var(--r-md);
  white-space: nowrap;
}
.score-pick-grid .score-pick-submit:disabled {
  opacity: 0.42;
}
.score-split-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 12px 8px;
  background: rgba(0,0,0,.2);
  border-radius: var(--r-md);
  border: 1px solid var(--border);
}
.score-split-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 72px;
}
.score-split-tag {
  font-size: .58rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.score-split-num {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}
.score-split-colon {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--muted);
  opacity: .55;
}

/* ─── Leaderboard ────────────────────────────────────────────────────────── */
.leaderboard-table { width: 100%; border-collapse: collapse; }
.leaderboard-table th {
  text-align: left; font-size: .68rem; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); padding: 9px 12px;
  border-bottom: 1px solid var(--border);
}
.leaderboard-table th:last-child, .leaderboard-table td:last-child { text-align: right; }
.leaderboard-table th:nth-child(3), .leaderboard-table td:nth-child(3) { text-align: center; }
.leaderboard-table td {
  padding: 12px 12px; border-bottom: 1px solid rgba(44,44,46,.8);
  font-size: .93rem; vertical-align: middle;
}
.leaderboard-table tr:last-child td { border-bottom: none; }
.leaderboard-table tr:hover td { background: rgba(255,255,255,.03); }
.rank-cell { font-weight: 700; width: 34px; font-size: 1rem; }
.rank-1 { color: #ffd700; } .rank-2 { color: #c0c0c0; } .rank-3 { color: #cd7f32; }
.player-name-cell { font-weight: 600; }
.points-cell {
  font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; color: var(--accent);
}
.games-cell { color: var(--muted); font-size: .82rem; }
.leaderboard-table tr.top-row td { background: rgba(232,255,71,.04); }

/* ─── Match ended ────────────────────────────────────────────────────────── */
.match-ended-banner {
  text-align: center; padding: 26px 18px; margin-bottom: 24px;
  background: rgba(232,255,71,.06);
  border: 1px solid rgba(232,255,71,.2); border-radius: var(--r-xl);
}
.match-ended-banner h2 {
  font-family: var(--font-display); font-size: 1.7rem; font-weight: 700; margin-bottom: 8px;
}
.match-ended-banner p { color: var(--muted); margin-bottom: 18px; font-size: .93rem; }
.match-ended-actions { display: flex; flex-direction: column; gap: 9px; }
@media (min-width: 480px) {
  .match-ended-banner { padding: 30px 24px; }
  .match-ended-banner h2 { font-size: 2rem; }
  .match-ended-actions { flex-direction: row; justify-content: center; flex-wrap: wrap; }
}

/* ─── Previous rounds ─────────────────────────────────────────────────────── */
.prev-rounds-wrap { margin-top: 28px; }
.prev-rounds-tabs {
  display: flex; gap: 6px; overflow-x: auto; -webkit-overflow-scrolling: touch;
  padding-bottom: 12px; margin-bottom: 16px;
  scrollbar-width: none;
}
.prev-rounds-tabs::-webkit-scrollbar { display: none; }
.round-tab {
  flex-shrink: 0; padding: 7px 16px; border-radius: 50px;
  font-size: .82rem; font-weight: 600;
  border: 1px solid var(--border); background: var(--surface2);
  color: var(--muted); cursor: pointer; transition: all .15s;
  -webkit-tap-highlight-color: transparent;
}
.round-tab.active, .round-tab:hover {
  background: var(--accent); border-color: var(--accent); color: #111;
}
.round-panel { display: none; }
.round-panel.active { display: block; }
.prev-court-list { display: flex; flex-direction: column; gap: 10px; }
@media (min-width: 540px) {
  .prev-court-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
}
.prev-court-card {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 14px;
}
.prev-court-card .court-label { font-size: .66rem; font-weight: 700; color: var(--muted); letter-spacing: .1em; text-transform: uppercase; margin-bottom: 10px; }
.prev-court-score {
  display: grid; grid-template-columns: 1fr 20px 1fr; align-items: center; gap: 6px; text-align: center;
}
.prev-team-names { font-size: .83rem; font-weight: 600; line-height: 1.4; }
.prev-score {
  font-family: var(--font-display); font-size: 1.7rem; font-weight: 700;
  color: var(--accent); line-height: 1; margin-top: 5px;
}
.prev-vs { font-size: .9rem; color: var(--muted); font-weight: 700; }
.winner-team .prev-score { color: var(--green); }
.prev-court-card.scored { border-color: rgba(48,209,88,.35); }
.score-form--history {
  margin-top: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.score-inputs--history-inline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}
.score-inputs--history-inline .score-input {
  width: auto;
  min-width: 72px;
  max-width: 110px;
  font-size: 1.35rem;
  padding: 10px 8px;
}
.score-picker-inner--compact { gap: 10px; }

/* ─── Auth ───────────────────────────────────────────────────────────────── */
.auth-wrap {
  min-height: calc(100vh - 58px); padding: 20px 16px;
  display: flex; align-items: center; justify-content: center;
}
.auth-card {
  width: 100%; max-width: 420px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-xl); padding: 26px 20px; box-shadow: var(--shadow-lg);
}
.auth-card h1 {
  font-family: var(--font-display); font-size: 1.65rem; font-weight: 700; margin-bottom: 4px;
}
.auth-card p.sub { color: var(--muted); font-size: .87rem; margin-bottom: 24px; }
.auth-footer { margin-top: 20px; text-align: center; font-size: .85rem; color: var(--muted); }
.auth-divider {
  display: flex; align-items: center; gap: 12px; margin: 18px 0;
  color: var(--muted); font-size: .78rem;
}
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
@media (min-width: 480px) { .auth-card { padding: 34px 30px; } .auth-card h1 { font-size: 1.9rem; } }

/* ─── My Matches ─────────────────────────────────────────────────────────── */
.match-list { display: flex; flex-direction: column; gap: 10px; }
.match-list-item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 16px 18px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; transition: border-color .15s;
}
.match-list-item:hover { border-color: #3c3c3e; }
.match-list-link {
  flex: 1; min-width: 0;
  color: inherit; text-decoration: none;
}
.match-list-link:hover .name { color: var(--accent); }
.match-list-item .name { font-family: var(--font-display); font-size: 1.1rem; font-weight: 700; }
.match-list-item .details { color: var(--muted); font-size: .78rem; margin-top: 4px; line-height: 1.5; }
.match-list-actions {
  display: flex; align-items: center; gap: 8px;
  flex-shrink: 0;
}
.match-list-chevron {
  color: var(--muted);
  font-size: 1.2rem;
  line-height: 1;
  user-select: none;
}
.match-delete-btn {
  color: var(--muted);
  padding: 8px !important;
}
.match-delete-btn:hover {
  color: #ff6b6b;
  background: rgba(255, 107, 107, 0.08) !important;
}
.match-delete-btn:disabled {
  opacity: 0.45;
  pointer-events: none;
}
.match-header-delete {
  padding: 8px 10px !important;
}
.btn-end-early {
  color: var(--muted);
  gap: 5px;
}
.btn-end-early:hover {
  color: #f5a623;
  background: rgba(245, 166, 35, 0.08) !important;
}
.end-early-label {
  font-size: .78rem;
}
.meta-pill-warn {
  color: #f5a623;
  border-color: rgba(245, 166, 35, 0.35);
}
.round-time-played {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  font-size: .78rem; font-weight: 600;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}
.round-time-played [data-lucide] { width: 13px; height: 13px; flex-shrink: 0; }
.match-ended-timing {
  display: flex; gap: 14px; flex-wrap: wrap;
  margin-top: 8px;
  font-size: .8rem;
  color: var(--muted);
}
.match-ended-timing span {
  display: flex; align-items: center; gap: 5px;
}
.match-ended-timing [data-lucide] {
  width: 13px; height: 13px; flex-shrink: 0;
}
.status-badge {
  font-size: .65rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  padding: 4px 10px; border-radius: 50px; white-space: nowrap; flex-shrink: 0;
}
.status-active { background: rgba(232,255,71,.1); color: var(--accent); border: 1px solid rgba(232,255,71,.2); }
.status-ended  { background: rgba(99,99,102,.1); color: var(--muted); border: 1px solid var(--border); }

/* ─── Utils ──────────────────────────────────────────────────────────────── */
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.divider     { height: 1px; background: var(--border); margin: 22px 0; }
.section-gap { margin-top: 24px; }
.text-center { text-align: center; } .text-muted { color: var(--muted); }
.mt-4 { margin-top: 16px; } .mt-8 { margin-top: 32px; }
.mb-4 { margin-bottom: 16px; } .mb-8 { margin-bottom: 32px; }

/* ─── Progress bar ───────────────────────────────────────────────────────── */
.progress-bar-wrap { background: var(--surface2); border-radius: 50px; height: 4px; overflow: hidden; margin: 7px 0; }
.progress-bar-fill { height: 100%; border-radius: 50px; background: var(--accent); transition: width .4s ease; }

/* ─── Cookie consent banner ──────────────────────────────────────────────── */
#cookie-banner {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 9000;
  background: var(--surface);
  border-top: 1px solid var(--border);
  box-shadow: 0 -8px 40px rgba(0,0,0,.5);
  padding: 16px 20px;
}
.cookie-banner-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}
.cookie-banner-text {
  flex: 1;
  min-width: 220px;
  font-size: .84rem;
  color: var(--muted);
  line-height: 1.55;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cookie-banner-text strong {
  color: var(--text);
  font-size: .9rem;
}
.cookie-banner-text a { color: var(--accent); }
.cookie-banner-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

/* ─── Privacy checkbox ────────────────────────────────────────────────────── */
.privacy-check-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: .88rem;
  color: var(--muted);
  line-height: 1.5;
}
.privacy-check-label input[type="checkbox"] {
  margin-top: 2px;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  accent-color: var(--accent);
  cursor: pointer;
}
.privacy-check-label a { color: var(--accent); }

/* ─── Footer ─────────────────────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  margin-top: 80px;
  padding: 48px 24px 36px;
  background: var(--surface);
}
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 36px;
}
.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.footer-brand-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: .03em;
}
.footer-brand-row .brand-logo { color: var(--accent); width: 18px; height: 18px; }
.footer-brand-row .brand-sub { font-size: .55rem; color: var(--accent); letter-spacing: .22em; text-transform: uppercase; }
.footer-tagline {
  color: var(--muted);
  font-size: .83rem;
  line-height: 1.55;
  max-width: 260px;
}
.footer-cols {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px 20px;
}
.footer-col-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .72rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}
.footer-col-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.footer-col-links a {
  color: var(--muted);
  font-size: .85rem;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color .18s;
}
.footer-col-links a:hover { color: var(--text); opacity: 1; }
.footer-col-links a svg,
.footer-col-links a i { width: 13px; height: 13px; flex-shrink: 0; }
.footer-bottom {
  border-top: 1px solid var(--border);
  margin-top: 36px;
  padding-top: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--muted);
  font-size: .75rem;
}
.footer-bottom a { color: var(--muted); }
.footer-bottom a:hover { color: var(--text); opacity: 1; }
.footer-bottom-sep { opacity: .35; }

@media (min-width: 640px) {
  .footer-inner { grid-template-columns: auto 1fr; }
  .footer-cols   { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 900px) {
  .footer-inner { grid-template-columns: auto 1fr; gap: 56px; }
  .footer-cols  { grid-template-columns: repeat(3, 1fr); gap: 32px 40px; }
}

/* ─── Spinner ────────────────────────────────────────────────────────────── */
.spinner {
  width: 17px; height: 17px; border-radius: 50%;
  border: 2px solid rgba(232,255,71,.2); border-top-color: var(--accent);
  animation: spin .7s linear infinite; display: inline-block; vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Toast ──────────────────────────────────────────────────────────────── */
#toast-container {
  position: fixed; bottom: 16px; left: 16px; right: 16px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 9999; pointer-events: none;
}
.toast {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 13px 16px;
  font-size: .88rem; box-shadow: var(--shadow-lg);
  animation: slideUp .25s ease, fadeOut .3s ease 2.7s forwards;
  pointer-events: all;
}
.toast-success { border-color: rgba(232,255,71,.4); color: var(--accent); }
.toast-error   { border-color: rgba(255,69,58,.4); color: var(--danger); }
@media (min-width: 480px) { #toast-container { bottom: 24px; left: auto; right: 24px; width: 280px; } }
@keyframes slideUp { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fadeOut { to { opacity: 0; pointer-events: none; } }

/* ─── Animations ─────────────────────────────────────────────────────────── */
.fade-in { animation: fadeIn .35s ease both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.pulse-accent { animation: pulseA 2.2s ease-in-out infinite; }
@keyframes pulseA {
  0%,100% { box-shadow: var(--accent-glow); }
  50%      { box-shadow: var(--accent-glow), 0 0 0 8px rgba(232,255,71,.1); }
}

/* ─── Lucide icons ───────────────────────────────────────────────────────── */
/* All lucide SVGs rendered inline */
[data-lucide] {
  width: 16px; height: 16px;
  stroke-width: 2;
  display: inline-block; vertical-align: middle;
  flex-shrink: 0;
}
/* Icon sizes */
.icon-xs  [data-lucide], [data-lucide].icon-xs  { width: 12px; height: 12px; }
.icon-sm  [data-lucide], [data-lucide].icon-sm  { width: 14px; height: 14px; }
.icon-md  [data-lucide], [data-lucide].icon-md  { width: 18px; height: 18px; }
.icon-lg  [data-lucide], [data-lucide].icon-lg  { width: 22px; height: 22px; }
.icon-xl  [data-lucide], [data-lucide].icon-xl  { width: 28px; height: 28px; }
.icon-2xl [data-lucide], [data-lucide].icon-2xl { width: 36px; height: 36px; }

/* Accent colour helper */
.ic { color: var(--accent); }

/* Navbar brand icon */
.brand-logo { width: 22px; height: 22px; color: var(--accent); stroke-width: 2.5; }

/* Feature card icon */
.feature-icon [data-lucide] { width: 32px; height: 32px; color: var(--accent); }
.feature-icon { display: flex; align-items: center; justify-content: flex-start; margin-bottom: 12px; }

/* Meta pill icon */
.meta-pill [data-lucide] { width: 13px; height: 13px; color: var(--accent); }

/* Nav link icon */
.nav-link [data-lucide] { width: 14px; height: 14px; }
.nav-btn  [data-lucide] { width: 14px; height: 14px; }

/* Mobile menu icon */
.nav-mobile-menu a [data-lucide] { width: 16px; height: 16px; color: var(--accent); }

/* Hamburger button uses lucide — hide the old spans approach */
.nav-hamburger [data-lucide] { width: 22px; height: 22px; color: var(--muted); }

/* Section icon */
.section-icon [data-lucide] { width: 20px; height: 20px; color: var(--accent); }

/* Button icons */
.btn [data-lucide] { width: 16px; height: 16px; }
.btn-sm [data-lucide] { width: 14px; height: 14px; }
.btn-lg [data-lucide] { width: 18px; height: 18px; }

/* Leaderboard medal override — keep rank numbers, style icons */
.rank-icon [data-lucide] { width: 17px; height: 17px; }

/* ─── Results page (ended match) ─────────────────────────────────────────── */
.results-page { padding: 24px 0 60px; }

.results-header {
  display: flex; flex-direction: column; gap: 12px;
  margin-bottom: 28px;
}
@media (min-width: 600px) {
  .results-header {
    flex-direction: row; align-items: flex-start;
    justify-content: space-between; flex-wrap: wrap;
  }
}
.results-actions-top {
  display: flex; gap: 10px; flex-wrap: wrap; flex-shrink: 0;
  align-items: stretch;
}
.results-btn-text-compact { display: none; }

@media (max-width: 639px) {
  .results-page .results-header {
    align-items: stretch;
  }
  .results-page .results-actions-top {
    flex-wrap: nowrap;
    gap: 5px;
    width: 100%;
    max-width: 100%;
  }
  .results-page .results-actions-top > .btn {
    flex: 1 1 0;
    min-width: 0;
    padding: 8px 6px !important;
    font-size: .68rem;
    font-weight: 700;
    gap: 4px;
    letter-spacing: 0;
    line-height: 1.1;
    border-radius: 999px;
  }
  .results-page .results-actions-top > .btn [data-lucide] {
    width: 13px !important;
    height: 13px !important;
    flex-shrink: 0;
  }
  .results-page .results-actions-top .match-delete-btn.match-delete-btn {
    padding: 8px 6px !important;
    color: var(--muted);
  }
  .results-page .results-actions-top .match-delete-btn:hover {
    color: #ff6b6b;
  }
  .results-page .results-btn-text-full { display: none; }
  .results-page .results-btn-text-compact { display: inline; }
}

/* ── Winner announcement ──────────────────────────────────────────────────── */
.winner-announce {
  text-align: center;
  padding: 36px 20px 28px;
  margin-bottom: 20px;
  background: radial-gradient(ellipse 80% 100% at 50% 0%, rgba(232,255,71,.12) 0%, transparent 70%);
  border: 1px solid rgba(232,255,71,.18);
  border-radius: var(--r-xl);
  position: relative; overflow: hidden;
}
.winner-announce::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 60% 50% at 50% 0%, rgba(232,255,71,.07) 0%, transparent 60%);
  pointer-events: none;
}
.winner-crown {
  display: flex; justify-content: center; margin-bottom: 12px;
}
.winner-crown [data-lucide] {
  width: 52px; height: 52px; color: var(--accent);
  filter: drop-shadow(0 0 16px rgba(232,255,71,.5));
}
.winner-name {
  font-family: var(--font-display);
  font-size: clamp(2rem, 7vw, 3.4rem);
  font-weight: 700; line-height: 1.1;
  color: var(--text); margin-bottom: 8px;
}
.winner-score {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 5vw, 2.2rem);
  font-weight: 700; color: var(--accent); line-height: 1;
  margin-bottom: 6px;
}
.winner-score span { font-size: .55em; color: var(--muted); font-weight: 400; }
.winner-label {
  font-size: .72rem; font-weight: 700; letter-spacing: .16em;
  text-transform: uppercase; color: var(--muted);
}

/* ── Podium ───────────────────────────────────────────────────────────────── */
.podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 8px;
  margin-bottom: 28px;
  padding: 0 4px;
}

.podium-slot {
  display: flex; flex-direction: column; align-items: center;
  flex: 1; max-width: 160px;
}

.podium-crown-badge {
  display: flex; justify-content: center;
  margin-bottom: 6px;
}
.podium-crown-badge [data-lucide] { width: 22px; height: 22px; color: #ffd700; }

.podium-avatar {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--surface2); border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 8px; flex-shrink: 0;
}
.podium-avatar [data-lucide] { width: 22px; height: 22px; color: var(--muted); }

.podium-avatar-1 {
  width: 60px; height: 60px;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(232,255,71,.2);
}
.podium-avatar-1 [data-lucide] { width: 28px; height: 28px; color: var(--accent); }

.podium-player-name {
  font-family: var(--font-display);
  font-size: .88rem; font-weight: 700;
  text-align: center; line-height: 1.2;
  margin-bottom: 4px; color: var(--text);
  word-break: break-word;
}
.podium-player-1 { font-size: 1.05rem; color: var(--accent); }

.podium-pts {
  font-family: var(--font-display);
  font-size: 1.15rem; font-weight: 700;
  color: var(--muted); margin-bottom: 10px;
}
.podium-pts-1 { font-size: 1.4rem; color: var(--accent); }

/* The block each player stands on */
.podium-block {
  width: 100%; border-radius: var(--r-md) var(--r-md) 0 0;
  display: flex; align-items: center; justify-content: center;
}
.podium-block-1 {
  height: 90px;
  background: linear-gradient(180deg, rgba(232,255,71,.2) 0%, rgba(232,255,71,.08) 100%);
  border: 1px solid rgba(232,255,71,.35);
  border-bottom: none;
}
.podium-block-2 {
  height: 66px;
  background: linear-gradient(180deg, rgba(192,192,192,.12) 0%, rgba(192,192,192,.05) 100%);
  border: 1px solid rgba(192,192,192,.2);
  border-bottom: none;
}
.podium-block-3 {
  height: 50px;
  background: linear-gradient(180deg, rgba(205,127,50,.1) 0%, rgba(205,127,50,.04) 100%);
  border: 1px solid rgba(205,127,50,.18);
  border-bottom: none;
}
.podium-rank {
  font-family: var(--font-display);
  font-size: 1.3rem; font-weight: 700; color: rgba(255,255,255,.3);
}
.podium-block-1 .podium-rank { color: rgba(232,255,71,.5); font-size: 1.6rem; }

@media (min-width: 480px) {
  .podium { gap: 12px; }
  .podium-slot { max-width: 200px; }
  .podium-avatar { width: 56px; height: 56px; }
  .podium-avatar-1 { width: 70px; height: 70px; }
  .podium-block-1 { height: 110px; }
  .podium-block-2 { height: 82px; }
  .podium-block-3 { height: 62px; }
}
@media (min-width: 640px) {
  .podium-slot { max-width: 240px; }
  .podium-player-name { font-size: 1rem; }
  .podium-player-1 { font-size: 1.2rem; }
}

/* ─── iOS safe areas ─────────────────────────────────────────────────────── */
@supports (padding: max(0px)) {
  .navbar { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
  .footer { padding-bottom: max(22px, env(safe-area-inset-bottom)); }
}

/* ─── Active match: edit name / players ─────────────────────────────────────── */
.match-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.match-edit-open {
  flex-shrink: 0;
}

.match-edit-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 20px;
}
.match-edit-overlay[hidden] {
  display: none;
}
.match-edit-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 14, 0.82);
  backdrop-filter: blur(10px);
}
.match-edit-dialog {
  position: relative;
  width: min(440px, 100%);
  max-height: min(88vh, 720px);
  overflow-y: auto;
  padding: 22px 22px 20px;
  margin: 0;
  animation: match-edit-pop 0.22s ease-out;
}
@keyframes match-edit-pop {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.match-edit-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}
.match-edit-players {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 42vh;
  overflow-y: auto;
  padding-right: 4px;
}
.match-edit-player-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.match-edit-player-num {
  flex-shrink: 0;
  width: 28px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
}
.match-edit-player-row .form-control {
  flex: 1;
  min-width: 0;
}
.match-edit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

/* ── PWA install hint (mobile phones only — compact bottom sheet) ───────────── */
.pwa-install-popin {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  pointer-events: none;
}
.pwa-install-popin[hidden] {
  display: none;
}
.pwa-install-underlay {
  position: absolute;
  inset: 0;
  background: rgba(6, 8, 14, 0.42);
  border: none;
  cursor: pointer;
  pointer-events: auto;
}
.pwa-install-card {
  position: relative;
  z-index: 1;
  pointer-events: auto;
  width: 100%;
  max-width: 480px;
  max-height: min(46vh, 320px);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -8px 36px rgba(0, 0, 0, 0.35);
  padding: 10px 14px calc(12px + env(safe-area-inset-bottom, 12px));
  animation: pwa-sheet-in 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
@media (prefers-reduced-motion: reduce) {
  .pwa-install-card {
    animation: none;
  }
}
@keyframes pwa-sheet-in {
  from {
    transform: translateY(104%);
    opacity: 0.96;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
.pwa-sheet-handle {
  width: 36px;
  height: 4px;
  margin: 0 auto 10px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.12);
}
.pwa-install-heading-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-right: 36px;
  margin-bottom: 4px;
}
.pwa-install-heading-row .pwa-ico-ring {
  flex-shrink: 0;
}
.pwa-install-x {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: var(--surface2);
  color: var(--text);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  transition: opacity 0.15s ease;
}
.pwa-install-x:hover {
  opacity: 0.85;
}
.pwa-install-heading {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.25;
  margin: 0;
}
.pwa-install-intro {
  margin: 0 0 8px;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.35;
}
.pwa-chrome-tip {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 10px;
  border-radius: var(--r-sm);
  background: rgba(232, 255, 71, 0.06);
  border: 1px solid rgba(232, 255, 71, 0.16);
  font-size: 0.76rem;
  line-height: 1.4;
  margin-bottom: 8px;
}
.pwa-chrome-tip strong {
  color: var(--accent);
}
.pwa-chrome-tip-ico {
  flex-shrink: 0;
}
.pwa-chrome-tip .pwa-ico-ring svg {
  color: var(--accent);
}
.pwa-install-steps {
  margin-bottom: 10px;
}
.pwa-visual-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 6px;
  margin-bottom: 8px;
  border-radius: var(--r-md);
  background: rgba(0, 0, 0, 0.2);
}
.pwa-ico-ring {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--r-sm);
  background: linear-gradient(135deg, rgba(232, 255, 71, 0.12), rgba(48, 209, 88, 0.1));
  border: 1px solid rgba(232, 255, 71, 0.14);
}
.pwa-install-heading-row .pwa-ico-ring {
  width: 38px;
  height: 38px;
}
.pwa-ico-ring svg {
  width: 20px;
  height: 20px;
  stroke: var(--accent);
}
.pwa-vis-arrow {
  opacity: 0.72;
}
.pwa-vis-arrow svg {
  width: 18px;
  height: 18px;
  stroke: var(--muted);
}
.pwa-step-list {
  padding-left: 1.1rem;
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.45;
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--text-dim);
}
.pwa-step-list strong {
  color: var(--text);
}
.pwa-plain {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.5;
}
.pwa-plain-muted {
  color: var(--muted);
}
.pwa-install-actions {
  display: flex;
  flex-direction: row;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.btn-pwa-secondary {
  padding: 8px 14px;
  font-size: 0.8rem !important;
  min-height: unset;
}
#pwa-native-btn.btn-pwa-install {
  width: 100%;
  justify-content: center;
  padding: 10px 14px;
  font-size: 0.87rem !important;
  margin-bottom: 6px;
}
.btn-full-sm {
  width: 100%;
  justify-content: center;
}
#pwa-native-btn.hidden,
#pwa-native-btn[hidden],
.pwa-install-popin button#pwa-native-btn[hidden] {
  display: none !important;
}
