/* DrinkingWhores — Neon Jukebox token system. Load first; nothing else defines raw hex.

   The idea: a lit bar-top jukebox seen in the dark. A deep aubergine ground, dark
   pucks with a single lit keyline in their own colour, and one violet wire
   threading the whole board. Light is the material — every piece either carries a
   keyline that glows or it recedes into the ground. The one printed thing left is
   the card that gets dealt to you, and it is cream so it reads as paper. */

:root {
  color-scheme: dark;

  /* ---- the lit inks ---- */

  --ink: #0A0318;
  --ink-2: #150829;
  --ink-3: #1B0A2E;

  --grape: #35135F;
  --grape-deep: #1E0A40;
  --grape-lit: #3C1A74;

  --violet: #A560FF;
  --violet-hi: #C9A9F5;
  --violet-deep: #7A57C4;
  --wire: #EBD9FF;

  --cream: #FFF3E6;
  --paper: #FFFFFF;
  --paper-shade: #F3E2D2;

  --sun: #FFC61A;
  --sun-hi: #FFE08A;
  --sun-deep: #8A6300;

  --punch: #FF2E88;
  --punch-hi: #FF7ABA;
  --punch-deep: #8A0D45;

  --mint: #2FE08A;
  --mint-hi: #86F3C2;
  --mint-deep: #05795A;

  --sky: #22D3EE;
  --sky-hi: #8FE9FA;
  --sky-deep: #075E71;

  --water: #38BDF8;

  --flare: #FF7A18;
  --flare-hi: #FFB878;
  --flare-deep: #A34B00;

  --blaze: #FF0033;
  --blaze-hi: #FF6A83;
  --blaze-deep: #C4001F;

  --hazard: #FFD400;

  /* ------------------------------------------------------------------
     Semantic layer. Everything downstream reads these names, never the
     ink names above. A new visual direction only has to remap this block
     — the components do not know what a punch or a grape is.
     ------------------------------------------------------------------ */

  /* Panels, the rail, the dock, the top bar: lit glass over the aubergine
     ground. The default surface is dark now, so --text is near-white. */
  --surface: #22103F;
  --surface-raised: #2C1655;
  --surface-sunken: #170A2E;
  --surface-well: rgba(255, 255, 255, 0.055);
  --text: #FFF1F7;
  --text-dim: #C9A9F5;
  --text-faint: #8A6BC7;

  /* The one printed stock left: the card that gets dealt. Cream paper, ink on
     it, so a prompt reads as an object handed to you and not another panel. */
  --surface-alt: var(--cream);
  --surface-alt-raised: var(--paper);
  --text-alt: var(--ink-3);
  --text-alt-dim: #5E2748;
  --text-alt-faint: #8A6B80;

  /* Accent is the hot pink: whose turn it is, titles, the live roll. */
  --accent: var(--punch);
  --accent-hi: var(--punch-hi);
  --accent-dim: color-mix(in srgb, var(--punch) 18%, transparent);
  --accent-deep: var(--punch-deep);
  --on-accent: #2A0518;

  /* Go: the primary action. */
  --ok: var(--mint);
  --ok-hi: var(--mint-hi);
  --ok-dim: color-mix(in srgb, var(--mint) 16%, transparent);
  --ok-deep: var(--mint-deep);
  --on-ok: #04321F;

  /* Ouch: drinks, No, setbacks, the shot. */
  --danger: var(--blaze);
  --danger-hi: var(--blaze-hi);
  --danger-dim: color-mix(in srgb, var(--blaze) 16%, transparent);
  --danger-deep: var(--blaze-deep);
  --on-danger: #FFFFFF;

  /* Prize gold: score, the leader, the finish, the hazard band. */
  --prize: var(--sun);
  --prize-hi: var(--sun-hi);
  --prize-deep: var(--sun-deep);

  /* Info cyan: minigame spaces, the focus ring, quiet chrome. */
  --info: var(--sky);
  --info-hi: var(--sky-hi);
  --info-deep: var(--sky-deep);

  /* Wild orange: dares, duels, rifts. */
  --wild: var(--flare);
  --wild-hi: var(--flare-hi);
  --wild-deep: var(--flare-deep);

  /* Every keyline is lit violet at two strengths. That single rule is what makes
     the whole interface read as one lit set. */
  --border: rgba(165, 96, 255, 0.28);
  --border-strong: rgba(165, 96, 255, 0.5);
  --border-alt: rgba(27, 10, 46, 0.22);
  --border-alt-strong: rgba(27, 10, 46, 0.85);
  --focus-ring: var(--sky);

  --bd-thin: 2px solid var(--border);
  --bd-key: 2px solid var(--border-strong);
  --bd-alt: 3px solid var(--border-alt-strong);
  --bd-danger: 3px solid var(--danger);

  --scrim: rgba(8, 2, 22, 0.88);

  /* The dark a lit piece drops onto, and the halo it throws. Nothing casts a
     coloured slab — light spills, ink does not. */
  --slab: rgba(0, 0, 0, 0.55);
  --slab-deep: rgba(0, 0, 0, 0.7);
  --halo: rgba(165, 96, 255, 0.9);

  /* Fills. Set any of these to a flat colour to strip the treatment out of
     every component at once. */
  --fill-app:
    radial-gradient(ellipse 80% 75% at 42% 40%, var(--grape) 0%, var(--grape-deep) 44%, var(--ink) 100%);
  --fill-surface: linear-gradient(180deg, rgba(60, 26, 116, 0.72), rgba(26, 10, 60, 0.72));
  --fill-surface-alt: linear-gradient(180deg, var(--paper), var(--cream) 55%);
  --fill-control: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.02));
  --fill-accent: linear-gradient(180deg, var(--mint-hi), var(--mint) 58%);
  --fill-accent-hover: linear-gradient(180deg, var(--paper), var(--mint-hi) 70%);
  --fill-danger: linear-gradient(180deg, var(--blaze-hi), var(--blaze) 46%, var(--blaze-deep));
  --fill-prize: linear-gradient(180deg, var(--sun-hi), var(--sun) 58%);
  --fill-lit: linear-gradient(180deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0) 55%);

  /* ---- type ----
     System stacks only; the game has to work with the wifi down. Arial Black is
     the heaviest wide face on every desktop and reads as a lit sign at six feet.
     The UI face is the platform's own, because nothing beside the display face
     should have a voice. The mono is the scoreboard and the room code. */
  --font-display: 'Arial Black', 'Segoe UI Variable Display', 'Segoe UI Black', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-body: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, 'Cascadia Mono', Consolas, 'SF Mono', Menlo, monospace;
  --font-emoji: 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif;

  /* Arial Black at display sizes wants negative tracking, not positive; only the
     small uppercase labels open up. */
  --track-caps: -0.03em;
  --track-label: 0.14em;
  --track-code: 0.18em;

  --fs-xs: 0.8rem;
  --fs-sm: 0.92rem;
  --fs-md: 1rem;
  --fs-lg: 1.22rem;
  --fs-xl: 1.62rem;
  --fs-2xl: clamp(1.75rem, 2.3vw, 2.4rem);
  --fs-3xl: clamp(2.2rem, 4vw, 3.6rem);
  --fs-prompt: clamp(1.6rem, 2.8vw, 2.7rem);

  --lh-tight: 1.02;
  --lh-snug: 1.22;
  --lh-body: 1.45;

  --sp-1: 0.22rem;
  --sp-2: 0.45rem;
  --sp-3: 0.72rem;
  --sp-4: 1.05rem;
  --sp-5: 1.7rem;
  --sp-6: 2.4rem;

  /* Rounded, but not soft: a lit puck, not a panel. */
  --r-sm: 9px;
  --r-md: 13px;
  --r-lg: 18px;
  --r-pill: 999px;

  /* The signature: a piece sits on a hard slab of dark and throws a halo of its
     own light. A pressable piece sits on a taller slab and falls into it. */
  --shadow-panel: 0 5px 0 var(--slab), 0 0 34px -12px var(--halo);
  --shadow-lift: 0 7px 0 var(--slab), 0 0 42px -12px var(--halo);
  --shadow-stamp: 0 3px 0 var(--slab), 0 0 22px -10px var(--halo);
  --shadow-press: 0 5px 0 var(--slab-deep), 0 0 26px -10px var(--halo);
  --shadow-press-down: 0 1px 0 var(--slab-deep);
  --shadow-glow: 0 0 28px -8px currentColor;
  --press-travel: 4px;

  --ctl-h: 2.7rem;
  --ctl-h-big: 3.2rem;
  --ctl-h-sm: 2.3rem;
  --ctl-h-thin: 1.6rem;

  /* Narrow on purpose: the rail is the mockup's right column and every pixel it
     gives up goes into the width of a board tile. */
  --rail-w: clamp(15rem, 22vw, 16.5rem);
  --topbar-h: 2.9rem;
  --led-row: 1.5rem;
  --seat-row: 2.4rem;
  --led-pad: 0.6rem;
  --led-c1: 5.4ch;
  --led-c2: 6ch;
  --led-c4: 6.4ch;

  --ease-out: cubic-bezier(0.22, 0.9, 0.28, 1);
  --ease-in-out: cubic-bezier(0.5, 0, 0.2, 1);
  --ease-pop: cubic-bezier(0.2, 1.5, 0.4, 1);
  --dur-fast: 110ms;
  --dur-mid: 220ms;
  --dur-slow: 380ms;
  --dur-move: 240ms;
  --dur-fade: 90ms;
  --dur-roll: 460ms;
  --dur-march: 1.2s;
  --dur-march-hot: 0.75s;
  --dur-blink: 1s;
  --dur-breathe: 1.6s;
  --dur-drift: 6s;
  --dur-slide: 1100ms;
  --anim-iter: infinite;
  --hop-lift: -0.6rem;

  /* Faint bar-room haze over the aubergine. One layer, deliberately sparse — it
     is atmosphere, not wallpaper, and it must never fight the wire. */
  --tex-confetti: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='190' height='190'%3E%3Cg fill='none' stroke-width='3' stroke-linecap='round' opacity='0.16'%3E%3Cpath stroke='%23A560FF' d='M20 26 l12 -14'/%3E%3Cpath stroke='%23FF2E88' d='M150 20 l-10 -14'/%3E%3Cpath stroke='%2322D3EE' d='M70 116 l14 10'/%3E%3Cpath stroke='%23FFC61A' d='M164 140 l-8 15'/%3E%3C/g%3E%3Cg opacity='0.13'%3E%3Ccircle cx='112' cy='62' r='2.6' fill='%23EBD9FF'/%3E%3Ccircle cx='30' cy='94' r='2.4' fill='%23FFC61A'/%3E%3Ccircle cx='176' cy='82' r='2' fill='%23FF2E88'/%3E%3Ccircle cx='88' cy='176' r='2.4' fill='%2322D3EE'/%3E%3C/g%3E%3C/svg%3E");
  --tex-size: 190px 190px;
}

