/* Wall to Wall's look: the ceramic studio (David's pick, 2026-11-12;
   docs/wall-to-wall.md, "Its look"). Glazed tiles fresh from the kiln on a
   wooden ware board, the displays round kiln shelves on a turntable, the
   wall a backsplash of bisque that takes on color as tiles go up; warm
   clay, cream and wood, with five deep glazes, each with its own motif.
   A finished row lights up, end to end, inside the wall.

   This file is the tokens (the house's, the room kit's and the game's own:
   the glazes) and the pieces every screen draws: a tile, a stack, a board.
   It's loaded before the room's structure (games/room/room.css), the table
   (table.css) after it. The Django pages (games/templates/wall-to-wall/
   page.html) wear just this.

   Faces, both OFL and bundled in fonts/: Young Serif (the display: the
   title, the scores) and Figtree (everything else). */

@font-face { font-family: "Young Serif"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/young-serif-400-latin.2e465c2f5f89.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 14%, transparent);
  --pick-ring: inset 0 0 0 2px currentColor;
  --pick-weight: 700;

  /* the glazes, by color (tiles.js NAMES): each a glaze, its motif's light, its pooled edge */
  --g0: #1d4b97; --g0-hi: #6f9be0; --g0-lo: #102b5c;
  --g1: #4f8f6f; --g1-hi: #9fd0b3; --g1-lo: #2c5a43;
  --g2: #cc4c22; --g2-hi: #f59a72; --g2-lo: #7e2a10;
  --g3: #e0a021; --g3-hi: #fbd889; --g3-lo: #8f5f08;
  --g4: #2b2622; --g4-hi: #8a7f74; --g4-lo: #0e0b09;
  --cream: #fbf6ec;
  /* the bisque wall, and a space waiting for its color */
  --bisque: #f0e3cf;
  /* the stage: a dark band over the ring for a moment (announce.js) */
  --stage: #2b211b; --stage-ink: #fff6e6;

  /* the room kit's (docs/guide/design/tokens.md, "Color jobs"), in the studio */
  --room: #e4d8c6;
  --table:
    radial-gradient(ellipse 70% 55% at 12% 0%, rgba(255, 246, 225, .85), transparent 70%),
    radial-gradient(circle at 20% 30%, rgba(120, 90, 60, .05) 0 1px, transparent 1.5px) 0 0 / 7px 7px,
    radial-gradient(circle at 70% 60%, rgba(255, 255, 255, .18) 0 1px, transparent 1.5px) 0 0 / 11px 11px,
    linear-gradient(#e9dfcf, #dccdb5);
  --rail: 0 solid transparent;
  --rail-radius: 0;
  --panel: #fbf6ec;
  --panel-edge: 1px solid #d8c6aa;
  --panel-radius: 14px;
  --sheet: #fbf6ec;
  --chip: #fbf6ec;
  --chip-edge: 1px solid #d8c6aa;
  --chip-radius: 12px;
  --ink: #2b211b;
  --soft: #5f4f42;
  --turn: #b5442a;
  --good: #2f7a52;
  --bad: #b42318;
  --focus: #2b211b;
  --btn: #2b211b;
  --btn-ink: #fbf6ec;
  --btn-edge: 2px solid #2b211b;
  --btn2: transparent;
  --btn2-ink: #2b211b;
  --btn2-edge: 1.5px solid #2b211b;
  --btn-radius: 10px;
  --btn-weight: 700;
  --confirm: #b42318;
  --confirm-ink: #ffffff;
  --turn-ink: #ffffff;
  --seat-ink: #111;
  --field-edge: 1.5px solid #a8957d;
  --ui-font: "Figtree", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --display: "Young Serif", Georgia, serif;
  --display-weight: 400;
  /* a win's confetti: the five glazes */
  --house-cheer: #1d4b97, #4f8f6f, #cc4c22, #e0a021;

  color-scheme: light;
}

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

