/* FOOTYUP · light theme overrides + Notifications drawer + Onboarding overlay
   Light theme: invert hardcoded surface tints that don't auto-flip via tokens. */

[data-theme="light"] {
  /* additional helper tokens for light-only states */
  --surface-faint: rgba(8, 8, 10, 0.04);
  --surface-faint-2: rgba(8, 8, 10, 0.06);
  --surface-hover: rgba(8, 8, 10, 0.05);
  --ink-glass: rgba(244, 241, 235, 0.7);   /* used for sticky chrome backdrops in light */
}

:root, [data-theme="dark"] {
  --surface-faint: rgba(244, 241, 235, 0.03);
  --surface-faint-2: rgba(244, 241, 235, 0.06);
  --surface-hover: rgba(244, 241, 235, 0.04);
  --ink-glass: rgba(8, 8, 10, 0.7);
}

/* ════════════════════════════════════════════════════════════
   GLOBAL light-theme polish
   ════════════════════════════════════════════════════════════ */

/* row hovers — flip rgba(244,...) to rgba(8,...) */
[data-theme="light"] .day-cell:hover,
[data-theme="light"] .players-table tbody tr:hover,
[data-theme="light"] .podium .slot:hover,
[data-theme="light"] .report-row:hover,
[data-theme="light"] .promo-row a:hover,
[data-theme="light"] .pay-method:hover,
[data-theme="light"] .press-row:hover,
[data-theme="light"] .search-row:hover,
[data-theme="light"] .search-row.focus,
[data-theme="light"] .radio-card:hover {
  background: rgba(8, 8, 10, 0.04);
}

/* faint inset surfaces */
[data-theme="light"] .checkout-aside,
[data-theme="light"] .press-pack,
[data-theme="light"] .qr-row-2fa {
  background: rgba(8, 8, 10, 0.03);
}
/* skeleton */
[data-theme="light"] .skel {
  background:
    linear-gradient(90deg,
      var(--bone-faint) 0%,
      rgba(8, 8, 10, 0.10) 40%,
      var(--bone-faint) 80%);
  background-size: 400% 100%;
}
[data-theme="light"] .gc-skel .ph-img { background: rgba(8, 8, 10, 0.06); }

