/* The inn at night. Colours come from the art palette (scripts/art/lib.js). */

:root {
  --ink: #0a0816;
  --night-0: #141230;
  --night-1: #221d4a;
  --night-2: #352e6e;
  --night-3: #4f4796;
  --slate-2: #6f7ca6;
  --slate-3: #a9b6d6;
  --amber-0: #a4501a;
  --amber-1: #e08a24;
  --amber-2: #ffc24d;
  --amber-3: #ffeaa0;
  --wine-2: #ad3040;
  --wine-3: #d9604f;
  --felt-2: #2a7d68;
  --cream-0: #b9b2c4;
  --cream-1: #f4efe2;

  --title: 'Cinzel', Georgia, serif;
  --label: 'Alegreya SC', Georgia, serif; /* names, buttons, panel headers */
  --body: 'Alegreya', Georgia, serif; /* talk, rules, logs */

  /* Carved tokens: walnut for most, honey oak for the one to press, stained for a warning. */
  --wood-0: #2a160a;
  --wood-1: #573319;
  --wood-2: #744726;
  --wood-3: #93623a;
  --wood-hi: rgba(255, 226, 180, 0.34);
  --oak-0: #7e4d12;
  --oak-1: #c98a2e;
  --oak-2: #e7b05a;
  --oak-hi: rgba(255, 244, 205, 0.7);
  --stain-1: #6e1f2a;
  --stain-2: #94303d;
  --grain: repeating-linear-gradient(93deg, rgba(30, 12, 0, 0.07) 0 2px, transparent 2px 7px, rgba(255, 225, 180, 0.03) 7px 8px, transparent 8px 13px);

  --s: 1; /* room scale, set by JS */
  --cw: 84; /* card width in CSS pixels, set by JS */

  color-scheme: dark;
}

* { box-sizing: border-box; }

/* Alegreya's default figures are old-style, which makes 0 read as o and 10 as IO. Every `font:` shorthand resets this, hence !important. */
* { font-variant-numeric: lining-nums !important; }

html { background: var(--ink); }

body {
  margin: 0;
  background: var(--ink);
  color: var(--cream-1);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.4;
  overflow-x: hidden;
}

[hidden] { display: none !important; }

img.px, .sprite, .px { image-rendering: pixelated; }

/* ---------- header ---------- */

.hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  background: var(--night-0);
  border-bottom: 4px solid var(--ink);
  box-shadow: inset 0 -2px 0 var(--night-2);
}

.title {
  margin: 0;
  font: 700 clamp(18px, 4.6vw, 26px)/1.2 var(--title);
  letter-spacing: 0.04em;
  color: var(--amber-2);
  text-shadow: 0 2px 0 var(--ink);
  white-space: nowrap;
}

.hud-right { display: flex; align-items: center; gap: 8px; min-width: 0; }

.who {
  font: 500 16px/1.1 var(--label);
  color: var(--amber-3);
  text-align: right; /* wraps rather than cutting a purse figure short */
}

/* ---------- chunky boxes ---------- */

.box, .dialogue {
  background: linear-gradient(180deg, var(--night-1), var(--night-0));
  border: 4px solid var(--cream-0);
  box-shadow: 0 0 0 2px var(--ink), inset 0 0 0 2px var(--ink), inset 0 0 0 4px var(--night-3), 0 6px 0 2px rgba(0, 0, 0, 0.45);
  border-radius: 2px;
}

.box {
  margin: 14px 12px;
  padding: 14px 16px;
}

.box-title {
  margin: 0 0 10px;
  font: 700 19px/1.2 var(--label);
  color: var(--amber-2);
  letter-spacing: 0.3px;
}

.prose { margin: 0 0 12px; }

.quiet { margin: 0; color: var(--slate-3); text-align: center; font-size: 14px; }
.quiet:empty { display: none; }

/* ---------- buttons ---------- */

.btn, .menu-item, .chip, .look {
  background: var(--grain), linear-gradient(180deg, var(--wood-3), var(--wood-2) 42%, var(--wood-1));
  color: var(--cream-1);
  border: 1px solid var(--wood-0);
  border-radius: 10px;
  box-shadow: inset 0 1px 0 var(--wood-hi), inset 0 -2px 0 rgba(30, 12, 0, 0.55), 0 2px 0 var(--wood-0), 0 3px 5px rgba(0, 0, 0, 0.45);
  text-shadow: 0 1px 0 rgba(30, 12, 0, 0.7);
  cursor: pointer;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 14px;
  font: 500 18px/1.15 var(--label);
  text-align: center;
  text-decoration: none;
}

