/* The one place for every colour, gradient, outline, shadow, radius, font and
   animation duration (ADR 0006, docs/design/look-and-feel.md U1 and U2). No
   other file may define any of them: components.css and the screens only use
   these variables. Change the look here, not in a screen. The token table in
   look-and-feel.md and the contrast ratios there are checked against this file
   by spec/unit-theme.test.ts. */

@font-face {
  font-family: "Fredoka";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fredoka-700.woff2") format("woff2");
}

:root {
  /* Fonts: Fredoka for the title, buttons and headings. Body text stays on the
     system font, so a failed font load never breaks reading. */
  --font-display: "Fredoka", ui-rounded, "Arial Rounded MT Bold", "Trebuchet MS", system-ui, sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Ground and text */
  --ground-top: #0e1638;
  --ground-bottom: #18245a;
  --panel: #1f2c6b;
  --ink: #060a20;
  --text: #ffffff;
  --text-muted: #c9d1f5;
  --link: #9ccbff;
  --focus: #ffc72c;
  --error: #ffb4a8;
  --ok: #7ce3a1;

  /* The three toy colours. Buttons and discs are flat, with an ink edge. */
  --red: #d21f27;
  --blue: #1e5bd8;
  --yellow: #ffc72c;

  /* Board */
  --board-edge: #1546a8;
  --board-shine: #4d82ea;
  --hole: #0a1030;

  /* Rubble */
  --rubble: #8a94a8;
  --rubble-hatch: #4b5568;
  --rock: #8c735c; /* a closed row (U71): solid, not hatched, so it is never mistaken for rubble */
  --rock-dark: #4a3a2c;

  /* Markers: a ring on your discs, a cross on the opponent's. */
  --marker-red: #ffffff;
  --marker-yellow: var(--ink);

  /* Avatars: picked by a hash of the player's id. Each takes --ink on top. */
  --avatar-1: #ff6b73;
  --avatar-2: #ffd866;
  --avatar-3: #6e9bff;
  --avatar-4: #7ce3a1;
  --avatar-5: #c4a6ff;
  --avatar-6: #ff9f5a;

  /* Shield states and the win glow */
  --gloss-column: rgba(255, 255, 255, 0.14);
  --backdrop: rgba(2, 4, 16, 0.75); /* the one dim behind every popup and overlay: deep navy, about 75% (Q27, U52a) */
  --field: #121a4a;
  --disabled: #3a4580;
  --disabled-text: #c9d1f5;
  --timer-ok: #4d82ea;
  --timer-warn: #ff9f5a;
  --timer-urgent: #ff6b5e;
  --shield-on: #7ce3a1;
  --shield-off: #8a94a8;
  --win-glow: rgba(255, 199, 44, 0.9);
  --disc-glow-red: rgba(210, 31, 39, 0.85);
  --disc-glow-yellow: rgba(255, 199, 44, 0.85);

  /* Bubbles: faint, translucent disc shapes rising behind everything (U3).
     Their opacity never goes above 0.22, so text over them keeps its contrast. */
  --bubble-red: rgba(210, 31, 39, 0.22);
  --bubble-yellow: rgba(255, 199, 44, 0.2);
  --bubble-blue: rgba(77, 130, 234, 0.22);
  --bubble-rim: rgba(255, 255, 255, 0.18);

  /* Confetti, built from the three toy colours plus white */
  --confetti-1: var(--red);
  --confetti-2: var(--yellow);
  --confetti-3: var(--blue);
  --confetti-4: var(--text);

  /* Outlines and hard offset shadows: toy pieces, no glossy gradients. */
  --outline: 3px solid var(--ink);
  --outline-thin: 2px solid var(--ink);
  --outline-thick: 4px solid var(--ink);
  --outline-marker: 3px solid var(--marker-red);
  --outline-marker-small: 2px solid var(--marker-red);
  --outline-bubble: 2px solid var(--bubble-rim);
  --outline-bubble-marker: 3px solid var(--bubble-rim);
  --outline-popup: 5px solid var(--ink); /* a popup card's edge is thicker than a normal card's, so it stands out (U52b) */
  --shadow: 0 5px 0 var(--ink);
  --shadow-popup: 0 8px 0 var(--ink); /* a stronger hard shadow, the same plain dark offset as every other card, with no light ring (U52b, 31 October 2026) */
  --glow-focus: 0 0 0 4px rgba(255, 199, 44, 0.45); /* the soft yellow glow outside a focused field or button's border, as a box-shadow, never a second outline (U51a, U9a) */
  --glow-focus-dark: 0 0 0 4px rgba(6, 10, 32, 0.35); /* the same focus glow, in ink, for a yellow button or tab whose own fill is the --focus colour (U9a) */
  --shadow-raised: 0 7px 0 var(--ink);
  --shadow-pressed: 0 0 0 var(--ink);
  --shadow-small: 0 2px 0 var(--ink);
  --shadow-title: 6px 6px 0 var(--red);
  --shadow-title-popup: 2px 2px 0 var(--red); /* the end popup's title: small, so it is not read as a doubled word (U160) */

  /* Radii */
  --radius-button: 14px;
  --radius-panel: 20px;
  --radius-board: 22px;
  --radius-pill: 999px;
  --outline-spinner: 5px solid var(--text-muted);
  --outline-spinner-head: 5px solid var(--yellow);
  --radius-chip: 2px;
  --radius-foot: 0 0 10px 10px;
  --radius-rock: 4px; /* rock has square corners: it is not a round piece (U71) */

  /* Durations (U19, U20 and the rest of motion-and-endings.md) */
  --dur-press: 0.08s;
  --dur-pop: 0.45s;
  --dur-drop: 0.4s;
  --dur-shake: 0.35s;
  --dur-lock: 0.3s;
  /* The earthquake (U65): shake, crumble and slide are 150ms each, then the drop (--dur-drop). The
     whole round stays under one second. */
  --dur-quake-shake: 0.15s;
  --dur-quake-crumble: 0.15s;
  --dur-quake-slide: 0.15s;
  /* The shrinking board (U69, U70): the warning flash, and the crack, crumble and turn to rock. */
  --dur-doomed: 1.2s;
  --dur-collapse: 0.2s;
  --dur-win-pulse: 0.7s;
  --dur-confetti: 1.6s;
  --dur-chip: 5s;
  --dur-spin: 0.9s;
  --dur-popup: 0.45s;
  --dur-meet: 1.6s; /* the pair of discs on the Quick match card swing together and part (U97) */
  --dur-ghost: 1.1s;
  --chip-fall: 0.42em;
  --dur-confetti-clear: 2.4s;
  --dur-bubble-min: 18s;
  --dur-bubble-step: 5s;
  --dur-bubble-stagger: 2.7s;
  --dur-chip-stagger: 1.1s;
  --dur-bubble-spread: 17s;
  --dur-confetti-spread: 0.5s;

  /* Pacing in milliseconds, read by the scripts. There is no countdown (U19): discs drop
     the moment the result arrives and land after --dur-drop. "Get ready" shows once (U55). */
  --ms-get-ready: 1000;
  --ms-popup-delay: 1400;
  --ms-message-fade: 3000; /* a confirmation fades after 3 seconds (U35a) */
  --ms-beat: 900;
  --ms-after-round: 1400;
  --ms-after-crash: 1000;
  --ms-win-hold: 3200;
  --ms-shake: 450;
  --ms-drop-land: 420;
  --ms-quake-step: 150;
  --ms-collapse-start: 250; /* a collapse starts this long after the discs begin to drop (U70) */
  --ms-collapse: 200; /* the same 200ms as --dur-collapse, read by the scripts */

  /* Bubble sizes in pixels: the smallest, and the spread above it (U3). */
  --stack-width: 420px;
  /* The tutorial card's fixed sizes (U167, ADR 0016): padding, the top area's height (the longest instruction, measured) and the board's
     width, for the phone. components.css sets the laptop and narrow values on .tutorial. */
  --tut-pad-y: 10px;
  --tut-pad-x: 16px;
  --tut-top: 204px;
  --tut-board-w: 316px;
  --tut-gap: 1; /* the phone tutorial's gaps as a fraction of U172's (1 is all of them, 0 none); the script lowers it on a short screen (U176) */
  --tut-margin: 24px; /* the space above and below the phone tutorial's content block, before the safe areas; the script lowers it on a short phone (U180) */
  --tut-next-h: 52px; /* Next's height on a phone: 52px (large set), 48px (short set), 44px (the last resort) (U179) */
  --list-width: 560px; /* forms and lists are never wider than this (U60) */
  --vv-top: 0px; /* the visible area above the phone keyboard; src/client/dialog.ts sets both on an open popup (Q21, U91) */
  --vv-height: 100%;
  --bubble-size-min: 24;
  --bubble-size-spread: 49;
}