/* ---- tile tones ----
   engine/mapgen.js gives every space a tone and the board colours from this one
   block, so a space can never be lit one way and read another. Hue is never the
   only cue — board.css also gives each tile its own border style, surface
   texture and words. The bare [data-tone] default must stay above the specific
   ones: same specificity, source order decides. */

[data-tone] {
  --tone: var(--violet);
  --tone-deep: var(--violet-deep);
}

[data-tone="good"] { --tone: var(--ok); --tone-deep: var(--ok-deep); }
[data-tone="bad"] { --tone: var(--wild); --tone-deep: var(--wild-deep); }
[data-tone="worst"] { --tone: var(--danger); --tone-deep: var(--danger-deep); }
[data-tone="wild"] { --tone: var(--info); --tone-deep: var(--info-deep); }
[data-tone="social"] { --tone: var(--accent); --tone-deep: var(--accent-deep); }
[data-tone="calm"] { --tone: var(--ok); --tone-deep: var(--ok-deep); }
[data-tone="quiet"] { --tone: var(--violet); --tone-deep: var(--violet-deep); }

/* The lit tile: a near-black face in the tone's own hue, and the keyline is the
   tone. Thirty-odd tiles all lit at full strength read as noise, so the ordinary
   ones sit back — the keyline is dimmed and the fill barely tinted. The loud
   treatment is spent only where it earns attention: the Shot spaces, the Finish,
   and whoever's turn it is. */