.btn:hover:not([disabled]), .menu-item:hover:not([disabled]), .chip:hover:not([disabled]), .look:hover { filter: brightness(1.12); }
.btn:active:not([disabled]), .menu-item:active:not([disabled]), .chip:active:not([disabled]), .look:active {
  transform: translateY(2px);
  box-shadow: inset 0 2px 3px rgba(30, 12, 0, 0.6), inset 0 -1px 0 var(--wood-hi), 0 0 0 var(--wood-0);
}
.btn[disabled], .chip[disabled], .menu-item[disabled] { filter: saturate(0.35) brightness(0.72); cursor: not-allowed; box-shadow: inset 0 1px 0 rgba(255, 226, 180, 0.12), 0 1px 0 var(--wood-0); }

.btn.primary, .chip[aria-pressed='true'] {
  background: var(--grain), linear-gradient(180deg, var(--oak-2), var(--oak-1) 55%, #ad7220);
  color: #1c1006;
  border-color: var(--oak-0);
  box-shadow: inset 0 1px 0 var(--oak-hi), inset 0 -2px 0 rgba(90, 50, 8, 0.6), 0 2px 0 #4c2d08, 0 3px 5px rgba(0, 0, 0, 0.45);
  text-shadow: 0 1px 0 rgba(255, 240, 200, 0.45);
}
.btn.danger { background: var(--grain), linear-gradient(180deg, var(--stain-2), var(--stain-1)); }
.btn.small { white-space: nowrap; min-height: 36px; padding: 4px 10px; font-size: 15px; border-radius: 8px; }
.btn.big { width: 100%; min-height: 56px; font-size: 20px; font-weight: 700; }

:focus-visible { outline: 3px solid var(--amber-2); outline-offset: 2px; }

input {
  min-height: 44px;
  width: 100%;
  padding: 8px 10px;
  background: var(--ink);
  color: var(--cream-1);
  border: 2px solid var(--night-3);
  border-radius: 8px;
  font: 400 17px/1.2 var(--body);
}

label { display: grid; gap: 4px; font: 400 15px/1.3 var(--label); color: var(--slate-3); }

/* ---------- the room ---------- */

.stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0;
  background: var(--ink);
}

.room {
  position: relative;
  width: calc(var(--w) * var(--s) * 1px);
  height: calc(var(--h) * var(--s) * 1px);
  background-size: 100% 100%;
  background-repeat: no-repeat;
  image-rendering: pixelated;
  overflow: hidden;
  isolation: isolate;
}

.night {
  position: absolute;
  inset: 0;
  z-index: 3;
  background: rgba(14, 10, 52, 0.58);
  mix-blend-mode: multiply;
  pointer-events: none;
}

.glow {
  position: absolute;
  z-index: 4;
  left: calc((var(--x) - var(--r)) * var(--s) * 1px);
  top: calc((var(--y) - var(--r)) * var(--s) * 1px);
  width: calc(var(--r) * 2 * var(--s) * 1px);
  height: calc(var(--r) * 2 * var(--s) * 1px);
  background: radial-gradient(circle, rgba(255, 178, 80, var(--a, 0.5)) 0%, rgba(240, 130, 40, calc(var(--a, 0.5) * 0.45)) 38%, rgba(240, 120, 30, 0) 72%);
  mix-blend-mode: screen;
  pointer-events: none;
  animation: flicker 3.6s ease-in-out infinite;
  animation-delay: var(--d, 0s);
}

@keyframes flicker {
  0%, 100% { opacity: 0.92; }
  18% { opacity: 1; }
  34% { opacity: 0.84; }
  52% { opacity: 0.98; }
  71% { opacity: 0.88; }
}

.sprite {
  position: absolute;
  left: calc(var(--x) * var(--s) * 1px);
  top: calc(var(--y) * var(--s) * 1px);
  width: calc(var(--sw) * var(--s) * 1px);
  height: calc(var(--sh) * var(--s) * 1px);
  background-repeat: no-repeat;
  background-color: transparent;
  background-size: 100% 100%;
  padding: 0;
  border: 0;
}

