/* Theme tokens (3.8): :root defaults plus one [data-theme] block per theme. Themes are
   global (md.theme); a new theme = a block here + an entry in js/core/themes.js. */

/* ============ Theme tokens ============ */
:root {
  --bg: #07100b;
  --bg-soft: #0c1810;
  /* Theme primitives: a [data-theme] block overrides these triplets to recolor
     the whole app. Everything else derives from them. */
  --pitch-rgb: 46 226 126;
  --gold-rgb: 243 198 79;
  --ink-rgb: 238 245 239;
  --ink-dim-rgb: 141 165 151;
  --neutral-rgb: 238 245 239; /* base for hairlines/cards (light overlay on dark) */
  --pitch: rgb(var(--pitch-rgb));
  --pitch-dim: rgb(var(--pitch-rgb) / 0.14);
  --accent3-rgb: var(--pitch-rgb); /* up-next time + group badge — equals primary unless a theme overrides */
  --accent3: rgb(var(--accent3-rgb));
  --gold: rgb(var(--gold-rgb));
  --ink: rgb(var(--ink-rgb));
  --ink-dim: rgb(var(--ink-dim-rgb));
  --third: #9aa7b4; /* best-third qualification: neutral slate, distinct from green/gold */
  --third-bar: #e8edf2; /* the thin standings bar — brightened for the dark card */
  --line: rgb(var(--neutral-rgb) / 0.09);
  --card: rgb(var(--neutral-rgb) / 0.035);
  /* League table zones beyond primary/secondary: third European place and relegation.
     Relegation is the same red in every theme, so "down" reads the same everywhere. */
  --zone-tertiary: rgb(var(--gold-rgb));
  --zone-down: #e5484d;
  /* Followed teams (3.7, D18): accent stripe and tint; light themes use a lighter tint */
  --followed-rgb: var(--pitch-rgb);
  --followed-a: 0.1;
}

/* ===== Light theme ===== */
:root[data-theme="light"] {
  --followed-a: 0.08;
  --bg: #f5f7f6;
  --bg-soft: #e8ece9;
  --pitch-rgb: 22 163 74;   /* deeper green for contrast on light */
  --gold-rgb: 202 138 4;    /* deeper amber */
  --ink-rgb: 17 27 22;      /* near-black text */
  --ink-dim-rgb: 90 105 97;
  --neutral-rgb: 7 16 11;   /* dark overlays for hairlines/cards on light bg */
  --third: #5a6b78;
  --third-bar: #5a6b78;     /* darker bar so it's visible on the light card */
}

/* ===== Candy (pink) ===== */
:root[data-theme="candy"] {
  --followed-a: 0.08;
  --bg: #fff0f6;
  --bg-soft: #ffe1ee;
  --pitch-rgb: 214 51 132;  /* pink primary */
  --gold-rgb: 168 85 247;   /* purple secondary */
  --ink-rgb: 60 18 40;      /* dark plum text */
  --ink-dim-rgb: 158 96 126;
  --neutral-rgb: 80 20 50;  /* dark overlays on the pink bg */
  --third: #9a6b80;
  --third-bar: #9a6b80;
}

/* ===== Team themes =====
   primary (--pitch) drives time/tabs/borders; secondary (--gold) = live/today/chips;
   --accent3 = up-next time + group badge. Dark-base teams inherit the default dark
   ink/neutrals and only recolour accents; light-base teams override the structure too. */

/* Dark-base teams — luminous accents that glow on the dark canvas */
:root[data-theme="brazil"] { --pitch-rgb: 42 191 107;  --gold-rgb: 74 134 224;  --accent3-rgb: 244 210 60; }  /* green · blue · yellow */
:root[data-theme="france"] { --pitch-rgb: 82 136 232;  --gold-rgb: 239 86 98;   --accent3-rgb: 132 174 242; } /* blue · red · light blue */
:root[data-theme="spain"]  { --pitch-rgb: 226 81 95;   --gold-rgb: 239 194 62;  --accent3-rgb: 209 74 88; }   /* red · gold · crimson */
:root[data-theme="norway"] { --pitch-rgb: 232 80 95;   --gold-rgb: 91 141 232;  --accent3-rgb: 132 174 242; } /* red · blue · light blue */