/* ── a tile: a glaze pooled darker at its edges, glossy at its top ────── */
.wt {
  --g: var(--g0); --hi: var(--g0-hi); --lo: var(--g0-lo);
  width: var(--tile, 32px); height: var(--tile, 32px); border-radius: 18%; position: relative; flex: none; box-sizing: border-box; display: block;
  background:
    radial-gradient(ellipse 70% 45% at 35% 18%, rgba(255, 255, 255, .55), rgba(255, 255, 255, 0) 70%),
    radial-gradient(circle at 50% 55%, var(--g) 45%, color-mix(in srgb, var(--g) 70%, var(--lo)) 100%);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .2), inset 0 -3px 0 rgba(0, 0, 0, .22), inset 0 2px 0 rgba(255, 255, 255, .35);
}
.wt svg { position: absolute; inset: 20%; width: 60%; height: 60%; fill: none; stroke: var(--hi); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.wt.c0, .wspace.c0 { --g: var(--g0); --hi: var(--g0-hi); --lo: var(--g0-lo); }
.wt.c1, .wspace.c1 { --g: var(--g1); --hi: var(--g1-hi); --lo: var(--g1-lo); }
.wt.c2, .wspace.c2 { --g: var(--g2); --hi: var(--g2-hi); --lo: var(--g2-lo); }
.wt.c3, .wspace.c3 { --g: var(--g3); --hi: var(--g3-hi); --lo: var(--g3-lo); }
.wt.c4, .wspace.c4 { --g: var(--g4); --hi: var(--g4-hi); --lo: var(--g4-lo); }
/* the first-player marker: a cream tile with a 1 */
.wt.marker { --g: var(--cream); --lo: #c9b48f; --hi: #fff; display: grid; place-items: center; font: 400 max(10px, calc(var(--tile, 32px) * .55))/1 var(--display); color: var(--ink); }
/* where tiles would go: see-through, and red where they'd fall to the floor */
.wt.ghost { opacity: .5; }
.wt.over { opacity: .7; box-shadow: inset 0 0 0 2px var(--bad), inset 0 0 0 4px rgba(255, 255, 255, .6); }

/* ── a board: a ware board, its grain running long, the bisque wall ───── */
.wb {
  position: relative; display: grid; grid-template-columns: auto auto; box-sizing: border-box; width: max-content;
  gap: calc(var(--tile) * .3) calc(var(--tile) * .45); padding: calc(var(--tile) * .4) calc(var(--tile) * .45); border-radius: 14px;
  background:
    repeating-linear-gradient(178deg, rgba(90, 55, 20, .07) 0 1px, transparent 1px 7px),
    repeating-linear-gradient(181deg, rgba(255, 240, 210, .08) 0 2px, transparent 2px 13px),
    linear-gradient(#d9b986, #c49860 55%, #a97c45);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), inset 0 -3px 0 rgba(80, 45, 15, .3);
}
.wb .whead { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; gap: 12px; color: #2b1c10; min-width: 0; }
.wb .whead .wbname { margin: 0; font: 400 calc(var(--tile) * .75)/1 var(--display); padding-bottom: calc(var(--tile) * .12); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
/* (the score in the UI face's even figures, trimmed to its capitals so it
   sits in the middle of its plate: Young Serif's figures are old-style, a 7
   below the line and a 1 short, so no padding centered every score, the
   2026-11-22 sweep) */
.wb .wscore { font: 700 max(20px, calc(var(--tile) * .74))/1 var(--ui-font); background: var(--cream); padding: .32em 12px; text-box: trim-both cap alphabetic; border-radius: 10px; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .12); font-variant-numeric: lining-nums tabular-nums; flex: none; }
.wgap { gap: max(4px, calc(var(--tile) * .09)); }
.wrows { display: grid; align-content: start; }
.wrow { all: unset; box-sizing: border-box; display: flex; justify-content: flex-end; padding: 2px; border-radius: 8px; position: relative; }
button.wrow { cursor: pointer; }
button.wrow:focus-visible { box-shadow: inset 0 0 0 3px var(--focus); }
.wslot, .wspace { width: var(--tile); height: var(--tile); border-radius: 18%; box-sizing: border-box; flex: none; }
.wslot { background: rgba(70, 40, 15, .22); box-shadow: inset 0 2px 3px rgba(0, 0, 0, .28), inset 0 -1px 0 rgba(255, 255, 255, .15); }
/* rows that can take the tiles in hand light up (a helper, call 12); the one previewed most */
/* (lit: a dashed edge; the one previewed: a solid, heavier one on a paler board, Never only color) */
.wrow.can { background: rgba(255, 250, 235, .3); outline: 2px dashed var(--turn); outline-offset: -2px; }
.wrow.preview { background: rgba(255, 250, 235, .7); outline: 0; box-shadow: inset 0 0 0 3.5px var(--turn); }
.wrow.no .wslot { opacity: .45; }
.wwall {
  position: relative; display: grid; grid-template-columns: repeat(5, var(--tile)); padding: max(6px, calc(var(--tile) * .14)); border-radius: 10px; overflow: hidden;
  background: radial-gradient(circle at 30% 30%, rgba(140, 100, 60, .07) 0 1px, transparent 1.6px) 0 0 / 5px 5px, linear-gradient(#f1e4d1, #e3d0b5);
  box-shadow: inset 0 0 0 2px rgba(120, 85, 45, .22), inset 0 3px 6px rgba(120, 85, 45, .15);
}
.wspace { all: unset; box-sizing: border-box; width: var(--tile); height: var(--tile); border-radius: 18%; position: relative; z-index: 1; background: var(--bisque); box-shadow: inset 0 0 0 1.5px rgba(90, 62, 40, .14), inset 0 2px 2px rgba(90, 62, 40, .1); }
.wspace > .wt { position: absolute; inset: 0; width: 100%; height: 100%; }
/* a space waiting for its color: the glaze's motif, faint, on a hint of it (the standard wall) */
.wspace.ghost > svg { position: absolute; inset: 24%; width: 52%; height: 52%; fill: none; stroke: color-mix(in srgb, var(--g) 40%, var(--bisque)); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.wspace.ghost { background: color-mix(in srgb, var(--g) 13%, var(--bisque)); }
/* the free wall's spaces a row can go to: lit, and pressable */
button.wspace { cursor: pointer; }
.wspace.open { background: color-mix(in srgb, var(--turn) 14%, var(--bisque)); box-shadow: inset 0 0 0 2.5px var(--turn); }
button.wspace:focus-visible { box-shadow: inset 0 0 0 3px var(--focus); }
/* a tile just set: the tiles it joins are lit, inside their own edges */
.wspace.lit > .wt { box-shadow: inset 0 0 0 3px #fff3c4, inset 0 0 10px 2px rgba(255, 230, 150, .8); }
.wspace.arrive > .wt { animation: wtarrive .45s cubic-bezier(.2, .9, .3, 1.2) both; }
@keyframes wtarrive { from { transform: translateX(calc(var(--tile) * -1.2)); opacity: 0; } }
/* a finished row lights up end to end, the light held inside the wall */
.wrowlight { position: absolute; left: 3px; right: 3px; height: calc(var(--tile) + 6px); border-radius: 8px; z-index: 2; pointer-events: none; mix-blend-mode: soft-light;
  top: calc(max(6px, var(--tile) * .14) - 3px + var(--r) * (var(--tile) + max(4px, var(--tile) * .09)));
  background: linear-gradient(90deg, rgba(255, 214, 120, .25), rgba(255, 232, 170, .9), rgba(255, 214, 120, .25)); }
.wfloor { all: unset; box-sizing: border-box; grid-column: 1 / -1; display: flex; align-items: flex-end; padding: 2px; border-radius: 8px; justify-self: start; }
button.wfloor { cursor: pointer; }
button.wfloor:focus-visible { box-shadow: inset 0 0 0 3px var(--focus); }
.wfloor.can { background: rgba(255, 250, 235, .22); outline: 2px dashed color-mix(in srgb, var(--turn) 70%, transparent); outline-offset: -2px; }
.wfloor.preview { background: rgba(255, 250, 235, .6); outline: 0; box-shadow: inset 0 0 0 3.5px var(--turn); }
.wfloor .cell { display: grid; justify-items: center; gap: 2px; }
.wfloor .cost { font: 700 max(11px, calc(var(--tile) * .4))/1 var(--ui-font); color: #24160a; }
.wfloor .wslot { background: rgba(90, 30, 20, .25); }
.wfloor .wt.falling { animation: wtfall .5s ease-in both; }
@keyframes wtfall { to { transform: translateY(calc(var(--tile) * .5)) rotate(8deg); opacity: 0; } }
.wgain { position: absolute; z-index: 3; font: 400 calc(var(--tile) * .7)/1 var(--display); color: #fff; background: var(--good); padding: 3px 9px; border-radius: 999px; white-space: nowrap; pointer-events: none; }
.wgain.loss { background: var(--bad); }
@media (prefers-reduced-motion: reduce) {
  .wspace.arrive > .wt, .wfloor .wt.falling { animation: none; }
  .wfloor .wt.falling { opacity: .35; }
}

/* ── a small wall, for the others and the result sheet ──────────────── */
.wwall.mini { --tile: var(--mini, 10px); padding: 2px; gap: 1px; border-radius: 4px; box-shadow: inset 0 0 0 1px rgba(120, 85, 45, .22); }
.wwall.mini .wspace, .wwall.mini .wt { border-radius: 2px; box-shadow: none; }
.wwall.mini svg { display: none; }
.wwall.mini .wspace.ghost { background: color-mix(in srgb, var(--g) 16%, var(--bisque)); }
