/* The party room. The room itself is one SVG (scene.js); this styles its lettering and
   everything laid over it. Fonts are the device's own: nothing is downloaded. */
:root {
  --bg: #0d0806;
  --panel: #17100c;
  --line: #3b2a1f;
  --ink: #fbf3e2;
  --soft: #cdbfa6;
  --amber: #f4b453;
  --amber-ink: #1e1410;
  --cream: #f4e6cf;
  --display: Georgia, "Times New Roman", "Noto Serif", "DejaVu Serif", serif;
  --ui: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace;
  --chalk: "Segoe Print", "Bradley Hand", "Chalkboard SE", "Comic Sans MS", cursive;
  --bar: clamp(56px, 8.34vh, 90px);
}
* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--ui);
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
}
[hidden] {
  display: none !important;
}
button,
input {
  font: inherit;
  color: inherit;
}
#app {
  position: fixed;
  inset: 0;
}

/* ------------------------------------------------------------ the room's lettering */
.scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  user-select: none;
  -webkit-user-select: none;
}
.t-display {
  font-family: var(--display);
  font-weight: 700;
}
.t-poster {
  font-family: var(--ui);
  font-weight: 900;
}
.t-ui {
  font-family: var(--ui);
}
.t-mono {
  font-family: var(--mono);
}
.t-chalk {
  font-family: var(--chalk);
}
.t-semi {
  font-weight: 600;
}
.t-bold {
  font-weight: 800;
}

/* ------------------------------------------------------------ over the room */
.hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.hud > * {
  pointer-events: auto;
}
.dot {
  display: inline-block;
  flex: none;
  width: 0.72em;
  height: 0.72em;
  border-radius: 50%;
  background: #888;
  box-shadow: 0 0 0 1.5px rgba(251, 243, 226, 0.55);
}
.chip {
  flex: none;
  padding: 0.28em 0.8em;
  border-radius: 0.3em;
  background: var(--amber);
  color: var(--amber-ink);
  font: 700 0.62em/1.3 var(--mono);
  letter-spacing: 0.2em;
  white-space: nowrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.5em;
  font-weight: 700;
  color: #f6d9a0;
  white-space: nowrap;
}
.brand-mark {
  width: 1.05em;
  height: 0.72em;
  border-radius: 0.2em;
  background: var(--amber);
}

/* The strip over the foot of the picture. */
.bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  background: rgba(10, 6, 4, 0.96);
  border-top: 3px solid #b9853a;
  padding-bottom: env(safe-area-inset-bottom);
  padding-left: max(2vw, env(safe-area-inset-left));
  padding-right: max(2vw, env(safe-area-inset-right));
}
.bar-screen {
  height: var(--bar);
  gap: 3vw;
  font-size: clamp(15px, 2.42vh, 28px);
}
.bar-screen .status {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7em;
  white-space: nowrap;
  overflow: hidden;
}
.status-main {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
}
.status-sub {
  color: var(--soft);
  display: flex;
  align-items: center;
  gap: 0.45em;
  min-width: 0;
}
.who {
  display: inline-flex;
  align-items: center;
  gap: 0.32em;
  color: var(--ink);
  font-weight: 700;
}
.code {
  display: flex;
  align-items: center;
  gap: 0.5em;
  white-space: nowrap;
}
.code-label {
  width: 3.2em;
  white-space: normal;
  font: 600 0.5em/1.2 var(--mono);
  letter-spacing: 0.22em;
  color: var(--soft);
}
.code-digits {
  font: 800 1.7em/1 var(--mono);
  letter-spacing: 0.08em;
}

/* A player's buttons. */
.bar-player {
  min-height: 64px;
  gap: 12px;
  padding-top: 6px;
  padding-bottom: max(6px, env(safe-area-inset-bottom));
  font-size: 14px;
  touch-action: none;
}
.pad {
  display: flex;
  align-items: center;
  gap: 10px;
}
.round {
  flex: none;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #1d130e;
  border: 2px solid #5a4030;
  color: var(--ink);
  cursor: pointer;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}
.round.held,
.round:active {
  background: #3a281c;
  border-color: var(--amber);
}
.round:focus-visible,
.pill-btn:focus-visible,
.button:focus-visible,
.plain:focus-visible,
.choice:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
}
/* The four buttons are one family (controls.js): round, dark, outlined, a picture and a word.
   Only bump carries the accent: amber when it is ready, dim with a ring sweeping round while
   it recharges, and a pulse the moment it is ready again. */
