:root {
  --bg: #120c09;
  --panel: rgba(28, 19, 14, 0.92);
  --panel-solid: #1f1510;
  --line: rgba(255, 220, 160, 0.16);
  --text: #f6ead6;
  --muted: #c2ab8c;
  --gold: #ffcf5a;
  --gold-dark: #2a1d05;
  --radius: 10px;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--text);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}

/* Pinned in place: the page itself can't scroll at all (screens that need to scroll, like your
   pubs and Options, scroll inside themselves). See pinPage() in main.js for why. */
body {
  position: fixed;
  inset: 0;
  width: 100%;
}

/*
 * It's a game, not a page: pressing and holding anywhere must never start selecting text, pop up
 * the phone's copy / look-up menu, or drag an image. Only text fields can be selected and typed in.
 */
* {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

input,
textarea {
  -webkit-user-select: text;
  user-select: text;
}

img,
canvas {
  -webkit-user-drag: none;
}

/* Taps on buttons act at once: no double-tap zoom delay. */
button,
a,
[role='radio'] {
  touch-action: manipulation;
}

#game {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: var(--hud-h, 220px);
}

#game canvas {
  display: block;
}

[hidden] {
  display: none !important;
}

/* ---------- top bar ---------- */

#topbar {
  position: fixed;
  top: calc(10px + env(safe-area-inset-top));
  left: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: none;
}

#topbar > * {
  pointer-events: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 13px;
}

/* The connection: amber and turning while it connects or reconnects (the pub behind dimmed), green and Live,
   with a pop, once you're in; grey if the pub's open in another tab (ui.js setStatus). */
#topbar > #status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 800;
  letter-spacing: 0.01em;
  transform-origin: left center;
  transition:
    background-color 0.3s,
    border-color 0.3s,
    color 0.3s;
}

#topbar > #status[data-state='wait'] {
  background: #f2a516;
  border-color: #ffd27a;
  color: #2a1804;
  font-size: 15px;
  padding: 7px 14px 7px 11px;
  animation: net-wait 1.6s ease-in-out infinite;
}

#status[data-state='wait'] .net-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2.6px solid currentColor;
  border-top-color: transparent;
  animation: net-spin 0.85s linear infinite;
}

#topbar > #status[data-state='live'] {
  background: #1f9d4a;
  border-color: #6fe39a;
  color: #ffffff;
  font-size: 13px;
  padding: 5px 12px 5px 10px;
}

#status[data-state='live'] .net-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #d6ffe4;
  box-shadow: 0 0 6px #8dffb8;
}

#topbar > #status.arrived {
  animation: net-live 2.2s ease-out;
}

#topbar > #status[data-state='off'] {
  background: #5a4a44;
  border-color: #8a766c;
  color: #ffd8cc;
}

#status[data-state='off'] .net-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #c8b4aa;
}

/* While it isn't live, the pub dims a little: what you see may be out of date. */
#game {
  transition: opacity 0.4s;
}

body[data-net='wait'] #game,
body[data-net='off'] #game {
  opacity: 0.6;
}

@keyframes net-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes net-wait {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(242, 165, 22, 0.6);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(242, 165, 22, 0);
  }
}

@keyframes net-live {
  0% {
    transform: scale(1.45);
    box-shadow: 0 0 0 0 rgba(60, 220, 120, 0.75);
  }
  25% {
    transform: scale(1.3);
    box-shadow: 0 0 0 14px rgba(60, 220, 120, 0);
  }
  70% {
    transform: scale(1.3);
  }
  100% {
    transform: scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  #topbar > #status,
  #status .net-dot {
    animation: none !important;
  }
}

#coins {
  color: var(--text);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

/* Pushes the buttons to the right of the top bar. */
#topbar > .spacer {
  flex: 1;
  padding: 0;
  border: 0;
  background: none;
  pointer-events: none;
}

/* Face videos must stay "on screen" for some browsers to keep decoding them. */
#video-sink {
  position: fixed;
  left: 0;
  top: 0;
  width: 2px;
  height: 2px;
  overflow: hidden;
  opacity: 0.01;
  pointer-events: none;
}

#video-sink video {
  width: 2px;
  height: 2px;
}

/* ---------- chat log and prompt (floating above the bottom bar) ---------- */

#chat-log {
  position: fixed;
  left: 12px;
  bottom: calc(var(--hud-h, 220px) + var(--chat-h) + 8px);
  width: min(380px, calc(100vw - 24px));
  list-style: none;
  margin: 0;
  padding: 0 4px;
  max-height: 17vh;
  overflow-y: auto;
  /* Scrolled by dragging, touch or mouse (ui.js does it, so the phone doesn't fight it), with no
     scrollbar showing. The text still can't be selected (see the rule for everything at the top). */
  touch-action: none;
  pointer-events: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  cursor: grab;
  font-size: 11.5px;
  line-height: 1.3;
  text-shadow: 0 1px 2px #000, 0 0 6px rgba(0, 0, 0, 0.7);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 14px);
  mask-image: linear-gradient(to bottom, transparent 0, #000 14px);
}

#chat-log::-webkit-scrollbar {
  display: none;
}

#chat-log.dragging {
  cursor: grabbing;
}

#chat-log li {
  padding: 1px 0;
  overflow-wrap: anywhere;
}

#chat-log b {
  color: var(--gold);
}

#chat-log li.mine b {
  color: #9fe0a8;
}

#chat-log li.notice {
  color: var(--muted);
  font-style: italic;
}

/* Beside a voice note: ⋯ to delete it or report it (ui.js), and, for the pub's owner, ⚑ and how many reported it. */
.note-more {
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  color: var(--text);
  background: rgba(255, 245, 225, 0.14);
  border: 0;
  border-radius: 999px;
  padding: 2px 8px 4px;
  margin-left: 2px;
  cursor: pointer;
  text-shadow: none;
}

.note-flag {
  color: #ff9a8a;
  font-weight: 800;
}

.note-menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.note-menu .btn {
  width: 100%;
}

.note-menu .fine {
  margin: 0 0 8px;
}

.voice-play {
  font: inherit;
  font-size: 12px;
  color: var(--gold-dark);
  background: var(--gold);
  border: 0;
  border-radius: 999px;
  padding: 1px 10px;
  cursor: pointer;
  text-shadow: none;
}

/* While "A  Dartboard" shows, the history sits above it (it would cover the newest voice note). The prompt
   only says what A does, so a tap goes through it. */
body.prompting #chat-log {
  bottom: calc(var(--hud-h, 220px) + var(--chat-h) + 52px);
}

#prompt {
  position: fixed;
  left: 50%;
  bottom: calc(var(--hud-h, 220px) + var(--chat-h) + 10px);
  transform: translateX(-50%);
  pointer-events: none;
  background: var(--panel);
  border: 1px solid var(--gold);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

kbd {
  display: inline-block;
  min-width: 20px;
  text-align: center;
  background: var(--gold);
  color: var(--gold-dark);
  border-radius: 4px;
  padding: 0 5px;
  font-family: inherit;
  font-weight: 800;
}

/* ---------- the chat pill, floating over the pub just above the bottom bar ---------- */

:root {
  --chat-h: 46px; /* the pill plus the gap under it; the chat log and prompt sit above */
}

#chat-dock {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(var(--hud-h, 220px) + 10px);
  z-index: 6;
  max-width: 720px;
  margin: 0 auto;
}

/* ---------- the bottom bar: the controls ---------- */

#hud {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  background:
    radial-gradient(ellipse at 50% 0, rgba(255, 220, 170, 0.07), transparent 70%),
    linear-gradient(to bottom, #2b211b, #17110d);
  border-top: 1px solid rgba(255, 220, 170, 0.16);
  border-radius: 18px 18px 0 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 -6px 18px rgba(0, 0, 0, 0.45);
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 10px;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

#hud > * {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
}

/* The chat box: no typing. Voice note (a speech bubble: record something for the pub), the camera at the
   poker table, and the live mic, which says Live: whoever is near hears you as you talk. While a note
   records, the box turns into the recording bar. */
.chat-field {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 3px;
  background: rgba(18, 12, 9, 0.82);
  border: 1px solid rgba(255, 220, 160, 0.22);
  border-radius: 999px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.dock-idle,
.dock-rec {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  min-width: 0;
}

.dock-gap {
  flex: 1;
}

#note-btn:not([hidden]) ~ .dock-gap {
  display: none;
}

#note-btn {
  flex: 1;
  min-width: 0;
  height: 34px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px 0 9px;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  color: var(--gold);
  background: transparent;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
}

#note-btn:hover,
#note-btn:active {
  background: rgba(255, 210, 120, 0.1);
}

/* Not connected just now: voice notes go when you're back. */
#note-btn:disabled {
  opacity: 0.45;
  cursor: default;
  background: transparent;
}

#note-btn svg {
  flex: none;
}

/* A video clip (js/clips.js), beside the voice note: a film camera, and Clip. */
#clip-btn {
  flex: none;
  height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 11px 0 8px;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  color: var(--gold);
  background: transparent;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}

#clip-btn:hover,
#clip-btn:active {
  background: rgba(255, 210, 120, 0.1);
}

#clip-btn:disabled {
  opacity: 0.45;
  cursor: default;
  background: transparent;
}

#clip-btn svg {
  flex: none;
}

/* On a keyboard, Enter records a note and Enter sends it (Esc drops it). */
.note-key {
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.45);
  min-width: 0;
  padding: 1px 6px;
}

body.touch .note-key {
  display: none;
}

/* The live mic: off (struck through) until you tap it; green and glowing while it's on. It says Live, so
   it's never mistaken for recording a voice note. */
#mic-btn {
  flex: none;
  height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 0 10px 0 7px;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: var(--muted);
  background: transparent;
  border: 1px solid rgba(255, 220, 160, 0.2);
  border-radius: 999px;
  cursor: pointer;
}

#mic-btn .mic-slash {
  fill: none;
}

#mic-btn[aria-pressed='true'] {
  color: #fff;
  background: #3fa45e;
  border-color: transparent;
  box-shadow: 0 0 0 3px rgba(63, 164, 94, 0.35);
  animation: mic-live 1.6s ease-in-out infinite;
}

#mic-btn[aria-pressed='true'] .mic-slash {
  display: none;
}

/* Recording a voice note: a red dot, the time, how loud it's hearing you, and Send. */
.chat-field.recording {
  border-color: rgba(239, 90, 74, 0.7);
  box-shadow: 0 0 0 3px rgba(239, 90, 74, 0.18), 0 4px 14px rgba(0, 0, 0, 0.35);
}

.chat-field.full {
  border-color: var(--gold);
}

#note-cancel {
  flex: none;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  cursor: pointer;
}

.rec-dot {
  flex: none;
  width: 10px;
  height: 10px;
  margin-left: 4px;
  border-radius: 50%;
  background: #ef5a4a;
  animation: rec-blink 1s ease-in-out infinite;
}

.chat-field.full .rec-dot {
  background: var(--gold);
  animation: none;
}

.rec-time {
  flex: none;
  min-width: 2.6em;
  font-size: 14px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.rec-level {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 18px;
}

.rec-level i {
  width: 3px;
  height: 5px;
  border-radius: 2px;
  background: rgba(255, 220, 160, 0.25);
  transition: height 0.08s linear, background 0.08s linear;
}

.rec-level i.on {
  background: #ef5a4a;
}

.rec-level i.on:nth-child(1),
.rec-level i.on:nth-child(7) {
  height: 7px;
}

.rec-level i.on:nth-child(2),
.rec-level i.on:nth-child(6) {
  height: 11px;
}

.rec-level i.on:nth-child(3),
.rec-level i.on:nth-child(5) {
  height: 15px;
}

.rec-level i.on:nth-child(4) {
  height: 18px;
}

.rec-words {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  color: var(--muted);
}

.note-send {
  flex: none;
  height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  color: var(--gold-dark);
  background: var(--gold);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}

.note-send:disabled {
  opacity: 0.55;
  cursor: progress;
}

@keyframes rec-blink {
  50% {
    opacity: 0.25;
  }
}

#mic-btn.starting {
  opacity: 0.6;
  cursor: progress;
}

@keyframes mic-live {
  50% {
    box-shadow: 0 0 0 6px rgba(63, 164, 94, 0.15);
  }
}

/*
 * Controls, like a handheld console: a black plastic cross pad on the left, a slanted rubber
 * Options button in the middle, and two round maroon buttons (B low, A high) in a slanted well on
 * the right. Kept short so the bar leaves room for the pub.
 */
#controls {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  /* 10px clear of the chat box above. */
  padding: 10px 16px 0 6px;
}

