/* Scoroscope · design tokens */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@500;700&display=swap');

:root {
  /* ─ Palette: dark premium (default) ─ */
  --bg:        #07090B;
  --bg-elev:   #0E1216;
  --bg-elev-2: #161B21;
  --bg-elev-3: #1E242B;
  --line:        rgba(255,255,255,0.06);
  --line-mid:    rgba(255,255,255,0.10);
  --line-strong: rgba(255,255,255,0.16);

  --ink:    #F2F4F6;
  --ink-2:  #B3BBC4;
  --ink-3:  #7A828B;
  --ink-4:  #4D555E;

  /* Brand */
  --mint:        #4ADE9E;
  --mint-bright: #6EF0B6;
  --mint-dim:    rgba(74, 222, 158, 0.12);
  --mint-line:   rgba(74, 222, 158, 0.30);
  --mint-text:   #4ADE9E;       /* sur fond sombre le mint passe en texte */
  --mint-deep:   #2EB57F;

  /* Accents */
  --yellow:     #FFD23F;
  --yellow-dim: rgba(255, 210, 63, 0.14);
  --red:        #FF5C5C;
  --red-dim:    rgba(255, 92, 92, 0.14);
  --blue:       #5B9DFF;
  --orange:     #FF9F4D;

  /* Fonts */
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body:    'Inter', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, monospace;

  /* Radii */
  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;
  --r-xl: 26px;

  /* Echelle typographique (à utiliser à la place des style="font-size:..." inline) */
  --fs-hero:       clamp(36px, 5vw, 56px);
  --fs-display-1:  clamp(28px, 4vw, 40px);
  --fs-display-2:  clamp(22px, 3vw, 32px);
  --fs-title-lg:   24px;
  --fs-title-md:   18px;
  --fs-body:       15px;
  --fs-small:      13px;
  --fs-eyebrow:    11px;
  --fs-micro:      10px;
  --fs-ticker:     42px;
  --fs-ticker-lg:  56px;

  /* Espacement de section vertical (à utiliser en padding-y des sections principales) */
  --space-section: clamp(40px, 6vw, 72px);

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
  --shadow-md: 0 10px 30px rgba(0,0,0,0.35);
  --glow-mint: 0 0 0 1px rgba(74,222,158,0.35), 0 8px 24px rgba(74,222,158,0.18);

  /* Aesthetic hooks reused across screens */
  --hero-dark:      #04140A;
  --hero-blue-dark: #0E1620;
  --star-color:     rgba(255,255,255,0.95);
  --star-opacity:   0.45;
  --crest-shade:    rgba(0,0,0,0.18);
  --selection-fg:   #00170B;
}

/* ── Variation · Carbone (warm graphite) ──────────────── */
:root[data-theme="carbone"] {
  --bg:        #14110F;
  --bg-elev:   #1C1916;
  --bg-elev-2: #25211D;
  --bg-elev-3: #2F2A25;
  --line:        rgba(255,235,210,0.06);
  --line-mid:    rgba(255,235,210,0.10);
  --line-strong: rgba(255,235,210,0.18);

  --ink:    #F4EFE7;
  --ink-2:  #BFB6A7;
  --ink-3:  #877E70;

  --mint:        #5BE8AC;
  --mint-bright: #82F5C2;
  --mint-dim:    rgba(91, 232, 172, 0.14);
  --mint-line:   rgba(91, 232, 172, 0.32);
  --mint-text:   #5BE8AC;
  --mint-deep:   #3BC990;

  --yellow:     #FFC857;
  --yellow-dim: rgba(255, 200, 87, 0.16);

  --hero-dark:      #0F1810;
  --hero-blue-dark: #15181E;
}

