/* Cardhub: a dark card-room look. Deep ink, brass, lit felt and ivory cards. */
:root {
  /* Room */
  --bg: #08090d;
  --bg-2: #10131a;
  --glass: rgb(20 23 31 / 0.78);
  --glass-hi: rgb(32 36 47 / 0.85);
  --line: rgb(255 255 255 / 0.08);
  --line-hi: rgb(255 255 255 / 0.14);
  --ink: #efe9dc;
  --muted: #9a9fab;
  --faint: #6b7180;

  /* Brass */
  --gold: #d9b263;
  --gold-hi: #f6dc97;
  --gold-lo: #a07a30;
  --gold-line: rgb(217 178 99 / 0.35);
  --gold-glow: rgb(240 200 110 / 0.55);
  --gold-grad: linear-gradient(180deg, #f8e2a2 0%, #e2bb68 45%, #c4943d 100%);

  /* Table */
  --felt: #13704d;
  --felt-mid: #0c4f37;
  --felt-deep: #052419;
  --wood: #2b1a10;
  --wood-hi: #4a2e1b;

  /* Cards */
  --paper: #fffdf6;
  --paper-2: #f2eadb;
  --back: #6e1023;
  --back-2: #3d0712;
  --red: #c4162f;
  --black: #15171c;
  --green: #1d7a3e;
  --gold-suit: #a97800;
  --blue: #1f5fb4;
  --brown: #7a4a1e;

  /* Marks on the table */
  --can: #f0c869;
  --on: #6ff0bd;
  --target: #6cc4ff;

  --accent: var(--gold);
  --danger: #ef7d6b;
  --display: 'Iowan Old Style', 'Palatino Linotype', Palatino, 'Book Antiqua', Georgia, serif;
  --ui: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --radius: 14px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --noise-soft: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}
html,
body {
  /* No pull-to-refresh: a downward drag at the top of the page (say, pulling a card) would otherwise reload the game. */
  overscroll-behavior-y: none;
}
html {
  background: var(--bg);
}
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  /* One linear gradient. Soft radial glows across the whole page were redrawn under everything that changed above them,
     and on a phone's GPU that cost more than the cards did. */
  background: linear-gradient(180deg, var(--bg-2), var(--bg) 60%);
  font:
    15px/1.5 var(--ui),
    sans-serif;
  -webkit-font-smoothing: antialiased;
}
#app {
  position: relative;
  z-index: 1;
}
button,
select,
input {
  font: inherit;
  color: inherit;
}
a {
  color: var(--gold);
  text-decoration-color: var(--gold-line);
  text-underline-offset: 3px;
}
a:hover {
  color: var(--gold-hi);
  text-decoration-color: currentColor;
}
h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: 0.005em;
}
h1 {
  font-size: clamp(34px, 5vw, 52px);
  line-height: 1.05;
  margin: 0 0 10px;
}
h2 {
  font-size: 19px;
  margin: 0;
}
::selection {
  background: rgb(217 178 99 / 0.35);
}

/* Shared surfaces and controls */
.panel,
.form,
.offer,
.result {
  background: linear-gradient(180deg, var(--glass-hi), var(--glass));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.05),
    0 20px 40px -20px rgb(0 0 0 / 0.7);
}
.primary,
.action,
.undo,
.hint-button,
.toggle,
.back {
  border-radius: 10px;
  cursor: pointer;
  transition:
    transform 0.15s var(--ease),
    filter 0.15s,
    border-color 0.15s,
    background-color 0.15s,
    box-shadow 0.15s;
}
.primary,
.action.confirm {
  position: relative;
  overflow: hidden;
  padding: 11px 20px;
  border: 1px solid #f9e7b4;
  background: var(--gold-grad);
  color: #22180a;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 0 rgb(255 255 255 / 0.35);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.6),
    inset 0 -2px 0 rgb(0 0 0 / 0.18),
    0 6px 18px -6px var(--gold-glow);
}
.primary::after,
.action.confirm::after {
  content: '';
  position: absolute;
  inset: 0 auto 0 -60%;
  width: 45%;
  background: linear-gradient(100deg, transparent, rgb(255 255 255 / 0.55), transparent);
  transform: skewX(-20deg);
  transition: left 0.6s var(--ease);
  pointer-events: none;
}
/* Hover brightens rather than lifts: a lift moves the edge out from under a pointer resting on it, and the button jitters. */
.primary:hover,
.action.confirm:hover {
  filter: brightness(1.06);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.6),
    inset 0 -2px 0 rgb(0 0 0 / 0.18),
    0 10px 26px -6px var(--gold-glow);
}
.primary:hover::after,
.action.confirm:hover::after {
  left: 120%;
}
.primary:active,
.action:active {
  transform: translateY(1px);
}
.action {
  padding: 9px 15px;
  border: 1px solid var(--line-hi);
  background: rgb(255 255 255 / 0.04);
  color: var(--ink);
  font-weight: 500;
}
.action:hover {
  border-color: var(--gold-line);
  background: rgb(217 178 99 / 0.09);
}
.back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px 7px 12px;
  border: 1px solid var(--line);
  background: rgb(255 255 255 / 0.03);
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 20px;
}
.back:hover {
  color: var(--gold-hi);
  border-color: var(--gold-line);
}
.undo,
.hint-button {
  margin-left: auto;
  align-self: center;
  padding: 7px 16px;
  border: 1px solid var(--line-hi);
  background: rgb(255 255 255 / 0.04);
  font-size: 14px;
}
.undo:hover:not(:disabled),
.hint-button:hover:not(:disabled) {
  border-color: var(--gold-line);
  color: var(--gold-hi);
}
.undo:disabled,
.hint-button:disabled {
  cursor: default;
  opacity: 0.4;
}
.toggle {
  align-self: center;
  padding: 7px 14px;
  border: 1px solid var(--line-hi);
  background: rgb(255 255 255 / 0.04);
  color: var(--muted);
  font-size: 14px;
}
.toggle:hover {
  border-color: var(--gold-line);
}
.toggle[aria-pressed='true'] {
  border-color: var(--gold-line);
  background: rgb(255 255 255 / 0.08);
  color: var(--gold-hi);
}
.card:focus-visible,
.slot:focus-visible,
.table-facts .fact:focus-visible,
.action:focus-visible,
.primary:focus-visible,
.undo:focus-visible,
.hint-button:focus-visible,
.toggle:focus-visible,
.back:focus-visible,
.remove:focus-visible,
.game-tile:focus-visible,
.field select:focus-visible,
.field input:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--gold-hi);
  outline-offset: 2px;
}
.error {
  color: var(--danger);
  margin: 0;
}
.error:empty {
  display: none;
}
.note {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

/* Pages */
.page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 20px 24px 64px;
}
.lede {
  color: var(--muted);
  margin: 0 0 24px;
  font-size: 17px;
  max-width: 46ch;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 4px 0 8px;
}
.brand {
  font-family: var(--display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
}
.brand::before {
  content: '♠';
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-right: 10px;
  border-radius: 8px;
  background: var(--gold-grad);
  color: #22180a;
  font-size: 18px;
  letter-spacing: 0;
  vertical-align: -6px;
  box-shadow: 0 4px 14px -4px var(--gold-glow);
}

/* Home: hero */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  align-items: center;
  gap: 24px;
  min-height: 300px;
  margin: 12px 0 28px;
  padding: 40px 44px;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--gold-line);
  background:
    radial-gradient(ellipse 70% 90% at 78% 50%, rgb(255 255 255 / 0.1), transparent 60%), var(--noise-soft),
    radial-gradient(ellipse at 70% 50%, var(--felt) 0%, var(--felt-mid) 50%, var(--felt-deep) 100%);
  box-shadow:
    inset 0 0 0 6px rgb(0 0 0 / 0.25),
    inset 0 0 80px rgb(0 0 0 / 0.55),
    0 40px 80px -30px rgb(0 0 0 / 0.8);
}
.hero h1 {
  font-size: clamp(48px, 8vw, 84px);
  letter-spacing: 0.02em;
  background: linear-gradient(180deg, #fff6d8 0%, var(--gold-hi) 35%, var(--gold) 70%, var(--gold-lo) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 4px 18px rgb(0 0 0 / 0.5));
}
.hero .lede {
  color: rgb(239 233 220 / 0.85);
  font-size: 19px;
  margin: 0;
  text-shadow: 0 1px 8px rgb(0 0 0 / 0.5);
}
.fan {
  position: relative;
  height: 220px;
  bottom: 22px;
}
.fan-card {
  --i: 0;
  --r: 0deg;
  --y: 0px;
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 120px;
  height: 168px;
  margin-left: -60px;
  border-radius: 10px;
  padding: 8px 10px;
  background: linear-gradient(155deg, var(--paper), var(--paper-2));
  color: var(--black);
  font-family: var(--display);
  transform-origin: 50% 140%;
  transform: rotate(var(--r)) translateY(var(--y));
  box-shadow:
    inset 0 0 0 1px rgb(0 0 0 / 0.08),
    -6px 10px 24px rgb(0 0 0 / 0.45);
  animation: deal 0.9s var(--ease) both;
  animation-delay: calc(var(--i) * 0.08s);
}
.fan-card:nth-child(1) {
  --i: 0;
  --r: -26deg;
  --y: 12px;
}
.fan-card:nth-child(2) {
  --i: 1;
  --r: -13deg;
  --y: 3px;
}
.fan-card:nth-child(3) {
  --i: 2;
  --r: 0deg;
  --y: 0px;
}
.fan-card:nth-child(4) {
  --i: 3;
  --r: 13deg;
  --y: 3px;
}
.fan-card:nth-child(5) {
  --i: 4;
  --r: 26deg;
  --y: 12px;
}
.fan-card.red {
  color: var(--red);
}
.fan-card b,
.fan-card i {
  display: block;
  font-style: normal;
  font-weight: 700;
  font-size: 22px;
  line-height: 1;
  text-align: center;
  width: 20px;
}
.fan-card i {
  font-size: 18px;
  margin-top: 2px;
}
.fan-card .pip {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 58px;
}
@keyframes deal {
  from {
    opacity: 0;
    transform: rotate(0deg) translateY(60px);
  }
}

/* Home: game list */
.section {
  margin: 36px 0 14px;
  font-size: 13px;
  font-family: var(--ui);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: 14px;
}
.section::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--gold-line), transparent);
}
.games {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 14px;
}
.game-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-height: 150px;
  width: 100%;
  overflow: hidden;
  text-align: start;
  padding: 18px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at 100% 0%, rgb(217 178 99 / 0.08), transparent 55%),
    linear-gradient(180deg, var(--glass-hi), var(--glass));
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.05),
    0 14px 30px -18px rgb(0 0 0 / 0.8);
  cursor: pointer;
  transition:
    transform 0.25s var(--ease),
    border-color 0.25s,
    box-shadow 0.25s;
}
.game-tile::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(115deg, transparent 30%, rgb(255 255 255 / 0.07) 50%, transparent 70%);
  background-size: 250% 100%;
  background-position: 100% 0;
  transition: background-position 0.7s var(--ease);
  pointer-events: none;
}
.game-tile:hover {
  transform: translateY(-3px);
  border-color: var(--gold-line);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.07),
    0 0 0 1px rgb(217 178 99 / 0.15),
    0 24px 40px -18px rgb(0 0 0 / 0.9),
    0 0 40px -12px rgb(217 178 99 / 0.35);
}
.game-tile:hover::after {
  background-position: 0 0;
}
.game-tile h2 {
  font-size: 22px;
  margin: 0 0 6px;
  padding-right: 44px;
  color: var(--ink);
}
.game-tile p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}
.game-tile small {
  margin-top: auto;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--gold-line);
  background: rgb(217 178 99 / 0.08);
  color: var(--gold-hi);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
}
.tile-suit {
  position: absolute;
  top: 8px;
  right: 16px;
  font-size: 40px;
  line-height: 1;
  color: rgb(239 233 220 / 0.14);
  transition:
    color 0.25s,
    transform 0.35s var(--ease);
}
.tile-suit.red {
  color: rgb(214 56 76 / 0.28);
}
.game-tile:hover .tile-suit {
  color: var(--gold);
  transform: scale(1.12) rotate(-8deg);
}
.game-tile:hover .tile-suit.red {
  color: #e2485f;
}
.saved {
  position: relative;
  display: grid;
}
.continue .game-tile {
  min-height: 110px;
  border-color: var(--gold-line);
}
.saved .game-tile:disabled {
  cursor: default;
  opacity: 0.7;
}
.saved .remove {
  position: absolute;
  bottom: 14px;
  right: 14px;
  padding: 3px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
}
.saved .remove:hover {
  color: var(--danger);
  border-color: rgb(239 125 107 / 0.35);
}

