/* Design tokens: the one place the Game Center's colors, type scale, spacing, bevels, surfaces and shadows are
   written down. base.css, phone.css, tv.css and splash.css only ever point at these, so the shell reads as one
   studio on the phone and the TV. A game's own stylesheet may keep its own colors and art, and borrows these too.

   Hex lives here and nowhere else in the shell. A color that needs an alpha gets an -rgb triple beside it, used as
   rgba(var(--name-rgb), 0.4). */

:root {
  /* ---------- color ---------- */

  /* The studio at night: an obsidian void, two steps of stage blue, and the light that pools on the floor. */
  --obsidian: #040711;
  --obsidian-rgb: 4, 7, 17;
  --stage: #0A1226;
  --stage-2: #111C38;
  --stage-light-rgb: 26, 58, 122;
  --stage-pool-rgb: 26, 66, 140;
  --stage-deep-rgb: 14, 34, 80;

  /* Signal colors. Cyan means live, active or your turn; gold is kept for the primary action, a winner, a champion. */
  --cyan: #00F0FF;
  --cyan-rgb: 0, 240, 255;
  --gold: #FFB800;
  --gold-rgb: 255, 184, 0;
  --green: #2BFF88;
  --green-rgb: 43, 255, 136;
  --lemon: #FFE600;
  --lemon-rgb: 255, 230, 0;
  --red: #FF2E4D;
  --red-rgb: 255, 46, 77;
  --red-soft: #FF8C9C;
  --red-pale: #FFE3E8;

  /* Ink: titles are near white and heavy, body text a cool grey a clear step down, hints a step below that. */
  --ink-title: #FFFFFF;
  --ink: #EAFBFF;
  --ink-2: #A9BCD3;
  --ink-3: #7489A6;
  --line: rgba(var(--cyan-rgb), 0.22);
  /* Dark text on the lit plates. */
  --on-gold: #1A1000;
  --on-gold-2: #3A2800;
  --on-cyan: #00161A;
  --on-green: #00210F;
  --on-lemon: #1F1B00;
  /* The join code's card: paper-white with a navy line while it waits. */
  --paper: #EAFBFF;
  --paper-ink: #10203A;

  /* Surfaces, darkest to brightest. Plates are lit from above, so each one runs from its top color to its base. */
  --surface-sunk: #050A1A;
  --surface-0: #070D1F;
  --surface-1: #0A142C;
  --surface-2: #0B1530;
  --surface-3: #0F1A38;
  --surface-4: #14224A;
  --surface-glass-rgb: 10, 18, 38;

  /* Gold is the show's precious metal: a highlight rolls through the hue. */
  --gold-hi: #FFE9A8;
  --gold-shade-rgb: 120, 70, 0;
  --gold-text: #FFD04D;
  --gold-metal: linear-gradient(180deg, #FFE9A8 0%, #FFCB3D 28%, #FFB800 52%, #E39700 60%, #FFBE1A 100%);
  --gold-metal-tv: linear-gradient(172deg, #FFF1BF 0%, #FFD04D 18%, #FFB800 46%, #E09A00 74%, #FFC93A 100%);
  --gold-floor: rgba(40, 28, 6, 0.82);
  --cyan-metal: linear-gradient(180deg, #6AF7FF, #00F0FF 55%, #00C6D6);
  --ice-metal: linear-gradient(155deg, #F2FDFF 0%, #8FDDEB 20%, #3D7F92 50%, #A4EAF5 78%, #EAFBFF 100%);
  --ok-metal: linear-gradient(155deg, #E2FFEE 0%, #5CFFA2 22%, #12984F 52%, #8CFFC0 80%, #E2FFEE 100%);
  --pass-metal: linear-gradient(155deg, #FFFBD0 0%, #FFEE4D 22%, #B8A200 52%, #FFF28A 80%, #FFFBD0 100%);
  --sting-shadow: #8A5A00;

  /* ---------- type ---------- */

  --display: 'Chakra Petch', 'Oswald', 'Arial Narrow', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;

  /* Phone: one hand, arm's length. Steps of about 1.15. */
  --ph-xs: 13px;
  --ph-sm: 15px;
  --ph-base: 17px;
  --ph-md: 19px;
  --ph-lg: 22px;
  --ph-xl: 26px;
  --ph-2xl: 30px;
  --ph-h1: clamp(32px, 9.6vw, 46px);
  --ph-hero: clamp(50px, 16vw, 72px);
  --ph-name: clamp(36px, 12vw, 56px);

  /* TV: read from the couch 3 to 4 m away. rem follows the screen height (tv.css sets it to 1.62vh, never under
     13px), so the steps hold from a laptop panel to a 75" set. The smallest step is still about 2vh. */
  --tv-xs: 1.2rem;
  --tv-sm: 1.4rem;
  --tv-base: 1.65rem;
  --tv-md: 1.95rem;
  --tv-lg: 2.5rem;
  --tv-xl: 3.3rem;
  --tv-2xl: 4.8rem;
  --tv-hero: 5.8rem;

  /* ---------- space ---------- */

  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;

  --tv-sp-1: 0.6vh;
  --tv-sp-2: 1.2vh;
  --tv-sp-3: 1.8vh;
  --tv-sp-4: 2.4vh;
  --tv-sp-5: 3.6vh;

  /* The TV's safe area. Some sets crop the edge of the picture (overscan), so every word on the TV keeps this far in
     from the edge of the screen; backgrounds and stage art still run to the edge. 2.5% of the screen, never under
     16px, so a small window keeps a gutter too. */
  --gc-safe-x: max(2.5vw, 16px);
  --gc-safe-y: max(2.5vh, 16px);

  /* The scrim: a soft backing for words that float over the stage (a hint, the strip at the foot of the screen), and
     the ink written on it. It has no hard edge: it fades out through --gc-scrim-edge. Each look sets its own pair. */
  --gc-scrim: rgba(var(--obsidian-rgb), 0.7);
  --gc-scrim-ink: var(--ink);
  --gc-scrim-edge: 0 0 1.1em 0.7em var(--gc-scrim);

  /* ---------- materials (the three layers a dimensional game is built from) ---------- */

  /* A game that builds a stage, a prop and a controller paints them with these, and each look sets every one of them
     for itself, so the same vault or betting table reads as print in Party and as lit glass in Studio. The values here
     are the desk's, made from the tokens above so any look that leaves one out still gets something that fits.

     The stage is the TV's atmosphere: a gradient from --gc-stage-1 to --gc-stage-2, a pool of --gc-stage-light, and a
     slow drift that lasts --gc-stage-motion (0s: it holds still). The drift is a CSS animation, so reduced motion
     stills it; a game also turns it off under html.lite, the way tv.css drops its own drift there. */
  --gc-stage-1: var(--stage-2);
  --gc-stage-2: var(--obsidian);
  --gc-stage-light: rgba(var(--stage-pool-rgb), 0.55);
  --gc-stage-motion: 0s;
  /* The prop is the TV's centerpiece: a face over a side that is --gc-prop-depth deep, lit along its top by the rim,
     with a sheen laid over the face and a cast shadow under it. Drawn as
       background: var(--gc-prop-sheen), var(--gc-prop-face);
       box-shadow: inset 0 2px 0 var(--gc-prop-rim), 0 var(--gc-prop-depth) 0 var(--gc-prop-edge), var(--gc-prop-shadow); */
  --gc-prop-face: var(--surface-4);
  --gc-prop-edge: var(--surface-sunk);
  --gc-prop-rim: rgba(255, 255, 255, 0.16);
  --gc-prop-depth: 10px;
  --gc-prop-shadow: 0 16px 30px rgba(0, 0, 0, 0.5);
  --gc-prop-sheen: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0) 45%, rgba(0, 0, 0, 0.16));
  /* The control is a key on the phone. Its lip shows the edge color, as deep as the press, so a pressed key travels the
     whole lip and lands flat:
       rest:    box-shadow: var(--gc-ctl-press) 0 var(--gc-ctl-edge), var(--gc-ctl-shadow);
       pressed: translate: var(--gc-ctl-press); box-shadow: 0 0 0 var(--gc-ctl-edge), var(--gc-ctl-shadow);
     --gc-ctl-press is an x and a y, so a look whose shadows fall to one side presses its keys that way too. --gc-ctl-face
     and --gc-ctl-ink are plain colors that pass AA together. */
  --gc-ctl-face: var(--surface-4);
  --gc-ctl-ink: var(--ink);
  --gc-ctl-edge: var(--surface-sunk);
  --gc-ctl-shadow: 0 6px 14px rgba(0, 0, 0, 0.4);
  --gc-ctl-press: 0 4px;
  --gc-ctl-radius: 6px;
  /* The line round a prop or a key, and its ink. */
  --gc-outline-w: 1px;
  --gc-outline: var(--line);
  /* The materials the new games are made of, each a background stack: brushed metal (the vault, the toggles), the
     betting felt, dossier paper, and a split-flap tile with its hinge across the middle. A look may size its own tiles
     inside a layer (24px 24px), so a game sets them with the background shorthand, never background-image. Text on a
     material is the game's to choose and check: its ink depends on what the game writes there. */
  --gc-metal:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.05) 0 1px, rgba(0, 0, 0, 0.05) 1px 3px),
    linear-gradient(180deg, #A9B4C2, #6C7787 48%, #8E99A8 52%, #565F6D);
  --gc-felt:
    radial-gradient(ellipse 70% 60% at 50% 40%, rgba(255, 255, 255, 0.08), transparent 70%),
    repeating-linear-gradient(45deg, rgba(0, 0, 0, 0.06) 0 2px, transparent 2px 4px),
    linear-gradient(#134A36, #0C3125);
  --gc-paper:
    linear-gradient(180deg, rgba(255, 255, 255, 0.35), transparent 30%),
    linear-gradient(#E9DFC8, #D9CCAF);
  --gc-flap:
    linear-gradient(180deg, transparent calc(50% - 1px), rgba(0, 0, 0, 0.8) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)),
    linear-gradient(180deg, var(--surface-3) 50%, var(--surface-1) 50%);

  /* ---------- bevels (the studio has no round corners) ---------- */

  /* A plate's corner cut; each kind of plate sets its own --bevel to suit its size. */
  --bevel: 12px;
  /* A round corner, for a look that wants one. The studio has none. Buttons and fields read it; the games' plates
     come to it with their own stylesheets. */
  --radius: 0;

  /* ---------- voice (how labels and lit things speak) ---------- */

  /* These four are the knobs a look turns to reach inside a game: the shell and the games' shared parts read them, so
     a look restyles a game through them and data-part, never through a game's own classes (public/js/themes.js).
     --caps is the case of names, titles and labels. --track scales their letter spacing (each label keeps its own
     em step, times this). --glow scales the alpha of every glow on text and edges: 0 puts them all out. */
  --caps: uppercase;
  --track: 1;
  --glow: 1;

  /* ---------- light and shadow ---------- */

  /* Lit rim along a plate's top edge, and the shade along its base. */
  --rim: inset 0 1px 0 rgba(255, 255, 255, 0.14);
  --rim-hi: inset 0 1px 0 rgba(255, 255, 255, 0.24);
  --shade: inset 0 -3px 0 rgba(0, 0, 0, 0.3);
  /* A plate's top-down sheen: brighter where the rig hits it, falling off to its base. (A button's --sheen in base.css
     is a separate number, the strength of its own gloss.) */
  --plate-sheen: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0) 46%, rgba(0, 0, 0, 0.18));
  /* Cast shadows. Beveled plates clip their own box-shadow, so these are filters for the group that holds them. */
  --lift-1: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.5)) drop-shadow(0 10px 14px rgba(0, 0, 0, 0.38));
  --lift-2: drop-shadow(0 6px 6px rgba(0, 0, 0, 0.5)) drop-shadow(0 20px 26px rgba(0, 0, 0, 0.45));
  /* The same, as a box-shadow, for the few plates that are not clipped. */
  --drop-1: 0 3px 3px rgba(0, 0, 0, 0.45), 0 8px 14px rgba(0, 0, 0, 0.32);

  /* ---------- motion ---------- */

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  color-scheme: dark;
  accent-color: var(--cyan);
  caret-color: var(--cyan);
}