/* A two-frame sheet: the frame width × 2, flipped between by position. */
.frames {
  background-size: 200% 100%;
  animation: idle 1.4s steps(1) infinite;
}

@keyframes idle {
  0%, 49.9% { background-position: 0 0; }
  50%, 100% { background-position: 100% 0; }
}

.spot {
  background: transparent;
  cursor: pointer;
  z-index: 2;
}

.spot .art { position: absolute; inset: 0; background-size: 100% 100%; background-repeat: no-repeat; image-rendering: pixelated; }
.spot.soon .art { filter: brightness(0.62) saturate(0.7); }
.spot .rope {
  position: absolute;
  left: calc(-8 * var(--s) * 1px);
  top: calc(-12 * var(--s) * 1px);
  width: calc(112 * var(--s) * 1px);
  height: calc(96 * var(--s) * 1px);
  background: url(/art/rope-sign.png) 0 0 / 100% 100% no-repeat;
  image-rendering: pixelated;
}

.spot:focus-visible { outline-offset: 4px; }

.plate {
  position: absolute;
  z-index: 6;
  left: calc((var(--x) + var(--sw) / 2) * var(--s) * 1px);
  top: calc((var(--y) + var(--sh) + 2) * var(--s) * 1px);
  transform: translateX(-50%);
  padding: 2px 6px;
  background: var(--ink);
  border: 2px solid var(--cream-0);
  font: 400 14px/1.15 var(--label);
  color: var(--cream-1);
  text-align: center;
  white-space: nowrap;
  pointer-events: none;
}

.plate.live { border-color: var(--amber-2); color: var(--amber-3); }
.plate.soon { border-color: var(--night-3); color: var(--slate-3); }
.plate small { display: block; font-size: 13px; color: var(--amber-2); }
.plate.soon small { color: var(--slate-3); }

.doorman {
  z-index: 7;
  background-image: url(/art/doorman.png);
  cursor: pointer;
}

.bubble {
  position: absolute;
  z-index: 6;
  left: calc((var(--x) + var(--sw)) * var(--s) * 1px - 8px);
  top: calc(var(--y) * var(--s) * 1px + 2px);
  padding: 0 5px;
  background: var(--cream-1);
  color: var(--ink);
  border: 2px solid var(--ink);
  font: 700 15px/1.3 var(--label);
  pointer-events: none;
  animation: bob 1.4s steps(2) infinite;
}

@keyframes bob { 50% { transform: translateY(-2px); } }

/* ---------- dialogue ---------- */

.dialogue {
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: max(10px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(720px, calc(100vw - 20px));
  max-height: 86vh;
  overflow-y: auto;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  padding: 14px;
}

.portrait {
  width: 72px;
  height: 72px;
  background: url(/art/portrait-halfhand.png) 0 0 / 200% 100% no-repeat;
  image-rendering: pixelated;
  border: 3px solid var(--ink);
  box-shadow: 0 0 0 2px var(--amber-0);
  animation: idle 0.9s steps(1) infinite;
}

@media (min-width: 560px) {
  .portrait { width: 144px; height: 144px; }
}

.speaker { font: 400 16px/1.2 var(--label); color: var(--amber-2); margin-bottom: 4px; padding-right: 28px; }
.line { margin: 0 0 10px; min-height: 2.9em; font-size: 16px; }

.close {
  position: absolute;
  right: 8px;
  top: 6px;
  width: 36px;
  height: 36px;
  background: transparent;
  border: 0;
  color: var(--cream-0);
  font: 400 25px/1 var(--label);
  cursor: pointer;
}

.menu { display: grid; gap: 6px; }

@media (min-width: 560px) {
  #menu { grid-template-columns: 1fr 1fr; }
  .line { min-height: 4.4em; }
}

.legend { grid-column: 1 / -1; margin: 2px 0 0; font-size: 14px; color: var(--slate-3); text-align: center; }

.menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 6px 12px;
  font: 500 18px/1.2 var(--label);
  text-align: left;
}

.menu-item:focus-visible { outline: 3px solid var(--amber-2); outline-offset: 2px; }
.menu-item small { margin-left: auto; font-size: 14px; color: var(--cream-0); }

.seat-form { display: grid; gap: 10px; margin-bottom: 8px; }

/* ---------- tables in play ---------- */