/* dark-on-light cards — flip surface colors */
[data-theme="light"] .gc .gc-img,
[data-theme="light"] .fu-modal-gallery,
[data-theme="light"] .checkout-success::before {
  background: linear-gradient(135deg, #E6E1D2 0%, #D6CFB9 100%);
}

/* pitch art — light variants */
[data-theme="light"] .pitch-art[data-surface="indoor"]  { --pitch-bg: #DCE4D9; --pitch-line: rgba(8,8,10,0.18); --pitch-tint: rgba(45,216,129,0.10); }
[data-theme="light"] .pitch-art[data-surface="outdoor"] { --pitch-bg: #D5DEC9; --pitch-line: rgba(8,8,10,0.18); --pitch-tint: rgba(45,216,129,0.10); }
[data-theme="light"] .pitch-art[data-surface="sand"]    { --pitch-bg: #E8D7B6; --pitch-line: rgba(8,8,10,0.22); --pitch-tint: rgba(255,176,32,0.10); }
[data-theme="light"] .pitch-art[data-surface="futsal"]  { --pitch-bg: #E8D2C7; --pitch-line: rgba(8,8,10,0.22); --pitch-tint: rgba(255,46,99,0.06); }
[data-theme="light"] .pitch-art .top-pill {
  background: rgba(244, 241, 235, 0.8);
  border-color: rgba(8, 8, 10, 0.18);
}
[data-theme="light"] .pitch-art .ph-tag { color: rgba(8, 8, 10, 0.5); }

/* status badges (game cards) on light */
[data-theme="light"] .gc .gc-status {
  background: rgba(244, 241, 235, 0.85);
  border-color: rgba(8, 8, 10, 0.2);
  color: var(--bone);
}
[data-theme="light"] .gc .gc-time {
  text-shadow: 0 2px 12px rgba(244, 241, 235, 0.6);
  color: var(--ink);
}

/* sticky chrome backdrop for light */
[data-theme="light"] .fu-header,
[data-theme="light"] .sched-controls,
[data-theme="light"] .standings-toolbar,
[data-theme="light"] .standings-filters {
  background: color-mix(in srgb, var(--ink) 88%, transparent);
}

/* day cell active text on light (ink-on-orange already works, but secondary color) */
[data-theme="light"] .day-cell.active .day-cell-label,
[data-theme="light"] .day-cell.active .day-cell-count {
  color: rgba(8, 8, 10, 0.7);
}

/* modal close button — flip dark backdrop */
[data-theme="light"] .fu-modal-close {
  background: rgba(244, 241, 235, 0.85);
  border-color: rgba(8, 8, 10, 0.2);
  color: var(--bone);
}

/* avatars in player cells — flip bg gradients */
[data-theme="light"] .fu-av { color: var(--ink); }
[data-theme="light"] .fu-avatar-stack .fu-av { border-color: var(--ink); }

/* hero corners on light */
[data-theme="light"] .h-corner { border-color: rgba(8, 8, 10, 0.25); }

/* hero ball animation softer on light */
[data-theme="light"] .hero-ball { opacity: 0.12; }

/* glow / soft accents */
[data-theme="light"] .live-strip.glow {
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--accent) 12%, var(--ink)),
    var(--ink) 30%,
    var(--ink) 70%,
    color-mix(in srgb, var(--accent) 12%, var(--ink)));
}

/* CTA hover swap — bone→ink hover on dark, ink→bone on light = already token-driven */
[data-theme="light"] .gc .gc-book {
  background: var(--bone);
  color: var(--ink);
}
[data-theme="light"] .gc .gc-book:hover {
  background: var(--accent); color: var(--accent-text);
}

/* Formation grid on light: the hero's photo backdrop is bright, so 10% ink
   cells washed out and only the orange dots read. Bump the matrix contrast so
   the grid is as legible as it is on the dark theme. */
[data-theme="light"] .grid-11 i { background: rgba(8, 8, 10, 0.18); }
[data-theme="light"] .grid-11 i.dim { background: rgba(8, 8, 10, 0.34); }
/* The base light-theme `i` rule above has the same specificity as hero.css's
   `.grid-11 i.on` but loads later — without this it clobbers the accent and the
   formation dots vanish into grey. Restore the accent at higher specificity. */
[data-theme="light"] .grid-11 i.on { background: var(--accent); }

/* gradient bands on team-card portraits — soften on light */
[data-theme="light"] .team-card .portrait { opacity: 0.85; }

/* search overlay backdrop on light */
[data-theme="light"] .search-overlay {
  background: rgba(244, 241, 235, 0.82);
}

/* select element bg fix */
[data-theme="light"] select {
  background: transparent !important;
  color: var(--bone) !important;
}

/* saved cards (Payments) — flip ink gradient to soft cream */
[data-theme="light"] .saved-card {
  background: linear-gradient(135deg, #E8E2D2, #D5CDB7);
  color: var(--bone);
}
[data-theme="light"] .saved-card.default {
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 22%, #E8E2D2), #D5CDB7);
}
[data-theme="light"] .saved-card .chip-img {
  background: linear-gradient(135deg, #c9a256, #826627);
}

/* member ID card stays light-bg on dark-stage by design, so no flip */

/* Year-in-Review slides — gradient backgrounds on light */
[data-theme="light"] .yir-slide.intro,
[data-theme="light"] .yir-slide.venue,
[data-theme="light"] .yir-slide.end {
  background-color: var(--ink);
}

/* ════════════════════════════════════════════════════════════
   NOTIFICATIONS DRAWER
   ════════════════════════════════════════════════════════════ */
.notif-trigger {
  position: relative;
}
.notif-trigger .pip {
  position: absolute;
  top: -4px; right: -4px;
  min-width: 16px; height: 16px;
  background: var(--accent);
  color: var(--accent-text);
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 9px;
  display: grid; place-items: center;
  padding: 0 4px;
  border: 1px solid var(--ink);
}

.notif-drawer {
  position: fixed;
  top: 0; right: 0;
  width: 420px;
  max-width: 100vw;
  height: 100vh;
  height: 100dvh;
  /* iOS notch + home indicator: keep close button below notch, action row above home bar */
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--ink);
  border-left: 1px solid var(--bone-faint);
  z-index: 91;
  display: flex; flex-direction: column;
  animation: nmSlideIn 0.3s cubic-bezier(.2,.7,.3,1);
}
.notif-head {
  padding: 22px 24px;
  border-bottom: 1px solid var(--bone-faint);
  display: flex; align-items: center; justify-content: space-between;
}
.notif-head h2 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 22px;
  letter-spacing: -0.015em;
  text-transform: uppercase;
}
.notif-head h2 .italic { font-style: italic; color: var(--accent); font-weight: 800; }
.notif-body {
  flex: 1;
  overflow-y: auto;
}
.notif-section {
  padding: 12px 24px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--bone-dim);
}
.notif-row {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 14px;
  padding: 14px 24px;
  border-top: 1px solid var(--bone-faint);
  cursor: pointer;
  transition: background 0.15s;
  position: relative;
}
.notif-row:hover { background: var(--surface-hover); }
.notif-row.unread::after {
  content: '';
  position: absolute;
  left: 14px; top: 22px;
  width: 5px; height: 5px;
  background: var(--accent);
  border-radius: 50%;
}
.notif-row .glyph {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  background: var(--bone-faint);
  color: var(--bone);
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 12px;
  letter-spacing: -0.01em;
  flex-shrink: 0;
}
.notif-row.unread .glyph { background: var(--accent); color: var(--accent-text); }
.notif-row .body { display: flex; flex-direction: column; gap: 3px; }
.notif-row .title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.notif-row .title b { color: var(--accent); font-weight: 900; }
.notif-row .desc {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--bone-dim);
  line-height: 1.5;
}
.notif-row .when {
  font-family: 'JetBrains Mono';
  font-size: 10px;
  color: var(--bone-dim);
  margin-top: 4px;
  letter-spacing: 0.04em;
}
.notif-foot {
  padding: 16px 24px;
  border-top: 1px solid var(--bone-faint);
  display: flex; justify-content: space-between; align-items: center;
}
.notif-foot button {
  background: transparent;
  border: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--bone-dim);
  cursor: pointer;
}
.notif-foot button.primary { color: var(--accent); font-weight: 900; }
.notif-foot button:hover { color: var(--bone); }
.notif-foot button.primary:hover { color: var(--bone); }