.ctl {
  position: relative;
  width: 56px;
  height: 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 0;
}
.ctl-icon {
  flex: none;
  width: 22px;
  height: 22px;
}
.ctl-word {
  font: 800 9.5px/1 var(--ui);
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
/* The key that does the same, for people at a keyboard. */
.ctl-key {
  display: none;
  position: absolute;
  z-index: 1;
  top: -4px;
  right: -9px;
  min-width: 20px;
  padding: 2px 5px;
  border-radius: 6px;
  background: var(--cream);
  color: #1e1410;
  font: 700 12px/1.15 var(--mono);
  text-align: center;
  white-space: nowrap;
  box-shadow: 0 1px 0 2px rgba(10, 6, 4, 0.9);
}
@media (hover: hover) and (pointer: fine) {
  .ctl-key {
    display: block;
  }
}
.ctl.floored {
  opacity: 0.45;
}
.ctl-bump.ready {
  background: var(--amber);
  border-color: var(--amber);
  color: var(--amber-ink);
}
.ctl-bump.ready.held,
.ctl-bump.ready:active {
  background: #ffcb7a;
}
.ctl-bump.cooling {
  border-color: #33241a;
  color: #8d7f6f;
}
/* The ring runs along the button's own outline, so it never spills out of the bar. */
.ctl-ring {
  position: absolute;
  inset: -3px;
  width: calc(100% + 6px);
  height: calc(100% + 6px);
  transform: rotate(-90deg);
  overflow: visible;
  pointer-events: none;
}
.ctl-ring-track,
.ctl-ring-sweep {
  fill: none;
  stroke-width: 5;
}
.ctl-ring-track {
  stroke: rgba(244, 180, 83, 0.2);
}
.ctl-ring-sweep {
  stroke: var(--amber);
  stroke-linecap: round;
}
.ctl-bump.ready .ctl-ring {
  opacity: 0;
}
.ctl-bump.pulse {
  animation: ctl-ready 0.5s ease-out;
}
@keyframes ctl-ready {
  0% {
    transform: scale(0.9);
    box-shadow: 0 0 0 0 rgba(244, 180, 83, 0.95);
  }
  45% {
    transform: scale(1.14);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 18px rgba(244, 180, 83, 0);
  }
}
@media (prefers-reduced-motion: reduce) {
  .ctl-bump.pulse {
    animation-name: ctl-ready-calm;
  }
}
@keyframes ctl-ready-calm {
  0% {
    box-shadow: 0 0 0 0 rgba(244, 180, 83, 0.95);
  }
  100% {
    box-shadow: 0 0 0 18px rgba(244, 180, 83, 0);
  }
}
.pill-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 14px 0 10px;
  border-radius: 20px;
  background: #1d130e;
  border: 2px solid #5a4030;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}
.pill-icon {
  display: grid;
}
.bar-player .status {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  overflow: hidden;
}
.status-label {
  flex: none;
  color: var(--soft);
}
.bar-player .status-main {
  flex: none;
  font-weight: 800;
  font-size: 1.15em;
}
.status-main.muted {
  color: var(--soft);
}
.status-rule {
  flex: none;
  width: 1px;
  height: 1.4em;
  background: #5a4030;
  margin: 0 4px;
}
.bar-player .status-sub {
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.door-btn {
  position: absolute;
  top: max(10px, env(safe-area-inset-top));
  right: max(10px, env(safe-area-inset-right));
  width: 42px;
  height: 42px;
  background: rgba(23, 16, 12, 0.88);
}
.notes {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  gap: 6px;
  justify-items: center;
  pointer-events: none;
}
.note,
.banner,
.link-state {
  display: flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.42em 1em;
  border-radius: 2em;
  background: rgba(23, 16, 12, 0.94);
  border: 1.5px solid var(--line);
  font-weight: 700;
  font-size: clamp(15px, 2.3vh, 26px);
  white-space: nowrap;
  transition: opacity 0.6s;
}
.note.going {
  opacity: 0;
}
.banner {
  position: absolute;
  top: max(58px, calc(env(safe-area-inset-top) + 58px));
  left: 50%;
  transform: translateX(-50%);
  font-size: 14px;
  border-color: var(--amber);
}
.link-state {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  left: max(12px, env(safe-area-inset-left));
  font-size: 14px;
  color: var(--amber);
}
/* Someone else's page is hidden during a turn-based game: plain, under the connection's own word when that shows. */
.link-state.away-mark {
  color: inherit;
  font-weight: 600;
}
.hud.linking .away-mark {
  top: calc(max(12px, env(safe-area-inset-top)) + 44px);
}
.turn-hint {
  display: none;
}

/* The door button's sheet, the card after a game, and the notice when the room is gone. */
.sheet-back,
.card-back {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(8, 4, 3, 0.62);
  overflow: auto;
}
.card-back.solid {
  background: var(--bg);
}
.sheet,
.card {
  width: min(100%, 460px);
  display: grid;
  gap: 12px;
  padding: 20px;
  border-radius: 16px;
  background: var(--cream);
  color: #1e1410;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.55);
}
.choice {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 0;
  border-radius: 12px;
  background: #ecd9b9;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.choice-icon {
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #9c2b20;
  color: #fff6e2;
}
.choice-words {
  display: grid;
  gap: 2px;
}
.choice-words strong {
  font-size: 18px;
}
.choice-words span {
  color: #5a4636;
  font-size: 14px;
}
.button,
.plain {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 12px 18px;
  border-radius: 24px;
  border: 0;
  font-weight: 800;
  font-size: 16px;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.button {
  background: var(--amber);
  color: var(--amber-ink);
}
.button[disabled] {
  opacity: 0.6;
}
.plain {
  background: transparent;
  color: inherit;
  box-shadow: inset 0 0 0 2px currentColor;
  opacity: 0.86;
}
.card-kicker {
  font: 700 12px/1 var(--mono);
  letter-spacing: 0.22em;
  color: #9c2b20;
}
.card-title,
.flip-title {
  margin: 0;
  font: 700 32px/1.1 var(--display);
}
.card-text,
.card-foot {
  margin: 0;
  line-height: 1.45;
  color: #3a2a1c;
}
.card-foot {
  font-size: 14px;
  color: #5a4636;
}
.places {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.places li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  background: #ecd9b9;
  font-size: 18px;
}
.places .dot {
  box-shadow: 0 0 0 1.5px rgba(30, 20, 16, 0.5);
}
.place {
  width: 2.2em;
  font: 700 0.8em/1 var(--mono);
  color: #5a4636;
}
.who-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}
.points {
  min-width: 1.7em;
  text-align: right;
  font: 800 1.1em/1 var(--mono);
}
/* What a game that keeps score was played for; the points beside it are what it adds tonight. */
.score {
  font: 700 0.9em/1 var(--mono);
  color: #5a4636;
}

/* ------------------------------------------------------------ the Tonight board, large */
.board-hit {
  cursor: pointer;
  outline: none;
}
.board-hit:focus-visible {
  stroke: #fff;
  stroke-width: 4;
}
.board-back {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 14px;
  background: rgba(8, 4, 3, 0.74);
  overflow: auto;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}
.board {
  position: relative;
  width: min(100%, 780px);
  display: grid;
  gap: 12px;
  padding: 24px 28px 16px;
  border: 12px solid #7a4b22;
  border-radius: 10px;
  background: #142b26;
  color: #f3ecd9;
  font-family: var(--chalk);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.6);
}
.board-title {
  margin: 0;
  font: 400 46px/1 var(--chalk);
  text-align: center;
}
.board-sub {
  margin: 0;
  text-align: center;
  color: #d9d2bf;
  font-size: 17px;
}
.board-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 26px;
  align-items: start;
  padding-top: 10px;
  border-top: 2px solid rgba(243, 236, 217, 0.4);
}
.board-head {
  margin: 0 0 8px;
  font: 700 13px/1 var(--mono);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--amber);
}
.board-places,
.board-games {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.board-places li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  border-radius: 8px;
  background: rgba(243, 236, 217, 0.07);
  font-size: 27px;
}
.board-places li.mine {
  box-shadow: inset 0 0 0 2px rgba(243, 236, 217, 0.85);
}
.board-place {
  flex: none;
  width: 2.4em;
  font: 700 0.6em/1 var(--mono);
  color: #d9d2bf;
}
.board-games .board-place {
  width: 1.6em;
  font-size: 0.8em;
}
.board-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.board-points {
  font-size: 1.2em;
  line-height: 1;
  color: #ffd75e;
}
.board-unit {
  width: 1.9em;
  font: 600 0.5em/1 var(--mono);
  color: #d9d2bf;
}
.board-games li {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 3px 12px;
  font-size: 20px;
}
.board-game {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.board-game strong {
  font-weight: 400;
}
.board-won {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #d9d2bf;
  font-size: 0.8em;
}
.board-places li.board-empty,
.board-games li.board-empty {
  padding: 3px 12px;
  background: none;
  color: #d9d2bf;
  font-size: 17px;
  line-height: 1.4;
}
.board-foot {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 14px;
  margin: 2px 0 0;
  font: 600 14px/1.3 var(--ui);
  color: #d9d2bf;
}
.board-now {
  color: #f3ecd9;
}
.board-hint {
  margin-left: auto;
  white-space: nowrap;
}
.board-close {
  position: absolute;
  top: 10px;
  right: 10px;
  min-height: 34px;
  padding: 4px 14px;
  border-radius: 17px;
  border: 2px solid rgba(243, 236, 217, 0.6);
  background: transparent;
  font: 700 14px/1 var(--ui);
  cursor: pointer;
}
.board-close:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
}