[data-tone] {
  --tone-fill: color-mix(in srgb, var(--tone) 9%, var(--ink));
  --tone-edge: color-mix(in srgb, var(--tone) 58%, transparent);
}

/* The spaces that are allowed to shout. */
[data-tone="worst"],
[data-tone="good"] {
  --tone-fill: color-mix(in srgb, var(--tone) 15%, var(--ink));
  --tone-edge: var(--tone);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: clamp(15px, 0.3vw + 11.5px, 17px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: var(--fs-md);
  line-height: var(--lh-body);
  color: var(--text);
  background-color: var(--ink);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: var(--track-caps);
  line-height: var(--lh-tight);
}

p { margin: 0 0 var(--sp-3); }
p:last-child { margin-bottom: 0; }

a {
  color: var(--accent-hi);
  text-underline-offset: 0.2em;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

/* Cyan against every surface in the set — the one colour no piece uses as its
   own keyline. */
:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

::selection {
  background: var(--accent);
  color: var(--on-accent);
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.3); }
::-webkit-scrollbar-thumb {
  background: var(--violet-deep);
  border-radius: var(--r-pill);
  border: 2px solid transparent;
  background-clip: padding-box;
}

@media (max-width: 560px) {
  :root {
    --led-c1: 5.2ch;
    --led-c2: 6ch;
    --led-c4: 4.4ch;
    --led-pad: 0.5rem;
    --sp-5: 1.3rem;
    --sp-6: 1.8rem;
  }
}

/* Every duration downstream reads these vars, so flipping them here defeats
   specificity fights. */
@media (prefers-reduced-motion: reduce) {
  :root {
    --dur-fast: 1ms;
    --dur-mid: 1ms;
    --dur-slow: 1ms;
    --dur-move: 1ms;
    --dur-roll: 1ms;
    --dur-march: 1ms;
    --dur-march-hot: 1ms;
    --dur-blink: 1ms;
    --dur-breathe: 1ms;
    --dur-drift: 1ms;
    --dur-slide: 1ms;
    --anim-iter: 1;
    --hop-lift: 0rem;
    --press-travel: 0px;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto;
  }
}