.notif-empty {
  padding: 80px 24px;
  text-align: center;
  display: flex; flex-direction: column; align-items: center;
  gap: 14px;
}
.notif-empty .frame {
  width: 88px; height: 88px;
  border: 1px solid var(--bone-faint);
  display: grid; place-items: center;
  color: var(--bone-dim);
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 32px;
}
.notif-empty h4 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 18px;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}
.notif-empty p {
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--bone-dim);
  max-width: 240px;
}

/* ════════════════════════════════════════════════════════════
   ONBOARDING OVERLAY
   ════════════════════════════════════════════════════════════ */
.onb-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(5, 6, 12, 0.82);
  backdrop-filter: blur(20px);
  display: grid;
  place-items: center;
  padding: 24px;
  animation: nmFadeIn 0.25s ease;
}
[data-theme="light"] .onb-overlay { background: rgba(244, 241, 235, 0.86); }

/* ── Post-signup blocking onboarding gate ─────────────────────── */
.onbg-overlay {
  /* taller than a viewport on small screens — scroll instead of centre-clip */
  align-items: start;
  overflow-y: auto;
  padding: 48px 24px;
  z-index: 200; /* above every other overlay/drawer — it's a hard gate */
  /* Lighter scrim than the product-tour overlay: the site stays recognisable
     behind it (so it reads as "one more step on this page", not a blank wall),
     just dimmed + lightly blurred to push focus onto the card. */
  background: rgba(5, 6, 12, 0.5);
  backdrop-filter: blur(4px);
}
[data-theme="light"] .onbg-overlay { background: rgba(244, 241, 235, 0.55); }
.onbg-card {
  width: 100%;
  max-width: 720px;
  margin: auto;
  background: var(--ink);
  border: 1px solid var(--bone-faint);
  padding: 40px;
  animation: nmModalIn 0.35s cubic-bezier(.2,.7,.3,1);
}
.onbg-intro { margin-bottom: 28px; }
.onbg-intro h1 { margin: 16px 0 0; }
.onbg-lede {
  margin-top: 16px;
  font-family: 'Manrope', sans-serif;
  font-size: 15px;
  line-height: 1.55;
  color: var(--bone-dim);
  max-width: 460px;
}
.onbg-fields { margin-top: 24px; display: flex; flex-direction: column; gap: 24px; }
.onbg-grouplbl {
  font-family: var(--font-display, 'Archivo'), sans-serif;
  font-weight: 700; font-size: 10px;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--bone-dim); margin-bottom: 10px;
}
.onbg-actions { margin-top: 28px; display: flex; justify-content: space-between; align-items: center; }
.onbg-err {
  margin-top: 16px; padding: 10px 14px;
  border: 1px solid var(--accent);
  font-family: 'Manrope', sans-serif; font-size: 13px; color: var(--bone);
}
.onbg-card .fu-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.onbg-card input[readonly] { opacity: 0.6; cursor: not-allowed; }