/* ── Variation · Gris (charcoal mid) ──────────────────── */
:root[data-theme="gris"] {
  --bg:        #2D3136;
  --bg-elev:   #383D43;
  --bg-elev-2: #424950;
  --bg-elev-3: #4E555D;
  --line:        rgba(255,255,255,0.08);
  --line-mid:    rgba(255,255,255,0.14);
  --line-strong: rgba(255,255,255,0.22);

  --ink:    #F4F6F8;
  --ink-2:  #C8CED4;
  --ink-3:  #8C949C;
  --ink-4:  #5E6770;

  --mint:        #4ADE9E;
  --mint-bright: #6EF0B6;
  --mint-dim:    rgba(74, 222, 158, 0.16);
  --mint-line:   rgba(74, 222, 158, 0.36);
  --mint-text:   #4ADE9E;
  --mint-deep:   #2EB57F;

  --yellow:     #FFD23F;
  --yellow-dim: rgba(255, 210, 63, 0.18);

  --hero-dark:      #20262B;
  --hero-blue-dark: #262E36;
}

/* ── Variation · Blanc (clean, daylight) ──────────────── */
:root[data-theme="blanc"] {
  --bg:        #F6F6F2;
  --bg-elev:   #FFFFFF;
  --bg-elev-2: #EFEFEB;
  --bg-elev-3: #E3E4DF;
  --line:        rgba(10,15,12,0.06);
  --line-mid:    rgba(10,15,12,0.11);
  --line-strong: rgba(10,15,12,0.20);

  --ink:    #0B0F0D;
  --ink-2:  #3D454E;
  --ink-3:  #767E87;
  --ink-4:  #B0B7BE;

  --mint:        #1AB270;       /* surfaces : boutons remplis, gradients */
  --mint-bright: #22CB80;
  --mint-dim:    rgba(26, 178, 112, 0.08);
  --mint-line:   rgba(26, 178, 112, 0.26);
  --mint-text:   #0E7A4B;       /* texte mint sur fond clair : 4.7:1 (WCAG AA) */
  --mint-deep:   #0A5C38;       /* texte mint sur surface mint-dim : 6.2:1 */

  --yellow:     #B58400;
  --yellow-dim: rgba(181, 132, 0, 0.10);
  --red:        #DC3F3F;
  --red-dim:    rgba(220, 63, 63, 0.08);
  --blue:       #2C7AE0;
  --orange:     #E37D1A;

  --shadow-sm: 0 1px 2px rgba(20,30,40,0.06);
  --shadow-md: 0 12px 28px rgba(20,30,40,0.08);
  --glow-mint: 0 0 0 1px rgba(26,178,112,0.30), 0 8px 24px rgba(26,178,112,0.15);

  --hero-dark:      #E5F1EA;
  --hero-blue-dark: #EAEFF6;
  --star-color:     #0A0F0C;
  --star-opacity:   0.12;
  --selection-fg:   #FFFFFF;
  --crest-shade:    rgba(0,0,0,0.10);
}

/* Tab bar adapts its glass background per theme */
:root[data-theme="blanc"] .tabbar {
  background: rgba(247,247,244,0.85);
}
:root[data-theme="gris"] .tabbar {
  background: rgba(45,49,54,0.85);
}
:root[data-theme="carbone"] .tabbar {
  background: rgba(20,17,15,0.85);
}

/* Number spinner & big dial inner shadow use mint var */
:root[data-theme="blanc"] .starfield { display: none; }

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'cv11', 'ss03';
}