/* ------------------------------------------------------------ a game laid over the room */
.stage {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(8, 4, 3, 0.95);
  overflow: auto;
}
/*
 * A game whose view covers everything (Cork & Bell): it gets the whole screen, the room is not
 * drawn under it, and of the room's own things only the door button, the notes and the word
 * about the connection stay on top. The door button is already sized for a phone held sideways.
 */
#app.in-game .stage {
  padding: 0;
  overflow: hidden;
  background: #0b1020;
}
#app.in-game svg.scene,
#app.in-game .bar,
#app.in-game .turn-hint,
#app.in-game .banner {
  display: none;
}
/* Any game's view (main.js, startStage): a player's bar, its walk and emote buttons and the hints
   do nothing for the game, so none of them lies over the view. Around a view drawn in the stage
   (one without `full`) the big screen keeps its bottom line: the join code is still worth seeing. */
#app.staged .hud-player .bar,
#app.staged .turn-hint,
#app.staged .banner {
  display: none;
}
/* A game laid out for an upright phone, on a phone still held sideways: the mirror of the room's
   hint, in the dark band left of the game's box (the box is 3:4 in the middle, below), never over
   it, and gone the moment the phone is upright. */
.upright-hint {
  display: none;
}
@media (orientation: landscape) and (max-height: 520px) {
  :root.upright #app.staged .upright-hint {
    position: absolute;
    top: 50%;
    left: max(12px, env(safe-area-inset-left));
    width: calc((100vw - min(100vw, var(--seen-h, 100dvh) * 0.75)) / 2 - 24px);
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 14px 10px;
    border-radius: 14px;
    border: 1.5px solid rgba(244, 180, 83, 0.55);
    color: var(--amber);
    font-weight: 700;
    font-size: 14px;
    line-height: 1.3;
    text-align: center;
  }
}
.flip {
  display: grid;
  gap: 10px;
  justify-items: center;
  text-align: center;
}
.flip .card-kicker {
  color: var(--amber);
}
.flip-sub {
  margin: 0;
  color: var(--soft);
}
.flip-row {
  display: flex;
  gap: clamp(14px, 4vw, 44px);
  margin-top: 14px;
  perspective: 600px;
}
.flip-who {
  display: grid;
  gap: 10px;
  justify-items: center;
}
.flip-coin {
  width: clamp(54px, 13vmin, 120px);
  height: clamp(54px, 13vmin, 120px);
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.7);
  box-shadow: inset 0 0 0 6px rgba(0, 0, 0, 0.18);
  animation: flip 0.55s linear infinite;
}
.flip-who:nth-child(2) .flip-coin {
  animation-duration: 0.62s;
}
.flip-who:nth-child(3) .flip-coin {
  animation-duration: 0.48s;
}
.flip-who:nth-child(4) .flip-coin {
  animation-duration: 0.7s;
}
.flip-name {
  font-weight: 700;
}
@keyframes flip {
  to {
    transform: rotateX(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .flip-coin {
    animation-duration: 2.4s;
  }
}

/* ------------------------------------------------------------ the way in */
.door {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  overflow: auto;
  background: radial-gradient(120% 90% at 50% 0%, #24160f 0%, var(--bg) 70%);
}
.door-card {
  width: min(100%, 480px);
  display: grid;
  gap: 14px;
}
.door-title {
  margin: 4px 0 0;
  font: 700 clamp(32px, 6vw, 46px) / 1.05 var(--display);
  color: #f6d9a0;
}
.door-sub {
  margin: 0;
  color: var(--soft);
  line-height: 1.45;
}
.door-form {
  display: grid;
  gap: 12px;
}
.field {
  display: grid;
  gap: 6px;
}
.field-label {
  font-size: 14px;
  color: var(--soft);
}
.input {
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 2px solid #5a4030;
  background: #120b08;
  font-size: 20px;
}
.input:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 1px;
}
.input-code {
  font: 800 34px/1 var(--mono);
  letter-spacing: 0.3em;
  text-align: center;
}
.roles {
  display: grid;
  gap: 8px;
}
.role {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 2px solid #5a4030;
  cursor: pointer;
}
.role.picked {
  border-color: var(--amber);
  background: rgba(244, 180, 83, 0.1);
}
.role input {
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  accent-color: var(--amber);
}
.role-words {
  display: grid;
  gap: 2px;
}
.role-words span {
  color: var(--soft);
  font-size: 14px;
  line-height: 1.35;
}
.door-error {
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fbe3da;
  color: #7a1d12;
  font-weight: 600;
}
/* Who is in the party whose code was typed, and a word when its screen is already taken. */
.door-who {
  margin: -4px 0 0;
  color: var(--soft);
  font-size: 15px;
}
.door-note {
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  border: 2px solid #5a4030;
  color: var(--soft);
  line-height: 1.4;
}
/* On a phone, the other way to be here: a small link under the form. */
.door-swap {
  justify-self: center;
  padding: 8px 6px;
  border: 0;
  background: none;
  color: var(--soft);
  font-size: 15px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.door-swap:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
}

/* The way in for the Table, from the front page (/table/): the front page's blue and its two
   faces (site/site.css, self-hosted under /fonts/, downloaded only by this page), so starting a
   party there looks like the page it came from. The party room's own way in is unchanged. */
@font-face {
  font-family: "Baloo 2";
  font-style: normal;
  font-display: swap;
  font-weight: 400 800;
  src: url("/m/26fb4610d4bc976d2584.woff2") format("woff2");
}
@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-display: swap;
  font-weight: 200 1000;
  src: url("/m/ba344451eab25b217a16.woff2") format("woff2");
}
.door[data-room="turn-based"] {
  /* By night: the front page's navy. */
  --ground: #08102a;
  --field: #111d44;
  --edge: #2c3d78;
  --ink: #eef2ff;
  --soft: #b4c0e3;
  --amber: #f7c24a;
  --amber-ink: #2a1606;
  --focus: #8fb8ff;
  --display: "Baloo 2", "Arial Rounded MT Bold", "Trebuchet MS", system-ui, sans-serif;
  background: radial-gradient(120% 90% at 50% 0%, #172552 0%, var(--ground) 70%);
  color: var(--ink);
  font-family: "Nunito", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  .door[data-room="turn-based"] {
    /* By day: the front page's pale blue. */
    --ground: #dfe8fb;
    --field: #f9fbff;
    --edge: #b3c3e6;
    --ink: #0d1733;
    --soft: #3b4a72;
    --amber: #f4b630;
    --focus: #1f5fd6;
    background: radial-gradient(120% 90% at 50% 0%, #edf2fd 0%, var(--ground) 70%);
    color-scheme: light;
  }
}
.door[data-room="turn-based"] .brand,
.door[data-room="turn-based"] .door-title {
  color: var(--ink);
}
.door[data-room="turn-based"] .door-title {
  font-weight: 800;
}
.door[data-room="turn-based"] .input,
.door[data-room="turn-based"] .role,
.door[data-room="turn-based"] .door-note {
  border-color: var(--edge);
  background: var(--field);
}
.door[data-room="turn-based"] .role.picked {
  border-color: var(--amber);
}
.door[data-room="turn-based"] .button {
  font-family: var(--display);
  font-size: 19px;
  box-shadow: 0 4px 0 var(--amber-ink);
}
/* A tap target of 44 pixels at least. */
.door[data-room="turn-based"] .door-swap {
  min-height: 44px;
}
.door[data-room="turn-based"] .input:focus-visible,
.door[data-room="turn-based"] .button:focus-visible,
.door[data-room="turn-based"] .plain:focus-visible,
.door[data-room="turn-based"] .door-swap:focus-visible {
  outline: 3px solid var(--focus);
}

/* ------------------------------------------------------------ an upright phone */
@media (orientation: portrait) and (max-width: 560px) {
  .hud-player .bar-player {
    flex-wrap: wrap;
    row-gap: 10px;
    justify-content: space-between;
    padding-top: 10px;
  }
  .hud-player .bar-player .status {
    order: -1;
    flex: 0 0 100%;
    min-height: 26px;
  }
  .hud-player .bar-player .round {
    width: 64px;
    height: 64px;
  }
  .hud-player .zoom-btn {
    display: none;
  }
  .hud-player .turn-hint {
    position: absolute;
    top: max(10px, env(safe-area-inset-top));
    left: max(10px, env(safe-area-inset-left));
    right: 62px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border-radius: 12px;
    background: var(--amber);
    color: var(--amber-ink);
    font-weight: 700;
    font-size: 13.5px;
    line-height: 1.25;
  }
  .hud-player .notes {
    top: max(64px, calc(env(safe-area-inset-top) + 64px));
  }
  .note {
    font-size: 15px;
  }
}

/* A small phone held sideways: "Closer" keeps only its picture, so the line has the width it needs. */
@media (orientation: landscape) and (max-height: 520px) and (max-width: 760px) {
  .hud-player .zoom-btn {
    width: 44px;
    padding: 0;
    justify-content: center;
  }
  .hud-player .zoom-btn > span:not(.pill-icon) {
    display: none;
  }
}
/* On any phone the line goes on two rows, and is never cut: what it is and the pick on the first,
   the rest under it, wrapping rather than trailing off when a long name makes it so. */
@media (orientation: landscape) and (max-height: 520px), (orientation: portrait) and (max-width: 560px) {
  .hud-player .bar-player .status {
    flex-wrap: wrap;
    align-content: center;
    justify-content: center;
    column-gap: 6px;
    row-gap: 2px;
    white-space: normal;
    text-align: center;
  }
  .hud-player .bar-player .status-main {
    font-size: 15px;
    white-space: nowrap;
    overflow: visible;
  }
  .hud-player .bar-player .status-sub {
    flex: 0 0 100%;
    font-size: 12.5px;
    line-height: 1.25;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
  }
  .hud-player .status-rule {
    display: none;
  }
}

/* An upright phone has the bar's full width for the line: the same two rows, a size larger. */
@media (orientation: portrait) and (max-width: 560px) {
  .hud-player .bar-player .status-main {
    font-size: 17px;
  }
  .hud-player .bar-player .status-sub {
    font-size: 14px;
  }
}

/* The settings step after the vote (settings-step.js): one row a setting; the corner's buttons and
   the notes stay on top of it, and the sheets they open (the door button's above all) over both. */
.hud:has(.settings-back) .corner,
.hud:has(.settings-back) .door-btn,
.hud:has(.settings-back) .notes {
  z-index: 2;
}
.settings-back {
  z-index: 1;
}
.sheet-back {
  z-index: 3;
}
/* In the full card the kicker and the title are the card's own rows. */
.settings-head {
  display: contents;
}
.settings-list {
  display: grid;
  gap: 6px;
}
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 10px;
  border-radius: 10px;
  background: #ecd9b9;
}
.settings-label {
  color: #5a4636;
}
.settings-select {
  min-height: 44px;
  max-width: 60%;
  padding: 4px 8px;
  border: 0;
  border-radius: 8px;
  background: #fff6e2;
  color: inherit;
  font: inherit;
  font-weight: 700;
}
.settings-said {
  margin: 0;
  font-weight: 700;
  color: #9c2b20;
}
.settings-card .settings-left {
  display: block;
}
.settings-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
/*
 * Choosing who plays on spots: the room stays in sight and in reach. The card is a compact one
 * that keeps clear of the floor, the pieces and their name tags (laid out per screen below), and
 * only the card itself takes taps. Each setting is a pill, its name over its pick; on the host's
 * card the native list lies invisibly over the pill, so a tap anywhere on it opens the list.
 */
.settings-back.spots {
  place-items: start center;
  background: none;
  pointer-events: none;
  overflow: visible;
}
.spots-card {
  pointer-events: auto;
  gap: 8px;
}
.spots-card .settings-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 12px;
  row-gap: 6px;
}
.spots-card .card-title {
  font-size: 26px;
}
.spots-line {
  margin: 0;
  font-weight: 600;
  line-height: 1.35;
  color: #3a2a1c;
}
.spots-list,
.settings-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.spot-chip {
  flex: 1 1 0;
  min-width: max-content;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 38px;
  padding: 4px 14px;
  border-radius: 19px;
  background: #ecd9b9;
}
.spot-chip.open {
  background: transparent;
  box-shadow: inset 0 0 0 2px #d5bd98;
}
.spot-label {
  color: #5a4636;
  font-size: 14px;
}
.spot-name {
  font-weight: 800;
}
.spot-chip.open .spot-name {
  color: #8a7259;
  font-weight: 600;
}
.pick {
  position: relative;
  flex: 1 1 auto;
  display: grid;
  align-content: center;
  min-height: 38px;
  padding: 3px 14px;
  border-radius: 12px;
  background: #ecd9b9;
  line-height: 1.15;
}
.pick.mine {
  min-height: 44px;
  padding-right: 34px;
  background: #fff6e2;
  box-shadow: inset 0 0 0 2px #dcc29b;
  cursor: pointer;
}
/* The pill's arrow: it opens a list. */
.pick.mine::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-right: 2.5px solid #1e1410;
  border-bottom: 2.5px solid #1e1410;
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}
.pick.mine:focus-within {
  outline: 3px solid #1e1410;
  outline-offset: 2px;
}
.pick-label {
  font-size: 12px;
  color: #5a4636;
  white-space: nowrap;
}
.pick-value {
  font-size: 15px;
  font-weight: 800;
  white-space: nowrap;
}
.pick .settings-select {
  position: absolute;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100%;
  min-height: 0;
  opacity: 0;
  cursor: pointer;
}
.spots-card .settings-left {
  font-size: 13.5px;
  line-height: 1.35;
}