.onb-card {
  width: 100%;
  max-width: 1120px;
  background: var(--ink);
  border: 1px solid var(--bone-faint);
  overflow: hidden;
  position: relative;
  animation: nmModalIn 0.35s cubic-bezier(.2,.7,.3,1);
}
.onb-head {
  padding: 19px 26px;
  border-bottom: 1px solid var(--bone-faint);
  display: flex; align-items: center; justify-content: space-between;
}
.onb-head .progress {
  display: flex; gap: 7px;
}
.onb-head .progress span {
  width: 34px; height: 2px;
  background: var(--bone-faint);
  transition: background 0.3s;
}
.onb-head .progress span.on { background: var(--accent); }
.onb-head .skip {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--bone-dim);
  border: 0;
  background: transparent;
  cursor: pointer;
}
.onb-head .skip:hover { color: var(--accent); }

.onb-body {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr; /* give the headline column the room it needs */
  height: 560px; /* fixed — every step is the exact same size, no card resize */
}
.onb-art {
  position: relative;
  background:
    radial-gradient(80% 100% at 30% 30%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%);
  overflow: hidden;
  display: grid; place-items: center;
  border-right: 1px solid var(--bone-faint);
}
.onb-art .num {
  font-family: var(--font-display);
  font-weight: 900;
  font-stretch: 125%;
  font-size: 288px;
  line-height: 0.86;
  letter-spacing: -0.06em;
  color: var(--accent);
  font-style: italic;
  animation: onbStepIn 0.4s cubic-bezier(.2,.7,.3,1);
}
.onb-art .glyph {
  position: absolute;
  font-family: var(--font-display);
  font-weight: 900;
  font-stretch: 125%;
  font-size: 76px;
  letter-spacing: -0.04em;
  color: transparent;
  -webkit-text-stroke: 1.5px var(--bone-faint);
  text-transform: uppercase;
  pointer-events: none;
}
.onb-art .glyph.tl { top: 28px; left: 28px; font-size: 21px; -webkit-text-stroke-width: 0; color: var(--bone-dim); font-style: normal; font-weight: 700; letter-spacing: 0.22em; }
.onb-art .glyph.br { bottom: 28px; right: 28px; }

.onb-content {
  padding: 56px 52px;
  display: flex; flex-direction: column;
  justify-content: flex-start; /* top-aligned + fixed title height = frozen Y across steps */
  animation: onbStepIn 0.35s cubic-bezier(.2,.7,.3,1);
}
.onb-eyebrow {
  display: flex; align-items: center; gap: 16px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--bone-dim);
  margin-bottom: 22px;
}
.onb-eyebrow::before {
  content: '';
  width: 34px; height: 1px;
  background: var(--accent);
}
.onb-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-stretch: 125%;
  /* Fixed (non-viewport) size so wrapping is deterministic: at the card's
     wide column every headline lands on exactly 2 lines, so the description
     and numbers sit at the same Y on every step — nothing jumps. */
  font-size: 46px;
  line-height: 0.95;
  letter-spacing: -0.035em;
  text-transform: uppercase;
  min-height: 92px; /* exactly 2 lines */
}
.onb-title .italic { font-style: italic; color: var(--accent); font-weight: 800; }
.onb-desc {
  margin-top: 4px;
  font-family: var(--font-sans);
  font-size: 18px;
  line-height: 1.55;
  color: var(--bone-dim);
}
.onb-desc b { color: var(--bone); }

.onb-foot {
  padding: 20px 26px;
  border-top: 1px solid var(--bone-faint);
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px;
}
.onb-foot .step-label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--bone-dim);
}
@keyframes onbStepIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* The wide 2-column tour needs the full ~1120px to keep every headline at two
   lines. Below that, stack art-over-content so the column never gets narrow
   enough to re-wrap a title to three lines (which would reintroduce the jump).
   This is onb-specific — it deliberately stacks earlier than the 800px mobile
   breakpoint used by other surfaces. */