/* The cross pad: one cross-shaped piece of plastic with a dimple in the middle. */
.dpad {
  --arm: 34px;
  display: grid;
  grid-template: repeat(3, var(--arm)) / repeat(3, var(--arm));
  filter: drop-shadow(0 3px 0 #0b0b0d) drop-shadow(0 5px 6px rgba(0, 0, 0, 0.55));
}

.dpad button,
.dpad-hub {
  border: 0;
  background: linear-gradient(#3a3a40, #232327);
  color: #5d5d66;
  font-size: 10px;
  padding: 0;
  touch-action: none;
  cursor: pointer;
}

.dpad button span {
  display: block;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.08), 0 -1px 0 rgba(0, 0, 0, 0.6);
}

.dpad button.pressed {
  background: linear-gradient(#232327, #2e2e33);
}

.dpad button.pressed span {
  transform: translateY(1px);
}

/* An invisible margin round the pad that counts as pressing it, so a thumb that's a little off
   still walks (input.js works out the direction from where you press). */
.dpad {
  position: relative;
}

.dpad::before {
  content: '';
  position: absolute;
  inset: -16px -14px -14px -16px;
  border-radius: 24px;
}

.dpad [data-dir='up'] {
  grid-area: 1 / 2;
  border-radius: 6px 6px 0 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
.dpad [data-dir='left'] {
  grid-area: 2 / 1;
  border-radius: 6px 0 0 6px;
  background: linear-gradient(#36363c, #26262a);
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.12);
}
.dpad [data-dir='right'] {
  grid-area: 2 / 3;
  border-radius: 0 6px 6px 0;
  background: linear-gradient(#36363c, #26262a);
}
.dpad [data-dir='down'] {
  grid-area: 3 / 2;
  border-radius: 0 0 6px 6px;
  background: linear-gradient(#2c2c31, #1d1d21);
}
.dpad-hub {
  grid-area: 2 / 2;
  background:
    radial-gradient(circle, #1c1c20 0 34%, rgba(255, 255, 255, 0.06) 36%, transparent 48%),
    linear-gradient(#323237, #26262a);
  cursor: default;
}

/* The middle of the bar: your coins at the top, Options at the bottom. */
#controls .mid {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
}

.coin-count {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: -2px;
  padding: 3px 11px 3px 6px;
  border-radius: 999px;
  background: linear-gradient(#120b08, #1f1510);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.7), 0 1px 0 rgba(255, 220, 170, 0.08);
  color: #ffe08a;
  font-size: 14px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.coin-count[hidden] {
  display: none;
}

.coin-count .coin {
  font-size: 15px;
}

/* Options: a small slanted rubber button with its name printed underneath. */
.options-btn {
  justify-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  background: none;
  border: 0;
  color: #9c8a74;
  font: inherit;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 6px 8px;
  cursor: pointer;
}

.options-lines {
  width: 34px;
  height: 10px;
  border-radius: 6px;
  transform: rotate(-24deg);
  background: linear-gradient(#8a8790, #5e5b63);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 2px 0 #2a282c, 0 3px 5px rgba(0, 0, 0, 0.5);
}

.options-btn:active .options-lines {
  background: linear-gradient(#6c6971, #55525a);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4), 0 1px 0 #2a282c;
  transform: rotate(-24deg) translateY(1px);
}

/* A and B: round, domed maroon buttons in a slanted well, A up and to the right of B. */
.ab {
  --size: 50px;
  position: relative;
  display: grid;
  grid-template-columns: var(--size) var(--size);
  grid-template-rows: 18px var(--size) 18px;
  column-gap: 12px;
}

.ab::before {
  content: '';
  position: absolute;
  left: -2px;
  right: -2px;
  top: 50%;
  height: calc(var(--size) + 14px);
  border-radius: 999px;
  transform: translateY(-50%) rotate(-24deg);
  background: linear-gradient(#120b08, #1f1510);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.7), 0 1px 0 rgba(255, 220, 170, 0.08);
}

.ab button {
  position: relative;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  border: 0;
  font: inherit;
  font-size: 17px;
  font-weight: 900;
  color: rgba(255, 225, 235, 0.8);
  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.35);
  background: radial-gradient(circle at 36% 30%, #e0578f, #a8235d 52%, #7a1640);
  box-shadow:
    inset 0 2px 1px rgba(255, 255, 255, 0.35),
    inset 0 -3px 4px rgba(0, 0, 0, 0.3),
    0 3px 0 #4b0c27,
    0 5px 8px rgba(0, 0, 0, 0.55);
  touch-action: none;
  cursor: pointer;
}

.btn-a {
  grid-area: 1 / 2 / 3 / 3;
  align-self: start;
}

.btn-b {
  grid-area: 2 / 1 / 4 / 2;
  align-self: end;
}

.ab button:active {
  transform: translateY(2px);
  background: radial-gradient(circle at 36% 30%, #c94a7e, #92204f 52%, #6a1237);
  box-shadow:
    inset 0 2px 3px rgba(0, 0, 0, 0.3),
    0 1px 0 #4b0c27,
    0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Key hints on the A and B buttons, for people with a keyboard. */
.hint {
  position: absolute;
  bottom: -14px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  font-weight: 700;
  padding: 0 4px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.55);
  color: var(--muted);
  text-shadow: none;
}

body.touch .hint {
  display: none;
}

/* ---------- the on-screen keyboard (phones) ---------- */

#kb-float {
  display: flex;
  flex-direction: column;
  gap: 7px;
  animation: kb-up 0.18s ease-out;
}

#kb-float[hidden] {
  display: none;
}

/* The keyboard for every text box: floating along the bottom, above any popup. */
#kb-float {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  background: linear-gradient(to bottom, #2b211b, #17110d);
  border-top: 1px solid rgba(255, 220, 160, 0.16);
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -6px 18px rgba(0, 0, 0, 0.45);
  touch-action: none;
}

#kb-float > * {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
}

/* Whatever's behind it makes room, so the box you're typing in can scroll above the keyboard. */
body.kb-float-open #home {
  padding-bottom: calc(var(--kb-h, 0px) + 24px);
}

body.kb-float-open .overlay {
  padding-bottom: calc(var(--kb-h, 0px) + 10px);
}

body.kb-float-open .home-foot {
  display: none;
}

@keyframes kb-up {
  from {
    transform: translateY(40px);
    opacity: 0;
  }
}

.kb-top {
  display: flex;
  align-items: center;
  gap: 6px;
}

.kb-quick {
  flex: 1;
  display: flex;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}

.kb-quick::-webkit-scrollbar {
  display: none;
}

.key-emoji {
  flex: none;
  font-size: 22px;
  width: 40px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
}

.key-emoji:active {
  background: rgba(255, 207, 90, 0.15);
}

.kb-close {
  flex: none;
  width: 40px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: #3a2a20;
  color: var(--text);
  font-size: 20px;
  cursor: pointer;
}

.kb-row {
  display: flex;
  justify-content: center;
  gap: 5px;
}

.key {
  flex: 1 1 0;
  max-width: 44px;
  height: 44px;
  border: 0;
  border-radius: 7px;
  background: #4a372a;
  color: var(--text);
  font: inherit;
  font-size: 19px;
  box-shadow: inset 0 -3px 0 #2c2017;
  touch-action: none;
  cursor: pointer;
}

/* A key being pressed lights up (keyboard.js keeps it lit a moment however quick the tap)... */
.key.down {
  background: #9a7a5e;
  transform: translateY(1px);
  box-shadow: inset 0 1px 0 #2c2017;
}

.key-emoji.down {
  background: rgba(255, 207, 90, 0.25);
}

/* ...and a letter, number or symbol pops up big above your finger, as a phone's own keyboard does. */
#kb-float > .kb-pop {
  position: absolute;
  z-index: 2;
  width: auto;
  max-width: none;
  margin: 0;
  height: 54px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translate(-50%, calc(-100% - 4px));
  background: #8a6a52;
  color: #ffffff;
  font-size: 30px;
  font-weight: 600;
  border-radius: 11px;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

#kb-float > .kb-pop[hidden] {
  display: none;
}

.key-shift,
.key-back,
.key-123,
.key-sym,
.key-abc {
  flex: 1.5 1 0;
  max-width: 66px;
  background: #33251b;
  font-size: 15px;
}

.key-shift.on {
  background: var(--text);
  color: var(--gold-dark);
}

.key-space {
  flex: 5 1 0;
  max-width: 240px;
  font-size: 14px;
  color: var(--muted);
}

.key-send {
  flex: 2 1 0;
  max-width: 96px;
  background: var(--gold);
  color: var(--gold-dark);
  font-weight: 800;
  font-size: 15px;
  box-shadow: inset 0 -3px 0 #c9971f;
}

/* ---------- Add to Home Screen (homescreen.js) ---------- */

.hs-guide {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 15px;
  line-height: 1.45;
}

.hs-guide p {
  margin: 0;
}

.hs-why {
  color: var(--text);
}

.hs-h {
  margin: 6px 0 0;
  font-size: 15px;
  color: var(--gold);
}

.hs-steps {
  margin: 0;
  padding-left: 1.4em;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hs-steps b,
.hs-guide b {
  color: var(--gold);
}

.hs-note {
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(242, 165, 22, 0.14);
  border: 1px solid rgba(242, 165, 22, 0.4);
}

.hs-install {
  align-self: flex-start;
}

.hs-fold summary,
.hs-card summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 700;
}

.hs-fold .hs-steps {
  margin-top: 8px;
}

.hs-card {
  margin: 14px 0 4px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
}

.hs-card summary {
  color: var(--text);
}

.hs-card[open] summary {
  margin-bottom: 10px;
}

/* ---------- options ---------- */

/* It slides up from the bottom (centred on bigger screens), the dim behind it fading in. It's
   never taller than the screen: the menus scroll inside it. */
#options.sheet {
  place-items: end center;
  padding: calc(12px + env(safe-area-inset-top)) 10px calc(10px + env(safe-area-inset-bottom));
  background: rgba(0, 0, 0, 0);
  transition: background 0.22s ease;
}

#options.sheet.shown {
  background: rgba(0, 0, 0, 0.55);
}

@media (min-width: 700px) and (min-height: 600px) {
  #options.sheet {
    place-items: center;
  }
}

.options-card {
  width: min(440px, 100%);
  max-height: calc(100dvh - 22px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  border-radius: 20px;
  transform: translateY(40px) scale(0.97);
  opacity: 0;
  transition:
    transform 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.1),
    opacity 0.18s ease;
}

#options.shown .options-card {
  transform: none;
  opacity: 1;
}

.opt-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 12px 10px;
  border-bottom: 1px solid var(--line);
  flex: none;
}

.opt-titles {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.opt-head h2 {
  margin: 0;
  font-size: 18px;
}

#options:not(.in-menu) .opt-head h2 {
  padding-left: 6px;
}

.opt-sub {
  padding-left: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#options.in-menu .opt-sub {
  display: none;
}

.opt-icon-btn {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

#options-back {
  font-size: 26px;
  padding-bottom: 3px;
}

.opt-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 10px 12px 14px;
}

/* Menus slide in from the side they're coming from. */
.opt-view {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.opt-view.from-right {
  animation: opt-in-right 0.22s ease-out;
}

.opt-view.from-left {
  animation: opt-in-left 0.22s ease-out;
}

@keyframes opt-in-right {
  from {
    transform: translateX(28px);
    opacity: 0;
  }
}

@keyframes opt-in-left {
  from {
    transform: translateX(-28px);
    opacity: 0;
  }
}

/* A row in a menu: an icon or picture, what it is (and what it's set to), then › or a switch. */
.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 54px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.menu-item:active {
  background: rgba(255, 207, 90, 0.1);
}

.menu-item[hidden] {
  display: none;
}

.menu-item .ico {
  width: 32px;
  font-size: 20px;
  text-align: center;
  flex: none;
}

.mi-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.mi-text small {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mi-go {
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
}

.mi-preview {
  width: 32px;
  height: 40px;
  flex: none;
}

.menu-item.compact {
  min-height: 48px;
}

/* On/off switches for the camera and notifications. */
.switch {
  position: relative;
  flex: none;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: #4a3a2e;
  transition: background 0.18s;
}

.switch::after {
  content: '';
  position: absolute;
  left: 3px;
  top: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #f6ead6;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  transition: transform 0.18s;
}

.toggle[aria-pressed='true'] .switch {
  background: #4caf6a;
}

.toggle[aria-pressed='true'] .switch::after {
  transform: translateX(18px);
}

.toggle:disabled {
  opacity: 0.6;
  cursor: progress;
}

/* Character: you, big, then the parts of your look. */
.opt-stage {
  display: grid;
  place-items: center;
  padding: 6px 0 10px;
  margin-bottom: 4px;
  border-radius: 16px;
  background: radial-gradient(ellipse at 50% 88%, rgba(0, 0, 0, 0.35) 0 18%, transparent 19%), radial-gradient(ellipse at 50% 30%, #3a2818, #241810 70%);
}

.opt-stage canvas {
  width: 120px;
  height: 150px;
}

.opt-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.opt-group h4 {
  margin: 10px 2px 8px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

/* Colours: round swatches. */
.opt-swatches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  gap: 8px;
}

.swatch-btn {
  aspect-ratio: 1;
  padding: 3px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.swatch-btn[aria-checked='true'] {
  box-shadow: 0 0 0 2px var(--gold);
}

.swatch {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--swatch);
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.25), inset 0 2px 0 rgba(255, 255, 255, 0.2);
}

/* Eye colours look like eyes. */
.swatch.eye {
  background: radial-gradient(circle, #1b1410 0 22%, var(--swatch) 23% 48%, #fff 50%);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25);
}

/* Styles and hats: little pictures of you with each, and its name. */
.opt-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
  gap: 8px;
}

.tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 4px 7px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.tile[aria-checked='true'] {
  border-color: var(--gold);
  background: rgba(255, 207, 90, 0.12);
}

.tile canvas {
  max-width: 100%;
}

.opt-name {
  display: flex;
  gap: 8px;
  min-width: 0;
}

.opt-input {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 16px;
  color: var(--text);
  background: #120c09;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  outline: none;
}

.opt-input:focus {
  border-color: var(--gold);
}

.opt-saved {
  min-height: 1.2em;
  margin: 4px 0 0 !important;
  font-size: 13px;
  color: #9fe0a8 !important;
}

.opt-saved.bad {
  color: #ffb4a0 !important;
}

@media (prefers-reduced-motion: reduce) {
  .options-card,
  .opt-view.from-right,
  .opt-view.from-left {
    transition: none;
    animation: none;
  }
}

/* Phones: a little tighter so the bar leaves room for the pub. */
@media (max-width: 400px) {
  .dpad {
    --arm: 32px;
  }
  .ab {
    --size: 48px;
  }
  .key {
    height: 42px;
  }
  .swatches {
    grid-template-columns: repeat(6, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  #mic-btn,
  .rec-dot {
    animation: none;
  }
}

/* ---------- panels ---------- */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 20; /* above the bottom bar */
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.55);
  padding: 16px;
}

.card {
  width: min(420px, 100%);
  background: var(--panel-solid);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 20px 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.card h2 {
  margin: 0 0 8px;
  font-size: 19px;
  color: var(--gold);
}

.card p {
  margin: 0 0 10px;
  color: var(--text);
  line-height: 1.45;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* A panel taller than the screen (the bureau de change, on a phone) scrolls inside, under its title and ✕,
   rather than running off the top and bottom of the screen where nothing can reach it. */
#panel > .card {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
}

#panel-body {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  /* (room for a focused button's outline at the sides) */
  margin: 0 -6px;
  padding: 0 6px 2px;
}

#panel-close {
  background: none;
  border: 0;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
}

.soon-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gold-dark);
  background: var(--gold);
  border-radius: 999px;
  padding: 2px 10px;
}

.btn {
  font: inherit;
  font-weight: 700;
  color: var(--gold-dark);
  background: var(--gold);
  border: 0;
  border-radius: var(--radius);
  padding: 10px 16px;
  cursor: pointer;
}

/* ---------- top bar extras ---------- */

.invite-link {
  width: 100%;
  font: inherit;
  font-size: 14px;
  color: var(--text);
  background: #120c09;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin: 4px 0 12px;
}

.row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ---------- welcome, sign-in and your pubs: the street outside, at night ----------
   Pub names and headings are signwritten (Alfa Slab One, gilded on painted boards, as on a pub's
   fascia); everything else is in Atkinson Hyperlegible Next. The pictures are front.js's. */

@font-face {
  font-family: 'Alfa Slab One';
  src: url('/fonts/alfa-slab-one.woff2') format('woff2');
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Alfa Slab One';
  src: url('/fonts/alfa-slab-one-ext.woff2') format('woff2');
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

#home {
  --sign: 'Alfa Slab One', Georgia, 'Times New Roman', serif;
  --sky: #10142b;
  position: fixed;
  inset: 0;
  overflow-y: auto;
  font-family: 'Atkinson Hyperlegible Next', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background:
    linear-gradient(180deg, var(--sky) 0, #1b1830 140px, #191220 300px, var(--bg) 560px) no-repeat,
    var(--bg);
  padding: calc(24px + env(safe-area-inset-top)) 16px calc(32px + env(safe-area-inset-bottom));
}

.home-inner {
  width: min(440px, 100%);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* vpub's name signwritten in gold leaf on a little painted board: the way home, and the footer's mark. */
.board {
  display: inline-block;
  padding: 7px 14px 8px;
  border-radius: 4px;
  background: linear-gradient(#25543f, #173a2c);
  box-shadow:
    inset 0 0 0 3px #173a2c,
    inset 0 0 0 4.5px #d8b25a,
    0 0 0 2px #0e261b,
    0 6px 16px rgba(0, 0, 0, 0.45);
}

.leaf {
  font-family: 'Alfa Slab One', Georgia, serif;
  font-weight: 400;
  background: linear-gradient(#fff0b8, #f3c95a 45%, #c08f30 55%, #f0c860);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(1.5px 1.5px 0 #0b2117);
}

.brand {
  align-self: flex-start;
  margin-bottom: 14px;
  font-size: 22px;
  line-height: 1;
  text-decoration: none;
}

.brand:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 4px;
  border-radius: 4px;
}

/* The other screens before you're in (Google, a new password, a confirmed address): in the middle. */
#home.signin {
  display: grid;
  place-items: center;
}

#home.signin .home-inner {
  width: min(320px, 100%);
  align-items: center;
  text-align: center;
  gap: 22px;
}

#home.signin .brand {
  align-self: center;
  margin: 0;
  font-size: 30px;
}

#home.signin h1 {
  font-size: 26px;
}

/* The welcome: the pub from the street on top (on a wide screen, the left), the way in under it. */
#home.front {
  padding: 0;
  background: var(--bg);
}

.front-layout {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

.front-scene {
  position: relative;
  flex: none;
  height: clamp(240px, 42svh, 330px);
  overflow: hidden;
  background: var(--sky);
}

.front-scene-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* The pub's sign swings a little on its bracket. */
.front-sign-swing {
  transform-box: view-box;
  transform-origin: 656px 112px;
  animation: sign-swing 7s ease-in-out infinite;
}

@keyframes sign-swing {
  0%,
  100% {
    transform: rotate(-2.2deg);
  }
  50% {
    transform: rotate(2.2deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .front-sign-swing {
    animation: none;
  }
}

.front-panel {
  width: min(400px, 100% - 32px);
  margin: 0 auto;
  padding: 26px 0 calc(32px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 18px;
  text-align: center;
}

#home .front-panel h1 {
  font-size: clamp(32px, 9.4vw, 44px);
  line-height: 1.02;
}

#home .front-lede,
#home .front-panel .invited {
  margin-top: -6px;
  color: var(--muted);
  font-size: 16.5px;
  line-height: 1.5;
  text-wrap: pretty;
}

#home .front-panel .invited b {
  color: var(--text);
}

#home.front .site-footer {
  width: 100%;
  margin-top: 40px;
  text-align: left;
}

