/* Sundown design tokens + shared components (TV and phone).
   Look: near-black stage, flat saturated colour blocks, electric lime for
   anything you can press, Anton for big shouty words, Archivo for the rest.
   No gradients, no emoji as art. Fonts are bundled so TV apps work offline. */

@font-face {
  font-family: 'Anton';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/anton-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 500 900;
  font-display: swap;
  src: url('../fonts/archivo-latin.woff2') format('woff2');
}

:root {
  --bg: #0B0B10;
  --panel: #1A1A24;
  --panel-2: #2A2A38;
  --input: #14141C;
  --ink: #FFFFFF;
  --ink-dim: #A3A3B5;
  --ink-mute: #5C5C70;
  --line: rgba(255, 255, 255, 0.2);

  --action: #D4FF3A;      /* lime: buttons, letter chip, timer, focus */
  --action-deep: #8DAE12;
  --action-ink: #0B0B10;
  --hype: #FF2E63;

  /* rarity colours, used everywhere a tier appears */
  --common: #3DB8FF;
  --uncommon: #A879FF;
  --niche: #FFB800;
  --jinx: #FF7AD9;
  --bs: #FF3B3B;
  --bs-deep: #A01E1E;

  --display: 'Anton', Impact, 'Arial Narrow', sans-serif;
  --font: 'Archivo', system-ui, 'Segoe UI', Roboto, Arial, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 700;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button, input { font: inherit; color: inherit; }
h1, h2, .display { font-family: var(--display); font-weight: 400; text-transform: uppercase; letter-spacing: 0.01em; }

.brand { font-family: var(--font); font-weight: 900; letter-spacing: 0.08em; color: var(--ink-dim); }
.brand span { color: var(--action); }

.btn {
  border: 0;
  border-radius: 999px;
  padding: 0.6em 1.6em;
  font-family: var(--font);
  font-weight: 900;
  cursor: pointer;
  background: transparent;
  color: var(--ink);
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.25);
  transition: transform 0.1s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(4px); }
.btn:disabled { opacity: 0.35; cursor: default; }
.btn-primary { background: var(--action); color: var(--action-ink); box-shadow: 0 6px 0 var(--action-deep); }
.btn-primary:active { box-shadow: 0 2px 0 var(--action-deep); }
.btn-ghost { background: transparent; }
.btn-block { display: block; width: 100%; }

.letter-chip {
  display: inline-grid; place-items: center;
  width: 1.5em; height: 1.5em;
  border-radius: 0.24em;
  background: var(--action);
  color: var(--action-ink);
  font-family: var(--font);
  font-weight: 900;
  vertical-align: middle;
}

/* Pill badge. --k sets the colour. */
.pill {
  display: inline-block;
  background: var(--k, var(--action));
  color: var(--action-ink);
  font-family: var(--font);
  font-weight: 900;
  padding: 0.3em 0.9em;
  border-radius: 999px;
  white-space: nowrap;
}

/* Player token: initial in a coloured circle. */
.avatar {
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--c, var(--panel-2));
  color: var(--action-ink);
  font-family: var(--font);
  font-weight: 900;
}

.toast {
  position: fixed; left: 50%; bottom: 6%;
  transform: translateX(-50%);
  background: var(--ink); color: var(--bg);
  font-weight: 800;
  padding: 0.6em 1.2em; border-radius: 999px;
  z-index: 50;
}

/* Tier text colours */
.kind-common-text { color: var(--common); }
.kind-uncommon-text { color: var(--uncommon); }
.kind-niche-text { color: var(--niche); }

@keyframes pop { 0% { transform: scale(0.3); opacity: 0; } 70% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); } }
@keyframes rise { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes pulse { 50% { transform: scale(1.05); } }
@keyframes shake { 20%, 60% { transform: translateX(-12px) rotate(-1deg); } 40%, 80% { transform: translateX(12px) rotate(1deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* Colour-blind-safe palette (TV/phone Settings > Colours). Okabe-Ito hues stay
   apart for red-green and blue-yellow colour blindness. Tiers keep their
   text labels too, so colour is never the only cue. */
:root.cb-safe {
  --common: #56B4E9;
  --uncommon: #CC79A7;
  --niche: #E69F00;
  --jinx: #F0E442;
  --bs: #D55E00;
  --bs-deep: #7A3500;
  --sk-easy: #56B4E9;
}
.cb-safe .mv.up { color: #56B4E9; }
.cb-safe .mv.down { color: #E69F00; }
.cb-safe .ai-meter.high { color: #56B4E9; }