@media (max-width: 1160px) {
  .onb-body { grid-template-columns: 1fr; height: auto; }
  .onb-art { min-height: 220px; border-right: 0; border-bottom: 1px solid var(--bone-faint); }
  .onb-title { min-height: 0; font-size: clamp(34px, 5.5vw, 50px); }
  .onb-content { padding: 44px 40px; }
  /* Stacked: align every row's left/right edge to the content inset
     (vertical padding untouched, so heights don't shift). */
  .onb-head, .onb-foot { padding-left: 40px; padding-right: 40px; }
}

@media (max-width: 800px) {
  .onb-body { grid-template-columns: 1fr; height: auto; min-height: 0; }
  .onb-art { min-height: 200px; border-right: 0; border-bottom: 1px solid var(--bone-faint); }
  .onb-art .num { font-size: 144px; }
  /* The corner watermark glyphs (FOOTYUP·TOUR / EST.2026) are sized for the
     tall 560px desktop panel; in the short stacked mobile panel they pile on
     top of the centred number. Drop them — the step is already shown by the
     progress dots and the "Step X of 4" footer. */
  .onb-art .glyph { display: none; }
  .onb-content { padding: 28px 24px; }
  .onb-head, .onb-foot { padding-left: 24px; padding-right: 24px; }
  .onb-title { min-height: 0; }
  .notif-drawer { width: 100vw; border-left: 0; }

  /* Stack the foot so step-label sits above the buttons regardless of
     button-label width. Without this, "Open the schedule" on step 4 is
     wide enough to push "Step 4 of 4" into a two-line wrap, while steps
     1-3 (with the short "Next" button) keep it on one line — the
     resulting jump is what reads as "everything jumps on step 4". */
  .onb-foot {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }
  .onb-foot > div:last-child { justify-content: flex-end; }
}

/* ════════════════════════════════════════════════════════════
   PHONE TIER — notifications drawer + onboarding gate/tour
   ════════════════════════════════════════════════════════════ */
@media (max-width: 480px) {
  /* ── Notifications drawer: full-bleed, no side borders ─────── */
  .notif-drawer {
    width: 100vw;
    border-left: 0;
    border-right: 0;
  }
  .notif-head { padding: 18px 16px; }
  .notif-body {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .notif-row { padding: 12px 16px; gap: 12px; }

  /* ── Onboarding gate (post-signup blocking form) ───────────── */
  .onbg-card {
    padding: 28px 16px;
    width: calc(100vw - 32px);
    max-width: 100%;
  }
  .onbg-intro { margin-bottom: 20px; }
  .onbg-intro h1 { font-size: 28px; }
  .onbg-lede { font-size: 13px; }
  .onbg-fields { gap: 18px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .fu-field.full { grid-column: auto; }
  .apply-stepper { grid-template-columns: 1fr; gap: 0; }
  .apply-stepper .apply-step {
    padding: 12px 14px;
    font-size: 9px;
    border-bottom: 1px solid var(--bone-faint);
    border-right: 0;
  }
  .apply-stepper .apply-step .num { font-size: 10px; }
  .onbg-actions {
    flex-direction: column;
    gap: 12px;
  }
  .onbg-actions button { width: 100%; }

  /* ── Onboarding radio grids (position / feet / availability) ── */
  .radio-cards { grid-template-columns: repeat(2, 1fr); }
  .radio-card {
    padding: 12px 10px;
    min-height: 44px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }
  .radio-card .label { font-size: 12px; }
  .radio-card .sub { font-size: 10px; line-height: 1.2; }

  /* ── Onboarding tour card ──────────────────────────────────── */
  .onb-card {
    width: calc(100vw - 24px);
    max-width: 100%;
    max-height: 90vh;
    overflow-y: auto;
  }
  .onb-body { min-height: 0; }
  .onb-art { min-height: 140px; }
  .onb-art .num { font-size: 100px; }
  .onb-content { padding: 24px 18px; }
  .onb-title { font-size: 24px; }
  .onb-desc { font-size: 13px; }
  .onb-foot { padding: 16px 18px; }
  .onb-head { padding-left: 18px; padding-right: 18px; }
}