@media (min-width: 900px) {
  .front-layout {
    flex-direction: row;
    min-height: 100vh;
  }

  /* The street fills the left, held still while the right scrolls, with more night sky above it. */
  .front-scene {
    position: sticky;
    top: 0;
    flex: 1.35 1 0;
    height: 100vh;
    background:
      radial-gradient(1.2px 1.2px at 18% 22%, #fff6d8 50%, transparent 51%),
      radial-gradient(1px 1px at 42% 12%, #fff6d8 50%, transparent 51%),
      radial-gradient(1.4px 1.4px at 66% 30%, #fff6d8 50%, transparent 51%),
      radial-gradient(1px 1px at 84% 16%, #fff6d8 50%, transparent 51%),
      radial-gradient(1.2px 1.2px at 30% 40%, #fff6d8 50%, transparent 51%),
      var(--sky);
  }

  .front-scene-art {
    top: auto;
    height: auto;
    aspect-ratio: 800 / 440;
  }

  .front-panel {
    flex: 1 1 0;
    width: auto;
    max-width: 420px;
    margin: 0 auto;
    padding: max(56px, 12vh) 40px 40px;
    text-align: left;
  }

  #home .front-panel h1 {
    font-size: 48px;
  }
}

#home.signin .stack {
  width: 100%;
}

#home.signin .invited {
  margin: -8px 0 0;
  color: var(--muted);
}

#home.signin .invited b {
  color: var(--text);
}

#home h1 {
  margin: 0;
  font-family: var(--sign);
  font-weight: 400;
  font-size: clamp(28px, 7.6vw, 36px);
  line-height: 1.08;
  letter-spacing: 0.005em;
  color: var(--text);
  text-wrap: balance;
}

#home h2 {
  margin: 12px 0 0;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

#home p {
  margin: 0;
  line-height: 1.5;
}

.lede {
  color: var(--muted);
  font-size: 17px;
  margin-top: 8px !important;
}

.fine {
  color: var(--muted);
  font-size: 13px;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stack label {
  font-weight: 700;
}

#home input {
  width: 100%;
  font: inherit;
  font-size: 16px;
  color: var(--text);
  background: rgba(18, 12, 9, 0.85);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  outline: none;
}

#home input:focus {
  border-color: var(--gold);
}

.code-input {
  font-size: 26px !important;
  letter-spacing: 0.35em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

#home .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 13px 16px;
  font-size: 16px;
  text-decoration: none;
}

.btn:disabled {
  opacity: 0.6;
  cursor: progress;
}

.btn-google {
  background: #fff !important;
  color: #1f1f1f !important;
  font-weight: 600 !important;
}

/* Email and password: a label over each box, the Show button inside the password box. */
#home .field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  text-align: left;
}

#home .field label {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}

#home .field .fine {
  font-size: 12px;
}

#home .field.pw {
  position: relative;
}

#home .field.pw input {
  padding-right: 64px;
}

.pw-show {
  position: absolute;
  right: 6px;
  bottom: 6px;
  height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: calc(var(--radius) - 2px);
  background: rgba(255, 220, 160, 0.1);
  color: var(--gold);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

/* When the password box has a hint under it, the button sits on the box, not the hint. */
#home .field.pw:has(.fine) .pw-show {
  bottom: calc(6px + 1.5em + 5px);
}

#home .or {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: -6px 0;
  color: var(--muted);
  font-size: 13px;
}

#home .or::before,
#home .or::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* "I'm 18 or over": a box to tick, with its words beside it. */
#home .check {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  text-align: left;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}

#home .check input {
  flex: none;
  width: 24px;
  height: 24px;
  margin: 0;
  padding: 0;
  accent-color: var(--gold);
  cursor: pointer;
}

#home .signin-h {
  margin: 0;
  font-size: 15px;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text);
}

#home .signin-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-top: -6px;
}

#home .signin-links .link {
  text-align: center;
}

#home .said:empty {
  display: none;
}

#home .said {
  font-size: 14px;
  color: var(--text);
}

.btn-quiet {
  background: transparent !important;
  color: var(--text) !important;
  border: 1px solid var(--line) !important;
}

/* Closing your account: the one button here that can't be taken back. */
.btn.btn-danger {
  background: #c4432d;
  color: #fff6ee;
}

/* The way to close your account, out of the way at the end of your pubs. */
.account-end {
  margin: 28px 0 0;
  text-align: center;
}

.account-end .link {
  color: var(--muted);
  font-size: 13px;
}

.link {
  background: none;
  border: 0;
  padding: 4px 0;
  color: var(--gold);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.form-error {
  color: #ffb4a0;
  background: rgba(224, 82, 58, 0.12);
  border: 1px solid rgba(224, 82, 58, 0.4);
  border-radius: var(--radius);
  padding: 10px 12px;
}

.who {
  display: flex;
  align-items: center;
  gap: 12px;
}

.who > div {
  flex: 1;
  min-width: 0;
}

.who h1 {
  font-size: clamp(24px, 6.8vw, 30px) !important;
}

.avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  flex: none;
  object-fit: cover;
  border: 2px solid var(--gold);
}

.avatar-letter {
  display: grid;
  place-items: center;
  background: var(--gold);
  color: var(--gold-dark);
  font-weight: 800;
  font-size: 22px;
}

/* Your pubs: a row of pub fronts (front.js), each in its own paint with its name signwritten in gold on
   the fascia, its sign hanging at the end, its windows lit. Tap one to walk in. */
.street {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  display: grid;
  gap: 26px;
}

.front-card {
  --paint: #1f4a39;
  --paint-dark: #143426;
  position: relative;
  display: flex;
  flex-direction: column;
  padding-top: 8px;
  color: var(--text);
  text-decoration: none;
}

.paint-oxblood {
  --paint: #5c1f22;
  --paint-dark: #3d1214;
}

.paint-navy {
  --paint: #1d2b4a;
  --paint-dark: #121b31;
}

.paint-black {
  --paint: #222026;
  --paint-dark: #121014;
}

.paint-slate {
  --paint: #3b464f;
  --paint-dark: #252d33;
}

.paint-teal {
  --paint: #1c4a4e;
  --paint-dark: #123236;
}

.paint-plum {
  --paint: #46233f;
  --paint-dark: #2e1629;
}

.paint-mahogany {
  --paint: #4e2a1a;
  --paint-dark: #341b10;
}

/* The cornice along the top, a touch wider than the front, in stone. */
.front-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -6px;
  right: -6px;
  height: 10px;
  border-radius: 3px;
  background: #e9dcc0;
  box-shadow:
    inset 0 -3px 0 #b9a88a,
    0 3px 0 rgba(0, 0, 0, 0.25);
}

/* The first floor: its walls (brick, timber, render or stone) and windows, as its owner designed them. */
.fc-upper {
  display: block;
  height: 54px;
  background: #7a3a2a;
}

.fc-upper-art {
  display: block;
  width: 100%;
  height: 100%;
}

.fc-fascia {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 62px;
  padding: 12px 74px 12px 18px;
  background: var(--paint);
  box-shadow:
    inset 0 0 0 5px var(--paint),
    inset 0 0 0 6.5px #d8b25a;
}

.fc-name {
  font: 400 23px/1.12 'Alfa Slab One', Georgia, serif;
  background: linear-gradient(#fff0b8, #f3c95a 45%, #c08f30 55%, #f0c860);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(1.5px 1.5px 0 rgba(0, 0, 0, 0.7));
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.fc-floor {
  display: block;
  height: 70px;
  background: var(--paint);
}

.fc-floor-art {
  display: block;
  width: 100%;
  height: 100%;
}

.fc-paint {
  fill: var(--paint);
}

.fc-paint-dark,
.fc-frame-fill {
  fill: var(--paint-dark);
}

.fc-frame {
  stroke: var(--paint-dark);
}

/* The sign, hanging from its bracket at the end of the fascia. */
.fc-sign {
  position: absolute;
  top: -8px;
  right: 10px;
  width: 54px;
  height: 54px;
  transform: rotate(3deg);
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.45));
}

.fc-sign-art {
  display: block;
  width: 100%;
  height: 100%;
}

.fc-words {
  display: block;
  padding: 12px 2px 0;
  color: var(--muted);
  font-size: 15px;
}

a.front-card:hover .fc-floor-art,
a.front-card:focus-visible .fc-floor-art,
a.front-card:hover .fc-upper-art,
a.front-card:focus-visible .fc-upper-art {
  filter: brightness(1.1);
}

a.front-card:hover .fc-words,
a.front-card:focus-visible .fc-words {
  color: var(--text);
}

a.front-card:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 8px;
  border-radius: 4px;
}

/* Starting a pub: its front, signwritten as you type its name. */
.front-preview {
  margin-top: 6px;
}

.front-preview.placeholder .fc-name {
  opacity: 0.5;
}

@media (min-width: 760px) {
  #home:not(.signin):not(.front) .home-inner:has(.street) {
    width: min(760px, 100%);
  }

  .street {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 30px;
  }
}

/* Under a pub you run: the way to its designer. */
.design-link {
  display: inline-block;
  margin: 8px 2px 0;
  font-size: 15px;
}

/* The front's designer (home.js): the front as it'll look, kept in view while you choose, then each choice. */
.design-preview {
  position: sticky;
  top: calc(-24px - env(safe-area-inset-top));
  z-index: 2;
  margin: 6px -16px 0;
  padding: calc(14px + env(safe-area-inset-top)) 16px 16px;
  background: var(--sky);
  box-shadow: 0 1px 0 var(--line);
}

.design {
  gap: 20px;
}

.design .design-label {
  margin-bottom: -12px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
}

.design-group {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.design-group legend {
  margin-bottom: 8px;
  padding: 0;
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
}

.design-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
  gap: 8px;
}

.design-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 4px 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.28);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

.design-tile[aria-checked='true'] {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold);
  color: var(--gold);
}

.design-art {
  display: block;
  width: 100%;
  max-width: 66px;
  aspect-ratio: 44 / 32;
  border-radius: 4px;
  overflow: hidden;
}

.design-art .choice-art {
  display: block;
  width: 100%;
  height: 100%;
}

.design-swatches {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 4px;
  max-width: 400px;
}

.design-swatch {
  aspect-ratio: 1;
  padding: 4px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.design-swatch[aria-checked='true'] {
  box-shadow: 0 0 0 2px var(--gold);
}

.design-tile:focus-visible,
.design-swatch:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

/* No pubs yet: an empty front waiting, its windows dark. */
.front-card.to-let .fc-name {
  opacity: 0.55;
}

.front-card.to-let .fc-floor-art,
.front-card.to-let .fc-upper-art {
  filter: grayscale(1) brightness(0.32);
}

.empty {
  color: var(--muted);
  font-size: 16px;
  text-wrap: pretty;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- top bar on phones ---------- */

#topbar {
  flex-wrap: nowrap;
}

#topbar .ico {
  margin-right: 5px;
}

@media (max-width: 600px) {
  #topbar {
    gap: 6px;
    left: 8px;
    right: 8px;
  }
  #people-count {
    display: none;
  }
  /* Hidden visually, still read out. */
  #topbar .label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  #topbar .ico {
    margin-right: 0;
  }
  #topbar > button {
    padding: 5px 9px;
  }
}

/* ---------- Drinks League (the bar) ---------- */

