/* ===========================================================
   Goalii Redesign — Design Tokens
   Premium, dark-first, pitch-green accent. Evolved from current.
   =========================================================== */

:root {
  /* === BRAND === */
  /* Accent — refined from neon #00FF66 → softer, more confident pitch green */
  --accent-50:  #E6FFF1;
  --accent-100: #BCFFD9;
  --accent-200: #80FFB7;
  --accent-300: #3BF389;
  --accent-400: #1FE672;     /* primary accent */
  --accent-500: #14C25C;
  --accent-600: #0E9847;
  --accent-700: #0A7236;
  --accent-800: #064D24;
  --accent-900: #042E16;

  /* Pro / premium — gold, used sparingly */
  --gold-300: #F5D27A;
  --gold-400: #E8B84A;
  --gold-500: #C99325;

  /* Reds (loss / down) */
  --red-400: #FF6B5C;
  --red-500: #F0463A;

  /* === SURFACES (dark by default) === */
  --bg-page:     #070A09;     /* near-black, slight green undertone */
  --bg-elev-1:   #0F1A14;     /* card */
  --bg-elev-2:   #16241B;     /* card-on-card */
  --bg-elev-3:   #1E3025;     /* hover / selected */
  --bg-tint:     rgba(31, 230, 114, 0.08);
  --bg-tint-strong: rgba(31, 230, 114, 0.16);

  /* Stadium gradient — used very sparingly, hero only */
  --grad-pitch: radial-gradient(1200px 600px at 50% 120%, rgba(31,230,114,0.22), transparent 60%);
  --grad-spotlight: radial-gradient(800px 400px at 50% -10%, rgba(255,255,255,0.08), transparent 60%);

  /* === INK (text on dark) === */
  --ink-100: #FAFCFB;        /* primary */
  --ink-200: #E5EBE7;
  --ink-300: #BFC7C2;
  --ink-400: #8C948F;        /* secondary */
  --ink-500: #5E665F;        /* tertiary / hint */
  --ink-600: #3F4641;
  --ink-700: #262B27;

  /* === BORDERS === */
  --border-hairline: rgba(255, 255, 255, 0.06);
  --border-subtle:   rgba(255, 255, 255, 0.10);
  --border-strong:   rgba(255, 255, 255, 0.16);
  --border-accent:   rgba(31, 230, 114, 0.32);
  --border-accent-strong: rgba(31, 230, 114, 0.6);

  /* === SHADOWS === */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.45), 0 2px 6px rgba(0,0,0,0.3);
  --shadow-lg: 0 24px 60px rgba(0,0,0,0.55), 0 8px 18px rgba(0,0,0,0.35);
  --shadow-glow: 0 0 0 1px rgba(31,230,114,0.32), 0 12px 32px rgba(31,230,114,0.18);
  --shadow-glow-soft: 0 8px 28px rgba(31,230,114,0.10);
  --inner-hairline: inset 0 0 0 1px rgba(255,255,255,0.04);

  /* === RADII === */
  --r-xs: 8px;
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 20px;
  --r-xl: 24px;
  --r-2xl: 28px;
  --r-pill: 9999px;

  /* === TYPE === */
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", system-ui, sans-serif;
  --font-mono: "SF Mono", ui-monospace, Menlo, monospace;

  /* Display — used for hero numbers, scores */
  --t-mega:    700 56px/56px var(--font);
  --t-display: 700 40px/44px var(--font);
  --t-title-1: 700 28px/32px var(--font);
  --t-title-2: 700 22px/26px var(--font);
  --t-title-3: 600 18px/22px var(--font);
  --t-headline:600 16px/20px var(--font);
  --t-body:    500 15px/20px var(--font);
  --t-callout: 500 14px/18px var(--font);
  --t-footnote:500 13px/16px var(--font);
  --t-caption: 600 11px/14px var(--font);
  --t-overline:700 10px/12px var(--font);

  /* === MOTION === */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Light mode (toggleable via Tweaks) */
.light {
  --bg-page: #F5F7F4;
  --bg-elev-1: #FFFFFF;
  --bg-elev-2: #FAFCFA;
  --bg-elev-3: #F0F4F0;
  --bg-tint: rgba(14, 152, 71, 0.08);
  --bg-tint-strong: rgba(14, 152, 71, 0.16);

  --ink-100: #0A1410;
  --ink-200: #1A241F;
  --ink-300: #3A453F;
  --ink-400: #6A746E;
  --ink-500: #98A19B;
  --ink-600: #C8D0CB;
  --ink-700: #E4EAE6;

  --border-hairline: rgba(10,20,16,0.06);
  --border-subtle:   rgba(10,20,16,0.10);
  --border-strong:   rgba(10,20,16,0.16);

  --shadow-sm: 0 1px 2px rgba(10,20,16,0.06);
  --shadow-md: 0 8px 24px rgba(10,20,16,0.08), 0 2px 6px rgba(10,20,16,0.04);
  --shadow-lg: 0 24px 60px rgba(10,20,16,0.10), 0 8px 18px rgba(10,20,16,0.06);
  --inner-hairline: inset 0 0 0 1px rgba(10,20,16,0.03);

  --accent-400: #0E9847;
}