/* Settings: the button on each page and the modal it opens */
.settings-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.settings-icon {
  font-size: 16px;
  line-height: 1;
  color: var(--gold);
}
.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.page-head .settings-button {
  align-self: flex-start;
}
dialog.settings {
  width: min(440px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  padding: 22px 24px 24px;
  border: 1px solid var(--gold-line);
  border-radius: var(--radius);
  color: var(--ink);
  background:
    radial-gradient(ellipse at 50% 0%, rgb(217 178 99 / 0.14), transparent 60%),
    linear-gradient(180deg, rgb(28 31 40 / 0.98), rgb(14 16 21 / 0.98));
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.08),
    0 40px 80px rgb(0 0 0 / 0.7);
  animation: rise 0.3s var(--ease) both;
}
dialog.settings[open] {
  display: grid;
  gap: 20px;
}
dialog.settings::backdrop {
  background: rgb(0 0 0 / 0.6);
  backdrop-filter: blur(3px);
}
.settings-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.settings-head h2 {
  margin: 0;
  font-size: 26px;
  background: linear-gradient(180deg, #fff6d8, var(--gold-hi) 40%, var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.settings-close {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgb(255 255 255 / 0.03);
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.settings-close:hover {
  color: var(--gold-hi);
  border-color: var(--gold-line);
}
.settings-close:focus-visible {
  outline: 2px solid var(--gold-hi);
  outline-offset: 2px;
}
.settings-group {
  display: grid;
  gap: 14px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.settings-group h3 {
  margin: 0;
  font-family: var(--ui);
  font-size: 13px;
  font-weight: 600;
  color: var(--gold);
}
.settings-group .check {
  color: var(--ink);
}

/* Setup */
.setup {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 460px);
  gap: 48px;
  align-items: start;
}
.intro h1 {
  background: linear-gradient(180deg, #fff6d8, var(--gold-hi) 40%, var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.intro .lede {
  font-size: 18px;
}
.rules-link {
  margin: 0;
}
.showcase {
  margin-top: 32px;
  height: 260px;
  display: grid;
  align-items: end;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--gold-line);
  background:
    radial-gradient(ellipse 60% 70% at 50% 60%, rgb(255 255 255 / 0.1), transparent 70%), var(--noise-soft),
    radial-gradient(ellipse at center, var(--felt) 0%, var(--felt-mid) 55%, var(--felt-deep) 100%);
  box-shadow:
    inset 0 0 0 6px rgb(0 0 0 / 0.25),
    inset 0 0 70px rgb(0 0 0 / 0.55),
    0 30px 60px -30px rgb(0 0 0 / 0.8);
}
.showcase .fan {
  bottom: 28px;
}
.form {
  display: grid;
  gap: 18px;
  padding: 24px;
  border-color: var(--gold-line);
}
.field {
  display: grid;
  gap: 6px;
}
.field > span {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.field select,
.field input[type='number'] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line-hi);
  border-radius: 10px;
  background-color: rgb(0 0 0 / 0.3);
  color: var(--ink);
  transition: border-color 0.15s;
}
.field select {
  appearance: none;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23d9b263' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  cursor: pointer;
}
.field select:hover,
.field input[type='number']:hover {
  border-color: var(--gold-line);
}
.field option {
  background: var(--bg-2);
}
.check {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 32px;
  cursor: pointer;
}
.check[hidden] {
  display: none;
}
.check input,
.amount input[type='range'] {
  accent-color: var(--gold);
}
.check input {
  width: 17px;
  height: 17px;
}
details {
  border-top: 1px solid var(--line);
  padding-top: 6px;
}
/* Tall enough to tap on a phone. */
details > summary {
  min-height: 32px;
  cursor: pointer;
  color: var(--muted);
  font-size: 14px;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
details > summary::-webkit-details-marker {
  display: none;
}
details > summary::before {
  content: '';
  width: 7px;
  height: 7px;
  border-right: 1.6px solid var(--gold);
  border-bottom: 1.6px solid var(--gold);
  transform: rotate(-45deg);
  transition: transform 0.2s;
}
details[open] > summary::before {
  transform: rotate(45deg);
}
details > summary:hover {
  color: var(--ink);
}
details .field,
details .check {
  margin-top: 14px;
}
/* A heading over each group of a game's rules (ADR 0048). */
details .group {
  border: 0;
  margin: 22px 0 0;
  padding: 0;
  min-width: 0;
}
details .group > legend {
  padding: 0;
  color: var(--gold);
  font-size: 15px;
  font-weight: 600;
}
.form .primary {
  padding-block: 14px;
  font-size: 16px;
}
/* An online room's lobby: who's here, the link to send, and the options the owner sets. */
.room-head {
  margin-bottom: 22px;
}
.room-head h1 {
  margin-bottom: 6px;
}
.eyebrow {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}
.room-status {
  margin: 0;
  min-height: 1.4em;
}
.lobby {
  display: grid;
  gap: 16px;
  max-width: 620px;
}
.lobby > p {
  margin: 0;
}
.lobby .panel {
  padding: 18px 20px;
}
.lobby .panel h2 {
  font-size: 20px;
}
.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.seated-count {
  font-size: 13px;
  color: var(--muted);
}
/* The invitation: what it's for, the code to read out, and the buttons to pass the link on. */
.invite {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    'text code'
    'buttons buttons';
  gap: 14px 18px;
  align-items: center;
  border-color: var(--gold-line);
  background:
    radial-gradient(circle at 100% 0, rgb(217 178 99 / 0.12), transparent 55%),
    linear-gradient(180deg, var(--glass-hi), var(--glass));
}
.invite-text {
  grid-area: text;
  display: grid;
  gap: 4px;
}
.room-code {
  grid-area: code;
  font-family: var(--display);
  font-size: 26px;
  letter-spacing: 0.12em;
  color: var(--gold-hi);
  white-space: nowrap;
  user-select: all;
}
.invite-buttons {
  grid-area: buttons;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.invite-buttons .action {
  flex: 1 1 140px;
}
/* The players: one row a seat, people first by seat, open seats dimmer. */
.seats {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.seat {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 8px 10px 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgb(0 0 0 / 0.18);
}
.seat.mine {
  border-color: var(--gold-line);
  background: rgb(217 178 99 / 0.07);
}
.seat.open {
  border-style: dashed;
  background: transparent;
}
.avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-family: var(--display);
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  background: var(--glass-hi);
  border: 1px solid var(--line-hi);
}
.seat.mine .avatar {
  color: #1a1307;
  background: var(--gold-grad);
  border-color: transparent;
}
.seat.open .avatar {
  border-style: dashed;
  background: transparent;
}
.seat-main {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 3px;
}
.seat-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.seat.open .seat-name {
  color: var(--muted);
}
.seat-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.seat-tags:empty {
  display: none;
}
.tag {
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  border: 1px solid var(--line-hi);
  color: var(--muted);
}
.tag.you {
  color: var(--gold-hi);
  border-color: var(--gold-line);
}
.tag.away {
  color: var(--danger);
  border-color: rgb(239 125 107 / 0.4);
}
.seat-note {
  font-size: 12px;
  color: var(--faint);
}
.seat .action {
  flex: none;
}
/* Your own name, edited in place: plain text until it's hovered or focused. */
.name-edit-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
}
.name-edit {
  min-width: 0;
  max-width: 100%;
  min-height: 32px;
  padding: 3px 6px;
  margin-left: -7px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
}
.name-edit:hover {
  border-color: var(--line-hi);
}
.name-edit:focus-visible {
  outline: none;
  border-color: var(--gold-line);
  background: rgb(0 0 0 / 0.3);
}
.pencil {
  flex: none;
  width: 14px;
  height: 14px;
  opacity: 0.7;
  background: var(--gold);
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M11.2 1.8a1.6 1.6 0 0 1 2.3 0l.7.7a1.6 1.6 0 0 1 0 2.3L5.6 13.4 2 14l.6-3.6z'/%3E%3C/svg%3E")
    center / contain no-repeat;
}
.name-edit:focus-visible + .pencil {
  opacity: 0;
}
/* Options: the owner's form, or for everyone else a closed summary they can open to read. */
.options {
  display: grid;
  gap: 14px;
}
.options.readonly > summary {
  min-height: 0;
  color: var(--ink);
  font-family: var(--display);
  font-size: 20px;
  font-weight: 600;
}
.options.readonly[open] > summary {
  margin-bottom: 4px;
}
details.options {
  display: block;
}
details.options[open] > .rules {
  margin-top: 14px;
}
.lobby-foot {
  display: grid;
  gap: 10px;
  justify-items: center;
  margin-top: 4px;
}
.lobby-foot .start {
  width: 100%;
  padding-block: 15px;
  font-size: 16px;
}
.link-button {
  min-height: 32px;
  padding: 4px 10px;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  text-decoration: underline;
  text-decoration-color: var(--line-hi);
  text-underline-offset: 3px;
  cursor: pointer;
}
.link-button:hover {
  color: var(--ink);
}
@media (max-width: 520px) {
  .invite {
    grid-template-columns: 1fr;
    grid-template-areas:
      'text'
      'code'
      'buttons';
  }
  .lobby .panel {
    padding: 16px;
  }
}
.rules {
  display: grid;
  gap: 14px;
}
.rules :disabled,
.rules .check:has(:disabled) {
  cursor: default;
  opacity: 0.75;
}
.offer {
  margin: 0 0 18px;
  padding: 16px 18px;
  border-color: var(--gold-line);
  background:
    radial-gradient(circle at 0 0, rgb(217 178 99 / 0.14), transparent 60%),
    linear-gradient(180deg, var(--glass-hi), var(--glass));
}
.offer p {
  margin: 0 0 12px;
}
.offer .buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* The game screen */
.game {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 20px;
  max-width: 1600px;
  margin: 0 auto;
  padding: 12px 24px 16px;
  /* What the bar above the table takes, with the gaps around it, so the table can fill the rest of the screen. */
  --above: 76px;
}
.bar {
  grid-column: 1 / -1;
  display: flex;
  gap: 16px;
  align-items: center;
}
.bar .back {
  margin: 0;
}
.bar .settings-button {
  margin-left: auto;
}
.bar .settings-button ~ .undo,
.bar .settings-button ~ .hint-button,
.bar .hint-button ~ .undo {
  margin-left: 0;
}
/* The 3D table, hint and undo: icons, named by their tooltips and for screen readers (src/icons.ts). */
.bar .icon {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin: 0;
  padding: 0;
  color: inherit;
}
.bar .icon svg {
  display: block;
}
.bar .icon.table-toggle {
  border-radius: 10px;
  border: 1px solid var(--line-hi);
  background: rgb(255 255 255 / 0.04);
  cursor: pointer;
}
.bar .icon.table-toggle:hover {
  border-color: var(--gold-line);
  color: var(--gold-hi);
}
.bar .icon[aria-pressed='true'] {
  border-color: var(--gold-line);
  background: rgb(255 255 255 / 0.08);
  color: var(--gold-hi);
}
/* While the hint is being worked out, the bulb glows on and off. */
.bar .icon.thinking {
  opacity: 1;
}
.bar .icon.thinking svg {
  animation: thinking calc(0.9s * var(--pace, 1)) ease-in-out infinite alternate;
}
@keyframes thinking {
  to {
    opacity: 0.3;
  }
}
@media (prefers-reduced-motion: reduce) {
  .bar .icon.thinking svg {
    animation: none;
  }
}
.bar h2 {
  font-size: 24px;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stage-wrap {
  position: relative;
  /* The table fills the screen's height; the renderer sizes the cards to fit whatever space it's given. svh, not dvh: a
     phone's address bar showing and hiding as the page scrolls would otherwise resize the table, and refit it, on every
     frame. */
  height: max(440px, calc(100svh - var(--above)));
  border-radius: 28px;
  overflow: hidden;
  /* So the felt below can sit under the cards and over this. */
  isolation: isolate;
  background: var(--felt-deep);
  box-shadow: 0 0 0 1px rgb(0 0 0 / 0.6);
}
/* The felt and its rail, on a layer of their own, drawn once: otherwise every card that moves or changes redraws the
   felt under it, and on a phone's GPU that redrawing was most of what made play stutter. Only gradients and unblurred
   shadows, for the same reason: a blurred shadow or a noise texture this size was the dearest thing on the page. */
.stage-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background:
    radial-gradient(ellipse 55% 50% at 50% 46%, rgb(255 255 255 / 0.09), transparent 70%),
    radial-gradient(ellipse at center, var(--felt) 0%, var(--felt-mid) 55%, var(--felt-deep) 100%);
  /* The rail: brass edge, then wood, then a brass bead. */
  box-shadow:
    inset 0 0 0 1px rgb(246 220 151 / 0.35),
    inset 0 0 0 7px var(--wood),
    inset 0 0 0 8px rgb(217 178 99 / 0.45);
  will-change: transform;
  pointer-events: none;
}
.stage-wrap::before {
  /* A faint ring painted on the felt, like a printed table. */
  content: '';
  position: absolute;
  inset: 18% 22%;
  border-radius: 50%;
  border: 1.5px solid rgb(246 220 151 / 0.07);
  box-shadow: 0 0 0 10px rgb(246 220 151 / 0.025);
  pointer-events: none;
}
.stage {
  position: absolute;
  left: 0;
  top: 0;
  width: 1000px;
  height: 700px;
  transform-origin: 0 0;
}
.side {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}
.panel {
  padding: 16px;
}
.side > .panel:first-child,
.side > .coach + .panel {
  border-color: var(--gold-line);
}
.facts {
  margin: 0 0 10px;
  padding: 0;
  list-style: none;
  font-size: 13px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.facts li {
  padding: 2px 10px;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.05);
  border: 1px solid var(--line);
}
.facts:empty {
  display: none;
}
.status {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.35;
  min-height: 1.35em;
  margin: 0 0 12px;
  color: var(--ink);
}
/* Why a hint's move is good, and the coach's note on the player's last card (ADR 0047). */
.advice-line,
.coach-note {
  margin: -4px 0 12px;
  font-size: 14px;
  line-height: 1.45;
}
.advice-line {
  color: var(--gold-hi);
}
.coach-note {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--gold-line);
  background: rgb(255 255 255 / 0.04);
  color: var(--ink);
}
.advice-line:empty,
.coach-note:empty,
.coach-summary:empty {
  display: none;
}
.advice-line .chip-card,
.coach-note .chip-card {
  display: inline-block;
  padding: 0 5px;
  margin: 0 1px;
  border-radius: 5px;
  background: linear-gradient(160deg, var(--paper), var(--paper-2));
  color: var(--black);
  font-weight: 700;
  font-size: 0.92em;
  line-height: 1.35;
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.4);
  white-space: nowrap;
}
.chip-card.suit-red {
  color: var(--red);
}
.chip-card.suit-green {
  color: var(--green);
}
.chip-card.suit-gold {
  color: var(--gold-suit);
}
.chip-card.suit-blue {
  color: var(--blue);
}
.chip-card.suit-brown {
  color: var(--brown);
}
.coach-toggle small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}
/* Online, a room's turn limit, counted down. */
.timer {
  margin: -6px 0 12px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}