.dl {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dl p {
  margin: 0 !important;
}

.dl-you {
  font-weight: 700;
  color: var(--gold) !important;
}

.dl-table {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 46vh;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.dl-table li {
  display: grid;
  grid-template-columns: 2.2em 1fr auto 3em;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  border-left: 4px solid transparent;
  font-size: 14px;
}

.dl-table li:last-child {
  border-bottom: 0;
}

.dl-table .zone-title {
  border-left-color: var(--gold);
}

.dl-table .zone-europe {
  border-left-color: #6cc48a;
}

.dl-table .zone-drop {
  border-left-color: #e0523a;
}

.dl-table li.you {
  background: rgba(255, 207, 90, 0.12);
  font-weight: 700;
}

.dl-pos {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.dl-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dl-pints {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.dl-points {
  text-align: right;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.opt-dl {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.opt-dl-linked {
  font-weight: 700;
  margin: 0 !important;
}

.opt-dl .btn-quiet {
  align-self: flex-start;
}

.opt-dl a.btn {
  text-align: center;
  text-decoration: none;
}

.opt-sub-title {
  margin: 18px 0 8px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 15px;
}

.opt-sub-title.first {
  margin-top: 4px;
  padding-top: 0;
  border-top: 0;
}

/* ---------- coins: the wallet panel ---------- */

#coins {
  font-weight: 700;
  color: var(--gold);
}

.wallet-balance {
  font-size: 15px;
}

.wallet-balance b {
  font-size: 30px;
  color: var(--gold);
  margin-right: 4px;
}

.wallet h4 {
  margin: 14px 0 6px;
  font-size: 13px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.give {
  display: flex;
  gap: 8px;
}

.give select,
.give input {
  font: inherit;
  font-size: 16px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 9px 10px;
  min-width: 0;
}

.give select {
  flex: 1;
}

.give input {
  width: 76px;
}

.coin-history {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 34vh;
  overflow-y: auto;
  font-size: 14px;
}

.coin-history li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}

.coin-history b {
  flex-shrink: 0;
  white-space: nowrap;
}

.coin-history .up {
  color: #8fe39a;
}

/* A bureau de change line's working, under what it was. */
.coin-history .coin-working {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

.coin-history .down {
  color: #ffb4a0;
}

.wallet-chips b {
  font-size: 20px;
  color: #ff9b8a;
  margin-right: 4px;
}

/* ---------- the bureau de change (bureau.js) ---------- */

.bureau {
  --chip: #ff9b8a;
  --baize: #9fe8c8;
}

.bureau-purse {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  margin-bottom: 4px;
}

.bureau-purse p {
  margin: 0;
  color: var(--muted);
}

.bureau-purse b {
  font-size: 22px;
  margin-right: 3px;
  color: var(--chip);
}

.bureau-purse p:first-child b {
  color: var(--gold);
}

.bureau-purse .vault b {
  color: #cfd8e3;
}

.bureau-way {
  border-top: 1px solid var(--line);
  margin-top: 12px;
  padding-top: 2px;
}

.bureau-way h4 {
  margin: 10px 0 0;
  font-size: 16px;
}

.bureau-way .fine {
  margin: 2px 0 8px;
}

.bureau-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.bureau-amount {
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
}

.bureau-step {
  font: inherit;
  font-size: 22px;
  line-height: 1;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  color: var(--text);
  background: transparent;
  cursor: pointer;
}

.bureau-step:disabled,
.bureau-all:disabled {
  opacity: 0.35;
  cursor: default;
}

.bureau-give {
  min-width: 62px;
  text-align: center;
  font-size: 19px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.way-buy .bureau-give {
  color: var(--gold);
}

.bureau-all {
  font: inherit;
  font-size: 14px;
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
}

/* The working, as a receipt: what goes in at the rate, the commission, and what comes out, in bold. */
.bureau-sum {
  width: 100%;
  margin: 0 0 12px;
  border-collapse: collapse;
  font-size: 14.5px;
  font-variant-numeric: tabular-nums;
}

.bureau-sum td {
  padding: 4px 0;
  color: var(--muted);
  border-bottom: 1px dashed var(--line);
}

.bureau-sum td:last-child {
  text-align: right;
  white-space: nowrap;
  padding-left: 12px;
  color: var(--text);
}

.bureau-sum tr:last-child td {
  border-bottom: 0;
  padding-top: 6px;
  font-weight: 700;
  color: var(--text);
}

.bureau-sum tr:last-child td:last-child {
  color: var(--chip);
}

.bureau-way .btn {
  width: 100%;
}

.bureau-short,
.bureau-note {
  color: var(--muted);
  font-size: 15px;
  margin: 4px 0 0;
}

.bureau-note {
  border-top: 1px solid var(--line);
  margin-top: 12px;
  padding-top: 12px;
}

.bureau-waiting {
  margin: 8px 0 0;
  padding: 8px 10px;
  border-radius: var(--radius);
  background: rgba(159, 232, 200, 0.1);
  color: var(--baize);
  font-size: 14px;
}

.bureau .bureau-said {
  min-height: 1.3em;
  margin: 10px 0 2px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  color: #9fe0a8;
}

.bureau .bureau-said.bad {
  color: #ffb4a0;
}

.bureau .bureau-said:empty {
  margin: 0;
}

.bureau-small {
  margin: 14px 0 0;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

/* ---------- the poker table screen ---------- */

/* Laid over the pub: the camera swings onto the poker table behind it (scene.lookAtPoker), and
   this darkens and softens it so the table and cards stand out. */
#poker {
  --face: 48px;
  --gold-hi: #ffe08a;
  position: fixed;
  inset: 0;
  z-index: 15; /* over the pub and the bottom bar; panels (z 20) open above it */
  color: var(--text);
  background:
    radial-gradient(ellipse at 50% 45%, rgba(18, 10, 6, 0.25), rgba(10, 6, 4, 0.8) 75%),
    linear-gradient(rgba(10, 6, 4, 0.35), rgba(10, 6, 4, 0.55));
  -webkit-backdrop-filter: blur(3px) saturate(1.1);
  backdrop-filter: blur(3px) saturate(1.1);
}

@media (min-width: 700px) and (min-height: 640px) {
  #poker {
    --face: 76px;
  }
}

.poker-inner {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
  /* Room at the bottom for the chat box, which floats over this screen (above the phone's home
     bar, so that's counted too). */
  padding: calc(8px + env(safe-area-inset-top)) 12px calc(var(--hud-h, 0px) + var(--chat-h) + 12px + env(safe-area-inset-bottom));
  max-width: 960px;
  margin: 0 auto;
}

.poker-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.poker-head .spacer {
  flex: 1;
}

.poker-tag,
.poker-coins {
  font-size: 13px;
  font-weight: 800;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 220, 160, 0.18);
  border-radius: 999px;
  padding: 5px 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.poker-tag small {
  font-weight: 600;
  color: var(--muted);
}

.poker-coins {
  color: var(--gold-hi);
}

.poker-coins.chips {
  color: #ffb4a8;
}

/* At a free table: what it plays for, coins or the bureau de change's chips. */
.unit-bar {
  flex-direction: row;
  justify-content: center;
  gap: 12px;
}

.unit-label {
  font-size: 13px;
  color: var(--muted);
}

.unit-picks {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 220, 160, 0.18);
}

.unit-pick {
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.unit-pick small {
  font-size: 12px;
  font-weight: 600;
  opacity: 0.8;
  font-variant-numeric: tabular-nums;
}

.unit-pick.on {
  color: var(--gold-dark);
  background: var(--gold);
}

.poker-close {
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 220, 160, 0.18);
  color: var(--text);
  border-radius: 999px;
  width: 34px;
  height: 34px;
  font-size: 15px;
  cursor: pointer;
}

/* A gold coin, drawn. */
.coin {
  display: inline-block;
  width: 1em;
  height: 1em;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff2b0, #f5c23c 45%, #b9801b);
  box-shadow: inset 0 0 0 1.5px rgba(120, 70, 10, 0.55);
  flex: none;
}

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

/* The table fills what's left, as big as fits: tall on phones held upright, wide otherwise. */
.table-wrap {
  flex: 1;
  min-height: 0;
  container-type: size;
  display: grid;
  place-items: center;
  padding: calc(var(--face) * 0.75 + 10px) calc(var(--face) * 0.5 + 10px) calc(var(--face) * 0.6 + 26px);
}

.table {
  position: relative;
  width: min(100cqw, 72cqh);
  aspect-ratio: 3 / 4;
}

@media (orientation: landscape) {
  .table {
    width: min(100cqw, 165cqh);
    aspect-ratio: 16 / 9.5;
  }
}

/* The table top, tilted away from you. Seats aren't tilted: poker.js puts them on its rim. */
.table-top {
  position: absolute;
  inset: 0;
  transform: perspective(900px) rotateX(24deg);
  transform-style: preserve-3d;
}

.rail {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(255, 220, 170, 0.35), transparent 60%),
    linear-gradient(160deg, #8a5530, #5a3218 55%, #3f220f);
  box-shadow:
    0 26px 40px rgba(0, 0, 0, 0.55),
    0 10px 0 #2c170a,
    inset 0 2px 0 rgba(255, 230, 190, 0.35),
    inset 0 -3px 6px rgba(0, 0, 0, 0.5);
}

.felt {
  position: absolute;
  inset: 5.5%;
  border-radius: 50%;
  background:
    radial-gradient(ellipse at 50% 40%, #3aa35a, #23763d 55%, #17532a);
  box-shadow: inset 0 0 0 3px rgba(0, 0, 0, 0.25), inset 0 8px 30px rgba(0, 0, 0, 0.45);
}

.felt-line {
  position: absolute;
  inset: 13%;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.14);
}

.poker-centre {
  position: absolute;
  left: 12%;
  right: 12%;
  top: 50%;
  transform: translateY(-58%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}

.board {
  display: flex;
  gap: 4px;
}

.poker-line {
  font-size: 13px;
  font-weight: 700;
  color: #f1fbe9;
  min-height: 1.3em;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

/* Chips: a small stack and how many, for bets and the pot. */
.chips {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 999px;
  padding: 2px 9px 2px 4px;
  font-size: 12px;
  color: #fff;
  white-space: nowrap;
}

.chip-stack {
  position: relative;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: repeating-conic-gradient(#d63b3b 0 30deg, #fff 30deg 45deg);
  box-shadow:
    0 -3px 0 -1px #2f74d0,
    0 -3px 0 0 rgba(0, 0, 0, 0.3),
    0 -6px 0 -1px #3aa35a,
    0 -6px 0 0 rgba(0, 0, 0, 0.3);
  margin-top: 6px;
}

.chips.pot {
  font-size: 14px;
  padding: 3px 12px 3px 6px;
  color: var(--gold-hi);
}

.chips.bet {
  position: absolute;
  transform: translate(-50%, -50%);
  z-index: 1;
}

/* ---- cards ---- */

.pcard {
  width: 34px;
  height: 48px;
  border-radius: 5px;
  background: linear-gradient(#ffffff, #f2ede2);
  color: #1b1b1b;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.45);
  flex: none;
}

.pcard b {
  font-size: 17px;
  font-weight: 800;
}

.pcard i {
  font-style: normal;
  font-size: 17px;
}

.pcard.red {
  color: #d22b2b;
}

.pcard.back {
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.25) 0 18%, transparent 19%),
    repeating-linear-gradient(45deg, #b13232 0 4px, #8e2323 4px 8px);
  border: 2px solid #fff;
}

.pcard.slot {
  background: rgba(0, 0, 0, 0.16);
  border: 1.5px dashed rgba(255, 255, 255, 0.25);
  box-shadow: none;
}

.pcard.board {
  width: 33px;
  height: 46px;
  border-radius: 5px;
}

.pcard.board b,
.pcard.board i {
  font-size: 17px;
}

@media (min-width: 700px) and (min-height: 640px) {
  .pcard.board {
    width: 54px;
    height: 76px;
    border-radius: 7px;
  }
  .pcard.board b,
  .pcard.board i {
    font-size: 26px;
  }
}

.pcard.small {
  width: 20px;
  height: 28px;
  border-radius: 3px;
  border-width: 1.5px;
}

.pcard.small b,
.pcard.small i {
  font-size: 10px;
}

.pcard.big {
  width: 64px;
  height: 90px;
  border-radius: 9px;
}

.pcard.big b,
.pcard.big i {
  font-size: 30px;
}

/* ---- seats ---- */

.seat {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 2;
}

.seat-name {
  max-width: calc(var(--face) + 40px);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 3px #000;
  margin-bottom: 3px;
}

.seat.mine .seat-name {
  color: var(--gold-hi);
}

/* Each player's camera, as it is, in a rounded frame. */
.seat-frame {
  position: relative;
  width: var(--face);
  height: var(--face);
  border-radius: 18%;
  box-shadow: 0 0 0 3px #fff6e2, 0 6px 14px rgba(0, 0, 0, 0.6);
}

.seat-face {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 18%;
}

.seat.mine .seat-frame {
  box-shadow: 0 0 0 3px var(--gold), 0 6px 14px rgba(0, 0, 0, 0.6);
}

.seat-frame.talking {
  box-shadow: 0 0 0 3px #4fd17a, 0 0 16px 3px rgba(79, 209, 122, 0.6);
}

.seat.won .seat-frame {
  box-shadow: 0 0 0 3px var(--gold-hi), 0 0 22px 4px rgba(255, 210, 90, 0.75);
}

.seat.folded .seat-frame,
.seat.folded .seat-name {
  opacity: 0.45;
}

/* The turn timer: a gold ring round the frame that runs down. */
.turn-ring {
  position: absolute;
  inset: -7px;
  border-radius: 24%;
  padding: 4px;
  background: conic-gradient(var(--gold-hi) calc(var(--left, 1) * 360deg), rgba(255, 255, 255, 0.15) 0);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  pointer-events: none;
}

.dealer-button {
  position: absolute;
  left: -10px;
  top: -8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #fff, #ddd6c6);
  color: #1b1b1b;
  font-size: 11px;
  font-weight: 900;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}

.seat-cards {
  position: absolute;
  right: -18px;
  top: 22%;
  display: flex;
}

.seat-cards .pcard:first-child {
  transform: rotate(-10deg);
}

.seat-cards .pcard:last-child {
  transform: rotate(8deg) translate(-6px, 1px);
}

.seat-stack {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: -8px;
  position: relative;
  z-index: 1;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(#2b1d14, #120b07);
  border: 1px solid rgba(255, 220, 160, 0.3);
  border-radius: 999px;
  padding: 2px 9px 2px 5px;
  white-space: nowrap;
}

.seat-stack em {
  font-style: normal;
  font-size: 10px;
  color: var(--gold-hi);
}

.seat-won {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 15px;
  font-weight: 900;
  color: #10301a;
  background: #8fe39a;
  border-radius: 999px;
  padding: 2px 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

/* Something they just said in the chat, over their seat. */
.seat-say {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 22px);
  transform: translateX(-50%);
  width: max-content;
  max-width: 150px;
  background: #fff8e8;
  color: #1b1410;
  font-size: 12px;
  line-height: 1.3;
  border-radius: 10px;
  padding: 4px 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  z-index: 3;
  overflow-wrap: anywhere;
}

.seat-say::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 100%;
  margin-left: -5px;
  border: 5px solid transparent;
  border-top-color: #fff8e8;
}

.seat.free .sit,
.seat.free .empty-seat {
  width: calc(var(--face) * 0.72);
  height: calc(var(--face) * 0.72);
  border-radius: 18%;
  border: 2px dashed rgba(255, 230, 180, 0.45);
  background: rgba(0, 0, 0, 0.4);
}

/* An empty seat is a faint ring: there to be seen, not to look at. */
.seat.free .empty-seat {
  width: calc(var(--face) * 0.46);
  height: calc(var(--face) * 0.46);
  border-radius: 50%;
  border: 1.5px solid rgba(255, 230, 180, 0.28);
  background: rgba(0, 0, 0, 0.22);
}

.seat.free .sit {
  font: inherit;
  color: var(--gold-hi);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.seat.free .sit span {
  font-size: 22px;
  font-weight: 800;
}

.seat.free .sit small {
  font-size: 11px;
  font-weight: 700;
}

.seat.free .empty-seat {
  display: block;
  opacity: 0.6;
}

/* What each player did last, under their seat. */
.seat-act {
  margin-top: 3px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
  color: #fff;
  background: rgba(0, 0, 0, 0.62);
  border-radius: 999px;
  padding: 2px 8px;
}

.seat-act.check,
.seat-act.call {
  color: #bfe9c8;
}

.seat-act.bet,
.seat-act.raise,
.seat-act.allin {
  color: #ffd36b;
}

.seat-act.fold,
.seat-act.away {
  color: rgba(255, 255, 255, 0.6);
}

/* Sitting out: there, but not playing. */
.seat.away .seat-frame {
  opacity: 0.5;
}

/* A bot's level is in its name; its face is the robot. */
.seat.bot .seat-name {
  color: #cfe3ff;
}

/* Asking for bots: Easy, Medium, Hard. */
.bot-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  max-width: 100%;
}

.bot-row .quick-btn {
  flex: none;
  padding: 7px 12px;
}

.bot-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}

/* Last hand: a tap at the top of the table screen. */
.poker-last {
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  color: var(--text);
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 220, 160, 0.25);
  border-radius: 999px;
  padding: 6px 11px;
  cursor: pointer;
}

/* On a phone the top of the table screen is short of room: the extras go first. */
@media (max-width: 440px) {
  .poker-tag small {
    display: none;
  }

  .poker-last,
  .poker-stand {
    padding: 5px 8px;
    font-size: 11px;
  }
}

.poker-last.on {
  color: var(--gold-dark);
  background: var(--gold);
  border-color: transparent;
}

.last-hand {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 6;
  width: min(300px, 88%);
  padding: 12px 14px;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
}

.last-title {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.last-board,
.last-cards {
  display: flex;
  gap: 4px;
}

.last-won {
  font-weight: 800;
  color: var(--gold-hi);
}

.last-shown {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  column-gap: 8px;
  font-size: 13px;
}

.last-shown small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
}

/* ---- the bottom: your cards and buttons ---- */

.poker-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.glass {
  background: rgba(16, 10, 7, 0.78);
  border: 1px solid rgba(255, 220, 160, 0.18);
  border-radius: 16px;
  padding: 12px 14px;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.poker-bar.glass,
.raise-panel {
  align-self: stretch;
  align-items: stretch;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.poker-bar p {
  margin: 0;
}

.waiting {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.5);
  border-radius: 999px;
  padding: 5px 14px;
  margin: 0;
  text-align: center;
}

/* Your two cards, big and fanned, rising over the table's edge. */
.my-cards {
  display: flex;
  justify-content: center;
  margin-top: -46px;
  position: relative;
  z-index: 3;
}

.my-cards .pcard:first-child {
  transform: rotate(-8deg) translateX(6px);
}

.my-cards .pcard:last-child {
  transform: rotate(7deg) translate(-6px, 3px);
}

.my-cards.folded {
  opacity: 0.45;
}

.my-hand {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #1b1206;
  background: linear-gradient(#ffe7a0, #f2b736);
  border-radius: 999px;
  padding: 3px 14px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.pills {
  display: flex;
  justify-content: center;
  gap: 8px;
  width: 100%;
  max-width: 460px;
}

.pill {
  flex: 1;
  font: inherit;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 12px 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.35), inset 0 -3px 0 rgba(0, 0, 0, 0.25), 0 4px 10px rgba(0, 0, 0, 0.45);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.pill:active {
  transform: translateY(1px);
}

.pill-icon {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  font-size: 11px;
}

.pill-red {
  background: linear-gradient(#ef5a4a, #b8231c);
}

.pill-gold {
  background: linear-gradient(#ffd75e, #e89a14);
  color: #2a1700;
  text-shadow: none;
}

.pill-blue {
  background: linear-gradient(#55a6ff, #1f63c9);
}

.pill-dark {
  background: linear-gradient(#3a2a1f, #1c130d);
  border: 1px solid rgba(255, 220, 160, 0.22);
  font-size: 13px;
}

.poker-bar input[type='range'] {
  width: 100%;
  accent-color: var(--gold);
}

.pill:disabled {
  opacity: 0.45;
  cursor: default;
  transform: none;
}

/* ---- a Sit & Go ---- */

.sng-offer p {
  font-size: 13px;
  line-height: 1.35;
  color: var(--text);
}

.chip-icon {
  display: inline-block;
  width: 1.05em;
  height: 1.05em;
  border-radius: 50%;
  background: repeating-conic-gradient(#d63b3b 0 30deg, #fff 30deg 45deg);
  box-shadow: inset 0 0 0 2px #d63b3b, 0 1px 2px rgba(0, 0, 0, 0.4);
  flex: none;
}

.seat.busted {
  opacity: 0.45;
  filter: grayscale(0.7);
}

.sng-over {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 8px 0;
  overflow-y: auto;
}

.sng-kicker {
  margin: 0;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}

.sng-over h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 28px;
  line-height: 1.1;
}

.sng-places {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sng-places li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
}

.sng-places li.me {
  background: rgba(255, 215, 94, 0.14);
  box-shadow: inset 0 0 0 1px rgba(255, 215, 94, 0.5);
}

.sng-pos {
  min-width: 34px;
  text-align: center;
  font-weight: 800;
}

.sng-who {
  flex: 1;
  font-weight: 700;
}

.sng-places small {
  color: var(--muted);
  font-size: 12px;
}

.sng-over .fine {
  margin: 0;
}

.quick {
  display: flex;
  gap: 6px;
}

.quick-btn {
  flex: 1;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 220, 160, 0.2);
  border-radius: 999px;
  padding: 7px 4px;
  cursor: pointer;
}

.buyin-row b {
  color: var(--gold-hi);
  font-size: 18px;
}

/* While the poker table is open: the chat box floats at the bottom of it, the walking controls hide,
   and the chat log sits in the table screen. */
body.poker-open #controls {
  display: none;
}

body.poker-open #hud {
  z-index: 16;
}

body.poker-open #hud {
  display: none;
}

body.poker-open #chat-dock {
  z-index: 16;
  bottom: calc(var(--hud-h, 0px) + 10px + env(safe-area-inset-bottom));
}

#poker #chat-log {
  position: static;
  width: auto;
  max-height: 3.2em;
  flex: none;
  font-size: 12px;
  opacity: 0.9;
}

#poker #chat-log:empty {
  display: none;
}

/* ---------- brief messages ---------- */

/* Brief messages: small, in the top left, sliding in and fading out. */
#toast {
  position: fixed;
  left: 12px;
  top: calc(10px + env(safe-area-inset-top));
  z-index: 30;
  max-width: min(300px, calc(100vw - 110px)); /* clear of the coins and buttons on the right */
  transform: translateX(-8px);
  opacity: 0;
  background: rgba(18, 12, 9, 0.85);
  border: 1px solid rgba(255, 220, 160, 0.18);
  border-radius: 10px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  text-align: left;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}

#toast.shown {
  opacity: 1;
  transform: none;
}

/* On bigger screens the top left has the people count, so messages go just under it. */
@media (min-width: 601px) {
  #toast {
    top: calc(46px + env(safe-area-inset-top));
  }
}

/* ---------- your pubs: Start a pub along the bottom ---------- */

#home.has-foot {
  padding-bottom: calc(96px + env(safe-area-inset-bottom));
}

.home-foot {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, rgba(18, 12, 9, 0.98) 60%, rgba(18, 12, 9, 0));
  display: flex;
  justify-content: center;
}

#home .home-foot .start-btn {
  width: min(440px, 100%);
  font-size: 17px;
  padding: 15px 16px;
}