/* Light-base teams — read cleaner on a light surface */
:root[data-theme="argentina"], :root[data-theme="usa"], :root[data-theme="canada"], :root[data-theme="mexico"] {
  --followed-a: 0.08;
  --bg: #f5f7f6;
  --bg-soft: #e8ece9;
  --ink-rgb: 17 27 22;
  --ink-dim-rgb: 90 105 97;
  --neutral-rgb: 7 16 11;
  --third: #5a6b78;
  --third-bar: #5a6b78;
}
:root[data-theme="argentina"] { --pitch-rgb: 63 128 196;  --gold-rgb: 217 148 35;  --accent3-rgb: 42 94 158; }  /* sky · sun · royal */
:root[data-theme="usa"]       { --pitch-rgb: 46 87 160;   --gold-rgb: 192 52 74;   --accent3-rgb: 58 107 196; } /* navy · red · blue */
:root[data-theme="canada"]    { --pitch-rgb: 207 51 64;   --gold-rgb: 158 37 50;   --accent3-rgb: 217 83 79; }  /* red · maroon · light red */
:root[data-theme="mexico"]    { --pitch-rgb: 31 148 96;   --gold-rgb: 207 51 64;   --accent3-rgb: 15 107 70; }  /* green · red · forest */
/* Germany — dark (black/red/gold), inherits the default dark ink + neutrals */
:root[data-theme="germany"] {
  --bg: #0b0b0d;
  --bg-soft: #17171b;
  --pitch-rgb: 224 180 60;    /* gold (tabs, borders, hovers) */
  --gold-rgb: 224 68 79;      /* red (live, today, chips) */
  --accent3-rgb: 235 205 110; /* pale gold (kickoff time, group badge) */
}

/* ===== Club themes (3.8, D9) =====
   A palette in the club's colours, nothing else: no crest, no logo. The colour names come
   from each club's English Wikipedia article (cited in docs/ARCHITECTURE.md 3.8); the hex
   values are this site's own picks for contrast (every accent at least 4.5:1 on --bg). */

/* Light-base clubs */
:root[data-theme="realmadrid"], :root[data-theme="bayern"], :root[data-theme="arsenal"] {
  --followed-a: 0.08;
  --bg-soft: #e9e9ee;
  --ink-rgb: 20 20 28;
  --ink-dim-rgb: 92 94 108;
  --neutral-rgb: 10 10 20;
  --third: #5a6b78;
  --third-bar: #5a6b78;
}
:root[data-theme="realmadrid"] { --bg: #f6f6f9; --pitch-rgb: 52 48 150;  --gold-rgb: 138 98 10;  --accent3-rgb: 98 36 128; }  /* white · crest blue band · gold */
:root[data-theme="bayern"]     { --bg: #f7f5f5; --pitch-rgb: 184 12 40;  --gold-rgb: 0 92 166;   --accent3-rgb: 150 12 36; }  /* white · red · crest blue */
:root[data-theme="arsenal"]    { --bg: #f7f6f6; --pitch-rgb: 186 0 10;   --gold-rgb: 28 58 138;  --accent3-rgb: 160 16 28; }  /* white · red · away blue */

/* Dark-base clubs: inherit the default dark ink and neutrals */
:root[data-theme="barcelona"] { --bg: #0a0f24; --bg-soft: #131a36; --pitch-rgb: 230 96 120;  --gold-rgb: 96 150 236;  --accent3-rgb: 236 128 146; } /* garnet · blue */
:root[data-theme="mancity"]   { --bg: #0a121b; --bg-soft: #122030; --pitch-rgb: 108 171 221; --gold-rgb: 222 238 250; --accent3-rgb: 150 198 236; } /* sky blue · white */
:root[data-theme="liverpool"] { --bg: #120809; --bg-soft: #1e1012; --pitch-rgb: 236 76 86;   --gold-rgb: 244 200 62;  --accent3-rgb: 242 124 128; } /* red · away yellow */
:root[data-theme="manutd"]    { --bg: #0c0b0b; --bg-soft: #191717; --pitch-rgb: 238 84 84;   --gold-rgb: 238 238 238; --accent3-rgb: 242 118 118; } /* red · white · black */
:root[data-theme="psg"]       { --bg: #071230; --bg-soft: #0f1d44; --pitch-rgb: 108 146 236; --gold-rgb: 236 78 88;   --accent3-rgb: 232 236 246; } /* blue · red · white */
:root[data-theme="inter"]     { --bg: #06070a; --bg-soft: #10131a; --pitch-rgb: 52 128 236;  --gold-rgb: 120 178 255; --accent3-rgb: 164 200 255; } /* black · blue */
:root[data-theme="juventus"]  { --bg: #0c0c0c; --bg-soft: #191919; --pitch-rgb: 236 236 236; --gold-rgb: 178 178 178; --accent3-rgb: 255 255 255; } /* black · white */