.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-top: 2px solid var(--night-2);
}

.row:first-child { border-top: 0; }
.row .label { flex: 1 1 150px; font: 400 16px/1.3 var(--label); }
.row .label small { display: block; color: var(--slate-3); font-size: 14px; }

/* ---------- support ---------- */

.support-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 6px 0; }
.support-row .label { flex: 0 0 150px; font: 400 16px/1.2 var(--label); }
.support-row code { flex: 1 1 180px; min-width: 0; overflow-wrap: anywhere; font: 400 13px/1.3 var(--body); color: var(--slate-3); }

/* ---------- the table page ---------- */

.tag {
  display: inline-block;
  padding: 2px 6px;
  border: 2px solid currentColor;
  font: 400 13px/1.1 var(--label);
  color: var(--slate-3);
  white-space: nowrap;
}

.tag:empty { display: none; }
.tag.agent { color: var(--amber-2); }
.tag.house { color: var(--wine-3); }
.tag.you { color: var(--ink); background: var(--amber-2); border-color: var(--amber-2); }

.status-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 14px;
  padding: 6px 12px;
  background: var(--ink);
  border-bottom: 2px solid var(--night-2);
  font: 400 16px/1.3 var(--label);
}

.pot { display: inline-flex; align-items: center; gap: 5px; color: var(--amber-3); }
.pot b { font-weight: 700; }
.coin { width: 16px; height: 16px; }
.clock { color: var(--slate-3); min-width: 3ch; text-align: right; }
.clock.urgent { color: var(--wine-3); }

.table-layout { display: grid; grid-template-columns: minmax(0, 1fr); max-width: 1280px; margin: 0 auto; }
.col { min-width: 0; }

@media (min-width: 980px) {
  .table-layout { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; }
  .log { height: 300px; }
}

.scene-wrap { display: flex; justify-content: center; background: var(--ink); }

.scene {
  position: relative;
  width: calc(var(--scene-w, 320) * var(--s) * 1px);
  height: calc(var(--scene-h, 144) * var(--s) * 1px);
  background: url(/art/scene-wall.png) 0 0 / calc(320 * var(--s) * 1px) calc(104 * var(--s) * 1px) no-repeat;
  image-rendering: pixelated;
  overflow: hidden;
  isolation: isolate;
}

.scene .front {
  position: absolute;
  z-index: 2;
  left: 0;
  top: calc(104 * var(--s) * 1px);
  width: 100%;
  height: calc(40 * var(--s) * 1px);
  background: url(/art/scene-table.png) 0 0 / 100% 100% no-repeat;
  image-rendering: pixelated;
}

.scene.art { background-size: 100% 100%; }
.scene.soft .front { image-rendering: auto; }

.scene .night { background: rgba(14, 10, 52, 0.4); }

.seat { z-index: 1; }
.seat.folded { filter: grayscale(0.85) brightness(0.55); animation-play-state: paused; }
.seat.out { opacity: 0.25; animation-play-state: paused; }

.seat-art {
  position: absolute;
  left: calc(var(--x) * var(--s) * 1px);
  top: calc(var(--y) * var(--s) * 1px);
  width: calc(var(--sw, 32) * var(--s) * 1px);
  height: calc(var(--sh, 48) * var(--s) * 1px);
  object-fit: contain;
  object-position: bottom;
  image-rendering: pixelated;
  z-index: 1;
}

/* Whose turn it is: a ring that empties as their time runs out. --p runs 1 to 0, in steps set by the page. */
.ring {
  position: absolute;
  z-index: 5;
  left: calc(var(--x) * var(--s) * 1px - 17px);
  top: calc(var(--y) * var(--s) * 1px - 17px);
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--amber-2) calc(var(--p) * 360deg), var(--night-2) 0);
  box-shadow: 0 0 0 2px var(--ink);
  font: 400 14px/1 var(--label);
  color: var(--amber-3);
}

.ring span { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--ink); }

.backs { position: absolute; z-index: 3; display: flex; top: calc(var(--y) * var(--s) * 1px); left: calc(var(--x) * var(--s) * 1px); }
.backs img { width: calc(10 * var(--s) * 1px); height: calc(14 * var(--s) * 1px); margin-right: calc(-3 * var(--s) * 1px); image-rendering: pixelated; }