.back-link {
  align-self: flex-start;
  padding: 0;
  font-size: 15px;
}

/* ---------- who runs vpub: the foot of the screens outside a pub, and Options › About vpub ---------- */

/* The sign-in screen keeps its form in the middle of the screen, with the footer under it. */
#home.signin {
  grid-template-rows: 1fr auto;
}

.site-footer {
  width: min(440px, 100%);
  margin: 56px auto 0;
  padding-top: 26px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 20px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
  text-align: left;
}

.site-footer.in-options {
  width: 100%;
  margin: 0;
  padding: 4px 4px 6px;
  border-top: 0;
}

.site-footer p {
  margin: 0;
}

.about-brand {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.about-mark {
  align-self: flex-start;
  font-size: 18px;
  line-height: 1;
}

.about-lede {
  color: var(--text);
}

.about-links,
.about-contact {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.about-links a,
.about-contact a,
.about-contact span {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  color: var(--muted);
  font-size: 16px;
  text-decoration: none;
}

.about-links a:hover,
.about-contact a:hover {
  color: var(--text);
}

.site-footer .about-label,
#home .site-footer .about-label {
  margin: 0 0 4px;
  font: 700 11.5px/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
}

.about-legal {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font: 11px/1.7 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(246, 234, 214, 0.5);
}

/* (the small print's own colour: in Options it sits in a .card, whose paragraphs are bright) */
.about-legal p {
  color: rgba(246, 234, 214, 0.5);
}

.about-legal .about-trust {
  color: var(--gold);
}

/* Options sits above the floating keyboard, and gets shorter to fit what's left. */
body.kb-float-open #options.sheet {
  padding-bottom: calc(var(--kb-h, 0px) + 8px);
}

body.kb-float-open .options-card {
  max-height: calc(100dvh - var(--kb-h, 0px) - 20px - env(safe-area-inset-top));
}

/* ---------- a poster, full size ---------- */

/* It hangs on a piece of the pub's wall: green striped wallpaper above wood panelling. */
#poster-view,
#board-view,
#telly-view {
  z-index: 22;
  padding: calc(16px + env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom));
  background:
    linear-gradient(to bottom, transparent 78%, #a56c43 78%, #a56c43 79%, #8e5b37 79%),
    repeating-linear-gradient(to right, #7f9e6e 0 24px, #739262 24px 48px);
  opacity: 0;
  transition: opacity 0.2s ease;
}

#poster-view.shown,
#board-view.shown,
#telly-view.shown {
  opacity: 1;
}

.poster-wall {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  transform: scale(0.96);
  transition: transform 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.1);
}

#poster-view.shown .poster-wall {
  transform: none;
}

/* A dark wooden frame with a cream mount, casting a shadow on the wall. */
.poster-frame {
  position: relative;
  padding: 12px;
  background: linear-gradient(145deg, #6e4224, #3e2210);
  border-radius: 4px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5), inset 0 0 0 2px rgba(255, 220, 170, 0.15);
}

.poster-frame img {
  display: block;
  max-width: min(78vw, 520px);
  max-height: calc(100dvh - 190px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  border: 8px solid #efe6d2;
  background: #efe6d2;
}

/* A drawing pin at the top. */
.poster-frame::before {
  content: '';
  position: absolute;
  top: -7px;
  left: 50%;
  width: 14px;
  height: 14px;
  margin-left: -7px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ff8a80, #d23a3a 55%, #8e1f1a);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.poster-close {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top));
  right: 12px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 220, 160, 0.3);
  background: rgba(18, 12, 9, 0.75);
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
  z-index: 1;
}

/* ---------- the telly (js/telly.js) ---------- */

/* Its player, while it's on: over the pub, under everything else on screen (it comes just after #game), laid over
   the telly's screen on the wall and no use to a tap; up close, over #telly-view, its controls to hand. It never
   moves in the page, as moving an iframe would reload it. */
#telly-layer {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: var(--hud-h, 220px);
  overflow: hidden;
  pointer-events: none;
}

#telly-layer.up-close {
  bottom: 0;
  z-index: 23; /* above #telly-view */
  overflow: visible;
}

body[data-net='wait'] #telly-layer:not(.up-close),
body[data-net='off'] #telly-layer:not(.up-close) {
  opacity: 0.6; /* dimmed with the pub */
}

#telly-layer iframe {
  position: absolute;
  left: 0;
  top: 0;
  width: 480px;
  height: 270px;
  border: 0;
  transform-origin: 0 0;
  background: #000;
}

#telly-layer.up-close iframe {
  pointer-events: auto;
  border-radius: 3px;
}

/* Up close it hangs on a piece of the pub's wall, as a poster does, its arm going back off to the right. */
.telly-wall {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.telly-set {
  position: relative;
  padding: 9px 9px 14px;
  border-radius: 10px;
  background: linear-gradient(#272b32, #111317);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* The bracket's arm, behind the set and back to the wall. */
.telly-set::before {
  content: '';
  position: absolute;
  top: 40%;
  right: -60px;
  width: 70px;
  height: 12px;
  border-radius: 4px;
  background: linear-gradient(#545b66, #23272d);
  z-index: -1;
}

/* Its standby light, green while it's on. */
.telly-set::after {
  content: '';
  position: absolute;
  right: 14px;
  bottom: 5px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #5be37a;
  box-shadow: 0 0 6px #5be37a;
}

.telly-hole {
  width: min(86vw, 640px, calc((100dvh - 230px) * 16 / 9));
  min-width: 260px;
  aspect-ratio: 16 / 9;
  min-height: 200px; /* the least YouTube asks for */
  border-radius: 3px;
  background: #000;
}

.telly-note {
  margin: 0;
  min-height: 1.3em;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}

.telly-note:empty {
  visibility: hidden;
}

.telly-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

/* ---------- poker: watching, choosing a seat, your info, animations ---------- */

/* Watching: the whole table flat from above, a bit bigger, no buttons. */
#poker.watching .table-top {
  transform: none;
}

#poker.watching .table {
  width: min(100cqw, 80cqh);
}

@media (orientation: landscape) {
  #poker.watching .table {
    width: min(100cqw, 165cqh);
  }
}

.poker-join {
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  color: #2a1700;
  background: linear-gradient(#ffd75e, #e89a14);
  border: 0;
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
}

/* The seat you've picked to sit in. */
.seat.free.chosen .sit {
  border-style: solid;
  border-color: var(--gold-hi);
  background: rgba(255, 207, 90, 0.2);
}

/* The pot sits under the board; an empty one keeps its space so nothing jumps. */
.chips.pot.placeholder {
  visibility: hidden;
}

/* Your stack, dealer button and turn timer, under your cards with your hand's name. */
.me-side {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.my-info {
  display: flex;
  align-items: center;
  gap: 6px;
}

.my-info .seat-stack {
  margin: 0;
}

.dealer-button.inline {
  position: static;
  width: 20px;
  height: 20px;
}

.my-timer {
  width: 70px;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.15);
  overflow: hidden;
}

.my-timer-fill {
  display: block;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #ffd75e, #8fe39a);
}

.me-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.poker-bar .me-row .my-cards {
  margin-top: -40px;
}

.pills.small .pill {
  flex: none;
  padding: 7px 14px;
  font-size: 12px;
}

/* Cards dealt out from the middle of the table to each seat, one after another. */
.seat-cards.deal {
  animation: deal-in 0.45s cubic-bezier(0.2, 0.8, 0.3, 1) both;
}

.seat[data-k='1'] .seat-cards.deal { animation-delay: 0.06s; }
.seat[data-k='2'] .seat-cards.deal { animation-delay: 0.12s; }
.seat[data-k='3'] .seat-cards.deal { animation-delay: 0.18s; }
.seat[data-k='4'] .seat-cards.deal { animation-delay: 0.24s; }
.seat[data-k='5'] .seat-cards.deal { animation-delay: 0.3s; }
.seat[data-k='6'] .seat-cards.deal { animation-delay: 0.36s; }
.seat[data-k='7'] .seat-cards.deal { animation-delay: 0.42s; }

@keyframes deal-in {
  from {
    transform: translate(var(--fx, 0), var(--fy, 0)) scale(0.5) rotate(-30deg);
    opacity: 0;
  }
}

/* Your two cards arrive last, sliding up and fanning out. */
.my-cards.deal .pcard {
  animation: my-deal 0.5s cubic-bezier(0.2, 0.8, 0.3, 1) both;
}

.my-cards.deal .pcard:first-child { animation-delay: 0.45s; }
.my-cards.deal .pcard:last-child { animation-delay: 0.55s; }

@keyframes my-deal {
  from {
    transform: translateY(-160px) scale(0.4) rotate(0deg);
    opacity: 0;
  }
}

/* A new card on the board turns over. */
.pcard.flip {
  animation: flip-in 0.45s ease-out both;
}

@keyframes flip-in {
  0% {
    transform: rotateY(90deg) scale(0.85);
    opacity: 0.3;
  }
  100% {
    transform: none;
  }
}

/* A new or bigger bet pops in. */
.chips.bet.pop {
  animation: pop 0.35s ease-out both;
}

@keyframes pop {
  0% {
    transform: translate(-50%, -50%) scale(0.3);
  }
  60% {
    transform: translate(-50%, -50%) scale(1.15);
  }
}

.chips.pot.pulse {
  animation: pulse 0.5s ease-out;
}

@keyframes pulse {
  40% {
    transform: scale(1.18);
  }
}

/* Folded cards thrown in, and the pot sliding to the winner. */
.flying {
  position: absolute;
  z-index: 4;
  transform: translate(-50%, -50%);
  pointer-events: none;
  display: flex;
}

.flying.muck .pcard:last-child {
  margin-left: -10px;
}

@media (prefers-reduced-motion: reduce) {
  .seat-cards.deal,
  .my-cards.deal .pcard,
  .pcard.flip,
  .chips.bet.pop,
  .chips.pot.pulse {
    animation: none;
  }
}

/* You won the hand: your cards glow. */
.my-cards.won .pcard {
  box-shadow: 0 0 0 3px var(--gold-hi), 0 0 22px 6px rgba(255, 210, 90, 0.7);
}

.poker-tag,
.poker-join {
  white-space: nowrap;
}

/* The camera icon beside the mic: only at the poker table and the table games (elsewhere it's in Options). */
#cam-btn {
  flex: none;
  width: 32px;
  height: 32px;
  display: none;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

body.poker-open #cam-btn:not([hidden]) {
  display: grid;
}

#cam-btn .cam-slash {
  fill: none;
}

#cam-btn[aria-pressed='true'] {
  color: #fff;
  background: #2f74d0;
}

#cam-btn[aria-pressed='true'] .cam-slash {
  display: none;
}

#cam-btn.starting {
  opacity: 0.6;
}

/* Stand up: small, at the top of the poker screen. */
.poker-stand {
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  color: var(--text);
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 220, 160, 0.25);
  border-radius: 999px;
  padding: 6px 11px;
  cursor: pointer;
}

.poker-stand.armed {
  color: #fff;
  background: linear-gradient(#ef5a4a, #b8231c);
  border-color: transparent;
}

/* The seat you'll get when you sit down. */
.seat.free.chosen .sit {
  pointer-events: none;
}

/* The chat history's show/hide arrow, at the left of the chat box: down hides it, up shows it. A
   dot means something was said while it was hidden. */
#log-toggle {
  position: relative;
  flex: none;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

#log-toggle svg {
  transition: transform 0.2s ease;
}

#log-toggle[aria-pressed='false'] svg {
  transform: rotate(180deg);
}

#log-toggle.unread::after {
  content: '';
  position: absolute;
  top: 3px;
  right: 3px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 2px rgba(18, 12, 9, 0.9);
}

body.log-hidden #chat-log {
  display: none !important;
}

/* ---------- the Drinks League chalkboard, opened big ---------- */

#board-view {
  overflow-y: auto;
  align-items: start;
}

.board-wall {
  width: min(560px, 100%);
  margin: auto;
  padding-top: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  transform: scale(0.96);
  transition: transform 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.1);
}

#board-view.shown .board-wall {
  transform: none;
}

/* An oak frame round a slate, rubbed with old chalk. */
.chalkboard {
  width: 100%;
  padding: 12px;
  background: linear-gradient(145deg, #9a6a3e, #5e3a1c);
  border-radius: 6px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5), inset 0 0 0 2px rgba(255, 220, 170, 0.18);
}