/* tiny utility — apply to any artboard root */
.app-root {
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 14px;
  letter-spacing: -0.005em;
  overflow: hidden;
  position: relative;
}
.app-scroll {
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.app-scroll::-webkit-scrollbar { display: none; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.display { font-family: var(--font-display); letter-spacing: -0.02em; }

/* Buttons */
.btn {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  border: none;
  border-radius: var(--r-md);
  padding: 12px 18px;
  cursor: pointer;
  transition: transform .12s, background-color .15s, box-shadow .15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
}
.btn-mint   { background: var(--mint); color: #00170B; }
.btn-mint:hover   { background: var(--mint-bright); }
.btn-yellow { background: var(--yellow); color: #1A1300; }
.btn-ghost  { background: transparent; color: var(--ink); border: 1px solid var(--line-strong); }
.btn-ghost:hover { background: var(--bg-elev-2); }
.btn-mono   { font-family: var(--font-mono); font-weight: 700; letter-spacing: 0.02em; }

/* Card */
.card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}
.card-flat {
  background: var(--bg-elev);
  border-radius: var(--r-lg);
}

/* Light-theme cards get a soft shadow + pure white surface for depth */
:root[data-theme="blanc"] .card,
:root[data-theme="blanc"] .card-flat {
  background: #FFFFFF;
  border-color: rgba(10,15,12,0.06);
  box-shadow: 0 1px 2px rgba(20,30,40,0.04);
}

/* Chips */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--bg-elev-2);
  color: var(--ink-2);
  border: 1px solid var(--line);
}
.chip-mint { background: var(--mint-dim); color: var(--mint); border-color: var(--mint-line); }
.chip-yellow { background: var(--yellow-dim); color: var(--yellow); border-color: rgba(255,210,63,0.32); }
.chip-red { background: var(--red-dim); color: var(--red); border-color: rgba(255,92,92,0.32); }
.chip-live { background: var(--red); color: #fff; border-color: transparent; }
.chip-live::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: #fff; animation: pulse 1.2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.3; }
}

/* Divider */
.hr { height: 1px; background: var(--line); border: 0; margin: 0; }

/* Avatars */
.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  font-family: var(--font-display);
  font-weight: 700;
  flex-shrink: 0;
  background: var(--bg-elev-3);
  color: var(--ink);
}

/* score input squares */
.score-square {
  width: 56px; height: 64px;
  background: var(--bg-elev-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-weight: 700; font-size: 28px;
  color: var(--ink);
  transition: all .12s;
  cursor: pointer;
}
.score-square.active { border-color: var(--mint); background: var(--mint-dim); color: var(--mint); }
.score-square:hover  { border-color: var(--line-strong); }

/* tab bar (mobile) */
.tabbar {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 86px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: rgba(7,9,11,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--line);
  padding: 10px 12px 28px;
  z-index: 10;
}
.tabbar-item {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  color: var(--ink-3); font-size: 10px; font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase;
}
.tabbar-item.active { color: var(--mint); }

/* sparkle bg used in some hero cards */
.starfield {
  position: absolute; inset: 0; pointer-events: none; opacity: var(--star-opacity);
  background-image:
    radial-gradient(1px 1px at 20% 30%, var(--star-color), transparent 50%),
    radial-gradient(1px 1px at 70% 60%, var(--star-color), transparent 50%),
    radial-gradient(1.2px 1.2px at 40% 80%, var(--star-color), transparent 50%),
    radial-gradient(1px 1px at 85% 22%, var(--star-color), transparent 50%),
    radial-gradient(1px 1px at 55% 15%, var(--star-color), transparent 50%);
}

/* progress bar */
.progress {
  height: 6px; background: var(--bg-elev-2); border-radius: 999px; overflow: hidden;
}
.progress > span {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--mint), var(--mint-bright));
  border-radius: inherit;
}

/* selection */
::selection { background: var(--mint); color: var(--selection-fg); }

/* ── Modern utilities ─────────────────────────────────── */

/* Eyebrow — small uppercase label */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.eyebrow::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--mint);
  display: inline-block;
}
.eyebrow.bare::before { display: none; }
.eyebrow.dot-yellow::before { background: var(--yellow); }
.eyebrow.dot-red::before    { background: var(--red); }
.eyebrow.dot-ink::before    { background: var(--ink); }

/* Display title */
.title-xl {
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1;
  color: var(--ink);
}
.title-lg {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--ink);
}
.title-md {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}

/* Hairline divider that fades at edges */
.hr-fade {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-strong), transparent);
  border: 0;
  margin: 0;
}

/* Big score ticker — used in predict & detail */
.ticker {
  font-family: var(--font-mono);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
  line-height: 0.9;
  color: var(--ink);
}