/* The Midnight card back: the official symbol, unaltered, centred with clear space on a plain dark back. */
.mini-back {
  display: grid;
  place-items: center;
  width: calc(18px * var(--s));
  height: calc(26px * var(--s));
  margin-right: calc(-5px * var(--s));
  background: var(--ink);
  border: 1px solid var(--slate-2);
}
.mini-back img { width: calc(10px * var(--s)); height: calc(10px * var(--s)); margin: 0; image-rendering: auto; }

.card.back.midnight {
  display: grid;
  place-items: center;
  background: var(--ink);
  box-shadow: inset 0 0 0 2px var(--slate-2);
}
.card.back.midnight img { width: 50%; height: auto; image-rendering: auto; }

/* ---------- the painted room and table ---------- */

.art-room .stage, .scene-wrap.art {
  background-color: var(--ink);
  background-repeat: repeat;
  image-rendering: pixelated;
}

.art-room .room { box-shadow: 0 0 0 4px var(--ink), 0 0 0 7px #55301f, 0 0 0 10px var(--ink); }
.art-room .room .night, .scene.art .night { display: none; }

.soft, .soft .sprite { image-rendering: auto; }

.hotspot { background: transparent; border: 2px solid transparent; cursor: pointer; z-index: 2; }
.hotspot:hover, .hotspot:focus-visible { border-color: var(--amber-2); background: rgba(255, 194, 77, 0.08); outline: 0; }
.art-debug .hotspot { border: 2px dashed var(--amber-2); }

.signs { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; padding: 10px 8px 2px; }
.signs:empty { display: none; }
.signs .btn { min-height: 44px; }

.rug-cover { position: absolute; z-index: 1; inset: 0; background-size: 100% 100%; background-repeat: no-repeat; pointer-events: none; }

.rug-mark {
  position: absolute;
  z-index: 1;
  left: calc(var(--x) * var(--s) * 1px);
  top: calc(var(--y) * var(--s) * 1px);
  width: calc(var(--size) * var(--s) * 1px);
  height: calc(var(--size) * var(--s) * 1px);
  opacity: var(--a);
  pointer-events: none;
  image-rendering: auto;
}

.hall-mark {
  position: absolute;
  z-index: 1;
  left: calc(var(--x) * var(--s) * 1px);
  top: calc(var(--y) * var(--s) * 1px);
  width: calc(var(--size) * var(--s) * 1px);
  height: calc(var(--size) * var(--s) * 1px);
  opacity: var(--a);
  pointer-events: none;
  image-rendering: auto;
}

/* Reading the table: what you passed, what came in, and how many each seat has passed. */
:root { --new: #7fdcc4; }

.pass-log { list-style: none; margin: 12px 0 0; padding: 8px 0 0; border-top: 2px solid var(--night-2); font-size: 15px; line-height: 1.5; color: var(--slate-3); }
.pass-log:empty { display: none; }
.mini-card { color: var(--cream-1); font-weight: 700; }
.mini-card.red { color: var(--wine-3); }

.card { position: relative; }
.card.received { box-shadow: 0 0 0 1px #241a14, 0 0 0 3px var(--new), 0 3px 7px rgba(0, 0, 0, 0.5); }
.card.received.chosen { box-shadow: 0 0 0 3px var(--amber-2), 0 0 0 5px var(--new); }
.card.new { box-shadow: 0 0 0 1px #241a14, 0 0 0 3px var(--new), 0 0 14px 4px var(--new); }
.card.arriving { visibility: hidden; }
.new-badge {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translate(-50%, -55%);
  padding: 2px 5px;
  background: var(--new);
  color: var(--ink);
  border: 2px solid var(--ink);
  font: 400 13px/1 var(--label);
  pointer-events: none;
}

.fly-card { position: fixed; z-index: 30; margin: 0; pointer-events: none; }

.pass-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 2px; min-height: 16px; margin-top: 3px; }
.tiny-back { display: inline-block; width: 8px; height: 11px; background: var(--night-2); border: 1px solid var(--slate-2); border-radius: 1px; }
.pass-arrow { margin-left: 3px; font: 700 13px/1 var(--body); color: var(--new); }

.menu-primary {
  justify-content: center;
  font-weight: 700;
  background: var(--grain), linear-gradient(180deg, var(--oak-2), var(--oak-1) 55%, #ad7220);
  color: #1c1006;
  border-color: var(--oak-0);
  box-shadow: inset 0 1px 0 var(--oak-hi), inset 0 -2px 0 rgba(90, 50, 8, 0.6), 0 2px 0 #4c2d08, 0 3px 5px rgba(0, 0, 0, 0.45);
  text-shadow: 0 1px 0 rgba(255, 240, 200, 0.45);
}

/* The pot, in the middle of the felt. */
.pot-on-felt {
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: 3px;
  transform: translateX(-50%);
  display: grid;
  justify-items: center;
  pointer-events: none;
}
.piles { display: flex; align-items: flex-end; gap: calc(8px * var(--s)); }
.sprite-pile {
  width: calc(var(--pw) * var(--s) * 1px);
  height: calc(var(--ph) * var(--s) * 1px);
  background-size: 100% 100%;
  background-repeat: no-repeat;
  image-rendering: pixelated;
}
.soft .sprite-pile { image-rendering: auto; }
.coin-pile { display: flex; flex-wrap: wrap; justify-content: center; width: 58px; }
.coin-pile img { width: 16px; height: 16px; margin: -3px; }
.carried { display: grid; justify-items: center; gap: 1px; opacity: 0.92; }
.carried .sprite-pile { width: calc(var(--pw) * var(--s) * 0.7px); height: calc(var(--ph) * var(--s) * 0.7px); }
.carried-label { padding: 0 4px; background: var(--ink); color: var(--amber-3); font: 400 13px/1.2 var(--label); white-space: nowrap; }
.pot-amount {
  margin-top: -6px;
  min-width: 44px;
  padding: 1px 10px;
  background: rgba(10, 8, 22, 0.86);
  border: 2px solid var(--amber-1);
  border-radius: 3px;
  color: var(--amber-3);
  font: 700 23px/1.1 var(--label);
  text-align: center;
}

.fly-chip { position: fixed; z-index: 31; width: 16px; height: 16px; pointer-events: none; }
.chip-label { position: fixed; z-index: 32; color: var(--amber-3); font: 700 22px/1 var(--label); text-shadow: 0 2px 0 var(--ink), 0 0 4px var(--ink); pointer-events: none; }

/* Choose your look. */
.looks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-bottom: 10px; }
.look {
  display: grid;
  justify-items: center;
  gap: 3px;
  min-height: 44px;
  padding: 6px 2px;
  font: 500 15px/1.1 var(--label);
}
.look[aria-pressed='true'] { border-color: var(--amber-2); box-shadow: inset 0 0 0 2px var(--amber-2), 0 2px 0 var(--wood-0); }
.look .face { width: 64px; height: 64px; }

.seat.away { filter: saturate(0.35) brightness(0.65); animation-play-state: paused; }
.tag.away { color: var(--amber-3); }

.radio { position: absolute; z-index: 8; top: 8px; right: 8px; max-width: 45%; text-align: right; }
.radio-credit { margin: 4px 0 0; font-size: 13px; line-height: 1.2; color: var(--cream-1); text-shadow: 0 1px 2px var(--ink); }
.radio-credit:empty { display: none; }

.midnight-link { display: inline-block; margin-top: 18px; padding: 8px 8px 8px 0; }
.midnight-link img { display: block; height: 32px; width: auto; }

.face {
  flex: 0 0 auto;
  display: inline-block;
  width: 24px;
  height: 24px;
  background-repeat: no-repeat;
  background-color: var(--night-1);
  border: 1px solid var(--amber-0);
  border-radius: 2px;
  image-rendering: pixelated;
  vertical-align: -6px;
}

.talk-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  margin: 0;
  padding: 6px 12px;
  background: var(--night-0);
  border-top: 2px solid var(--night-2);
  font-size: 16px;
  line-height: 1.25;
}
.talk-line b { color: var(--amber-2); }

.log p.said .face { margin-right: 5px; }

.hand-confirm { margin-top: 12px; }
.hand-confirm:empty { display: none; }
.hand-confirm .btn { width: 100%; }

.raise-amounts { display: flex; gap: 6px; }
.raise-amounts .btn { flex: 1 1 0; }

.plates {
  display: grid;
  grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr));
  gap: 4px;
  padding: 6px;
  background: var(--ink);
}