.timer.short {
  color: var(--danger);
  font-weight: 600;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 210px;
  overflow-y: auto;
}
.actions:empty {
  display: none;
}
.amount {
  display: flex;
  gap: 12px;
  align-items: center;
  width: 100%;
}
.amount input[type='range'] {
  flex: 1;
  min-width: 0;
  height: 28px;
}
.amount input[type='range']:focus-visible {
  outline: 2px solid var(--gold-hi);
  outline-offset: 2px;
}
.scores {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.scores td {
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
}
.scores tr:last-child td {
  border-bottom: 0;
}
.scores td:last-child {
  text-align: right;
  font-weight: 700;
  color: var(--gold-hi);
  font-family: var(--display);
  font-size: 16px;
}
.scores + .note {
  margin-top: 8px;
}
.log {
  height: 220px;
  overflow-y: auto;
  font-size: 13px;
  color: var(--muted);
  margin: 0;
  padding: 0;
  list-style: none;
  mask-image: linear-gradient(180deg, transparent 0, #000 36px);
  scrollbar-width: thin;
  scrollbar-color: rgb(255 255 255 / 0.15) transparent;
}
.log li {
  padding: 4px 0 4px 12px;
  position: relative;
}
.log li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 12px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--faint);
}
.log li:last-child {
  color: var(--ink);
}
.log li:last-child::before {
  background: var(--gold);
  box-shadow: 0 0 6px var(--gold);
}