/* An upright phone: the card goes under the corner's buttons, full width, and the hint to turn
   the phone makes way for it (the card says what to do). */
@media (orientation: portrait) and (max-width: 560px) {
  .hud:has(.settings-back.spots) .turn-hint {
    display: none;
  }
  .settings-back.spots {
    padding: calc(max(10px, env(safe-area-inset-top)) + 54px) 10px 0;
  }
  .spots-card {
    width: 100%;
    padding: 14px 16px;
    gap: 10px;
  }
  /* "Back to the room" keeps its own width on one line; Start takes the rest. */
  .settings-card .settings-actions {
    grid-template-columns: auto 1fr;
  }
  .settings-card .settings-actions .button,
  .settings-card .settings-actions .plain {
    min-height: 48px;
    padding: 8px 16px;
    font-size: 15px;
    white-space: nowrap;
  }
}

/*
 * A phone held sideways has little height above the pieces' name tags. The corner's buttons stand
 * in a column at the right edge, and the card fills the width to their left in four short rows:
 * the game and how to take a spot; who chooses and the time; the spots with the host's two
 * buttons; the settings. A refusal takes the place of the time line until the next change.
 */
@media (orientation: landscape) and (max-height: 520px) {
  .hud:has(.settings-back.spots) .corner {
    flex-direction: column;
  }
  .hud:has(.settings-back.spots) .corner .door-word {
    max-width: 0;
    /* And none of its padding, or a sliver of the word stays beside the door's picture (rooms.css). */
    padding-right: 0;
  }
  .hud:has(.settings-back.spots) .corner .door-btn,
  .hud:has(.settings-back.spots) .corner-btn {
    gap: 0;
    padding: 0;
    width: 44px;
  }
  .settings-back.spots {
    place-items: start stretch;
    padding: 6px calc(max(10px, env(safe-area-inset-right)) + 52px) 0 max(8px, env(safe-area-inset-left));
  }
  .settings-card.spots-card {
    width: auto;
    padding: 6px 12px 8px;
    gap: 5px 12px;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "head time time"
      "line line line"
      "spots spots actions"
      "picks picks picks";
    align-items: center;
  }
  .spots-card .settings-head {
    grid-area: head;
  }
  .spots-card .card-kicker {
    display: none;
  }
  .spots-card .card-title {
    font-size: 21px;
  }
  .spots-card .spots-line {
    grid-area: line;
    font-size: 13.5px;
  }
  .spots-card .settings-left,
  .spots-card .settings-said {
    grid-area: time;
    font-size: 13px;
    line-height: 1.25;
  }
  .settings-back.said .spots-card .settings-left {
    display: none;
  }
  .spots-card .spots-list {
    grid-area: spots;
    flex-wrap: nowrap;
    min-width: 0;
  }
  .spots-card .spot-chip {
    flex: 0 1 auto;
    min-width: 0;
    min-height: 44px;
    gap: 6px;
    padding: 4px 11px;
  }
  .spots-card .spot-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .spots-card .spot-label {
    white-space: nowrap;
  }
  .spots-card .settings-pills {
    grid-area: picks;
  }
  .spots-card .settings-actions {
    grid-area: actions;
    display: flex;
    gap: 8px;
  }
  .spots-card .settings-actions .button,
  .spots-card .settings-actions .plain {
    width: auto;
    min-height: 44px;
    padding: 6px 14px;
    font-size: 15px;
    white-space: nowrap;
  }
}