.seat-plate {
  min-width: 0;
  padding: 5px 4px;
  background: var(--night-0);
  border: 2px solid var(--night-2);
  text-align: center;
  font: 500 15px/1.2 var(--label);
}

.seat-plate.turn { border-color: var(--amber-2); background: var(--night-1); }
.seat-plate.mine { box-shadow: inset 0 0 0 1px var(--amber-0); }
.seat-plate.folded, .seat-plate.out { color: var(--slate-2); }
.seat-plate .name { display: block; overflow-wrap: anywhere; }
.seat-plate .chips { display: inline-flex; align-items: center; gap: 3px; color: var(--amber-3); }
.seat-plate .chips img { width: 8px; height: 8px; }
.seat-plate .tag { margin: 2px 0 0; font-size: 12px; }
.seat-plate .rep { display: block; font-size: 12px; color: var(--slate-3); }

.hand { display: flex; flex-wrap: nowrap; justify-content: center; gap: 4px; min-height: calc(var(--cw) * 120 / 84 * 1px); }

.card {
  --ch: calc(var(--cw) * 120 / 84);
  flex: 0 0 auto;
  width: calc(var(--cw) * 1px);
  height: calc(var(--ch) * 1px);
  padding: 0;
  border: 0;
  border-radius: calc(var(--cw) * 0.075px);
  box-shadow: 0 0 0 1px #241a14, 0 3px 7px rgba(0, 0, 0, 0.5);
}