/* Density modes */
.density-cozy { --pad-card: 18px; --gap-card: 14px; --pad-screen: 20px; }
.density-compact { --pad-card: 14px; --gap-card: 10px; --pad-screen: 16px; }
.density-spacious { --pad-card: 22px; --gap-card: 18px; --pad-screen: 24px; }

:root { --pad-card: 18px; --gap-card: 14px; --pad-screen: 20px; }

/* === BASE === */
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  font-family: var(--font);
  color: var(--ink-100);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; padding: 0; color: inherit; }
input, textarea, select { font-family: inherit; }
a { color: inherit; text-decoration: none; }

/* === SCREEN PRIMITIVES === */
.gl-screen {
  width: 100%; height: 100%;
  background: var(--bg-page);
  display: flex; flex-direction: column;
  color: var(--ink-100);
  position: relative;
  overflow: hidden;
  font-family: var(--font);
}
.gl-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.gl-scroll::-webkit-scrollbar { display: none; }

/* === CARD === */
.gl-card {
  background: var(--bg-elev-1);
  border-radius: var(--r-lg);
  border: 1px solid var(--border-hairline);
  box-shadow: var(--shadow-sm), var(--inner-hairline);
}
.gl-card-elev {
  background: linear-gradient(180deg, var(--bg-elev-2), var(--bg-elev-1));
  border-radius: var(--r-lg);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-md), var(--inner-hairline);
}

/* === BUTTONS === */
.gl-btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 54px; padding: 0 24px;
  background: var(--accent-400); color: #06120A;
  font: 700 16px/20px var(--font);
  letter-spacing: -0.1px;
  border-radius: var(--r-pill);
  box-shadow: 0 8px 24px rgba(31,230,114,0.32), inset 0 1px 0 rgba(255,255,255,0.3);
  transition: transform 0.12s var(--ease-out), filter 0.12s;
}
.gl-btn-primary:hover { filter: brightness(1.05); }
.gl-btn-primary:active { transform: scale(0.97); }

.gl-btn-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 50px; padding: 0 22px;
  background: rgba(255,255,255,0.06); color: var(--ink-100);
  font: 600 15px/19px var(--font);
  border-radius: var(--r-pill);
  border: 1px solid var(--border-subtle);
  transition: background 0.12s, transform 0.12s;
}
.gl-btn-secondary:hover { background: rgba(255,255,255,0.10); }
.gl-btn-secondary:active { transform: scale(0.97); }

.gl-btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 14px;
  font: 600 13px/16px var(--font);
  color: var(--accent-400);
  border-radius: var(--r-pill);
  background: var(--bg-tint);
  transition: background 0.12s;
}
.gl-btn-ghost:hover { background: var(--bg-tint-strong); }

/* === CHIPS === */
.gl-chip {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 32px; padding: 0 14px;
  border-radius: var(--r-pill);
  font: 600 13px/16px var(--font);
  color: var(--ink-300);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-hairline);
  white-space: nowrap;
  transition: all 0.15s var(--ease-out);
}
.gl-chip.active {
  color: #06120A;
  background: var(--accent-400);
  border-color: var(--accent-400);
}
.gl-chip-tone-pro {
  color: var(--gold-400);
  background: rgba(232,184,74,0.10);
  border: 1px solid rgba(232,184,74,0.32);
}

/* === OVERLINE === */
.gl-overline {
  font: var(--t-overline);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--ink-400);
}

/* === TAB BAR (bottom nav) === */
.gl-tab-bar {
  height: 88px;
  padding: 10px 8px 28px;
  background: color-mix(in srgb, var(--bg-elev-1) 88%, transparent);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-top: 1px solid var(--border-hairline);
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  position: relative;
  z-index: 5;
}
.gl-tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  color: var(--ink-500);
  font: 600 10px/12px var(--font);
  letter-spacing: 0.2px;
  position: relative;
  transition: color 0.15s;
}
.gl-tab.active { color: var(--accent-400); }
.gl-tab.active::before {
  content: ""; position: absolute; top: 0;
  width: 28px; height: 3px; border-radius: 0 0 3px 3px;
  background: var(--accent-400);
}
.gl-tab svg { width: 24px; height: 24px; }

/* === NAV BAR (top) === */
.gl-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 20px 12px; gap: 12px;
}
.gl-nav-icon-btn {
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--r-pill);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-hairline);
  color: var(--ink-200);
  transition: background 0.12s;
}
.gl-nav-icon-btn:hover { background: rgba(255,255,255,0.08); }

/* === DOTS / DIVIDERS === */
.gl-dot { display: inline-block; width: 4px; height: 4px; border-radius: 50%; background: currentColor; opacity: 0.5; }

/* === UTILS === */
.gl-mono { font-family: var(--font-mono); font-feature-settings: "tnum" 1; }
.gl-tnum { font-feature-settings: "tnum" 1; }
.gl-clip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* keyframes */
@keyframes pulse-soft {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}
@keyframes glow-breathe {
  0%, 100% { box-shadow: 0 0 0 0 rgba(31,230,114,0.4); }
  50% { box-shadow: 0 0 0 8px rgba(31,230,114,0); }
}
.gl-pulse { animation: pulse-soft 1.6s ease-in-out infinite; }
.gl-live-dot { display:inline-block; width:8px; height:8px; border-radius:50%; background: var(--red-400); animation: glow-breathe 1.6s ease-in-out infinite; }