/* Cards */
.card {
  position: absolute;
  left: 0;
  top: 0;
  width: 72px;
  height: 100px;
  border-radius: 7px;
  border: 0;
  padding: 0;
  background: var(--paper);
  color: var(--black);
  font-family: var(--display);
  /* --pace is the player's game speed (src/speed.ts): 1 at the quickest, larger is slower. Only transform animates, which
     the compositor runs on its own. Marks switch on and off at once. */
  transition: transform calc(0.32s * var(--pace, 1)) var(--ease);
  /* Each card is drawn once onto a layer of its own, which then only moves: a card sliding across the table, or one
     beside it changing, redraws nothing else. */
  will-change: transform;
  /* Cards draw with no blur and no filter anywhere: on a phone's GPU, a blurred shadow or a filter on each of fifty cards
     cost more than everything else on the page put together. Marks are solid rings, a wider faint one standing in for
     a glow. */
  box-shadow:
    inset 0 0 0 1px rgb(0 0 0 / 0.16),
    0 1px 0 1px rgb(0 0 0 / 0.22);
}
.card:disabled {
  cursor: default;
}
.card .corner {
  position: absolute;
  /* Rank and suit fit in the top third of the card, which is what a cascade or a hand leaves showing. */
  top: 4px;
  left: 4px;
  width: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
}
.card .corner b {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.04em;
  white-space: nowrap;
}
.card .corner i {
  font-style: normal;
  font-size: 13px;
}
.card .corner.flip {
  top: auto;
  left: auto;
  bottom: 4px;
  right: 4px;
  transform: rotate(180deg);
}
.card .big {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 36px;
  line-height: 1;
  pointer-events: none;
}
.card .big.named {
  font-size: 13px;
  font-weight: 700;
  padding: 0 14px;
  text-align: center;
  letter-spacing: 0.02em;
}
.card.back {
  background:
    radial-gradient(circle at 50% 50%, rgb(246 220 151 / 0.22) 0 9px, transparent 10px),
    radial-gradient(ellipse at 50% 35%, var(--back) 0%, var(--back-2) 100%);
  box-shadow:
    inset 0 0 0 1px rgb(0 0 0 / 0.3),
    inset 0 0 0 4px #f4ecdb,
    inset 0 0 0 5px rgb(160 122 48 / 0.9),
    0 1px 0 1px rgb(0 0 0 / 0.22);
}
.card.back::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  transform: rotate(45deg);
  border: 1.5px solid rgb(246 220 151 / 0.85);
  background: var(--back-2);
  box-shadow: 0 0 0 3px rgb(61 7 18 / 0.9);
}
.card.can {
  cursor: pointer;
  box-shadow:
    inset 0 0 0 1px rgb(0 0 0 / 0.14),
    0 0 0 2px var(--can),
    0 0 0 5px rgb(240 200 105 / 0.3);
}
/* In a hand being chosen from, the playable cards keep their plain look (they're still .can, so they take clicks)
   and the others are greyed out. */
.card.can.play {
  box-shadow:
    inset 0 0 0 1px rgb(0 0 0 / 0.16),
    0 1px 0 1px rgb(0 0 0 / 0.22);
}
/* Greyed by colour rather than a filter, which would draw each card a second time. */
.card.dim {
  background: #8f8b82;
  color: #3a3b3f;
}
.card.dim.suit-red,
.card.dim.suit-green,
.card.dim.suit-gold,
.card.dim.suit-blue,
.card.dim.suit-brown {
  color: #4d3f40;
}
/* Hover thickens the ring rather than lifting the card: a lifted card would cover its neighbour in a stacked column. */
@media (hover: hover) {
  .card.can:hover,
  .card.go:hover {
    box-shadow:
      inset 0 0 0 1px rgb(0 0 0 / 0.14),
      0 0 0 3px var(--can),
      0 0 0 6px rgb(240 200 105 / 0.35);
  }
}
.card.on {
  box-shadow:
    inset 0 0 0 1px rgb(0 0 0 / 0.14),
    0 0 0 3px var(--on),
    0 0 0 6px rgb(111 240 189 / 0.3),
    0 8px 0 rgb(0 0 0 / 0.25);
}
.card.target {
  cursor: pointer;
  box-shadow:
    inset 0 0 0 1px rgb(0 0 0 / 0.14),
    0 0 0 3px var(--target),
    0 0 0 6px rgb(108 196 255 / 0.3);
}
.card.go {
  cursor: pointer;
}
/* Cards that can be dragged keep the browser from scrolling under a finger, so a drag on a phone moves the card. */
.card.grab {
  cursor: grab;
  touch-action: none;
}
/* When the table is resized, everything moves straight to its new place rather than sliding there. */
.stage.refit .card {
  transition: none;
}
.stage.dragging,
.stage.dragging .card {
  cursor: grabbing;
}
/* While dragged, a card follows the finger at once. Only the few cards being carried have a soft shadow. */
.card.lifted {
  transition: none;
  box-shadow:
    inset 0 0 0 1px rgb(0 0 0 / 0.14),
    0 0 0 3px var(--on),
    0 12px 16px rgb(0 0 0 / 0.4);
}
.card.over,
.slot.over {
  box-shadow:
    0 0 0 3px var(--target),
    0 0 0 7px rgb(108 196 255 / 0.45);
}
.slot {
  position: absolute;
  left: 0;
  top: 0;
  width: 72px;
  height: 100px;
  border-radius: 8px;
  border: 1.5px solid rgb(246 220 151 / 0.14);
  background: rgb(0 0 0 / 0.2);
  padding: 0;
}
.slot:disabled {
  cursor: default;
}
.slot[hidden] {
  display: none;
}
.slot.go {
  cursor: pointer;
  border-color: var(--can);
  background: rgb(240 200 105 / 0.12);
  box-shadow: 0 0 0 4px rgb(240 200 105 / 0.25);
}
.slot.target {
  cursor: pointer;
  border: 2px solid var(--target);
  background: rgb(108 196 255 / 0.12);
  box-shadow: 0 0 0 4px rgb(108 196 255 / 0.25);
}

/* Solitaire (Marks.quiet): nothing says what can be played or where it can go, so every card and pile looks and
   points the same, playable or not. A move that can't be made does nothing. A picked card, a drop and a tutorial's
   hint still show. */
.stage.quiet:not(.layered) .card:is(.can, .target):not(.on, .over, .lifted, .hint) {
  box-shadow:
    inset 0 0 0 1px rgb(0 0 0 / 0.16),
    0 1px 0 1px rgb(0 0 0 / 0.22);
}
.stage.quiet:not(.dragging) .card,
.stage.quiet:not(.dragging) .slot {
  cursor: pointer;
}
.stage.quiet .slot:is(.go, .target):not(.over, .hint) {
  border: 1.5px solid rgb(246 220 151 / 0.14);
  background: rgb(0 0 0 / 0.2);
  box-shadow: none;
}
.stage.quiet .table-facts .fact:is(.go, .target):not(.over, .hint) {
  border: 1px solid var(--gold-line);
  box-shadow: none;
}

/* With a card layer (Fireside) the canvas draws the cards. Their elements stay, unseen, for focus and spoken names, and
   go straight to their places while the drawn cards travel. */