/* Written at twice the art's size, so these land on whole device pixels on a phone or retina screen. */
.card.face {
  background: url(/art/cards/cards.png) calc(var(--col) / 12 * 100%) calc(var(--row) / 3 * 100%) / 1300% 400% no-repeat;
  image-rendering: auto;
}

.card.back:not(.midnight) {
  background: url(/art/cards.png) 0 100% / 1300% 500% no-repeat;
  image-rendering: pixelated;
}

button.card { cursor: pointer; }
button.card:hover, button.card:focus-visible { transform: translateY(calc(var(--cw) * -0.07px)); }
button.card[disabled] { cursor: default; transform: none; }
.card.chosen, button.card.chosen:hover { transform: translateY(calc(var(--cw) * -0.18px)); box-shadow: 0 0 0 3px var(--amber-2), 0 5px 10px rgba(0, 0, 0, 0.55); }
.hand { padding-top: calc(var(--cw) * 0.2px); }

.claims { list-style: none; margin: 0; padding: 0; }
.claims li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 10px; padding: 6px 0; border-top: 2px solid var(--night-2); }
.claims li:first-child { border-top: 0; }
.claims .st { font: 400 14px/1.4 var(--label); }
.claims .st.proven { color: var(--felt-2); filter: brightness(1.5); }
.claims .st.caught { color: var(--wine-3); }
.claims .st.standing { color: var(--slate-3); }
.claims .empty { color: var(--slate-3); }

.log { height: 240px; overflow-y: auto; padding: 8px 10px; background: var(--ink); border: 2px solid var(--night-2); font-size: 16px; line-height: 1.4; overflow-wrap: anywhere; }
.log p { margin: 0 0 5px; color: var(--slate-3); }
.log p.said { color: var(--cream-1); }
.log p.said b { color: var(--amber-2); font-weight: 700; }

.say { margin-top: 10px; display: grid; gap: 8px; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; }
.say-row { display: flex; gap: 8px; }

.leave-row { margin-top: 12px; }
.leave-row button { width: 100%; }

.error { margin: 8px 0 0; color: var(--wine-3); font-size: 15px; }
.error:empty { display: none; }

.raise-row { display: flex; gap: 8px; align-items: center; }
.raise-row input { width: 92px; flex: 0 0 auto; }
.menu-note { margin: 4px 0 0; font-size: 15px; color: var(--slate-3); }

/* The top bar at a table: what's on it, and what's in the purse. */
.purse-bar { order: 3; flex: 1 1 100%; margin: 0; text-align: center; font: 500 16px/1.2 var(--label); color: var(--amber-3); }
.purse-bar:empty { display: none; }
.hud:has(.purse-bar) { flex-wrap: wrap; row-gap: 4px; }
@media (min-width: 760px) {
  .purse-bar { order: 0; flex: 0 1 auto; text-align: right; margin-left: auto; }
  .hud:has(.purse-bar) .hud-right { margin-left: 0; }
}