/* A wide screen (the big screen, a laptop): the card stands at the side, away from the lit spots,
   under the corner's buttons, so the posters of the games whose lights they are stay in sight. */
@media (min-height: 521px) and (min-width: 561px) {
  .settings-back.spots {
    padding: 72px 16px 16px;
  }
  .settings-back.spots.side-right {
    place-items: start end;
  }
  .settings-back.spots.side-left {
    place-items: start start;
  }
  .spots-card {
    width: min(100%, 360px);
  }
}

/* A game laid out for an upright phone (screen-fit.js, allowUpright): no hint to turn the phone,
   and on a phone that stays sideways the game is letterboxed to an upright shape in the middle. */
:root.upright .turn-hint {
  display: none;
}
@media (orientation: landscape) and (max-height: 520px) {
  :root.upright .stage {
    left: 50%;
    right: auto;
    width: min(100%, calc(var(--seen-h, 100dvh) * 0.75));
    transform: translateX(-50%);
    box-shadow: 0 0 0 100vmax #05030a;
  }
}
/* A phone held sideways: the rows two by two and tighter, so the whole card fits the short screen. */
@media (max-height: 520px) and (min-width: 600px) {
  /* Under the corner's buttons, so the card never lies across them. */
  .settings-back {
    padding: calc(max(10px, env(safe-area-inset-top)) + 52px) 8px 8px;
  }
  .settings-card {
    width: min(100%, 680px);
    gap: 6px;
  }
  .settings-list {
    grid-template-columns: 1fr 1fr;
    gap: 4px 8px;
  }
  .settings-row {
    padding: 0 0 0 10px;
  }
}