.stage.layered .card,
.stage.layered .card.back,
.stage.layered .card.can,
.stage.layered .card.dim,
.stage.layered .card.on,
.stage.layered .card.target,
.stage.layered .card.hint,
.stage.layered .card.winning,
.stage.layered .card.overtakes,
.stage.layered .card.over,
.stage.layered .card.lifted {
  will-change: auto;
  background: none;
  box-shadow: none;
  filter: none;
  animation: none;
  transition: none;
}
.stage.layered .card > *,
.stage.layered .card.back::after {
  visibility: hidden;
}
.stage.layered .card:focus-visible {
  outline-offset: 2px;
}
/* Fireside (docs/spikes/fireside-table.md): the canvas draws the whole room and picks cards itself. The elements stay
   for focus and screen readers only, unseen and never under the pointer. */
.fireside3d {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.stage-wrap:has(> .stage.free) {
  background: #090504;
}
.stage-wrap:has(> .stage.free)::before,
.stage-wrap:has(> .stage.free)::after {
  display: none;
}
.stage.free,
.stage.free * {
  pointer-events: none;
}
.stage.free > * {
  opacity: 0;
}
/* The cover over the table while a drawn style loads (loading.ts): a fireside glow and a bar. */
.table-loading {
  position: absolute;
  inset: 0;
  z-index: 9;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background:
    radial-gradient(ellipse 60% 45% at 50% 60%, rgb(255 140 50 / 0.16), transparent 70%),
    radial-gradient(ellipse at center, #1a0e08 0%, #090504 75%);
  transition: opacity 0.4s;
}
.table-loading.gone {
  opacity: 0;
  pointer-events: none;
}
.table-loading p {
  margin: 0;
  font-family: var(--display);
  color: var(--gold-hi);
  font-size: 1.15rem;
  letter-spacing: 0.02em;
}
.table-loading .track {
  width: min(60%, 280px);
  height: 6px;
  border-radius: 99px;
  overflow: hidden;
  background: rgb(255 255 255 / 0.08);
  box-shadow: inset 0 0 0 1px var(--gold-line);
}
.table-loading .bar {
  height: 100%;
  background: var(--gold-grad);
  box-shadow: 0 0 12px var(--gold-glow);
  transform-origin: 0 50%;
  transform: scaleX(0);
  transition-property: transform;
  transition-timing-function: cubic-bezier(0.2, 0.7, 0.3, 1);
}
@media (prefers-reduced-motion: reduce) {
  .table-loading,
  .table-loading .bar {
    transition: none;
  }
}

/* The table view: the felt drawn flat in a panel over the room, as Hearthside Hearts shows the trick. */
.table-view {
  position: absolute;
  top: 12px;
  right: 12px;
  width: min(44%, 560px);
  height: 42%;
  z-index: 7;
  overflow: hidden;
  border-radius: 18px;
  background: radial-gradient(ellipse at center, rgb(40 74 52 / 0.94), rgb(22 40 28 / 0.96));
  border: 1px solid rgb(255 215 160 / 0.28);
  box-shadow:
    0 12px 34px rgb(0 0 0 / 0.55),
    inset 0 0 24px rgb(0 0 0 / 0.35);
}
.table-view[hidden] {
  display: none;
}
@media (max-width: 640px) {
  .table-view {
    left: 8px;
    right: 8px;
    top: 8px;
    width: auto;
    height: 36%;
  }
}

/* Seat plates and pile counts */
.plate {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px 12px 4px 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgb(20 22 28 / 0.92), rgb(8 9 12 / 0.92));
  border: 1px solid var(--gold-line);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 2px 0 rgb(0 0 0 / 0.4);
  /* No colour transition: the turn moves on with every play, and colours animate on the main thread. */
  z-index: 2000;
  pointer-events: none;
}
.plate::before {
  content: '';
  width: 22px;
  height: 22px;
  margin-right: 7px;
  border-radius: 50%;
  flex: none;
  background:
    radial-gradient(circle at 50% 38%, rgb(239 233 220 / 0.85) 0 4px, transparent 4.5px),
    radial-gradient(ellipse 8px 6px at 50% 100%, rgb(239 233 220 / 0.85) 0 99%, transparent 100%),
    linear-gradient(180deg, #3a3f4c, #20242d);
  box-shadow: inset 0 0 0 1px var(--gold-line);
}
.plate .badge {
  margin-inline-start: 6px;
  padding: 1px 8px;
  border-radius: 999px;
  background: rgb(217 178 99 / 0.16);
  color: var(--gold-hi);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.plate.active {
  background: var(--gold-grad);
  border-color: #fae9b9;
  color: #22180a;
}
/* A ring round the seat whose turn it is. It doesn't pulse: an animation that never stops keeps a phone drawing frames,
   and restyling, for as long as a turn lasts. */
.plate.active::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  box-shadow: 0 0 0 3px rgb(240 200 105 / 0.55);
  pointer-events: none;
}
.plate.active::before {
  background:
    radial-gradient(circle at 50% 38%, #fff8e2 0 4px, transparent 4.5px),
    radial-gradient(ellipse 8px 6px at 50% 100%, #fff8e2 0 99%, transparent 100%),
    linear-gradient(180deg, #5a4214, #2e2108);
}
.plate.active .badge {
  background: rgb(0 0 0 / 0.14);
  color: #22180a;
}
/* Online, a seat the computer is playing for someone who is away: a robot's head for the avatar, the name dimmed,
   and a badge saying so. */
.plate.stand-in {
  color: var(--muted);
  font-style: italic;
}
.plate.stand-in::before {
  border-radius: 6px;
  background:
    radial-gradient(circle at 34% 45%, #9fe3ff 0 2.5px, transparent 3px),
    radial-gradient(circle at 66% 45%, #9fe3ff 0 2.5px, transparent 3px),
    linear-gradient(90deg, transparent 0 40%, #9fe3ff 40% 60%, transparent 60%) 50% 78% / 100% 2px no-repeat,
    linear-gradient(180deg, #4a5466, #262b36);
}
.plate .badge.bot {
  background: rgb(120 200 240 / 0.18);
  color: #bfe9ff;
  font-style: normal;
}
.plate.active.stand-in {
  color: #22180a;
}
.plate.active .badge.bot {
  background: rgb(0 0 0 / 0.14);
  color: #22180a;
}
/* Online, someone whose connection dropped, before the computer takes their seat: the name dimmed, and a badge. */
.plate.away {
  color: var(--muted);
}
.plate.away::before {
  opacity: 0.45;
}
.plate .badge.away {
  background: rgb(255 255 255 / 0.08);
  color: var(--muted);
}
.plate.active.away {
  color: #22180a;
}
/* What the game shows over the table, like trumps (ADR 0035). A row standing in for a zone, like the turned trump card,
   takes clicks and drops for it. */
.table-facts {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 1600;
  pointer-events: none;
}
.table-facts[hidden] {
  display: none;
}
.table-facts .fact {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgb(20 22 28 / 0.92), rgb(8 9 12 / 0.92));
  border: 1px solid var(--gold-line);
  color: var(--gold-hi);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 2px 0 rgb(0 0 0 / 0.4);
}
.table-facts .fact:not(:has(.mini)) {
  padding-left: 12px;
}
/* "Trumps:" and then the suit, so the suit sits at the end. */
.table-facts .fact.trumps {
  padding: 4px 4px 4px 12px;
}
.table-facts .fact.go,
.table-facts .fact.target {
  pointer-events: auto;
  cursor: pointer;
}
.table-facts .fact.go {
  border-color: var(--can);
  box-shadow: 0 0 0 4px rgb(240 200 105 / 0.25);
}
.table-facts .fact.target {
  border: 2px solid var(--target);
  box-shadow: 0 0 0 4px rgb(108 196 255 / 0.25);
}
.table-facts .fact.over {
  box-shadow:
    0 0 0 3px var(--target),
    0 0 0 7px rgb(108 196 255 / 0.45);
}
.table-facts .fact.hint {
  box-shadow:
    0 0 0 3px var(--can),
    0 0 0 8px rgb(240 200 105 / 0.4);
}
/* The turned card in small: only its suit, in the suit's colour. */
.table-facts .mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(160deg, var(--paper), var(--paper-2));
  color: var(--black);
  font-family: var(--display);
  font-size: 17px;
  line-height: 1;
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.14);
}
/* Stronger than the plain suit colours, which the rule above would otherwise beat. */
.table-facts .mini.suit-red {
  color: var(--red);
}
.table-facts .mini.suit-green {
  color: var(--green);
}
.table-facts .mini.suit-gold {
  color: var(--gold-suit);
}
.table-facts .mini.suit-blue {
  color: var(--blue);
}
.table-facts .mini.suit-brown {
  color: var(--brown);
}
.count {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
  min-width: 26px;
  height: 26px;
  padding: 0 7px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: radial-gradient(circle at 35% 30%, #2b2f3a, #0c0e13);
  border: 1.5px solid var(--gold);
  color: var(--gold-hi);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 4px 10px rgb(0 0 0 / 0.5);
  z-index: 1500;
  pointer-events: none;
}

/* Overlays: hand results, game over, the hot-seat cover */
.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  background: radial-gradient(ellipse at center, rgb(0 0 0 / 0.55), rgb(0 0 0 / 0.85));
  z-index: 3000;
  animation: fade 0.25s ease both;
}
.result {
  position: relative;
  color: var(--ink);
  min-width: 300px;
  max-width: min(520px, 100%);
  max-height: calc(100% - 16px);
  overflow-y: auto;
  padding: 28px 30px 24px;
  display: grid;
  gap: 14px;
  text-align: center;
  border-color: var(--gold-line);
  background:
    radial-gradient(ellipse at 50% 0%, rgb(217 178 99 / 0.16), transparent 60%),
    linear-gradient(180deg, rgb(28 31 40 / 0.96), rgb(14 16 21 / 0.96));
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.08),
    0 0 0 1px rgb(0 0 0 / 0.5),
    0 40px 80px rgb(0 0 0 / 0.7);
  animation: rise 0.4s var(--ease) both;
}
.result::before {
  content: '♠ ♥ ♦ ♣';
  font-size: 12px;
  letter-spacing: 0.4em;
  color: var(--gold);
  opacity: 0.8;
}
.result h2 {
  font-size: 30px;
  background: linear-gradient(180deg, #fff6d8, var(--gold-hi) 40%, var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.result h3 {
  font-size: 13px;
  font-family: var(--ui);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 6px 0 0;
}
.result ol {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: place;
  display: grid;
  gap: 6px;
  text-align: start;
}
.result ol li {
  counter-increment: place;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgb(255 255 255 / 0.04);
  border: 1px solid var(--line);
}
.result ol li::before {
  content: counter(place);
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgb(255 255 255 / 0.08);
  font-family: var(--display);
  font-weight: 700;
  flex: none;
}
.result ol li:first-child {
  border-color: var(--gold-line);
  background: linear-gradient(90deg, rgb(217 178 99 / 0.18), rgb(217 178 99 / 0.04));
  font-weight: 700;
  font-size: 17px;
}
.result ol li:first-child::before {
  content: '♛';
  background: var(--gold-grad);
  color: #22180a;
  box-shadow: 0 0 16px var(--gold-glow);
}
.result .primary,
.result .action {
  justify-self: center;
  min-width: 200px;
}
.overlay.pass {
  background: var(--noise-soft), radial-gradient(ellipse at center, var(--felt-mid), var(--felt-deep));
  backdrop-filter: none;
}
@keyframes fade {
  from {
    opacity: 0;
  }
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.97);
  }
}
.breakdown {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.breakdown th {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  padding-bottom: 6px;
}
.breakdown th,
.breakdown td {
  padding: 3px 0 3px 14px;
  text-align: right;
}
.breakdown th:first-child,
.breakdown td:first-child {
  padding-left: 0;
  text-align: start;
}
.breakdown .team td {
  font-weight: 700;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.breakdown .team td:last-child {
  color: var(--gold-hi);
  font-family: var(--display);
  font-size: 16px;
}
.breakdown .rule td {
  color: var(--muted);
  font-size: 13px;
}
.breakdown .rule td:first-child {
  padding-left: 12px;
}

/* Tutorials (ADR 0033): the coach, and what it points at. */
.coach {
  border-color: var(--gold);
  background:
    radial-gradient(circle at 0 0, rgb(217 178 99 / 0.16), transparent 60%),
    linear-gradient(180deg, var(--glass-hi), var(--glass));
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.06),
    0 0 30px -10px var(--gold-glow),
    0 20px 40px -20px rgb(0 0 0 / 0.7);
}
.coach .step {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}
.coach .progress {
  height: 4px;
  margin: 0 0 14px;
  border-radius: 2px;
  background: rgb(255 255 255 / 0.08);
  overflow: hidden;
}
.coach .progress span {
  display: block;
  height: 100%;
  background: var(--gold-grad);
  box-shadow: 0 0 10px var(--gold-glow);
  transition: width 0.4s var(--ease);
}
.coach .said {
  margin: 0 0 8px;
  font-size: 14px;
  color: var(--muted);
  font-style: italic;
}
.coach .say {
  margin: 0 0 12px;
  font-family: var(--display);
  font-size: 17px;
  line-height: 1.45;
}
.coach .hint-text {
  margin: 0 0 12px;
  font-weight: 600;
  color: var(--gold-hi);
}
.coach .hint-text:empty {
  display: none;
}
.card.winning {
  box-shadow:
    0 0 0 3px #ff9f43,
    0 0 0 7px rgb(255 159 67 / 0.4);
}
.card.overtakes {
  box-shadow:
    0 0 0 3px #c58bff,
    0 0 0 7px rgb(197 139 255 / 0.4);
}
.card.hint,
.slot.hint {
  box-shadow:
    0 0 0 3px var(--can),
    0 0 0 8px rgb(240 200 105 / 0.4);
}
.action.hint {
  outline: 2px solid var(--can);
  outline-offset: 2px;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.suit-red {
  color: var(--red);
}
.suit-green {
  color: var(--green);
}
.suit-gold {
  color: var(--gold-suit);
}
.suit-blue {
  color: var(--blue);
}
.suit-brown {
  color: var(--brown);
}

@media (max-width: 960px) {
  .showcase {
    display: none;
  }
  .setup {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }
  .hero {
    grid-template-columns: minmax(0, 1fr);
    padding: 32px 24px 28px;
  }
  .fan {
    height: 170px;
    transform: scale(0.8);
    margin-top: -10px;
  }
}
@media (max-width: 860px) {
  .game {
    grid-template-columns: minmax(0, 1fr);
    padding: 8px 10px 24px;
    gap: 10px;
    --above: 58px;
  }
  /* On a phone a seat's name is one small line, so it takes less of the table, in portrait or landscape. */
  .plate {
    font-size: 11px;
    padding: 2px 8px 2px 2px;
    border-radius: 999px;
    white-space: nowrap;
  }
  .plate::before {
    width: 16px;
    height: 16px;
    margin-right: 5px;
  }
  .plate .badge {
    margin-inline-start: 4px;
    padding: 0 6px;
    font-size: 9px;
  }
  /* The status and actions sit under the table, so leave room to see them without scrolling. */
  .stage-wrap {
    height: clamp(360px, calc(100svh - var(--above) - 150px), 175vw);
    border-radius: 20px;
  }
  .log {
    height: 140px;
  }
}
/* A phone on its side: the bar and the table fill the screen's height exactly, and the status and actions sit under
   them, a scroll away. */
@media (orientation: landscape) and (max-height: 560px) {
  .game {
    grid-template-columns: minmax(0, 1fr);
    padding: 6px 10px 12px;
    gap: 6px;
    /* The padding above the bar, the bar, the gap below it and a little felt-free edge under the table. */
    --above: calc(6px + 37px + 6px + 6px);
  }
  .stage-wrap {
    height: calc(100svh - var(--above));
    border-radius: 16px;
  }
}
@media (max-width: 560px) {
  /* Beside the table there's room only for the gear; its name stays for screen readers. */
  .bar .settings-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .page {
    padding: 14px 16px 48px;
  }
  .topbar {
    flex-wrap: wrap;
    row-gap: 8px;
  }
  .brand {
    font-size: 16px;
  }
  .hero {
    min-height: 0;
    padding: 28px 20px 8px;
    border-radius: 18px;
  }
  .hero .lede {
    font-size: 16px;
  }
  .fan {
    height: 150px;
    transform: scale(0.65);
    margin: -20px 0 -30px;
  }
  .bar h2 {
    font-size: 18px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
  .bar {
    gap: 8px;
  }
  .bar .back,
  .bar .undo,
  .bar .hint-button,
  .bar .toggle {
    padding: 6px 10px;
  }
  .bar .field.table-style > span,
  .bar .field.speed > span {
    display: none;
  }
  .bar .field.speed select {
    min-width: 0;
  }
  .result {
    padding: 22px 18px 18px;
    min-width: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .card,
  .game-tile,
  .tile-suit {
    transition: none;
  }
  .fan-card,
  .overlay,
  .result {
    animation: none;
  }
}
.fast .card {
  transition: none;
}
.fast .overlay,
.fast .result {
  animation: none;
}

/* The scores and log sit beside the table as panels of their own; Fireside lifts them into a sheet (below). */
.sheet-panels {
  display: contents;
}
.bar .hud[hidden] {
  display: none;
}

/* Fireside (docs/spikes/fireside-table.md §5): the room fills the screen, and the controls sit over it in Hearthside
   Hearts' palette: the bar's buttons as round pills, the game's facts top left, the prompt and its buttons in the
   middle above the hand, each seat's tag over its character, and the scores and log in a sheet. */
.game.fireside {
  --fs-cream: #f8ead0;
  --fs-gold: #f0b860;
  --fs-rose: #ff6f86;
  --fs-ink: rgb(28 16 10 / 0.78);
  --fs-line: rgb(255 220 170 / 0.18);
  position: fixed;
  inset: 0;
  z-index: 50;
  display: block;
  max-width: none;
  margin: 0;
  padding: 0;
  color: var(--fs-cream);
  background: #0b0605;
  overflow: hidden;
}
.game.fireside .stage-wrap {
  position: absolute;
  inset: 0;
  height: auto;
  border-radius: 0;
  box-shadow: none;
}
.game.fireside .stage-wrap::after {
  box-shadow: none;
}
/* The bar: the game's name top left, its buttons top right. */
.game.fireside .bar {
  position: absolute;
  top: 12px;
  left: 16px;
  right: 16px;
  z-index: 60;
  gap: 8px;
  pointer-events: none;
}
.game.fireside .bar > * {
  pointer-events: auto;
}
.game.fireside .bar h2 {
  margin-right: auto;
  font: 800 11px var(--ui);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fs-gold);
  background: none;
  -webkit-background-clip: border-box;
  background-clip: border-box;
  text-shadow: 0 2px 10px #000;
  order: 1;
}
.game.fireside .bar .back {
  order: 0;
}
.game.fireside .bar > :not(h2, .back) {
  order: 2;
}
.game.fireside .bar .back,
.game.fireside .bar .undo,
.game.fireside .bar .hint-button,
.game.fireside .bar .toggle,
.game.fireside .bar .hud,
.game.fireside .bar .icon,
.game.fireside .bar .settings-button {
  margin: 0;
  min-height: 38px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--fs-line);
  background: var(--fs-ink);
  color: var(--fs-cream);
  font-size: 14px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.game.fireside .bar .hud,
.game.fireside .bar .icon {
  width: 38px;
  padding: 0;
  font-size: 16px;
}
.game.fireside .bar .icon[aria-pressed='true'] {
  border-color: rgb(240 184 96 / 0.5);
  color: var(--fs-gold);
}
.game.fireside .bar .hud[aria-pressed='false'] {
  opacity: 0.55;
}
.game.fireside .bar .undo:disabled,
.game.fireside .bar .hint-button:disabled {
  opacity: 0.4;
}
/* The side panel's parts each take their own place over the room. */
.game.fireside .side {
  display: contents;
}
.game.fireside .side > .panel:first-child {
  /* Centred with margins, not a transform, which would hold the facts (fixed, below) inside it. */
  position: absolute;
  left: 0;
  right: 0;
  bottom: 31%;
  z-index: 40;
  width: fit-content;
  max-width: min(560px, 92vw);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  /* A backdrop filter would also hold the facts inside it. */
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  pointer-events: none;
}
.game.fireside .side > .panel:first-child > * {
  pointer-events: auto;
}
.game.fireside .facts {
  position: fixed;
  top: 58px;
  left: 16px;
  margin: 0;
  max-width: 40vw;
}
.game.fireside .facts li {
  background: var(--fs-ink);
  border-color: var(--fs-line);
  color: var(--fs-cream);
}
.game.fireside .status {
  margin: 0;
  padding: 10px 20px;
  border-radius: 16px;
  background: var(--fs-ink);
  border: 1px solid var(--fs-line);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--fs-cream);
  font-style: italic;
  font-size: 20px;
  font-weight: 500;
  text-align: center;
  text-shadow: 0 1px 8px rgb(0 0 0 / 0.6);
  box-shadow: 0 10px 30px rgb(0 0 0 / 0.35);
}
.game.fireside .status:empty {
  display: none;
}
.game.fireside .timer {
  margin: 0;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--fs-ink);
}
.game.fireside .side .note {
  margin: 0;
  color: rgb(248 234 208 / 0.75);
  text-shadow: 0 1px 6px #000;
}
.game.fireside .actions {
  justify-content: center;
  max-height: none;
  overflow: visible;
  gap: 10px;
}
.game.fireside .actions .action {
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid var(--fs-line);
  background: var(--fs-ink);
  color: var(--fs-cream);
  font-weight: 700;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.game.fireside .actions .action:hover {
  border-color: rgb(255 200 110 / 0.7);
  background: rgb(70 40 24 / 0.9);
}
/* The move to make: Hearthside Hearts' ember button. */
.game.fireside .actions .action.confirm {
  padding: 14px 36px;
  border: 0;
  color: #3a1a0c;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-shadow: none;
  background: linear-gradient(180deg, #ffd58a, #eb9548 60%, #d6713a);
  box-shadow:
    0 10px 34px rgb(245 140 60 / 0.5),
    inset 0 1px 0 rgb(255 255 255 / 0.6),
    inset 0 -3px 0 rgb(120 40 10 / 0.25);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.game.fireside .actions .action.confirm:hover {
  filter: brightness(1.06);
  box-shadow:
    0 16px 44px rgb(245 140 60 / 0.65),
    inset 0 1px 0 rgb(255 255 255 / 0.6),
    inset 0 -3px 0 rgb(120 40 10 / 0.25);
}
.game.fireside .amount {
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--fs-ink);
  border: 1px solid var(--fs-line);
}
/* A tutorial's coach: a card top left. */
.game.fireside .coach {
  position: absolute;
  top: 100px;
  left: 16px;
  z-index: 45;
  width: min(340px, calc(100vw - 32px));
  max-height: 40vh;
  overflow-y: auto;
  background: var(--fs-ink);
  border-color: var(--fs-line);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
/* The scores and log: a sheet over the room, opened from the bar. */
.game.fireside .sheet-panels {
  display: none;
}
.game.fireside.sheet .sheet-panels {
  position: absolute;
  top: 64px;
  right: 16px;
  z-index: 55;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: min(360px, calc(100vw - 32px));
  max-height: calc(100% - 80px);
  padding: 18px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgb(58 34 22 / 0.95), rgb(30 17 11 / 0.97));
  border: 1px solid rgb(255 215 160 / 0.22);
  box-shadow: 0 30px 90px rgb(0 0 0 / 0.7);
  animation: rise 0.3s var(--ease) both;
}
.game.fireside.sheet .sheet-panels .panel {
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
}
.game.fireside .scores td:last-child {
  color: var(--fs-gold);
}
.game.fireside .log {
  height: auto;
  max-height: 34vh;
  color: rgb(248 234 208 / 0.75);
  pointer-events: auto;
}
.game.fireside.no-view .table-view {
  display: none;
}
.game.fireside .table-view {
  top: 60px;
  right: 16px;
  z-index: 35;
}
/* Sized to what it shows: a trick takes a corner, a board or a tableau more. */
.game.fireside .table-view[data-size='small'] {
  width: min(34%, 440px);
  height: min(40%, 340px);
}
.game.fireside .table-view[data-size='medium'] {
  width: min(36%, 480px);
  height: 38%;
}
/* On a crowded table each tag is just the animal and name, and the facts show only for the seat on turn. */
.plate.tag.compact .who small,
.plate.tag.compact:not(.active) .badge {
  display: none;
}

/* Each seat's tag, over its character's head; the viewer's own at the bottom left. */
.seat-tags {
  /* No stacking order of its own: tags sit under the table view, and bubbles and floaters over it. */
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.plate.tag {
  gap: 9px;
  padding: 5px 14px 5px 5px;
  border: 1px solid var(--fs-line, rgb(255 220 170 / 0.18));
  background: var(--fs-ink, rgb(28 16 10 / 0.78));
  color: var(--fs-cream, #f8ead0);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 8px 22px rgb(0 0 0 / 0.4);
  transform-origin: 50% 100%;
  z-index: 30;
}
/* The tags and bubbles over the characters move with them every frame, so each is a layer of its own that the GPU only
   moves. Otherwise each move redraws what's under it, shadow and all: on a Redmi Pad SE ten-seat Hold'em ran at 42
   frames a second with them, and 60 without. */
.plate.tag:not(.mine),
.seat-tags .bubble {
  will-change: transform;
}
.plate.tag::before {
  display: none;
}
.plate.tag .av {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 19px;
  background: radial-gradient(circle at 35% 30%, #6b4630, #2c1a12);
  border: 1px solid var(--fs-line, rgb(255 220 170 / 0.18));
}
.plate.tag .who {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.plate.tag .who b {
  font-weight: 800;
  font-size: 14px;
}
.plate.tag .who small {
  font-size: 12px;
  font-weight: 700;
  opacity: 0.75;
}
.plate.tag.unseen {
  visibility: hidden;
}
.plate.tag.mine {
  left: 16px;
  top: auto;
  bottom: 16px;
  transform: none;
}
.plate.tag.active {
  background: var(--fs-ink, rgb(28 16 10 / 0.78));
  color: var(--fs-cream, #f8ead0);
  border-color: rgb(255 200 110 / 0.85);
  box-shadow:
    0 0 0 3px rgb(255 190 100 / 0.16),
    0 0 26px rgb(255 170 80 / 0.5);
}
.plate.tag.active::after {
  border-radius: 999px;
}
.plate.tag .badge {
  background: rgb(255 111 134 / 0.16);
  color: var(--fs-rose, #ff6f86);
}
.plate.tag.active .badge {
  background: rgb(255 111 134 / 0.16);
  color: var(--fs-rose, #ff6f86);
}
/* Hand results and the game's end, in the room's colours. */
.game.fireside .overlay {
  background: radial-gradient(ellipse at center, rgb(10 5 3 / 0.35), rgb(10 5 3 / 0.78));
  backdrop-filter: none;
}
.game.fireside .overlay.pass {
  background: radial-gradient(ellipse at 50% 45%, rgb(40 20 12 / 0.92), rgb(10 5 3 / 0.98));
}
.game.fireside .result {
  border-radius: 26px;
  border-color: rgb(255 215 160 / 0.22);
  background: linear-gradient(180deg, rgb(58 34 22 / 0.95), rgb(30 17 11 / 0.97));
  color: var(--fs-cream);
}
.game.fireside .result h2 {
  font-style: italic;
  font-size: 36px;
  background: none;
  color: #ffe9c2;
  -webkit-background-clip: border-box;
  background-clip: border-box;
}
.game.fireside .result::before {
  color: var(--fs-gold);
}
.game.fireside .result .primary {
  border: 0;
  border-radius: 999px;
  padding: 14px 36px;
  color: #3a1a0c;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  background: linear-gradient(180deg, #ffd58a, #eb9548 60%, #d6713a);
  box-shadow:
    0 10px 34px rgb(245 140 60 / 0.5),
    inset 0 1px 0 rgb(255 255 255 / 0.6);
}
@media (max-width: 640px) {
  .game.fireside .bar {
    top: 8px;
    left: 8px;
    right: 8px;
    gap: 6px;
  }
  .game.fireside .bar h2 {
    display: none;
  }
  .game.fireside .bar .back,
  .game.fireside .bar .undo,
  .game.fireside .bar .hint-button,
  .game.fireside .bar .toggle,
  .game.fireside .bar .settings-button {
    min-height: 34px;
    padding: 5px 11px;
    font-size: 13px;
  }
  .game.fireside .bar .hud {
    width: 34px;
    min-height: 34px;
  }
  .game.fireside .table-view,
  .game.fireside .table-view[data-size] {
    top: 82px;
    left: 8px;
    right: 8px;
    width: auto;
  }
  .game.fireside .table-view[data-size='small'] {
    height: 26%;
  }
  .game.fireside .table-view[data-size='medium'] {
    height: 31%;
  }
  .game.fireside .facts {
    top: 48px;
    left: 8px;
    max-width: calc(100vw - 16px);
    flex-wrap: nowrap;
    overflow: hidden;
    font-size: 12px;
  }
  .game.fireside .side > .panel:first-child {
    bottom: 26%;
  }
  .game.fireside .status {
    font-size: 16px;
    padding: 8px 14px;
  }
  .plate.tag {
    padding: 3px 10px 3px 3px;
    gap: 6px;
  }
  .plate.tag .av {
    width: 24px;
    height: 24px;
    font-size: 14px;
  }
  .plate.tag .who b {
    font-size: 12px;
  }
  .plate.tag .who small {
    font-size: 10px;
  }
  .plate.tag.mine {
    left: 8px;
    bottom: 10px;
  }
}

/* The director's words on Fireside (src/show.ts): speech bubbles over the tags, points rising from them, a banner for a
   big card, and letterbox bars for a big moment. Hidden on every other table. */
.seat-tags .bubble {
  position: absolute;
  left: 0;
  top: 0;
  padding: 7px 13px;
  border-radius: 14px;
  background: #f8ead0;
  color: #3a2015;
  font-weight: 800;
  font-size: 14px;
  white-space: nowrap;
  opacity: 0;
  scale: 0.6;
  transform-origin: 50% 100%;
  transition:
    opacity 0.25s,
    scale 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.3);
  z-index: 40;
}
.seat-tags .bubble::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 100%;
  margin-left: -6px;
  border: 6px solid transparent;
  border-top-color: #f8ead0;
}
.seat-tags .bubble.show {
  opacity: 1;
  scale: 1;
}
.seat-tags .floater {
  position: absolute;
  font: 700 30px var(--display);
  pointer-events: none;
  z-index: 40;
  animation: floater 1.7s ease-out both;
}
.seat-tags .floater.bad {
  color: #ff6f86;
  text-shadow:
    0 0 16px rgb(255 60 100 / 0.8),
    0 2px 8px #000;
}
.seat-tags .floater.good {
  color: #9ff0b8;
  text-shadow:
    0 0 16px rgb(80 220 140 / 0.7),
    0 2px 8px #000;
}
@keyframes floater {
  0% {
    opacity: 0;
    transform: translate(-50%, 0) scale(0.5);
  }
  15% {
    opacity: 1;
    transform: translate(-50%, -14px) scale(1.15);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -80px) scale(1);
  }
}
.fs-banner,
.fs-bars {
  display: none;
}
.game.fireside .fs-banner {
  display: block;
  position: absolute;
  left: 0;
  right: 0;
  top: 19%;
  z-index: 58;
  text-align: center;
  pointer-events: none;
  font: italic 700 clamp(34px, 6.2vw, 84px) var(--display);
  color: #e9dcff;
  text-shadow:
    0 0 44px rgb(150 90 255 / 0.9),
    0 4px 20px #000;
  opacity: 0;
}
.game.fireside .fs-banner.show {
  animation: banner 2.6s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
@keyframes banner {
  0% {
    opacity: 0;
    transform: scale(0.82) translateY(14px);
    letter-spacing: 8px;
    filter: blur(8px);
  }
  14% {
    opacity: 1;
    transform: scale(1);
    letter-spacing: 0.5px;
    filter: blur(0);
  }
  78% {
    opacity: 1;
    transform: scale(1.03);
  }
  100% {
    opacity: 0;
    transform: scale(1.06);
  }
}
.game.fireside .fs-bars {
  display: block;
  position: absolute;
  left: 0;
  right: 0;
  height: 7.5vh;
  z-index: 57;
  background: #000;
  pointer-events: none;
  transform: scaleY(0);
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.game.fireside .fs-bars.top {
  top: 0;
  transform-origin: 50% 0;
}
.game.fireside .fs-bars.bottom {
  bottom: 0;
  transform-origin: 50% 100%;
}
.game.fireside.cine .fs-bars {
  transform: scaleY(1);
}
@media (prefers-reduced-motion: reduce) {
  .seat-tags .bubble,
  .game.fireside .fs-bars {
    transition: none;
  }
  .seat-tags .floater {
    animation-duration: 0.01s;
  }
  .game.fireside .fs-banner.show {
    animation: banner-fade 2.6s linear both;
  }
}
@keyframes banner-fade {
  0%,
  100% {
    opacity: 0;
  }
  10%,
  80% {
    opacity: 1;
  }
}
/* On a weak GPU (the low tier's plain room, which marks the root) nothing is blurred behind the controls: each blur is
   redrawn with every frame of the room, and on a tablet they cost a fifth of the frame. The ink is a little darker in
   its place. A class on the root, not :has(), since :has() over every element made each style change on a phone cost
   up to 17 ms. */
:root.fireside-plain .game.fireside {
  --fs-ink: rgb(28 16 10 / 0.86);
}
:root.fireside-plain .game.fireside * {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* Choosing a suit, such as the trumps: four tiles over the table, high enough that the hand stays in view. */
.overlay.suit-choice {
  align-items: start;
  padding-top: clamp(16px, 9vh, 72px);
  background: radial-gradient(ellipse at 50% 20%, rgb(0 0 0 / 0.4), rgb(0 0 0 / 0.72));
}
.suit-card {
  width: min(560px, 100%);
  max-width: 100%;
}
.suit-tiles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.suit-tile {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 14px 6px 12px;
  min-height: 112px;
  border-radius: 14px;
  border: 1px solid rgb(0 0 0 / 0.2);
  background: linear-gradient(160deg, var(--paper), var(--paper-2));
  color: var(--black);
  font-family: var(--display);
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.7),
    0 6px 14px rgb(0 0 0 / 0.45);
  transition:
    transform 0.15s var(--ease),
    box-shadow 0.15s var(--ease);
}
.suit-tile:hover,
.suit-tile:focus-visible {
  transform: translateY(-4px);
  outline: none;
  box-shadow:
    0 0 0 3px var(--gold),
    0 0 22px var(--gold-glow),
    0 10px 20px rgb(0 0 0 / 0.5);
}
.suit-tile:active {
  transform: translateY(-1px) scale(0.98);
}
.suit-tile.hint {
  box-shadow:
    0 0 0 3px var(--can),
    0 0 0 8px rgb(240 200 105 / 0.4);
}
.suit-symbol {
  font-size: 56px;
  line-height: 1.05;
}
.suit-symbol.suit-red {
  color: var(--red);
}
.suit-symbol.suit-green {
  color: var(--green);
}
.suit-symbol.suit-gold {
  color: var(--gold-suit);
}
.suit-symbol.suit-blue {
  color: var(--blue);
}
.suit-symbol.suit-brown {
  color: var(--brown);
}
.suit-name {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.suit-choice .result h2 {
  font-size: 24px;
}
@media (max-width: 480px) {
  .suit-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  /* Short tiles, symbol beside name, so the hand the choice is made from stays in view below. */
  .suit-tile {
    grid-auto-flow: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 64px;
    padding: 8px 6px;
  }
  .suit-symbol {
    font-size: 36px;
  }
  .suit-choice .result h2 {
    font-size: 20px;
  }
}
.game.fireside .suit-tile {
  border-radius: 18px;
}
@media (prefers-reduced-motion: reduce) {
  .suit-tile {
    transition: none;
  }
  .suit-tile:hover,
  .suit-tile:focus-visible,
  .suit-tile:active {
    transform: none;
  }
}
.fast .suit-tile {
  transition: none;
}

.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 22px;
  margin-top: 36px;
  padding: 18px 0 8px;
  border-top: 1px solid var(--gold-line);
  font-size: 14px;
}
.footer a {
  color: var(--ink-dim, var(--ink));
  text-decoration: none;
  padding: 6px 2px;
}
.footer a:hover,
.footer a:focus-visible {
  color: var(--gold);
  text-decoration: underline;
}
.doc {
  max-width: 640px;
}
.doc p {
  line-height: 1.6;
}
.doc small {
  display: block;
  margin-top: 24px;
  opacity: 0.7;
}
.doc a {
  color: var(--gold);
}