.add-chips { margin-top: 12px; padding-top: 10px; border-top: 2px solid var(--night-2); }
.add-chips-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.purse-line { margin: 0; font: 500 16px/1.2 var(--label); color: var(--amber-3); }
.add-chips-form { display: grid; gap: 8px; margin-top: 10px; }

/* Settings: the player key. */
.btn.icon { min-width: 40px; padding: 4px 6px; font-size: 18px; }
.settings { display: block; z-index: 21; }
.settings .box-title { padding-right: 32px; }
.settings .btn { flex: 0 0 auto; }
.key-warning { margin: 0 0 10px; padding: 8px 10px; background: var(--ink); border: 2px solid var(--wine-3); border-radius: 8px; line-height: 1.3; }
.key-warning b { color: var(--amber-2); }
.key-restore { display: grid; gap: 4px; margin-top: 12px; }
.key-restore input { min-width: 0; flex: 1 1 auto; }
.key-confirm { margin-top: 10px; }
.settings .quiet { margin-top: 8px; }
.recover { max-width: 560px; margin: 24px auto; }
.recover .quiet { margin-top: 10px; }
.recover a { color: var(--amber-2); }

/* Last call: the banner, and the numbers under it. */
.last-call {
  margin: 0 0 10px;
  padding: 10px 12px;
  background: var(--grain), linear-gradient(180deg, var(--stain-2), var(--stain-1));
  border: 2px solid var(--amber-1);
  border-radius: 8px;
  font: 700 23px/1.2 var(--label);
  color: var(--cream-1);
  text-align: center;
  text-shadow: 0 1px 0 rgba(30, 12, 0, 0.7);
}
.last-call-line { margin: 0 0 6px; }
.last-call-line b { color: var(--amber-3); }
.seat-plate .last-paid { color: var(--amber-3); }
.claims .st.withdrawn { color: var(--slate-2); text-decoration: line-through; }

/* The purse: what you bring, and what came back. */
.notice {
  margin: 0 0 8px;
  padding: 6px 10px;
  background: var(--ink);
  border: 2px solid var(--new);
  border-radius: 8px;
  font: 700 17px/1.3 var(--body);
  color: var(--cream-1);
}
.buyin { display: grid; gap: 8px; margin-bottom: 8px; }
.buyin-row { display: flex; align-items: center; white-space: nowrap; gap: 8px; font: 500 18px/1.2 var(--label); color: var(--cream-1); }
.buyin-row input { width: 84px; flex: 0 0 auto; }

/* The claim lap: what to beat, what you hold, what you can always do, and the picker. */
.to-beat {
  margin: 0 0 10px;
  padding: 8px 12px;
  background: var(--ink);
  border: 2px solid var(--amber-1);
  border-radius: 8px;
  font: 500 21px/1.25 var(--body);
  color: var(--cream-1);
  overflow-wrap: anywhere;
}
.to-beat b { font: 700 21px/1.25 var(--label); color: var(--amber-2); }

.to-beat:not([hidden]) + .line { min-height: 0; margin-bottom: 6px; }

.best-true { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; margin-bottom: 4px; }
.best-true p { flex: 1 1 200px; margin: 0; }
.best-label { font: 500 17px/1.3 var(--label); color: var(--slate-3); }
.best-true b { color: var(--amber-3); }

.true-moves { display: grid; gap: 8px; margin-bottom: 4px; }
.true-moves:not(.strong) { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.true-moves:not(.strong) .btn.big { min-height: 48px; font-size: 18px; font-weight: 500; }

.chips-title { margin: 8px 0 0; font: 700 17px/1.2 var(--label); color: var(--amber-2); }
.chips-label { margin: 6px 0 0; font: 500 16px/1.2 var(--label); color: var(--slate-3); }
.picker { display: grid; gap: 6px; }
.pick-row { display: grid; gap: 6px; }
.pick-row.kinds { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.pick-row.ranks { grid-template-columns: repeat(auto-fill, minmax(54px, 1fr)); }
.chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 3px 4px;
  font: 500 17px/1.1 var(--label);
}
.chip-tag { font: 500 13px/1.1 var(--label); }
.chip-tag.true { color: var(--new); }
.chip-tag.bluff { color: var(--cream-0); }
.chip[aria-pressed='true'] .chip-tag { color: #1c1006; }
.chip[data-truthful] { border-color: var(--new); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