/* A big screen is read from across the room: its cards and the game laid over it are larger. */
@media (min-width: 1500px) and (min-height: 800px) {
  .sheet,
  .card,
  .flip {
    zoom: 1.6;
  }
}

/* A short, wide screen (a phone held sideways): everything laid over the room is a size smaller. */
@media (max-height: 520px) {
  .note {
    font-size: 15px;
    padding: 0.3em 0.85em;
  }
  .door-btn {
    width: 38px;
    height: 38px;
  }
  .sheet,
  .card {
    gap: 8px;
    padding: 14px;
  }
  .card-title,
  .flip-title {
    font-size: 24px;
  }
  .places li {
    padding: 5px 10px;
    font-size: 16px;
  }
  .button,
  .plain {
    min-height: 42px;
    padding: 9px 16px;
  }
  .card-foot {
    display: none;
  }
  .door {
    place-items: start center;
  }
}

/* ------------------------------------------------------------ the buttons and the board, by device */
/* An upright phone: bigger buttons, and the board's two lists one under the other. */
@media (orientation: portrait) and (max-width: 560px) {
  .hud-player .ctl-icon {
    width: 25px;
    height: 25px;
  }
  .hud-player .ctl-word {
    font-size: 10.5px;
  }
  .board {
    padding: 18px 16px 12px;
    border-width: 9px;
  }
  .board-title {
    font-size: 36px;
  }
  .board-cols {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .board-places li {
    font-size: 23px;
  }
  .board-foot {
    flex-direction: column;
    gap: 4px;
  }
  .board-hint {
    margin-left: 0;
  }
}
/* A big screen is read from across the room. */
@media (min-width: 1500px) and (min-height: 800px) {
  .board {
    zoom: 1.6;
  }
}
/* A phone held sideways is short: the board keeps its two lists side by side, a size smaller. */
@media (max-height: 520px) {
  .board-back {
    padding: 8px;
  }
  .board {
    gap: 6px;
    padding: 10px 18px 8px;
    border-width: 8px;
  }
  .board-title {
    font-size: 28px;
  }
  .board-sub {
    font-size: 14px;
  }
  .board-cols {
    gap: 18px;
    padding-top: 6px;
  }
  .board-head {
    margin-bottom: 5px;
    font-size: 11px;
  }
  .board-places,
  .board-games {
    gap: 4px;
  }
  .board-places li {
    padding: 3px 10px;
    font-size: 20px;
  }
  .board-games li {
    padding: 1px 10px;
    font-size: 16px;
  }
  .board-close {
    top: 6px;
    right: 6px;
    min-height: 30px;
  }
  .board-foot {
    font-size: 12.5px;
  }
}

/* The frame meter (frame-meter.js, ?meter=1): one line at the top left, over everything, taking no taps. */
.frame-meter {
  position: absolute;
  top: max(2px, env(safe-area-inset-top));
  left: max(4px, env(safe-area-inset-left));
  z-index: 30;
  /* Clear of the corner's three round buttons at the top right (rooms.css). */
  max-width: calc(100% - 190px);
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.7);
  color: #e8f7d4;
  font: 600 11px/15px var(--mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}
#app.in-game .frame-meter {
  display: none;
}
/* A phone held upright: under the corner's buttons and the "turn your phone sideways" hint (rooms.css), on as many lines as it needs. */
@media (orientation: portrait) and (max-width: 560px) {
  .frame-meter {
    top: calc(max(10px, env(safe-area-inset-top)) + 118px);
    max-width: calc(100% - 20px);
    white-space: normal;
  }
}