.slate {
  --chalk: #f4efe0;
  padding: 16px 16px 14px;
  border-radius: 2px;
  color: var(--chalk);
  font-family: 'Chalkboard SE', 'Comic Sans MS', 'Segoe Print', 'Bradley Hand', cursive;
  background:
    radial-gradient(ellipse at 20% 30%, rgba(255, 255, 255, 0.07), transparent 45%),
    radial-gradient(ellipse at 75% 70%, rgba(255, 255, 255, 0.05), transparent 50%),
    radial-gradient(ellipse at 60% 15%, rgba(255, 255, 255, 0.04), transparent 35%),
    #2c3832;
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.55);
  text-shadow: 0 0 1px rgba(244, 239, 224, 0.6);
  max-height: calc(100dvh - 260px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  min-height: 160px;
  overflow-y: auto;
}

.chalk-title {
  margin: 0;
  text-align: center;
  font-size: 24px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.chalk-league {
  margin: 2px 0 12px;
  text-align: center;
  font-size: 15px;
  opacity: 0.85;
  border-bottom: 2px solid rgba(244, 239, 224, 0.45);
  padding-bottom: 8px;
}

.chalk-note {
  margin: 10px 0;
  text-align: center;
  font-size: 15px;
}

.chalk-note.small {
  font-size: 13px;
  opacity: 0.8;
}

.chalk-table {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 16px;
}

.chalk-table li {
  display: grid;
  grid-template-columns: 2.2em 1fr 3.2em 3em;
  align-items: baseline;
  gap: 6px;
  padding: 4px 2px;
  border-bottom: 1px dashed rgba(244, 239, 224, 0.18);
}

.chalk-table .chalk-head {
  font-size: 12px;
  opacity: 0.7;
  border-bottom: 0;
  padding-bottom: 0;
}

.chalk-head span:nth-child(n + 3),
.chalk-num {
  text-align: right;
}

.chalk-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Coloured chalk for the zones, and you circled. */
.chalk-table li.zone-title .chalk-pos {
  color: #ffd66b;
}

.chalk-table li.zone-europe .chalk-pos {
  color: #8fd3ff;
}

.chalk-table li.zone-drop .chalk-pos {
  color: #ff9a8a;
}

.chalk-table li.you {
  border: 2px solid rgba(255, 214, 107, 0.75);
  border-radius: 14px 10px 16px 9px;
}

/* The board's two sides: the drinks table, and the Games Room. */
.chalk-tabs {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: -4px 0 10px;
}

.chalk-tab {
  font: inherit;
  font-size: 14px;
  color: var(--chalk);
  background: transparent;
  border: 2px solid transparent;
  border-radius: 12px 9px 13px 8px;
  padding: 3px 12px;
  opacity: 0.7;
  cursor: pointer;
}

.chalk-tab[aria-selected='true'] {
  border-color: rgba(244, 239, 224, 0.6);
  opacity: 1;
}

.chalk-sub {
  margin: 14px 0 6px;
  font-size: 14px;
  font-weight: normal;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.8;
  text-align: center;
}

.chalk-bests {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 14px;
}

.chalk-bests li {
  display: grid;
  grid-template-columns: 7.6em 1fr;
  gap: 8px;
  padding: 3px 2px;
  border-bottom: 1px dashed rgba(244, 239, 224, 0.18);
}

.chalk-game {
  white-space: nowrap;
}

.chalk-best {
  opacity: 0.9;
}

.chalk-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 14px;
}

.chalk-link {
  font: inherit;
  font-size: 14px;
  color: var(--chalk);
  background: transparent;
  border: 2px solid rgba(244, 239, 224, 0.6);
  border-radius: 12px 9px 13px 8px;
  padding: 6px 12px;
  cursor: pointer;
}

/* The latest photos, stuck to the wall under the board. */
.polaroids {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px 12px;
  padding: 0 4px 24px;
}

.polaroid {
  margin: 0;
  width: 82px;
  padding: 5px 5px 4px;
  background: #fbf8f0;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.4);
  transform: rotate(var(--tilt, 0deg));
  position: relative;
}

.polaroid::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  width: 34px;
  height: 12px;
  margin-left: -17px;
  background: rgba(240, 230, 190, 0.75);
  transform: rotate(calc(var(--tilt, 0deg) * -0.5));
}

.polaroid img {
  display: block;
  width: 72px;
  height: 72px;
  object-fit: cover;
  background: #ddd6c4;
}

.polaroid figcaption {
  margin-top: 3px;
  text-align: center;
  font-family: 'Bradley Hand', 'Segoe Print', 'Comic Sans MS', cursive;
  font-size: 11px;
  color: #3a2c20;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- the beer pong screen ---------- */

/* Over the whole pub (which isn't drawn behind it: see scene.pause), with the table on a canvas in
   the middle, a scoreboard of pints along the top, and the chat box floating at the bottom. */
#beerpong,
.game-screen {
  --gold-hi: #ffe08a;
  position: fixed;
  inset: 0;
  z-index: 15;
  color: var(--text);
  background:
    radial-gradient(ellipse at 50% 30%, #4a2e1b, #1d120b 75%),
    #1d120b;
}

body.bp-open #game {
  visibility: hidden;
}

.bp-inner {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: calc(8px + env(safe-area-inset-top)) 10px calc(var(--hud-h, 0px) + var(--chat-h) + 10px + env(safe-area-inset-bottom));
  max-width: 1100px;
  margin: 0 auto;
}

.bp-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bp-head .spacer {
  flex: 1;
}

.bp-help-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(255, 220, 160, 0.25);
  background: rgba(0, 0, 0, 0.5);
  color: var(--text);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

/* The scoreboard: Red v Blue, each player's face, name, pint (five sips) and points. */
.bp-board {
  display: flex;
  align-items: stretch;
  gap: 6px;
  min-height: 0;
}

.bp-board:empty {
  display: none;
}

.bp-team {
  --team: #e8503a;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 220, 160, 0.14);
  border-top: 3px solid var(--team);
  border-radius: 12px;
  padding: 4px 7px 6px;
}

.bp-team.team-1 {
  --team: #3aa0f0;
}

.bp-team-name {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--team);
}

.bp-vs {
  align-self: center;
  font-size: 13px;
  font-weight: 900;
  color: var(--muted);
}

.bp-chip {
  position: relative;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  grid-template-areas: 'face name points' 'face pint points';
  align-items: center;
  column-gap: 7px;
  row-gap: 3px;
  min-height: 32px;
}

.bp-face {
  grid-area: face;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--team, #e8503a), 0 2px 6px rgba(0, 0, 0, 0.5);
}

.bp-free-face {
  display: block;
  width: 22px;
  height: 22px;
  margin: 0 5px;
  background: rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.16);
}

.bp-name {
  grid-area: name;
  min-width: 0;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* A free corner: one quiet line. */
.bp-chip.bp-free {
  min-height: 22px;
  grid-template-areas: 'face name name';
}

.bp-chip.bp-free .bp-name {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.bp-chip.mine .bp-name {
  color: var(--gold-hi);
}

/* The pint: five little glasses, full or drunk. */
.bp-pint {
  grid-area: pint;
  display: flex;
  gap: 2px;
}

.bp-pint i {
  width: 7px;
  height: 10px;
  border-radius: 1px 1px 2.5px 2.5px;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.bp-pint i.full {
  background: linear-gradient(#fff6e0 0 28%, #f0ac30 28%);
  box-shadow: none;
}

.bp-points {
  grid-area: points;
  font-size: 16px;
  color: var(--gold-hi);
}

.bp-chip em {
  grid-area: points;
  font-style: normal;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.06em;
  color: #fff;
  background: #b8231c;
  border-radius: 999px;
  padding: 2px 7px;
}

.bp-chip.out {
  opacity: 0.5;
}

/* Serving: the face's ring pulses. */
.bp-chip.serving .bp-face {
  animation: bp-serving 1s ease-in-out infinite;
}

@keyframes bp-serving {
  50% {
    box-shadow: 0 0 0 3px var(--gold-hi), 0 0 12px var(--gold-hi);
  }
}

.bp-chip.talking .bp-face {
  box-shadow: 0 0 0 3px #3fd17a, 0 0 12px #3fd17a;
}

.bp-unbot {
  position: absolute;
  left: 20px;
  top: -4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 0;
  background: #b8231c;
  color: #fff;
  font-size: 10px;
  line-height: 18px;
  padding: 0;
  cursor: pointer;
}

/* The table. */
.bp-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  border-radius: 16px;
  overflow: hidden;
  background: #3a2414;
  box-shadow: inset 0 0 0 1px rgba(255, 220, 160, 0.12), 0 6px 20px rgba(0, 0, 0, 0.5);
  /* Your finger steers the bat: no scrolling or zooming here. */
  touch-action: none;
  cursor: crosshair;
}

.bp-canvas {
  position: absolute;
  inset: 0;
  display: block;
}

.bp-status {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100% - 20px);
  width: max-content;
  background: rgba(16, 10, 7, 0.72);
  border: 1px solid rgba(255, 220, 160, 0.18);
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  pointer-events: none;
}

/* Big moments, cut from paper: SIP!, DOWN IT!, YOU WIN! */
.bp-banner {
  position: absolute;
  top: 30%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.6) rotate(-3deg);
  opacity: 0;
  pointer-events: none;
  font-size: clamp(20px, 6vw, 34px);
  font-weight: 900;
  letter-spacing: 0.02em;
  color: #2a1700;
  background: #ffd24a;
  border-radius: 10px;
  padding: 8px 18px 6px;
  box-shadow: 4px 5px 0 rgba(0, 0, 0, 0.3);
  white-space: nowrap;
  max-width: 94%;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity 0.18s, transform 0.25s cubic-bezier(0.3, 1.6, 0.5, 1);
}

.bp-banner.shown {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1) rotate(-3deg);
}

.bp-banner.down,
.bp-banner.out {
  color: #fff;
  background: #e8503a;
}

.bp-banner.good {
  background: #fff6e0;
}

.bp-banner.win {
  background: linear-gradient(#ffe7a0, #f2b736);
  font-size: clamp(24px, 8vw, 44px);
}

/* The result, and the table's records, in a card at the bottom of the table. */
.bp-card {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  width: min(94%, 440px);
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.bp-card[hidden] {
  display: none;
}

.bp-result,
.bp-records {
  background: rgba(16, 10, 7, 0.84);
  border: 1px solid rgba(255, 220, 160, 0.2);
  border-radius: 14px;
  padding: 10px 12px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
}

.bp-res-teams {
  display: flex;
  gap: 10px;
}

.bp-res-team {
  flex: 1;
  min-width: 0;
}

.bp-res-team h3,
.bp-records h3 {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 900;
  color: #e8503a;
}

.bp-res-team.team-1 h3 {
  color: #3aa0f0;
}

.bp-res-team.won h3 {
  color: var(--gold-hi);
}

.bp-res-team p {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  margin: 2px 0;
  font-size: 12px;
}

.bp-res-team p span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bp-res-down,
.bp-next {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

.bp-records h3 {
  color: var(--gold-hi);
}

.bp-records ol {
  margin: 0;
  padding-left: 18px;
  font-size: 12px;
  color: var(--muted);
}

.bp-records b {
  color: var(--text);
}

/* Under the table: buttons, the queue, and the pub's chat. */
.bp-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.bp-bar .pill {
  padding: 10px 12px;
  font-size: 14px;
}

.bp-queue,
.bp-queue-note {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-align: center;
}

.bp-queue-note {
  align-self: center;
  flex: 1.2;
  color: var(--gold-hi);
}

.bp-help ul {
  padding-left: 18px;
  margin: 8px 0;
}

.bp-help li {
  margin: 4px 0;
}

.game-screen #chat-log {
  position: static;
  width: 100%;
  max-height: 3.2em;
  flex: none;
  font-size: 12px;
  opacity: 0.9;
}

.game-screen #chat-log:empty {
  display: none;
}

/* Playing a game: more room for the table, one line of chat (each message on one line). */
.game-screen.bp-playing #chat-log {
  max-height: 1.6em;
}

.game-screen.bp-playing #chat-log li {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* While the table's open the walking controls hide, and the chat box floats at the bottom of it, with
   the camera switch beside the live mic. */
body.bp-open #controls {
  display: none;
}

body.bp-open #hud {
  z-index: 16;
}

body.bp-open #hud {
  display: none;
}

body.bp-open #chat-dock {
  z-index: 16;
  bottom: calc(var(--hud-h, 0px) + 10px + env(safe-area-inset-bottom));
}

body.bp-open #cam-btn:not([hidden]) {
  display: grid;
}

body.bp-open #prompt {
  display: none;
}

@media (min-width: 700px) and (min-height: 560px) {
  .bp-face:not(.bp-free-face) {
    width: 40px;
    height: 40px;
  }
  .bp-chip {
    grid-template-columns: 40px minmax(0, 1fr) auto;
  }
  .bp-name {
    font-size: 13px;
  }
}

/* ---------- the darts screen (the rest is the beer pong screen's) ---------- */

#darts {
  background:
    radial-gradient(ellipse at 50% 30%, #2f3b2c, #141a12 75%),
    #141a12;
}

/* Everyone in the game on one board, in throwing order. */
.dt-board .dt-team {
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 28px;
  border-top-color: var(--gold-hi);
}

.dt-team .dt-chip {
  flex: 0 1 210px;
  min-width: 112px;
  grid-template-areas: 'face name points' 'face note points';
}

.dt-note {
  grid-area: note;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}

.dt-note.bad {
  color: #ff8a6a;
}

.dt-stage {
  background: #1b231b;
}

/* The round (or what's needed) over the board, the visit's darts under it. */
.dt-round {
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: min(94%, 460px);
  pointer-events: none;
}

.dt-round[hidden],
.dt-visit[hidden] {
  display: none;
}

.dt-round-in {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 2px 8px;
  background: rgba(16, 10, 7, 0.82);
  border: 1px solid rgba(255, 220, 160, 0.2);
  border-radius: 12px;
  padding: 5px 12px;
  font-size: 13px;
  text-align: center;
}

.dt-round-in b {
  font-size: 16px;
  color: var(--gold-hi);
}

.dt-round-in small {
  font-size: 11px;
  color: var(--muted);
}

.dt-round-in .dt-next {
  flex-basis: 100%;
}

.dt-fin i {
  font-style: normal;
  font-weight: 900;
  background: #ffd24a;
  color: #2a1700;
  border-radius: 6px;
  padding: 1px 6px;
  margin-left: 4px;
}

.dt-visit {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.dt-slots {
  display: flex;
  gap: 6px;
}

.dt-slot {
  min-width: 52px;
  padding: 6px 8px;
  border-radius: 10px;
  background: rgba(16, 10, 7, 0.78);
  border: 1px dashed rgba(255, 220, 160, 0.25);
  font-size: 14px;
  font-weight: 900;
  color: var(--muted);
  text-align: center;
}

.dt-slot.hit {
  border-style: solid;
  border-color: #ffd24a;
  color: #ffd24a;
}

.dt-slot.miss {
  color: #ffb4a0;
}

.dt-visit small {
  font-weight: 800;
  color: var(--gold-hi);
  background: rgba(16, 10, 7, 0.78);
  padding: 4px 8px;
  border-radius: 999px;
}

/* During a game the status line sits just over the visit's darts. */
.dt-stage.dt-playing .bp-status {
  top: auto;
  bottom: 54px;
}

/* Picking the game, before it starts. */
.bp-card .dt-chooser {
  pointer-events: auto;
}

.dt-opts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 5px 0;
}

.dt-opts.small span {
  font-size: 12px;
  color: var(--muted);
}

.dt-opt {
  flex: 1;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 220, 160, 0.25);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.dt-opt.on {
  background: #ffd24a;
  border-color: #ffd24a;
  color: #2a1700;
}

.dt-opt:disabled {
  cursor: default;
}

