/* Turn of Phrase's look: the county fair (David's call, 2026-11-09;
   docs/turn-of-phrase.md, "Its look"). A painted wooden prize wheel on a
   booth, brass pegs and a leather flapper; the board a row of hand-painted
   tiles in a frame of round bulbs; barn red, mustard, teal and cream on
   dark stained wood. Barn red is the accent (the primary button); the turn
   color, the room's bulb yellow, only ever rings or outlines (your seat,
   the cursor's tile, the dock when it's yours). This file is the tokens
   (the house's, the room kit's and the game's own) and the shared pieces
   (a tile, a key, a card); it's loaded before the room's structure
   (games/room/room.css), the table (table.css) after it. The Django pages
   (games/templates/turn-of-phrase/page.html) wear just this.

   Faces, both OFL and bundled in fonts/: Alfa Slab One, a sign painter's
   slab (headings, the wheel's values, the board's letters) and Figtree
   (everything else you read or press). */

@font-face { font-family: "Alfa Slab One"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/alfa-slab-one-400-latin.02368f332779.woff2") format("woff2"); }
@font-face { font-family: "Figtree"; font-style: normal; font-weight: 400 800; font-display: swap; src: url("fonts/figtree-400-800-latin.392aed3eb142.woff2") format("woff2"); }

:root {
  /* the house's (docs/guide/design/tokens.md) */
  --t-display: clamp(32px, 7vw, 44px); --t-heading: 20px; --t-body: 16px; --t-label: 16px; --t-note: 14px;
  --s1: 4px; --s2: 8px; --s3: 16px; --s4: 24px; --s5: 40px;
  --pick-tint: color-mix(in srgb, currentColor 16%, transparent);
  --pick-ring: inset 0 0 0 2px currentColor;
  --pick-weight: 800;

  /* the fair: stained wood, barn red, mustard, teal, cream, brass */
  --wood: #2e1c13; --wood-2: #3c2619; --wood-3: #4d3222; --wood-lo: #1f130c;
  --cream: #f7ecd2; --cream-2: #efe0bd;
  --red: #b3302a; --red-d: #8e231f;
  --mustard: #e2a72b; --teal: #1d7470; --teal-l: #38b3a8;
  --brass: #c9a253; --brass-hi: #fff0c0; --brass-lo: #7c5a1c;
  --bulb: #ffe59a; --bulb-off: #6a4b2f;
  --paint-ink: #24160f;       /* lettering on a cream tile or key */
  --board: #163f3d;           /* the board behind the tiles */
  --board-off: #1d5552;       /* a tile with no letter */
  --typed: #1c4f8f;           /* what you fill in, on a tile */
  /* the wheel's paint */
  --w-red: #b3302a; --w-mustard: #e2a72b; --w-teal: #1d7470; --w-cream: #f7ecd2;
  --w-bust: #1b120d; --w-lose: #fbf4e2; --w-ink: #24160f; --w-cream-ink: #fff7e6;

  /* the room kit's (docs/guide/design/tokens.md, "Color jobs"), at the fair */
  --room: #2e1c13;
  --table: radial-gradient(ellipse 70% 55% at 50% -5%, rgba(255, 229, 154, .10), transparent 70%), repeating-linear-gradient(92deg, rgba(255, 255, 255, .018) 0 2px, transparent 2px 9px), linear-gradient(180deg, #3c2619, #2e1c13);
  --rail: 0 solid transparent;
  --rail-radius: 0;
  --panel: #1f130c;           /* solid, so the board never shows through words */
  --panel-edge: 1.5px solid rgba(247, 236, 210, .16);
  --panel-radius: 12px;
  --sheet: #26170f;
  --chip: #1f130c;
  --chip-edge: 1.5px solid rgba(247, 236, 210, .16);
  --chip-radius: 10px;
  --ink: #f7ecd2;
  --soft: #d9c7a3;            /* 9:1 on the wood */
  --turn: #ffe066;            /* the room's bulb yellow: yours, your turn, picked */
  --turn-ink: #2a2005;
  --good: #8fdc9a;
  --bad: #ff9c8f;
  --focus: #ffe066;
  --btn: #b3302a;             /* barn red: the one fill */
  --btn-ink: #fff7e6;
  --btn-edge: 2px solid #b3302a;
  --btn2: transparent;
  --btn2-ink: #f7ecd2;
  --btn2-edge: 2px solid #f7ecd2;
  --btn-radius: 10px;
  --btn-weight: 800;
  --confirm: #b3302a;
  --confirm-ink: #fff7e6;
  --seat-ink: #1a120c;
  --field-edge: 2px solid #d9c7a3;
  --ui-font: "Figtree", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --display: "Alfa Slab One", Rockwell, "Rockwell Extra Bold", Georgia, serif;
  --display-weight: 400;
  /* a win's confetti: the fair's paint */
  --house-cheer: #b3302a, #e2a72b, #1d7470, #f7ecd2;

  color-scheme: dark;
}

body { background: var(--room); color: var(--ink); }

/* ── a tile: one square of the board ─────────────────────────────────── */
.tptile {
  position: relative; display: grid; place-items: center; box-sizing: border-box; border-radius: 3px;
  width: var(--tile, 38px); height: calc(var(--tile, 38px) * 1.18);
  font: 400 calc(var(--tile, 38px) * .62)/1 var(--display); color: var(--paint-ink);
  padding-top: .15em; /* (Alfa Slab's capitals sit high in their line: centered by ink) */
}
.tptile.off { background: var(--board-off); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .25); }
.tptile.blank, .tptile.shown, .tptile.punct { background: linear-gradient(var(--cream), var(--cream-2)); box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .12); }
/* a letter called: every tile with it lights at once, before it turns over */
.tptile.lit { background: linear-gradient(#fffaf0, #fff1c9); box-shadow: 0 0 0 3px var(--teal-l), 0 0 16px 4px rgba(56, 179, 168, .75); }
.tptile.typed { color: var(--typed); }
.tptile.typed::after { content: ""; position: absolute; left: 18%; right: 18%; bottom: 10%; height: 2px; background: var(--typed); opacity: .55; }
/* the cursor: the tile you're filling in, ringed in the turn color */
.tptile.cursor { box-shadow: inset 0 0 0 3px var(--turn), inset 0 0 12px rgba(255, 224, 102, .6); } /* (inside the blank's edge: ADR 0105) */
.tptile.cursor:empty::before { content: ""; width: 2px; height: 56%; background: var(--paint-ink); }
@media (prefers-reduced-motion: no-preference) {
  .tptile.cursor:empty::before { animation: tpblink 1s steps(2) infinite; }
  @keyframes tpblink { 50% { opacity: 0; } }
  /* a letter called: every tile with it lights at once, then each turns over */
  .tptile.fresh { animation: tpturn 420ms ease-in-out both; animation-delay: var(--d, 0ms); }
  @keyframes tpturn {
    0% { background: linear-gradient(#fffaf0, #fff1c9); color: transparent; box-shadow: 0 0 0 2px var(--teal-l), 0 0 14px 3px rgba(56, 179, 168, .75); transform: none; }
    50% { color: transparent; transform: scaleY(.1); }
    100% { transform: none; }
  }
}

/* ── a key on the letter rack ─────────────────────────────────────────── */
.tpkey {
  all: unset; box-sizing: border-box; position: relative; display: grid; place-items: center; width: var(--key, 40px); height: var(--key-h, 40px);
  border-radius: 8px; font: 800 18px/1 var(--ui-font); background: var(--cream); color: var(--paint-ink); box-shadow: 0 3px 0 #a99067;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
button.tpkey { cursor: pointer; }
button.tpkey:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
@media (hover: hover) { button.tpkey:hover { outline: 3px solid var(--turn); outline-offset: 2px; } }
/* called: crossed out, for everyone (call 15) */
.tpkey.used { background: transparent; color: rgba(247, 236, 210, .72); box-shadow: inset 0 0 0 1.5px rgba(247, 236, 210, .22); }
.tpkey.used::after { content: ""; position: absolute; left: 8px; right: 8px; top: 50%; height: 2px; background: rgba(247, 236, 210, .6); transform: rotate(-38deg); }
/* not yours to pick now: dashed, never faded */
.tpkey.no { background: transparent; color: var(--cream-2); box-shadow: none; outline: 1.5px dashed rgba(247, 236, 210, .45); outline-offset: -2px; }
/* picked (the final's letters): a tint, an inner ring and bold, never the fill */
.tpkey.pick { background: #fff3cc; box-shadow: inset 0 0 0 2.5px var(--paint-ink), 0 3px 0 #a99067; font-weight: 900; }

/* ── a card on the stage ─────────────────────────────────────────────── */
.tpcard { box-sizing: border-box; width: 100%; max-width: 560px; background: linear-gradient(var(--cream), var(--cream-2)); color: var(--paint-ink); border-radius: 14px; padding: 20px 24px; box-shadow: 0 18px 50px rgba(0, 0, 0, .5); display: grid; gap: 12px; text-align: center; }
.tpcard h2 { margin: 0; font: 400 30px/1.1 var(--display); }
.tpcard p { margin: 0; font-size: 16px; }
.tpanswer { font: 400 20px/1.25 var(--display) !important; color: var(--teal); letter-spacing: .02em; }