/* "New version ready after this round" and the like (site/release-switch.js, Hud.release): one
   more line of the bottom bar's words, a row of its own under them, never over the corner's
   buttons or the join code. One line always: a narrow bar cuts it short rather than wrap. */
.status.has-release {
  flex-wrap: wrap;
  align-content: center;
  row-gap: 2px;
}
.status-release {
  flex: 0 0 100%;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  text-align: center;
  font-size: 12px;
  line-height: 1.3;
  font-weight: 600;
  color: var(--soft);
}
.bar-screen .status-release {
  font-size: 0.62em;
}
/* "New version, tap to load": the line is a button, in amber. Only its words take the tap (the
   row's empty ends do not): the bar's words sit between the thumbs' pads, and a jump or a bump
   that lands a little off must never reload the page. The words' tap area is 44 pixels tall, the
   smallest tap target anywhere, as a real row of its own (nothing reaches over the words above
   it), and the big screen's bar, otherwise of a fixed height, grows to hold it. */
button.status-release {
  display: flex;
  justify-content: center;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font-family: inherit;
  color: var(--amber);
  pointer-events: none;
}
button.status-release > span {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 10px;
  pointer-events: auto;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  touch-action: manipulation;
}
.bar-screen:has(button.status-release) {
  height: auto;
  min-height: var(--bar);
}