.dt-sub {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.dt-chooser p {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.dt-result ol {
  margin: 4px 0;
  padding: 0;
  list-style: none;
}

.dt-result li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 0;
  font-size: 13px;
}

.dt-result li.won {
  color: var(--gold-hi);
  font-weight: 800;
}

/* At real boards: your throw. Drinks League's score input board goes under the board, with the round
   and the visit's darts over its keys (the board picture takes what room is left). */
.dt-pad {
  position: relative;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  gap: 6px;
  width: 100%;
  max-width: 560px;
  align-self: center;
  padding: 8px;
  border-radius: 16px;
  background: rgba(16, 10, 7, 0.62);
  border: 1px solid rgba(255, 220, 160, 0.14);
}

.dt-pad[hidden] {
  display: none;
}

.dt-pad-top,
.dt-keys {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dt-pad .dt-round,
.dt-pad .dt-visit,
.dt-pad .bp-status {
  position: static;
  transform: none;
  width: auto;
  max-width: none;
  margin: 0 auto;
}

.dt-pad .bp-status[hidden],
.dt-pad .dt-round[hidden],
.dt-pad .dt-visit[hidden] {
  display: none;
}

.dt-pad .dt-round-in {
  padding: 4px 10px;
}

.dt-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.dt-tabs button {
  min-height: 38px;
  padding: 2px 0 0;
  border: 0;
  border-radius: 4px 20px 20px 4px;
  background: rgba(255, 240, 220, 0.1);
  color: var(--text);
  font: inherit;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
}

.dt-tabs button[aria-selected='true'] {
  background: #f5b700;
  color: #0f211a;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.16);
}

.dt-tabs button:disabled {
  opacity: 0.3;
  cursor: default;
}

.dt-nums {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.dt-nb {
  min-height: clamp(38px, 6vh, 52px);
  padding: 2px 0 0;
  border: 0;
  border-radius: 4px 14px 14px 4px;
  font: inherit;
  font-size: 21px;
  font-weight: 900;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(233, 239, 230, 0.22);
  transition: transform 0.06s ease;
  cursor: pointer;
}

.dt-nb:active:not(:disabled),
.dt-wide button:active:not(:disabled),
.dt-acts button:active:not(:disabled) {
  transform: translateY(1px);
}

.dt-nb:disabled,
.dt-wide button:disabled,
.dt-acts button:disabled {
  opacity: 0.16;
  box-shadow: none;
  cursor: default;
}

.dt-wide {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.dt-wide button,
.dt-acts button {
  min-height: 42px;
  padding: 2px 4px 0;
  border: 0;
  border-radius: 4px 22px 22px 4px;
  font: inherit;
  font-size: 16px;
  font-weight: 900;
  white-space: nowrap;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(233, 239, 230, 0.22);
  cursor: pointer;
}

.dt-acts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.dt-acts.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* The four colours of a dartboard, a miss and the save, as on Drinks League's darts. */
.dt-bed-black {
  background: #050807;
  color: #fff;
}

.dt-bed-cream {
  background: #f7e6b0;
  color: #0f211a;
}

.dt-bed-red,
.dt-acts .dt-fail {
  background: #d3302f;
  color: #fff;
}

.dt-bed-green,
.dt-acts .dt-done {
  background: #23915a;
  color: #fff;
}

.dt-bed-miss {
  background: #f26a1b;
  color: #0f211a;
}

.dt-bed-save {
  background: #2d6be0;
  color: #fff;
}

.dt-acts .dt-undo {
  background: rgba(255, 240, 220, 0.06);
  color: var(--text);
  box-shadow: inset 0 0 0 2px rgba(233, 239, 230, 0.36);
}

.dt-acts .dt-undo:disabled {
  opacity: 0.35;
}

#darts.dt-marking .dt-stage {
  min-height: 96px;
}

/* (the scores stay in sight, up to three to a row) */
#darts.dt-marking .bp-board {
  flex-shrink: 0;
}

#darts.dt-marking .dt-team {
  gap: 4px 10px;
}

#darts.dt-marking .dt-team .dt-chip {
  flex: 1 1 30%;
  min-width: 0;
}

.dt-how {
  margin: 0 0 4px;
}

/* Most phones: the keys come first, and the board picture steps aside (the keys sit at the bottom, by your thumb). */
@media (max-height: 760px) {
  #darts.dt-marking .dt-stage {
    display: none;
  }
  #darts.dt-marking .dt-pad {
    margin-top: auto;
  }
}

/* A wide screen: the board on the left, the keys on the right. */
@media (min-width: 900px) and (orientation: landscape) {
  #darts.dt-marking .bp-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 460px);
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    column-gap: 10px;
  }
  #darts.dt-marking .bp-head,
  #darts.dt-marking .bp-board,
  #darts.dt-marking .bp-bar {
    grid-column: 1 / -1;
  }
  #darts.dt-marking .dt-stage {
    grid-column: 1;
    grid-row: 3;
  }
  #darts.dt-marking .dt-pad {
    grid-column: 2;
    grid-row: 3;
    align-self: start;
    max-height: 100%;
    overflow: auto;
  }
}

/* ---------- the quiz machine's screen (js/quiz/screen.js) ----------
   Drinks League's Pub Quiz as it looks there (its quiz.css): the chalkboard in its wooden frame, the
   subjects' chalk emblems, the pint that is the clock, and the four answers on paper buttons, lettered
   in lager yellow. Its colours are set here, on the screen, so the rules below read as they do there. */
#quiz {
  --paper: #f2ecdf;
  --ink: #1d1712;
  --ink-dim: rgba(29, 23, 18, 0.66);
  --lager: #f5b700;
  --coal: #0f211a;
  --chalk: #f2f5ef;
  --chalk-dim: rgba(242, 245, 239, 0.76);
  --tint: rgba(29, 23, 18, 0.08);
  --edge: rgba(0, 0, 0, 0.22);
  --drop-pitch: #ff8177;
  --bad-tint: #fbe3e1;
  --drop-ink: #b8231c;
  --display: 'League Gothic', 'Arial Narrow', Impact, sans-serif;
  --body: 'Atkinson Hyperlegible Next', system-ui, sans-serif;
  background:
    radial-gradient(ellipse at 50% 20%, #2c3550, #0d1222 75%),
    #0d1222;
}

#quiz .bp-inner {
  gap: 8px;
}

.qz-front {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 2px 6px 4px;
}

.qz-answers[hidden] {
  display: none;
}

/* the chalkboard takes the room there is, so the answers sit at the foot of the screen */
.qz-front > .board,
.qz-front > .slate {
  flex: 1 1 auto;
  min-height: 150px;
}

.qz-front > .slate.read {
  flex-grow: 0.6;
  justify-content: center;
}

.qz-answers {
  flex: none;
  padding: 0 6px;
}

#quiz .emblem {
  display: block;
  flex: none;
  width: 64px;
  height: 64px;
  overflow: visible;
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#quiz .emblem .w { stroke: #f2f5ef; }
#quiz .emblem .y { stroke: #f5b700; }
#quiz .emblem .c { stroke: #ff8177; fill: rgba(255, 129, 119, 0.22); }
#quiz .emblem .f { fill: rgba(245, 183, 0, 0.26); stroke: none; }
#quiz .emblem .fy { fill: rgba(245, 183, 0, 0.3); stroke: #f5b700; }
#quiz .emblem .d { fill: #f2f5ef; stroke: none; }
#quiz .emblem .dy { fill: #f5b700; stroke: none; }
#quiz .emblem.small { width: 40px; height: 40px; stroke-width: 3.6; }
#quiz .emblem.big { width: clamp(84px, 16vh, 150px); height: clamp(84px, 16vh, 150px); }
#quiz .emblem.ghost {
  position: absolute;
  right: 6px;
  bottom: 8px;
  width: clamp(110px, 20vh, 190px);
  height: clamp(110px, 20vh, 190px);
  opacity: 0.1;
  pointer-events: none;
}
.qz-em { display: contents; }
.chalk-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* the chalkboard: a slate for a question, a board for an announcement */
#quiz .slate,
#quiz .board {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px;
  border: 7px solid #a8733a;
  border-radius: 5px;
  background:
    radial-gradient(120% 90% at 12% 8%, rgba(242, 245, 239, 0.055), transparent 60%),
    linear-gradient(118deg, transparent 0 18%, rgba(242, 245, 239, 0.045) 18% 31%, transparent 31% 57%, rgba(242, 245, 239, 0.035) 57% 66%, transparent 66%),
    #1b2927;
  color: #f2f5ef;
  box-shadow: inset 0 0 0 2px #0b1220, inset 0 0 22px rgba(0, 0, 0, 0.35), 0 0 0 2px #0b1220, 0 5px 0 rgba(0, 0, 0, 0.28);
}
#quiz .board {
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 16px 14px 18px;
  text-align: center;
}
#quiz .board .kicker {
  margin: 0;
  color: var(--lager);
  font: 400 21px/1 var(--display);
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
#quiz .board.sudden .kicker { color: var(--drop-pitch); }
#quiz .board h1 {
  margin: 0;
  max-width: 100%;
  font: 400 clamp(38px, 11vw, 58px) / 0.92 var(--display);
  text-transform: uppercase;
  text-wrap: balance;
}
#quiz .board p {
  margin: 0;
  max-width: 44ch;
  font: 500 14px/1.35 var(--body);
  color: rgba(242, 245, 239, 0.86);
}
#quiz .board .qz-rule { color: rgba(242, 245, 239, 0.7); font-size: 13px; }
.qz-crest { width: 88px; height: 88px; margin: -4px 0 0; }

#quiz .pips { display: flex; gap: 9px; margin-top: 6px; }
#quiz .pips i { width: 24px; height: 6px; border-radius: 3px; background: rgba(242, 245, 239, 0.2); }
#quiz .pips .done { background: #f2f5ef; }
#quiz .pips .now { background: var(--lager); }

#quiz .subjects-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px 6px;
  width: 100%;
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
}
#quiz .subjects-list li {
  display: grid;
  justify-items: center;
  gap: 3px;
  color: rgba(242, 245, 239, 0.8);
  font: 600 11px/1.15 var(--body);
  text-wrap: balance;
}
#quiz .subjects-list .emblem { width: 38px; height: 38px; stroke-width: 3.4; }

.qz-count {
  margin: 0;
  text-align: center;
  font: 800 15px/1.2 var(--body);
  color: var(--gold-hi);
}
.qz-records { position: static; transform: none; width: auto; }
.qz-watch { margin: 0; text-align: center; font-size: 13px; color: var(--muted); }

/* the slate's top line: the subject's emblem, the subject and which question, and the clock */
#quiz .slate-top {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas: "em subj clock" "em qn clock";
  align-items: center;
  gap: 4px 10px;
}
#quiz .slate.read .slate-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
#quiz .slate-top .emblem { grid-area: em; }
#quiz .slate-top .subj {
  grid-area: subj;
  align-self: end;
  overflow: hidden;
  color: var(--lager);
  font: 400 23px/1 var(--display);
  letter-spacing: 0.05em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}
#quiz .slate-top .qn {
  grid-area: qn;
  align-self: start;
  color: rgba(242, 245, 239, 0.74);
  font: 700 12px/1 var(--body);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
#quiz .slate.sudden .slate-top .subj,
#quiz .slate.sudden .slate-top .qn { color: var(--drop-pitch); }
#quiz .slate-q {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  margin: 0;
  min-height: 3.9em;
  font: 600 clamp(18px, 3vh, 25px) / 1.3 var(--body);
  text-wrap: balance;
}
#quiz .slate.read .slate-q { min-height: 0; font-size: clamp(16px, 2.4vh, 19px); }

/* the clock: a pint that goes down, and the seconds left */
#quiz .clock { grid-area: clock; display: flex; align-items: center; gap: 8px; }
#quiz .pint { display: block; flex: none; width: 33px; height: 46px; overflow: visible; }
#quiz .pint-glass-in { fill: rgba(242, 245, 239, 0.07); }
#quiz .pint-beer { fill: #f5b700; }
#quiz .pint-head { fill: #fff6dc; }
#quiz .pint-fizz { fill: none; stroke: rgba(255, 255, 255, 0.8); stroke-width: 2.4; stroke-linecap: round; }
#quiz .pint-glass { fill: none; stroke: #f2f5ef; stroke-width: 2.6; stroke-linejoin: round; }
#quiz .pint-shine { fill: none; stroke: rgba(255, 255, 255, 0.5); stroke-width: 2; stroke-linecap: round; }
#quiz .clock-n {
  min-width: 31px;
  font: 400 42px/0.86 var(--display);
  font-variant-numeric: tabular-nums;
  text-align: right;
}
#quiz .clock.low .clock-n { color: #ff8177; }
#quiz .clock.low .pint-glass { stroke: #ff8177; }
#quiz .clock.low .pint { transform-origin: 50% 100%; animation: qz-rock 0.5s ease-in-out infinite; }
#quiz .clock.over .clock-n,
#quiz .clock.locked .clock-n {
  min-width: 0;
  font-size: 25px;
  line-height: 1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
#quiz .clock.over .clock-n { color: #ff8177; }
#quiz .clock.over .pint-glass { stroke: #ff8177; }
@keyframes qz-rock {
  0%, 100% { transform: rotate(-5deg); }
  50% { transform: rotate(5deg); }
}

/* the four answers */
#quiz .answers { display: flex; flex-direction: column; gap: 8px; }
#quiz .ans {
  position: relative;
  display: flex;
  align-items: stretch;
  width: 100%;
  min-height: 52px;
  padding: 0;
  border: 0;
  border-radius: 4px 27px 27px 4px;
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
  font: 600 16px/1.25 var(--body);
  text-align: left;
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.16), 0 0 0 1px var(--edge);
  transition: transform 0.08s ease, opacity 0.18s ease;
  cursor: pointer;
}
#quiz button.ans:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.16), 0 0 0 1px var(--edge);
}
#quiz .ans-l {
  display: grid;
  place-items: center;
  width: 46px;
  flex: none;
  padding-bottom: 3px;
  background: var(--lager);
  color: var(--coal);
  font: 400 27px/1 var(--display);
}
#quiz .ans-l b { font-weight: 400; }
#quiz .ans-t { flex: 1; min-width: 0; align-self: center; padding: 8px 18px 10px 12px; }
#quiz .ans[disabled] { cursor: default; }
/* once an answer is in, the others stand back; nothing says whether it was right */
#quiz .answers.locked .ans { opacity: 0.42; }
#quiz .answers.locked .ans.picked { opacity: 1; outline: 3px solid var(--chalk); outline-offset: 1px; }
#quiz .ans.picked .ans-l { background: var(--coal); color: var(--lager); }

/* marking: who said what, then what was right */
#quiz .mrow { min-height: 44px; cursor: default; }
#quiz .mrow .ans-l { background: var(--tint); color: var(--ink-dim); }
#quiz .mrow .ans-t {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 10px;
  padding-top: 6px;
  padding-bottom: 8px;
  color: var(--ink-dim);
}
#quiz .mrow.said .ans-t { color: var(--ink); }
#quiz .mark.revealed .mrow.right {
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.16), 0 0 0 3px #2f9e63;
  animation: qz-pop 0.42s cubic-bezier(0.2, 1.5, 0.4, 1);
}
#quiz .mark.revealed .mrow.right .ans-l { background: #2f9e63; color: #fff; }
#quiz .mark.revealed .mrow.right .ans-t { color: var(--ink); }
#quiz .mark.revealed .mrow.said:not(.right) .ans-l { background: var(--bad-tint); color: var(--drop-ink); }
#quiz .mark.revealed .mrow:not(.right):not(.said) { opacity: 0.62; }
#quiz .mrow.none { background: none; box-shadow: inset 0 0 0 2px rgba(242, 245, 239, 0.2); }
#quiz .mrow.none .ans-t { padding-left: 14px; color: var(--chalk-dim); }
#quiz .who { display: flex; flex-wrap: wrap; gap: 5px; }
.qz-tag {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px 0 8px;
  border-radius: 3px 12px 12px 3px;
  background: var(--team, #c2ab8c);
  color: #1d1712;
  font: 400 17px/1 var(--display);
  letter-spacing: 0.02em;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.18);
}
#quiz .verdict {
  margin: 8px 0 0;
  text-align: center;
  color: #f2f5ef;
  font: 400 25px/1.1 var(--display);
  letter-spacing: 0.02em;
}
@keyframes qz-pop {
  0% { transform: scale(0.94); }
  100% { transform: scale(1); }
}