/* Live ping — concentric pulse */
.live-ping {
  position: relative;
  display: inline-block;
  width: 8px;
  height: 8px;
}
.live-ping::before,
.live-ping::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--red);
}
.live-ping::after {
  animation: ping 1.5s cubic-bezier(0, 0, 0.2, 1) infinite;
}
@keyframes ping {
  0%   { transform: scale(1); opacity: 0.7; }
  75%  { transform: scale(2.6); opacity: 0; }
  100% { transform: scale(2.6); opacity: 0; }
}

/* Segmented tabs */
.segtabs {
  display: inline-flex;
  background: var(--bg-elev-2);
  border-radius: 999px;
  padding: 4px;
  border: 1px solid var(--line);
}
.segtabs > * {
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-3);
  cursor: pointer;
  transition: color .12s, background-color .12s;
}
.segtabs > .active {
  background: var(--bg);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
:root[data-theme="blanc"] .segtabs > .active { background: #fff; box-shadow: 0 1px 4px rgba(20,30,40,0.06); }

/* Team-color spine on a match card */
.spine {
  position: absolute;
  left: 0;
  top: 18px;
  bottom: 18px;
  width: 3px;
  border-radius: 0 3px 3px 0;
}

/* Floating tab bar capsule */
.tabbar-float {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 24px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  padding: 8px;
  border-radius: 26px;
  background: rgba(255,255,255,0.78);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--line);
  box-shadow: 0 16px 40px rgba(20,30,40,0.10), 0 2px 8px rgba(20,30,40,0.04);
  z-index: 10;
}
:root[data-theme="noir"]    .tabbar-float,
:root:not([data-theme]) .tabbar-float,
:root[data-theme="carbone"] .tabbar-float { background: rgba(20,22,26,0.72); }
:root[data-theme="gris"]    .tabbar-float { background: rgba(45,49,54,0.72); }

.tabbar-float .tf-item {
  display: flex; align-items: center; justify-content: center;
  height: 44px;
  border-radius: 18px;
  color: var(--ink-3);
  transition: color .12s, background-color .12s;
  position: relative;
}
.tabbar-float .tf-item.active {
  background: var(--ink);
  color: var(--bg-elev);
}
.tabbar-float .tf-item.center {
  height: 52px;
  background: var(--mint);
  color: var(--selection-fg);
  margin: -8px 0;
  border-radius: 22px;
  box-shadow: 0 8px 20px rgba(24,168,109,0.30);
}
.tabbar-float .tf-item.center.active { background: var(--mint); color: var(--selection-fg); }

/* Number-with-delta inline (e.g., +12) */
.delta-up   { color: var(--mint); }
.delta-down { color: var(--red); }
.delta-flat { color: var(--ink-3); }

/* Cell hover surface */
.row-hover:hover { background: var(--bg-elev-2); }

/* Tiny progress (used in cards inline) */
.bar-mini {
  height: 4px;
  border-radius: 999px;
  background: var(--bg-elev-2);
  overflow: hidden;
  position: relative;
}
.bar-mini > span {
  display: block; height: 100%;
  background: var(--ink);
  border-radius: inherit;
}
.bar-mini.mint > span { background: var(--mint); }

/* Pill of digits — for big-score input */
.digit-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 24px;
  background: var(--bg-elev);
  border: 1.5px solid var(--line-mid);
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: -0.05em;
  color: var(--ink);
  transition: border-color .15s, transform .15s;
}
.digit-pill.active {
  border-color: var(--mint);
  box-shadow: 0 0 0 6px var(--mint-dim);
}

/* Subtle "card pad" with internal hairline */
.card-pad-divide > * + * {
  border-top: 1px solid var(--line);
}

/* Pull a card flush to edge but keep internal padding */
.bleed-x-pad { padding-left: 20px; padding-right: 20px; }

/* Editorial number column */
.numcol {
  font-family: var(--font-mono);
  font-feature-settings: 'tnum', 'ss03';
  font-weight: 700;
}