/* a round's scores, and the final ones */
.qz-table {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: min(100%, 360px);
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
}
.qz-table li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: baseline;
  gap: 10px;
  padding: 4px 10px;
  border-radius: 4px 14px 14px 4px;
  background: rgba(242, 245, 239, 0.07);
  font: 600 15px/1.2 var(--body);
  text-align: left;
}
.qz-table li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qz-table li small { color: rgba(242, 245, 239, 0.6); font-size: 12px; }
.qz-table li b { color: var(--lager); font: 400 24px/1 var(--display); }
.qz-table li.won { background: rgba(245, 183, 0, 0.18); }
.qz-table li.out { opacity: 0.4; }
.qz-next { color: rgba(242, 245, 239, 0.65); }

/* the scores along the top: who's in, who's answered, who got it */
.qz-board .qz-team {
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 14px;
  border-top-color: var(--gold-hi);
}
.qz-team .qz-chip {
  flex: 0 1 170px;
  min-width: 104px;
  grid-template-areas: 'face name points' 'face note points';
}
.qz-note { grid-area: note; font-size: 11px; font-weight: 700; color: var(--muted); }
.qz-chip.done .qz-note { color: #8fdca0; }
.qz-chip.got .qz-note { color: #8fdca0; }
.qz-chip.miss .qz-note { color: #ff8a6a; }
.qz-chip.sat { opacity: 0.45; }
.quiz-confetti { position: fixed; inset: 0; z-index: 60; width: 100%; height: 100%; pointer-events: none; }

/* a short phone: everything a question needs on one screen */
@media (max-height: 720px) {
  #quiz .emblem.small { width: 34px; height: 34px; }
  #quiz .pint { width: 28px; height: 39px; }
  #quiz .clock-n { font-size: 36px; }
  #quiz .emblem.ghost { display: none; }
  #quiz .slate-q { min-height: 0; font-size: 18px; }
  #quiz .ans { min-height: 46px; font-size: 15px; }
  #quiz .answers { gap: 6px; }
  .qz-crest { width: 64px; height: 64px; }
  #quiz .board h1 { font-size: clamp(32px, 9vw, 48px); }
}

/* ---------- the croupier's screen (js/casino/screen.js) ----------
   Drinks League's Casino on its own page (/games/casino/vpub.html), in a frame that takes the room there is. */
#casino {
  background:
    radial-gradient(ellipse at 50% 20%, #173a2c, #071a13 75%),
    #071a13;
}

.cs-box {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  border-radius: 16px;
  overflow: hidden;
  background: #0b3b2c;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(255, 220, 160, 0.12);
}

.cs-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ---------- the pool screen (the rest is the beer pong screen's) ---------- */

#pool {
  background:
    radial-gradient(ellipse at 50% 30%, #3a2616, #150d08 75%),
    #150d08;
}

.pl-stage {
  background: #24170f;
}

/* The two sides: reds, yellows, or the open table before the colours are decided. */
.pl-team {
  --team: #c9b48a;
}

.pl-team.pl-red {
  --team: #e8503a;
}

.pl-team.pl-yel {
  --team: #f4c430;
}

.pl-chip {
  grid-template-areas: 'face name points' 'face note points';
}

.pl-note {
  grid-area: note;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}

.pl-balls {
  display: flex;
  gap: 3px;
  margin-top: 2px;
}

.pl-balls i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.pl-balls i.full.red {
  background: #d8352f;
  box-shadow: none;
}

.pl-balls i.full.yel {
  background: #f4c430;
  box-shadow: none;
}

.pl-balls i.full.none {
  background: rgba(255, 255, 255, 0.35);
  box-shadow: none;
}

.pl-black {
  font-size: 11px;
  font-weight: 900;
  color: #fff;
  background: #1c1b1d;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  padding: 1px 8px;
}

/* Fine aim: two buttons in the corner of the table. */
.pl-nudge {
  position: absolute;
  left: 8px;
  bottom: 8px;
  display: flex;
  gap: 6px;
}

.pl-nudge[hidden] {
  display: none;
}

.pl-nudge-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(255, 220, 160, 0.3);
  background: rgba(16, 10, 7, 0.78);
  color: var(--gold-hi);
  font-size: 16px;
  cursor: pointer;
  touch-action: none;
}

.bp-card .pl-choose {
  pointer-events: auto;
}

.dt-opt.pl-red {
  border-color: #e8503a;
}

.dt-opt.pl-yel {
  border-color: #f4c430;
}

.pl-res h3 {
  color: var(--text);
}

/* The bot's level, in one row under the table. */
.pl-bots {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  max-width: 460px;
}

.pl-bots span {
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  white-space: nowrap;
}

.pl-bots .dt-opt {
  padding: 8px 6px;
}

/* Drinks League's crests for darts and pool (public/img), on the help and the quiet tables. */
.game-crest {
  display: block;
  width: 104px;
  height: 104px;
  margin: 0 auto 8px;
}

.card-crest {
  float: right;
  width: 46px;
  height: 46px;
  margin: -4px -4px 4px 8px;
}

/* ---------- the beer garden's games (js/garden/screen.js) ---------- */

/* The kicking games' lettering, as in the Drinks League. */
@font-face {
  font-family: 'League Gothic';
  src: url('/fonts/league-gothic.woff2') format('woff2');
  font-display: swap;
}

@font-face {
  font-family: 'Atkinson Hyperlegible Next';
  src: url('/fonts/atkinson-hyperlegible-next.woff2') format('woff2');
  font-weight: 200 800;
  font-display: swap;
}

#garden {
  background:
    radial-gradient(ellipse at 50% 20%, #24304a, #0b1020 75%),
    #0b1020;
}

.gd-inner {
  gap: 8px;
}

.gd-title {
  margin: 0;
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 0.02em;
}

/* The pitch keeps its shape (360 by 380) and fills what room there is. */
.gd-pitch {
  flex: 1 1 auto;
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gd-pitch[hidden] {
  display: none;
}

.gd-canvas {
  display: block;
  border-radius: 14px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.55), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  touch-action: manipulation;
}

/* A dot a kick: gold for a goal or one over, red for a miss, ringed for the one to come. */
.gd-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 18px;
}

.gd-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
}

.gd-dot.made {
  background: #f5b700;
}

.gd-dot.missed {
  background: #d3302f;
}

.gd-dot.now {
  box-shadow: 0 0 0 2px #f2f5ef;
}

.gd-total {
  margin-left: 6px;
  font-size: 15px;
  color: var(--gold-hi);
}

.gd-kick {
  flex: 0 0 auto;
  align-self: center;
  width: min(100%, 360px);
  font-size: 18px;
  padding: 14px 10px;
}

.gd-kick[hidden] {
  display: none;
}

.gd-kick:disabled {
  opacity: 0.6;
}

.gd-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(100%, 440px);
  align-self: center;
}

.gd-card:empty {
  display: none;
}

.gd-section h3 {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 900;
  color: var(--gold-hi);
}

.gd-how {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
}

.gd-how li {
  margin: 2px 0;
}

.gd-big {
  margin: 2px 0;
  font-size: 20px;
  font-weight: 900;
}

.gd-note,
.gd-empty {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.gd-board {
  margin: 0;
  padding-left: 20px;
  font-size: 13px;
}

.gd-board li::marker {
  color: var(--muted);
}

.gd-board li span {
  display: inline-block;
  max-width: 60%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}

.gd-board li b {
  float: right;
  color: var(--text);
}

.gd-board li.mine span {
  color: var(--gold-hi);
  font-weight: 800;
}

/* ---------- logging a drink (js/logdrink.js) ---------- */

/* The middle of the bottom bar's top: your coins, and the pint to tap to log a drink. */
.mid-top {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* A pint to tap: by your coins, and up in each game's header. */
.pint-btn {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 207, 90, 0.35);
  background: radial-gradient(circle at 50% 35%, #3a2616, #170e09 70%);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.6), 0 1px 0 rgba(255, 220, 170, 0.08);
  cursor: pointer;
}

.pint-btn[hidden] {
  display: none;
}

.pint-btn:active {
  transform: translateY(1px);
}

.pint-btn:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.pint-glyph {
  width: 20px;
  height: 20px;
}

.hud-pint {
  margin-top: -2px;
}

/* The screen itself: it slides up from the bottom like Options (centred on bigger screens), over the pub
   and over any game, and never grows taller than the screen. */
#log-sheet.sheet {
  z-index: 22;
  place-items: end center;
  padding: calc(12px + env(safe-area-inset-top)) 10px calc(10px + env(safe-area-inset-bottom));
  background: rgba(0, 0, 0, 0);
  transition: background 0.22s ease;
}

#log-sheet.sheet.shown {
  background: rgba(0, 0, 0, 0.55);
}

@media (min-width: 700px) and (min-height: 600px) {
  #log-sheet.sheet {
    place-items: center;
  }
}

.log-card {
  width: min(460px, 100%);
  max-height: calc(100dvh - 22px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  border-radius: 20px;
  transform: translateY(40px) scale(0.97);
  opacity: 0;
  transition:
    transform 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.1),
    opacity 0.18s ease;
}

#log-sheet.shown .log-card {
  transform: none;
  opacity: 1;
}

#log-sheet .opt-head h2 {
  padding-left: 6px;
}

#log-sheet .opt-sub {
  white-space: normal;
}

body.kb-float-open #log-sheet.sheet {
  padding-bottom: calc(var(--kb-h, 0px) + 8px);
}

body.kb-float-open .log-card {
  max-height: calc(100dvh - var(--kb-h, 0px) - 20px - env(safe-area-inset-top));
}

.log-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 14px 14px 18px;
}

.log-body p {
  margin: 0;
}

.log-wait {
  padding: 18px 4px;
}

.log-barmaid {
  font-style: italic;
  color: var(--gold);
  text-align: center;
}

.log-cannot {
  gap: 12px;
}

.log-cannot .btn {
  align-self: stretch;
  text-align: center;
}

.dl-ico {
  width: 24px;
  height: 24px;
  flex: none;
}

/* The photo: what you've taken, your face camera live, or a box to tap to take one. */
.log-photo {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.log-shot {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 4 / 3;
  max-height: 34dvh;
  overflow: hidden;
  border-radius: 14px;
  background: #0d0806;
  border: 1px solid var(--line);
}

.log-shot img,
.log-shot video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Your face camera, the way a mirror shows you (the photo itself comes out the right way round). */
.log-shot.live video {
  transform: scaleX(-1);
}

.log-shot.empty {
  gap: 6px;
  align-content: center;
  border: 2px dashed rgba(255, 207, 90, 0.35);
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.log-shot.empty .dl-ico {
  width: 40px;
  height: 40px;
  color: var(--gold);
}

.log-photo-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.log-photo-btn {
  flex: 1 1 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  padding: 8px 12px;
}

.log-photo-btn .dl-ico {
  width: 20px;
  height: 20px;
}

.log-photo-note:empty {
  display: none;
}

/* Same again: the drink you last had today, in one tap. */
.log-same {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  padding: 10px 16px;
  text-align: left;
}

.log-same-lead {
  font-size: 19px;
  font-weight: 900;
}

.log-same-what {
  font-size: 14px;
  font-weight: 600;
}

.log-same-box {
  gap: 6px;
}

.log-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.log-field[hidden] {
  display: none;
}

.log-label {
  font-size: 14px;
  font-weight: 800;
}

.log-hint {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.35;
}

.log-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.log-chips[hidden] {
  display: none;
}

.log-chip {
  min-height: 36px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.log-chip[aria-pressed='true'] {
  border-color: var(--gold);
  background: rgba(255, 207, 90, 0.16);
  color: var(--gold);
}

/* What you're drinking: Drinks League's choices, each with what it's worth to you. */
.log-drinks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.log-drink {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  padding: 6px 12px 6px 9px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font: inherit;
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.15;
  text-align: left;
  cursor: pointer;
}

.log-drink b {
  font-size: 22px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.log-drink[aria-checked='true'] {
  border-color: var(--gold);
  background: var(--gold);
  color: var(--gold-dark);
}

.log-pie {
  grid-column: 1 / -1;
  grid-template-columns: 26px minmax(0, 1fr);
}

.log-pie small {
  display: block;
  margin-top: 2px;
  font-size: 12.5px;
  font-weight: 500;
  opacity: 0.8;
}

.log-select {
  width: 100%;
}

.log-submit {
  width: 100%;
  min-height: 52px;
  font-size: 17px;
}

.log-pint-toggle {
  margin-top: 4px;
}

/* What a drink just logged scored: a gold strip at the top, over everything, in Drinks League's words. */
.logged {
  position: fixed;
  left: 50%;
  top: calc(10px + env(safe-area-inset-top));
  z-index: 35;
  width: min(440px, calc(100vw - 20px));
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 16px;
  background: var(--gold);
  color: var(--gold-dark);
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.14), 0 10px 30px rgba(0, 0, 0, 0.45);
  transform: translate(-50%, -14px);
  opacity: 0;
  transition:
    transform 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.2),
    opacity 0.2s ease;
  cursor: pointer;
}

.logged.shown {
  transform: translate(-50%, 0);
  opacity: 1;
}

.lg-pts {
  flex: none;
  font-size: 38px;
  font-weight: 900;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.lg-pts .dl-ico {
  width: 36px;
  height: 36px;
}

.lg-text {
  flex: 1;
  min-width: 0;
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.3;
}

.lg-text strong {
  display: block;
  margin-top: 2px;
  font-size: 16px;
  font-weight: 900;
}

@media (prefers-reduced-motion: reduce) {
  .log-card,
  .logged {
    transition: none;
  }
}

/* ---------- the window above Birdie: shouting a voice note or a video clip onto a league's Bar (shout.js) ---------- */

.shout {
  display: grid;
  gap: 12px;
}

.shout-words {
  margin: 0;
  line-height: 1.45;
}

.shout-words.dim {
  color: var(--muted);
  font-size: 14px;
}

.shout-kinds,
.shout-leagues {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.shout-leagues .chip {
  font: inherit;
  font-size: 14px;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
}

.shout-leagues .chip.on {
  color: var(--gold-dark);
  background: var(--gold);
  border-color: var(--gold);
}

.shout-kind {
  flex: 1 1 140px;
}

.shout-go.on {
  background: #c4432d;
  color: #fff6ee;
}

/* The camera, as you'll be seen, before and while a clip records: at the window, and for a clip in the chat. */
.cam-frame {
  overflow: hidden;
  border-radius: var(--radius);
  background: #0b0706;
  aspect-ratio: 4 / 3;
  max-height: 40vh;
}

.cam-view {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cam-view.mirror {
  transform: scaleX(-1);
}

/* How loud your voice is coming through, as it records. */
.shout-level {
  display: flex;
  gap: 4px;
  height: 22px;
  align-items: flex-end;
}

.shout-level span {
  flex: 1;
  height: 100%;
  border-radius: 3px;
  background: rgba(255, 220, 160, 0.14);
}

.shout-level span.on {
  background: var(--gold);
}

.shout-time {
  margin: 0;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

/* ---------- a video clip in the chat (clips.js): recording one, and watching one (ui.js) ---------- */

.clip {
  display: grid;
  gap: 10px;
}

.clip-time,
.clip-words {
  margin: 0;
}

.clip-time {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.clip-words:empty {
  display: none;
}

.clip-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.clip-go {
  flex: 1 1 150px;
}

.clip-go.on {
  background: #c4432d;
  color: #fff6ee;
}

/* Its room kept from the start (a phone records 4:3), so the panel doesn't jump as the clip loads, and the
   clip held inside its frame's rounded corners. */
.clip-frame {
  overflow: hidden;
  isolation: isolate;
  contain: paint;
  aspect-ratio: 4 / 3;
  max-height: 60vh;
  border-radius: var(--radius);
  background: #000;
}

.clip-watch {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
