/* Formby Property Tycoon — web.
   Brand follows the printed box and the iPhone app: charcoal, cream, SM yellow. */

/* Brand values taken from Theme.swift, not approximated:
   charcoal #3B3D43, yellow #FFDA06, felt #2B2D32 behind the board. */
:root {
  --ink: #2b2d32;
  --ink-2: #33363b;
  --ink-3: #3b3d43;
  --charcoal: #3b3d43;
  --cream: #f4efe4;
  --cream-dim: #a9a79f;
  --white: #fbfaf7;
  --yellow: #ffda06;
  --green: #31a34e;
  --red: #b01111;
  --radius: 14px;
  --gutter: 12px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

/* The Squirrel Nuts mark: an S with a compacted N through it. Sized to the text
   it sits in and nudged onto the baseline, like any currency symbol. */
.sn {
  height: 0.84em;
  width: 0.62em;
  vertical-align: -0.055em;
  margin-right: 0.02em;
  fill: currentColor;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  height: 100%;
  background: var(--ink);
  color: var(--cream);
  font: 16px/1.45 ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overscroll-behavior: none;
}

body {
  padding: var(--safe-t) 0 var(--safe-b);
}

#app {
  min-height: 100%;
}

h1 {
  font-size: clamp(1.5rem, 6vw, 2.1rem);
  line-height: 1.1;
  margin: 0;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 1.1rem;
  margin: 0;
}

p {
  margin: 0;
}

.sub {
  color: var(--cream-dim);
  font-size: 0.95rem;
}

.small {
  font-size: 0.85rem;
  color: var(--cream-dim);
}

/* ── screens ─────────────────────────────────────────────────────────── */

.screen {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 24px var(--gutter);
  align-items: center;
  text-align: center;
  justify-content: center;
}

/* Clear of the corner buttons. The app does the same thing — `HomeView.swift` gives
   the box lid a 48pt top padding with the comment "Clear of the settings button in
   the corner" — and without it the cog lands on the lid's top-right corner. */
.screen.home {
  padding-top: calc(var(--safe-t) + 58px);
}

.screen.game {
  justify-content: flex-start;
  gap: 8px;
  padding: 8px var(--gutter) calc(8px + var(--safe-b));
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 340px;
}

/* ── buttons ─────────────────────────────────────────────────────────── */

.btn {
  appearance: none;
  border: 0;
  border-radius: var(--radius);
  background: var(--yellow);
  color: #27231a;
  font: inherit;
  font-weight: 650;
  padding: 15px 18px;
  cursor: pointer;
  width: 100%;
  max-width: 340px;
  transition: transform 0.08s ease, filter 0.15s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn.ghost {
  background: var(--ink-3);
  color: var(--cream);
}

.btn.danger {
  background: var(--red);
  color: #fff;
}

.btn.small {
  padding: 9px 13px;
  font-size: 0.9rem;
  width: auto;
}

.btn.disabled {
  filter: grayscale(0.7) brightness(0.7);
  pointer-events: none;
}

.icon {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--cream-dim);
  font-size: 1.1rem;
  padding: 6px 10px;
  cursor: pointer;
}

.linkish {
  appearance: none;
  border: 0;
  background: none;
  color: var(--cream-dim);
  text-decoration: underline;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 4px;
}

/* ── home ────────────────────────────────────────────────────────────── */

.lid img {
  width: min(78vw, 300px);
  border-radius: 10px;
  box-shadow: 0 14px 40px rgb(0 0 0 / 0.5);
}

.credits {
  margin-top: auto;
  padding-top: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  max-width: 420px;
}

.credits p {
  font-size: 0.8rem;
  color: var(--cream-dim);
}

.credit-mark {
  height: 34px;
  opacity: 0.9;
}

/* ── lobby ───────────────────────────────────────────────────────────── */

.qr {
  background: #fff;
  padding: 10px;
  border-radius: 12px;
  width: min(60vw, 220px);
  line-height: 0;
}

.qr svg {
  width: 100%;
  height: auto;
  display: block;
}

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

.code-row code {
  font-size: 2rem;
  letter-spacing: 0.22em;
  font-weight: 700;
  color: var(--yellow);
  padding-left: 0.22em;
}

.code-input {
  font-size: 2rem;
  letter-spacing: 0.25em;
  text-align: center;
  text-transform: uppercase;
  width: 100%;
  max-width: 340px;
  padding: 14px;
  border-radius: var(--radius);
  border: 2px solid var(--ink-3);
  background: var(--ink-2);
  color: var(--cream);
  font-family: inherit;
}

.name-input {
  font-size: 1.05rem;
  text-align: center;
  width: 100%;
  max-width: 340px;
  padding: 14px;
  border-radius: var(--radius);
  border: 2px solid var(--ink-3);
  background: var(--ink-2);
  color: var(--cream);
  font-family: inherit;
}

.code-input:focus,
.name-input:focus {
  outline: none;
  border-color: var(--yellow);
}

.seats {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 340px;
}

.seat {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--ink-2);
  border-radius: var(--radius);
  padding: 9px 12px;
  text-align: left;
}

/* Everything except the "away" flag, wrapped so the whole row is one tap target.
   It is a <button> when the seat can be edited and a <span> when it can't, so all
   the button chrome has to be reset back to looking like the row it sits in. */
.seat-body {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  appearance: none;
  border: 0;
  margin: 0;
  padding: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
}

.seat.pickable .seat-body {
  cursor: pointer;
}

.seat.pickable .seat-body:focus-visible {
  outline: 2px solid var(--yellow);
  outline-offset: 4px;
  border-radius: 6px;
}

.seat.adrift {
  opacity: 0.5;
}

.ring {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 3px solid var(--ring, #888);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: #00000040;
  padding: 0;
  cursor: default;
}

/* The whole row is the button now, not the badge, so the cursor belongs on .seat-body
   and this is only here to anchor the dot. */
.seat.pickable .ring {
  position: relative;
}

/* A small pencil-ish dot, so it's obvious yours can be changed. */
.seat.pickable .ring::after {
  content: "";
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--yellow);
  border: 2px solid var(--ink-2);
}

.token-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 9px;
}

.token-choice {
  appearance: none;
  /* The border is in the piece's own colour, so it carries the same colour-only cue as
     the player pills and had the same problem: 2.5px is a hairline. */
  border: 4px solid var(--ring);
  background: var(--ink-3);
  color: var(--cream);
  border-radius: 13px;
  padding: 11px 7px 9px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  font: inherit;
}

.token-choice.on {
  background: var(--ring);
}

.token-choice img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.token-name {
  font-size: 0.76rem;
  font-weight: 650;
}

.token-choice em {
  font-style: normal;
  font-size: 0.66rem;
  opacity: 0.75;
}

.ring img {
  width: 76%;
  height: 76%;
  object-fit: contain;
}

.who {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.who em {
  font-style: normal;
  font-size: 0.78rem;
  color: var(--cream-dim);
}

.flag {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--cream-dim);
}

/* ── game: players bar ───────────────────────────────────────────────── */

.players {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

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

.topline {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.topline .players {
  flex: 1 1 auto;
  min-width: 0;
}

.menu-btn {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--ink-3);
  color: var(--cream);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.menu-btn .ico {
  width: 20px;
  height: 20px;
}

/* The Home screen's top-right corner — feedback, then settings, as on the app.
   Fixed rather than absolute so it stays put if the page scrolls: the whole point of
   moving these out of the footer was that nobody should have to go looking for them.
   z-30 puts them above the page and under every sheet and the opening titles. */
.home-corner {
  position: fixed;
  top: calc(var(--safe-t) + 10px);
  right: calc(var(--gutter) + 4px);
  z-index: 30;
  display: flex;
  gap: 6px;
}

/* A hair lighter than the in-game button: that one sits on the players bar, this one
   on the felt, and the felt is darker. */
.corner-btn {
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.corner-btn:hover {
  background: var(--ink-2, var(--ink-3));
}

/* White pill, going yellow on whoever's turn it is, ringed in their colour,
   name above the cash. Matches the app. */
.pill {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--white);
  color: var(--charcoal);
  border-radius: 999px;
  padding: 5px 11px 5px 6px;
  /* Thicker than it was (2.5px). The ring is what says whose pill this is, and a thin
     line of colour is the hardest possible way to carry that — hardest of all for
     anyone who finds the colours themselves difficult to tell apart. The piece
     artwork beside it is the cue that doesn't depend on colour at all, which is why
     it stays even when the pill is dimmed. */
  border: 4px solid var(--ring);
}

.pill.turn {
  background: var(--yellow);
}

.pill.out {
  opacity: 0.42;
  filter: grayscale(0.6);
}

.pill.adrift {
  border-style: dashed;
}

.pip {
  width: 22px;
  height: 22px;
  object-fit: contain;
  flex: 0 0 auto;
}

/* Four across is the tight case: shrink the piece and the name rather than let
   the cash — the thing people are actually reading — get squeezed out. */
.players.crowded .pill {
  padding: 4px 8px 4px 5px;
  gap: 4px;
}

.players.crowded .pip {
  width: 18px;
  height: 18px;
}

.players.crowded .nm {
  font-size: 0.66rem;
}

.players.crowded .cash {
  font-size: 0.8rem;
}

.pill .who {
  display: flex;
  flex-direction: column;
  line-height: 1.12;
  min-width: 0;
}

.pill .nm {
  font-size: 0.74rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pill .cash {
  font-size: 0.88rem;
  font-weight: 750;
  white-space: nowrap;
}

/* ── game: the board ─────────────────────────────────────────────────── */

/* `flex: 1 1 auto` gives this a definite height, which is what lets the board's
   `max-height: 100%` resolve — without it the board sizes purely off width and
   runs off the bottom in landscape. Aligning to the start keeps the board tucked
   under the players bar, so the leftover height on a tall phone falls between the
   board and the controls rather than being split around it. */
/* `flex: 1 1 0` so the height comes from the flex line rather than the content,
   which is what BoardView.fit() measures to size the square. Centred, so the
   leftover height on a tall phone sits evenly above and below rather than
   collecting in one lump. */
.board-host {
  width: 100%;
  flex: 1 1 0;
  display: grid;
  place-items: center;
  min-height: 0;
  /* The dice layer is absolutely positioned inside this; without a positioning
     context it escapes to the viewport and lands somewhere else entirely. */
  position: relative;
}

/* Square, always, and sized in JS from the host box — see BoardView.fit().
   Pure CSS can't express "the largest square that fits this box": an explicit
   width beats aspect-ratio, so max-height can never push the width back down,
   and the board runs off the bottom in landscape. */
.board-root {
  aspect-ratio: 1;
  width: 100%;
}

.board-stage {
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 8px;
  touch-action: none;
  position: relative;
  background: #0d0e10;
}

.board-surface {
  position: absolute;
  inset: 0;
  transform-origin: center center;
  transition: transform 0.18s ease-out;
}

.board-root.zoomed .board-surface {
  transition: none;
}

/* The gutter the ownership tabs live in. Tabs sit outside their square so they
   never cover a sponsor's logo, and every square is on the perimeter, so without
   this inset they'd fall outside the board and be clipped. */
.board-inner {
  position: absolute;
  inset: 2.6%;
}

/* An <img>, not a background — see the note in BoardView's constructor. object-fit:fill
   is what background-size: 100% 100% was doing: the artwork is square and so is the
   board, so stretching to the box and preserving the ratio come to the same thing, and
   fill means no letterboxing if a rounding error makes the box a pixel off square.
   max-width:none is insurance only: there is no blanket img rule in here today, but
   several components set one on their own images, and a stray cap on this one would
   shrink the board away from the squares drawn on top of it. */
.board-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: fill;
  border-radius: 3px;
}

/* A black square with pieces floating on it is a baffling thing to be handed, so say
   what happened. Only ever shown if the artwork itself fails to load. */
.board-stage.art-missing::after {
  content: "The board artwork didn't load — reload the page to try again.";
  position: absolute;
  inset: auto 8% 8% 8%;
  text-align: center;
  font-size: 13px;
  color: #d8d8d8;
}

.layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.layer.taps {
  pointer-events: auto;
}

.tap {
  position: absolute;
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.owner-tab {
  position: absolute;
  border-radius: 1px;
  box-shadow: 0 0 2px #0006;
}

.owner-tab.mortgaged {
  opacity: 0.45;
  filter: grayscale(0.6);
}

.building {
  position: absolute;
  background: var(--green);
  border-radius: 1.5px;
  box-shadow: 0 0 1.5px #000a;
  /* A new house grows into place. The app's BuildingsOverlay does the same with
     `.transition(.scale(scale: 0.2).combined(with: .opacity))`. Only transform and
     opacity, so a house that merely moves does not slide. */
  transition:
    transform 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.2),
    opacity 0.28s ease-out;
}

.building.rising {
  transform: scale(0.2);
  opacity: 0;
}

.building.hotel {
  background: var(--red);
  border-radius: 2px;
}

/* The pewter piece standing on a coloured base, the way the app draws it — an
   ellipse under the feet rather than a disc behind the whole thing. The colour
   is how you tell whose piece it is; at 13px bare pewter vanishes into the
   photograph. */
.piece {
  position: absolute;
  aspect-ratio: 1;
  display: grid;
  place-items: end center;
  /* `--hop` is set by BoardView to the current hop length, so the slide between
     squares takes exactly as long as the hop does. The app's BoardAnimator uses
     0.19s, or 0.15s for a long way round the board. */
  transition:
    left var(--hop, 0.19s) linear,
    top var(--hop, 0.19s) linear,
    width 0.2s ease,
    transform 0.095s ease-out;
  pointer-events: none;
}

/* Each hop lifts the piece off the board and puts it down again, which is what makes
   it read as counting rather than sliding. `BoardAnimator.hop` holds the lift for the
   first half of the step and drops it for the second. */
.piece.lifted {
  transform: translateY(-18%) scale(1.06);
}

.piece::before {
  content: "";
  grid-area: 1 / 1;
  align-self: end;
  width: 94%;
  height: 34%;
  border-radius: 50%;
  background: var(--ring);
  box-shadow: 0 0 0 1.5px var(--edge, #fff), 0 1px 3px #0009;
}

.piece img {
  grid-area: 1 / 1;
  align-self: end;
  width: 86%;
  height: 92%;
  object-fit: contain;
  object-position: bottom;
  margin-bottom: 9%;
  filter: drop-shadow(0 1px 1.5px #0008);
}

.piece.current::before {
  box-shadow:
    0 0 0 1.5px var(--edge, #fff),
    0 0 0 3.5px var(--ring),
    0 1px 4px #000b;
}

/* The square in play. */
.square-glow {
  position: absolute;
  border: 2.5px solid var(--yellow);
  border-radius: 3px;
  box-shadow: 0 0 10px #ffda0688, inset 0 0 8px #ffda0655;
  pointer-events: none;
  animation: glow 1.6s ease-in-out infinite;
}

@keyframes glow {
  50% {
    opacity: 0.55;
  }
}

.piece.adrift {
  opacity: 0.45;
  filter: grayscale(0.5);
}

/* ── game: ticker and actions ────────────────────────────────────────── */

.ticker {
  width: 100%;
  max-width: 480px;
  min-height: 3.6em;
  max-height: 4.6em;
  overflow: hidden;
  font-size: 0.85rem;
  color: var(--cream-dim);
  text-align: center;
}

.ticker p {
  margin: 1px 0;
}

.ticker p:last-child {
  color: var(--cream);
}

/* The action panel is a card, not loose buttons on the felt. */
.actions {
  width: 100%;
  max-width: 460px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  align-items: center;
  background: var(--white);
  color: var(--charcoal);
  border-radius: 18px;
  padding: 13px;
  box-shadow: 0 6px 20px #0004;
}

.actions:empty {
  display: none;
}

.panel-row {
  display: flex;
  gap: 7px;
  width: 100%;
  align-items: stretch;
}

.panel-row .btn {
  width: auto;
  flex: 1 1 auto;
  max-width: none;
}

.panel-row .spacer {
  display: none;
}

.ico {
  width: 1.15em;
  height: 1.15em;
  flex: 0 0 auto;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  white-space: nowrap;
}

/* Three buttons across a phone is tight; let the label shrink before it wraps. */
.panel-row .btn {
  padding-inline: 12px;
  font-size: clamp(0.84rem, 3.4vw, 1rem);
}

/* Inside the panel the secondary buttons are dark on white, as in the app. */
.actions .btn.ghost {
  background: var(--charcoal);
  color: var(--white);
}

/* `--cream-dim` is for dim text on a dark screen; inside the cream panel it is
   grey on near-white and barely a shade off the background. */
.actions .small {
  color: #4a4d53;
}

/* The winner's name, on cream. Yellow is the brand but it is a highlighter colour:
   on near-white it has barely a point of contrast and the one line everybody looks
   at was the hardest to read on the screen. The gold is carried by the winner's row
   right beneath it instead. */
.actions .prompt.big {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.offer {
  display: flex;
  gap: 12px;
  align-items: center;
  width: 100%;
  text-align: left;
}

.offer-deed {
  width: 76px;
  border-radius: 5px;
  flex: 0 0 auto;
  box-shadow: 0 1px 4px #0003;
}

.offer-text h3 {
  margin: 0 0 2px;
  font-size: 1.12rem;
  line-height: 1.15;
}

.offer-price {
  display: block;
  font-size: 1.05rem;
  font-weight: 700;
}

.offer-text .small {
  color: #6c6e74;
}

.countdown {
  margin-left: 8px;
  font-variant-numeric: tabular-nums;
  color: #6c6e74;
  font-weight: 600;
}

.trade-offer {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 5px;
  text-align: left;
}

.trade-offer .small {
  color: #6c6e74;
}

.prompt {
  font-weight: 650;
}

.prompt.big {
  font-size: 1.3rem;
  color: var(--yellow);
}

.waiting-for {
  color: var(--cream-dim);
  font-size: 0.92rem;
  padding: 12px 0;
}

.bidder {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  justify-content: space-between;
}

/* The deed under the hammer. Sized so it never pushes the bid buttons off a small
   screen — on a phone in landscape the buttons matter more than the picture. */
.auction-deed {
  display: block;
  max-height: 32vh;
  max-width: 62%;
  margin: 6px auto 2px;
  border-radius: 8px;
  box-shadow: 0 6px 16px #0008;
}

/* The feedback box and the diagnostics log. Both deliberately plain: one is a box to
   type in, the other is a wall of text to read, and neither is improved by styling. */
.feedback-box {
  width: 100%;
  min-height: 7.5em;
  resize: vertical;
  padding: 10px 12px;
  border-radius: 10px;
  border: 2px solid var(--ink-3);
  background: var(--ink-2);
  color: var(--cream);
  font: inherit;
  line-height: 1.4;
}

.feedback-box:focus {
  outline: none;
  border-color: var(--yellow);
}

.diagnostics {
  max-height: 46vh;
  overflow: auto;
  margin: 0;
  padding: 10px;
  border-radius: 8px;
  background: var(--ink-2);
  color: var(--cream);
  font: 11px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: pre-wrap;
  word-break: break-word;
  -webkit-overflow-scrolling: touch;
}

.bid-row {
  display: flex;
  gap: 6px;
}

/* ── deed row ────────────────────────────────────────────────────────── */

.deed-row {
  width: 100%;
  max-width: 560px;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 2px 4px;
  scrollbar-width: none;
  min-height: 44px;
}

.deed-row::-webkit-scrollbar {
  display: none;
}

.deed-row-pip {
  width: 24px;
  height: 24px;
  object-fit: contain;
  flex: 0 0 auto;
  opacity: 0.85;
}

.deed-row-empty {
  font-size: 0.78rem;
  color: var(--cream-dim);
}

.deed-thumb {
  position: relative;
  flex: 0 0 auto;
  width: 38px;
  height: 52px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  overflow: hidden;
  background: var(--white);
  cursor: pointer;
  box-shadow: 0 1px 3px #0006;
}

.deed-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  display: block;
}

.deed-thumb.mortgaged {
  filter: grayscale(0.85) brightness(0.72);
}

.deed-built {
  position: absolute;
  right: 1px;
  bottom: 1px;
  background: var(--green);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 800;
  line-height: 1;
  padding: 2px 3px;
  border-radius: 3px;
}

/* ── card and purchase flashes ───────────────────────────────────────── */

.flash {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: #000c;
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  padding: 24px;
  animation: fade 0.18s ease;
  cursor: pointer;
}

.flash-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: 340px;
  text-align: center;
}

.flash-card img {
  width: 100%;
  max-width: 280px;
  max-height: 58dvh;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 16px 48px #000a;
  animation: pop 0.26s cubic-bezier(0.2, 1.3, 0.5, 1);
}

@keyframes pop {
  from {
    transform: scale(0.82);
    opacity: 0;
  }
}

.flash-text {
  color: var(--cream);
  font-size: 0.95rem;
  line-height: 1.35;
}

.flash-hint,
.flash-price {
  color: var(--cream-dim);
  font-size: 0.82rem;
}

.flash-price {
  color: var(--yellow);
  font-size: 1.05rem;
  font-weight: 700;
}

.flash-yours {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--cream);
  font-size: 1.5rem;
  font-weight: 750;
}

.flash-pip {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

/* ── dice ──────────────────────────────────────────────────────────────
   Real cubes. See src/ui/dice.ts: the element holding the value is never
   animated, so a die cannot come to rest on the wrong number. */

.dice-layer {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  z-index: 5;
  transition: opacity 0.5s ease;
}

.dice-layer.going {
  opacity: 0;
}

/* --die is the one size everything below is written in terms of, so the whole
   throw scales with it. em works out of it via font-size. */
.dice-scene {
  --die: 46px;
  --half: calc(var(--die) / 2);
  font-size: var(--die);
  width: var(--die);
  height: var(--die);
  perspective: calc(var(--die) * 14);
}

/* Seen from above and in front, as the app's camera is.

   27deg, not the 54deg this used to be. The app's SceneKit camera sits at
   (0, 9.5, 4.6) looking at (0, 0.3, 0), which is 26.6 degrees off vertical — nearly
   overhead. At 54 you are looking at the dice from twice as far over: the top face is
   squashed to a sliver and the two side faces dominate, so what you read is the shape
   of the cube rather than the number on it. Reported from a real game as "it's the
   perspective rather than the pips", which is exactly right. */
.dice-table {
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transform: rotateX(27deg);
}

.die-drift,
.die-hop,
.die-spin-x,
.die-spin-y,
.die-cube {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
}

.die-face {
  position: absolute;
  inset: 0;
  border-radius: calc(var(--die) * 0.13);
  background: #fdfaf2;
  border: 1px solid #0000001f;
  box-shadow: inset 0 0 calc(var(--die) * 0.18) #0000001c;
  backface-visibility: hidden;
}

.die-face i {
  --pip: 19%;
  position: absolute;
  width: var(--pip);
  height: var(--pip);
  margin: calc(var(--pip) / -2) 0 0 calc(var(--pip) / -2);
  border-radius: 50%;
  background: #3b3d43;
}

/* Held still for anyone who asked for that: the numbers are the point. */
.dice-layer.still .die-drift,
.dice-layer.still .die-hop,
.dice-layer.still .die-spin-x,
.dice-layer.still .die-spin-y {
  animation: none !important;
}

.dice-total {
  position: absolute;
  bottom: 14%;
  background: var(--yellow);
  color: var(--charcoal);
  font-weight: 800;
  font-size: 1.15rem;
  min-width: 2.1em;
  text-align: center;
  padding: 5px 10px;
  border-radius: 999px;
  box-shadow: 0 4px 12px #0008;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.2s ease, transform 0.3s cubic-bezier(0.2, 1.3, 0.5, 1);
}

.dice-total.in {
  opacity: 1;
  transform: scale(1);
}

/* ── standings ───────────────────────────────────────────────────────── */

.standings {
  list-style: none;
  counter-reset: place;
  margin: 0;
  padding: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.standings li {
  counter-increment: place;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 10px;
  background: #00000010;
}

.standings li::before {
  content: counter(place);
  font-weight: 800;
  color: #8a8c92;
  min-width: 1.2em;
}

.standings li:first-child {
  background: var(--yellow);
}

.standings li.out {
  opacity: 0.55;
}

.standings .nm {
  flex: 1 1 auto;
  text-align: left;
  font-weight: 600;
  font-size: 0.9rem;
}

.standings .cash {
  font-weight: 750;
}

/* ── sheets ──────────────────────────────────────────────────────────── */

.sheet-back {
  position: fixed;
  inset: 0;
  background: #000a;
  backdrop-filter: blur(3px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 50;
  animation: fade 0.16s ease;
}

@keyframes fade {
  from {
    opacity: 0;
  }
}

.sheet {
  background: var(--ink-2);
  width: 100%;
  max-width: 520px;
  max-height: 86dvh;
  border-radius: 18px 18px 0 0;
  display: flex;
  flex-direction: column;
  padding-bottom: var(--safe-b);
  animation: rise 0.2s ease;
}

@keyframes rise {
  from {
    transform: translateY(18px);
  }
}

/* flex: none on both ends, or a long sheet — the rules, the credits — squashes its
   own header to nothing and the scrolling body paints over the close button. */
.sheet header {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 10px 10px 18px;
  border-bottom: 1px solid var(--ink-3);
}

.sheet-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 14px 18px;
  text-align: left;
}

.sheet footer {
  flex: none;
  padding: 10px 18px;
  display: flex;
  gap: 8px;
  border-top: 1px solid var(--ink-3);
}

/* .btn caps itself at 340px, which is right on a screen where it stands on its own
   but wrong in here: the sheet is 520px, so the button stopped 160px short and sat
   hard against the left edge while the content above it ran the full width. In a
   footer a button spans it, and two of them split it. */
.sheet footer .btn {
  flex: 1;
  max-width: none;
}

.prose p {
  margin: 0 0 10px;
  font-size: 0.92rem;
  color: var(--cream-dim);
}

.deed-art {
  width: 100%;
  max-width: 230px;
  display: block;
  margin: 0 auto 14px;
  border-radius: 8px;
}

.facts {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 5px 14px;
  margin: 0;
  font-size: 0.9rem;
}

.facts dt {
  color: var(--cream-dim);
}

.facts dd {
  margin: 0;
  text-align: right;
  font-weight: 600;
}

.manage {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.manage-row {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--ink-3);
}

.manage-row.mortgaged {
  opacity: 0.6;
}

.manage-row .nm {
  font-size: 0.9rem;
  flex: 1 1 auto;
}

.manage-row em {
  font-style: normal;
  color: var(--cream-dim);
  font-size: 0.8rem;
}

.swatch {
  width: 7px;
  height: 26px;
  border-radius: 3px;
  background: var(--ink-3);
  flex: 0 0 auto;
}

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

/* ── trading ─────────────────────────────────────────────────────────── */

.trade {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.trade h4 {
  margin: 0 0 6px;
  font-size: 0.86rem;
  color: var(--cream-dim);
  font-weight: 600;
}

.trade-side {
  background: #00000026;
  border-radius: 12px;
  padding: 10px 11px;
}

.who-chips,
.prop-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  appearance: none;
  border: 1.5px solid var(--ink-3);
  background: var(--ink-3);
  color: var(--cream);
  border-radius: 999px;
  padding: 6px 11px;
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  width: auto;
  max-width: none;
}

.chip.on {
  background: var(--yellow);
  border-color: var(--yellow);
  color: var(--charcoal);
  font-weight: 650;
}

/* A colour dot rather than a thick left border, which reads as a crescent once
   the chip is fully rounded. */
.chip.prop {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.chip.prop::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--swatch, var(--cream-dim));
  flex: 0 0 auto;
  box-shadow: 0 0 0 1px #0003;
}

.chip.frozen {
  opacity: 0.4;
}

.trade-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 9px;
}

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

.stepper-value {
  min-width: 5.2em;
  text-align: center;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.warn {
  color: #ffb4a8;
  font-size: 0.85rem;
}

/* ── sponsors ────────────────────────────────────────────────────────── */

.sponsors {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sponsor-group h4 {
  margin: 0 0 8px;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cream-dim);
}

.sponsor-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 9px;
}

.sponsor-list li {
  background: var(--white);
  border-radius: 11px;
  padding: 11px 9px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  text-align: center;
}

.sponsor-list li.dark-tile {
  background: var(--charcoal);
}

.sponsor-list li.dark-tile span {
  color: var(--cream);
}

.sponsor-list img {
  height: 38px;
  width: 100%;
  object-fit: contain;
}

.sponsor-list span {
  font-size: 0.74rem;
  color: var(--charcoal);
  line-height: 1.2;
}

.sponsors hr {
  border: 0;
  border-top: 1px solid var(--ink-3);
  width: 100%;
  margin: 2px 0;
}

.sponsors .btn {
  text-decoration: none;
  text-align: center;
}

/* Each tile is one link now, so the card's layout lives on the anchor. */
.sponsor-list a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  height: 100%;
  text-decoration: none;
}

.sponsor-list.tall img {
  height: 50px;
}

.sponsor-name-fallback {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--charcoal);
  line-height: 1.2;
}

.dark-tile .sponsor-name-fallback {
  color: var(--cream);
}

.hospice-plate {
  align-self: center;
  background: var(--white);
  border-radius: 10px;
  padding: 10px 16px;
}

.hospice-plate img {
  display: block;
  height: 40px;
}

.credit-mark.wide {
  height: 44px;
  align-self: center;
}

.credit-present {
  margin: 0;
  text-align: center;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--cream);
}

.credit-title {
  margin: -8px 0 0;
  text-align: center;
  font-size: 0.86rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  color: var(--yellow);
}

.sponsors .small {
  text-align: center;
  margin: 0;
}

.sponsor-group.winners {
  text-align: center;
}

.sponsor-group.winners p {
  margin: 0 0 3px;
  font-size: 0.86rem;
  color: var(--cream);
}

/* ── the seat editor ─────────────────────────────────────────────────── */

.seat-editor {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Same reasoning as the footer button: .name-input's 340px cap is for the join screen,
   where it is the only thing on the page. Here it is one of four things stacked between
   the sheet's two edges, and a short box among full-width ones reads as a mistake. */
.seat-editor .name-input {
  max-width: none;
}

.seat-editor .field-label {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cream-dim);
}

.seat-editor .field-label + .token-picker {
  margin-top: 2px;
}

.seat-editor .name-input + .field-label {
  margin-top: 12px;
}

/* One row of six, as the app has it. No captions: the pieces are distinctive, and
   six names underneath turn a row into a grid and the sheet into a page. */
.seat-editor .token-picker {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

/* Each piece carries its own colour, as the app's TokenBadge does: a quiet tint
   and ring when it's free, the full colour when it's yours. Without it the row is
   six grey pewter shapes and you don't find out the boat makes you blue until the
   board appears. */
.seat-editor .token-choice {
  position: relative;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  padding: 0;
  background: color-mix(in srgb, var(--ring) 12%, var(--ink-2));
  border: 2px solid color-mix(in srgb, var(--ring) 45%, transparent);
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}

.seat-editor .token-choice img {
  width: 76%;
  height: 76%;
  object-fit: contain;
}

/* The piece's own colour, not the brand yellow: this is the moment you find out
   that choosing the boat makes you the blue one on the board. */
.seat-editor .token-choice.on {
  border-color: var(--ring);
  background: color-mix(in srgb, var(--ring) 42%, var(--ink-2));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 30%, transparent);
}

/* Somebody else has it. Still tappable — tapping swaps the two, which beats
   refusing in a game where the phone goes round the table — but dimmed so it's
   clear it isn't free. */
.seat-editor .token-choice.held img {
  opacity: 0.35;
}

/* Somebody else's piece: the swap arrows sit in the corner rather than over the
   piece, so it still reads as itself. */
.seat-editor .token-choice.held::after {
  content: "⇄";
  position: absolute;
  right: 3px;
  bottom: 1px;
  font-size: 0.72rem;
  line-height: 1;
  color: var(--cream);
  opacity: 0.8;
}

/* The hint that a seat can be edited at all. Quiet, because it is guidance, not
   information — once somebody has tapped one they never need it again. */
.tap-hint {
  display: block;
  font-size: 0.72rem;
  color: var(--cream-dim);
  opacity: 0.75;
  font-style: normal;
}

/* ── settings ────────────────────────────────────────────────────────── */

.settings {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.setting-group h4 {
  margin: 0 0 8px;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cream-dim);
}

.setting-group .small {
  margin: 7px 0 0;
  line-height: 1.35;
}

/* A row you can hit anywhere, the way a Form row behaves. The checkbox itself is
   kept in the layout rather than display:none so it stays focusable by keyboard. */
.setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 13px;
  background: var(--ink-2);
  border-radius: 11px;
  margin-bottom: 6px;
  color: var(--cream);
  font-size: 0.95rem;
  cursor: pointer;
}

.setting.unavailable {
  opacity: 0.5;
  cursor: default;
}

.setting input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.switch {
  flex: none;
  width: 44px;
  height: 26px;
  border-radius: 13px;
  background: var(--ink-3);
  box-shadow: inset 0 0 0 1px #0004;
  position: relative;
  transition: background 0.16s;
}

.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--white);
  transition: transform 0.16s;
}

.setting input:checked ~ .switch {
  background: var(--green);
}

.setting input:checked ~ .switch::after {
  transform: translateX(18px);
}

.setting input:focus-visible ~ .switch {
  outline: 2px solid var(--yellow);
  outline-offset: 2px;
}

/* ── rules and the log ───────────────────────────────────────────────── */

.rules h4 {
  margin: 14px 0 4px;
  font-size: 0.98rem;
  color: var(--cream);
}

.rules h4:first-child {
  margin-top: 0;
}

.log-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.log-list li {
  padding: 9px 12px;
  background: var(--ink-2);
  color: var(--cream);
  font-size: 0.88rem;
  line-height: 1.35;
}

.log-list li:first-child {
  border-radius: 10px 10px 0 0;
  background: var(--ink-3);
}

.log-list li:last-child {
  border-radius: 0 0 10px 10px;
}

/* ── the deed sheet ──────────────────────────────────────────────────── */

.deed-owner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 0 0 10px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--cream);
}

.deed-owner.warn {
  color: var(--yellow);
  font-weight: 400;
  font-size: 0.85rem;
}

.deed-owner-pip {
  height: 22px;
  width: 22px;
  object-fit: contain;
}

.deed-owner-built {
  font-weight: 400;
  color: var(--cream-dim);
}

.deed-blurb {
  margin: 0 0 14px;
  text-align: center;
  font-size: 0.95rem;
  line-height: 1.4;
  color: var(--cream);
}

/* ── the bill ────────────────────────────────────────────────────────── */

.flash-card.bill {
  gap: 9px;
}

.bill-heading {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.22em;
  color: var(--yellow);
}

/* The deed arrives at a slight angle with DUE stamped across it, as the app's
   PaymentOverlay does — the tilt is what stops it reading as a dialog. */
.bill-art {
  position: relative;
  display: grid;
  place-items: center;
}

/* The direct child only: a square crop nests a full-size board image inside this
   element, and clamping that one's height would move the crop window. */
.bill-art > img {
  max-height: 34dvh;
  transform: rotate(-3deg);
}

/* A square cut from the board, for a bill that has no deed behind it. */
.bill-art .square-art {
  filter: drop-shadow(0 16px 36px #000a);
  transform: rotate(-3deg);
}

/* The crop works by oversizing the board image inside a small window, so none of the
   overlay's own image rules may touch it — `max-width: 280px` alone shrinks the board
   to a thumbnail and the window then shows its middle instead of the square. */
.square-art img {
  max-width: none;
  max-height: none;
  min-width: 0;
  border-radius: 0;
  box-shadow: none;
  animation: none;
  object-fit: fill;
}

.bill-stamp {
  position: absolute;
  font-size: 2.1rem;
  font-weight: 900;
  letter-spacing: 0.22em;
  color: var(--red);
  background: #fffffff0;
  border: 3px solid var(--red);
  border-radius: 6px;
  padding: 1px 10px 2px;
  transform: rotate(-16deg);
  animation: stamp 0.26s cubic-bezier(0.2, 1.4, 0.4, 1) 0.14s backwards;
}

@keyframes stamp {
  from {
    transform: rotate(-16deg) scale(3);
    opacity: 0;
  }
}

.bill-place {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--cream);
}

.bill-amount {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 2.5rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  color: var(--yellow);
}

.bill-amount .sn {
  height: 0.78em;
  width: 0.6em;
}

.bill-who {
  margin: 0;
  /* Full width of the card, or the row shrinks to fit and wraps after every item. */
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px 7px;
  font-size: 0.94rem;
  font-weight: 700;
  color: var(--cream);
}

/* Names are the player's own, so they can be anything. Keep each one whole and let
   the row wrap if it has to — a truncated "Pl… → Th…" says nothing at all. */
.bill-who span {
  white-space: nowrap;
}

/* Beats `.flash-card img { width: 100% }`, which otherwise makes each piece as wide
   as the card and wraps the row onto four lines. */
.flash-card .bill-pip {
  flex: none;
  height: 24px;
  width: 24px;
  object-fit: contain;
  border-radius: 0;
  box-shadow: none;
  animation: none;
}

.bill-arrow {
  color: var(--cream-dim);
  font-weight: 400;
}

.flash-card.bill .btn {
  margin-top: 4px;
  min-width: 200px;
}

/* A bill waiting to be acknowledged: the cursor says the backdrop isn't the button. */
.flash.must-tap {
  cursor: default;
}

/* ── chrome ──────────────────────────────────────────────────────────── */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(18px + var(--safe-b));
  transform: translate(-50%, 16px);
  background: #000d;
  color: var(--cream);
  padding: 11px 17px;
  border-radius: 11px;
  font-size: 0.88rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 60;
  max-width: 86vw;
  text-align: center;
}

.toast.on {
  opacity: 1;
  transform: translate(-50%, 0);
}

.conn {
  position: fixed;
  top: calc(6px + var(--safe-t));
  left: 50%;
  transform: translateX(-50%);
  background: var(--red);
  color: #fff;
  font-size: 0.72rem;
  padding: 3px 10px;
  border-radius: 20px;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 40;
  pointer-events: none;
}

.conn.on {
  opacity: 1;
}

.spinner {
  width: 30px;
  height: 30px;
  border: 3px solid var(--ink-3);
  border-top-color: var(--yellow);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── money moving ────────────────────────────────────────────────────────────
   The layer sits over everything and catches nothing. perspective is what makes
   rotate3d on a note read as a banknote flipping over rather than squashing. */
.money-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 60;
  perspective: 600px;
}

/* 32×17 with a pale oval through the middle, as NoteView draws it. Positioned
   entirely by transform — left/top stay at 0 so there is one thing to animate. */
.note {
  position: absolute;
  left: 0;
  top: 0;
  width: 32px;
  height: 17px;
  border-radius: 2px;
  border: 0.8px solid rgb(59 61 67 / 0.55);
  box-shadow: 0 1px 2px #0000004d;
  will-change: transform, opacity;
}

.note::after {
  content: "";
  position: absolute;
  inset: 3.5px 8px;
  border-radius: 50%;
  background: #ffffffbf;
}

/* "+200" / "−150". Monospaced digits so a figure doesn't jiggle as it drifts. */
.cash-delta {
  position: absolute;
  transform: translate(-50%, 6px) scale(0.4);
  padding: 2px 7px;
  border-radius: 999px;
  background: #fffffff2;
  font-size: 0.75rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  box-shadow: 0 2px 4px #00000059;
  opacity: 1;
  will-change: transform, opacity;
}

.cash-delta.up {
  color: #1fa14a;
  border: 1px solid rgb(31 161 74 / 0.45);
}

.cash-delta.down {
  color: #e8262a;
  border: 1px solid rgb(232 38 42 / 0.45);
}

/* Pops out on a spring, then drifts down and fades — 0.3s then 1.1s, as the app's
   two withAnimation calls do it. */
.cash-delta.popped {
  transform: translate(-50%, 6px) scale(1);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.cash-delta.drifted {
  transform: translate(-50%, 30px) scale(1);
  opacity: 0;
  transition: transform 1.1s ease-in, opacity 1.1s ease-in;
}

@media (prefers-reduced-motion: reduce) {
  .cash-delta.popped {
    transition: none;
  }
}

/* The connection log. Monospaced and scrollable: it is meant to be read quickly and
   copied, not admired. */
.log-dump {
  max-height: 52dvh;
  overflow: auto;
  background: var(--ink);
  border-radius: 10px;
  padding: 10px 12px;
}

.log-dump pre {
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  line-height: 1.5;
  color: var(--cream-dim);
  white-space: pre-wrap;
  word-break: break-word;
}

/* ── Board effects, ported from BoardEffects.swift ──────────────────────────
   Two short-lived marks on a square, both in the brand yellow.

   The target is lit three squares before the piece arrives, not when the dice
   settle: counting a token round the board is half the fun of a roll, and naming
   the destination up front gives the answer away. It sits under the pieces so the
   one arriving lands on top of it.

   Values are the app's, not approximations of it — fill at 16%, a 2.5px ring
   growing to 1.3 and fading over 0.62s on a loop for the target; a 3px ring
   growing to 1.4 over 0.75s, once, for the landing. */

.layer.effects-under { z-index: 0; }
.layer.effects-over { z-index: 3; }

.target-ripple,
.land-pulse {
  position: absolute;
  border-radius: 4px;
  pointer-events: none;
}

.target-ripple {
  /* #ffda06 at 16%. */
  background: #ffda0629;
}

.target-ripple::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 2.5px solid var(--yellow);
  border-radius: 4px;
  animation: target-ripple 0.62s ease-out infinite;
}

@keyframes target-ripple {
  from { transform: scale(1); opacity: 0.95; }
  to { transform: scale(1.3); opacity: 0; }
}

.land-pulse {
  border: 3px solid var(--yellow);
  animation: land-pulse 0.75s ease-out forwards;
}

@keyframes land-pulse {
  from { transform: scale(1); opacity: 1; }
  to { transform: scale(1.4); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  /* Still say where the piece is going, just without the beating ring. */
  .target-ripple::after { animation: none; opacity: 0.95; }
  .land-pulse { animation: none; opacity: 0; }
  .piece.lifted { transform: none; }
}

/* While a piece is still travelling, nothing is tappable — the app does the same.
   Dimmed rather than hidden: buttons vanishing and reappearing would move the whole
   panel under someone's thumb between one tap and the next. */
.actions.busy {
  pointer-events: none;
  opacity: 0.55;
  transition: opacity 0.15s ease;
}

/* ── the end of a game ────────────────────────────────────────────────────── */
/*
   Mirrors the app's HospiceCard (`InfoViews.swift`). The game is free and takes
   no money, so this is the only ask it ever makes — which is why it gets a card
   of its own rather than a line of text, and why it sits above everything else
   on the screen bar the result itself.
*/
/*
   The end-of-game card sits in `.actions`, which is cream with charcoal type — not
   the dark screens the rest of the app is built on. The first version of this card
   was written in dark-screen colours: white-at-8% backgrounds, white-at-55% text.
   On cream that is a card you cannot see and a link that is not there at all. Every
   colour here is picked against `--white`.
*/
.hospice-card {
  display: grid;
  justify-items: center;
  gap: 0.6rem;
  margin: 0.75rem 0 0;
  padding: 1.2rem 1.1rem;
  text-align: center;
  background: var(--cream);
  border: 1.5px solid rgb(59 61 67 / 20%);
  border-radius: 16px;
}

.hospice-card .small {
  max-width: 34ch;
  color: #4a4d53;
}

.hospice-card .prompt {
  font-size: 1.12rem;
  font-weight: 800;
  color: var(--ink);
}

/* The charity is what this screen is for, so the mark is big enough to read the
   name on it rather than a thumbnail. */
.hospice-mark {
  height: 68px;
  padding: 10px 14px;
  background: #fff;
  border: 1px solid rgb(59 61 67 / 14%);
  border-radius: 12px;
  box-shadow: 0 2px 8px #0000001a;
}

/* Quiet on purpose — it sits under the hospice ask and must not compete with it —
   but quiet means smaller and lighter in weight, not invisible. */
.also-by {
  display: block;
  margin-top: 0.7rem;
  font-size: 0.9rem;
  font-weight: 650;
  text-align: center;
  color: rgb(59 61 67 / 78%);
  text-decoration: underline;
  text-decoration-color: rgb(59 61 67 / 30%);
  text-underline-offset: 3px;
}

.also-by:hover,
.also-by:focus-visible {
  color: var(--ink);
  text-decoration-color: currentColor;
}

/* ── game length, in the lobby ────────────────────────────────────────────── */
/*
   The app asks this on a Host sheet before the lobby; the web goes straight to
   the lobby, so it is asked here. Chips rather than a <select> because the
   options are five short words and a native picker on iOS covers half the
   screen to show them.
*/
.length-label {
  margin: 0.4rem 0 0;
  text-align: center;
}

.length-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
}

.chip {
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--paper, #fff);
  background: rgb(255 255 255 / 10%);
  border: 1px solid rgb(255 255 255 / 20%);
  border-radius: 999px;
  cursor: pointer;
}

.chip.chosen {
  color: #2b2d32;
  background: var(--yellow, #ffda06);
  border-color: var(--yellow, #ffda06);
}

/* ── the intro cards ──────────────────────────────────────────────────────── */
/*
   The web's own version of the app's onboarding. Full-screen rather than a sheet:
   it is the first thing a stranger sees on a forwarded link, and a dismissible
   panel over a home screen invites dismissing before reading.
*/
.intro-back {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 16px;
  overflow-y: auto;
  background: var(--felt, #2b2d32);
}

.intro-card {
  position: relative;
  width: min(100%, 30rem);
  margin: auto;
  padding: 1.4rem 1.2rem 1.2rem;
  text-align: center;
}

.intro-card h2 {
  margin: 0.2rem 0 0.8rem;
  font-size: clamp(1.4rem, 6vw, 1.9rem);
  color: var(--yellow, #ffda06);
}

.intro-skip {
  position: absolute;
  top: 0;
  right: 0.4rem;
}

.intro-kicker {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgb(255 255 255 / 55%);
}

.intro-text {
  margin: 0 0 0.7rem;
  font-size: 0.95rem;
  line-height: 1.5;
  text-align: left;
  color: rgb(255 255 255 / 82%);
}

.intro-rows,
.intro-steps {
  margin: 0 0 1rem;
  padding: 0;
  text-align: left;
}

.intro-rows li {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.55rem 0.75rem;
  margin-bottom: 0.4rem;
  list-style: none;
  background: rgb(255 255 255 / 8%);
  border-radius: 10px;
}

.intro-rows strong {
  font-size: 0.95rem;
  color: #fff;
}

.intro-rows span {
  font-size: 0.82rem;
  color: rgb(255 255 255 / 65%);
}

.intro-steps {
  padding-left: 1.3rem;
}

.intro-steps li {
  margin-bottom: 0.4rem;
  font-size: 0.95rem;
  color: rgb(255 255 255 / 85%);
}

.intro-dots {
  display: flex;
  gap: 0.35rem;
  justify-content: center;
  margin: 0.9rem 0;
}

.intro-dots .dot {
  width: 7px;
  height: 7px;
  background: rgb(255 255 255 / 25%);
  border-radius: 50%;
}

.intro-dots .dot.on {
  background: var(--yellow, #ffda06);
}

.intro-nav {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
}

.intro-nav .btn {
  min-width: 7.5rem;
}

/* Offers you have made and can still take back. Mirrors TradeView's section. */
.open-offers-head {
  margin: 1rem 0 0.3rem;
  font-weight: 650;
}

/* "Ends X from now" under the ticker, as GameView.swift:570 shows it. */
/* ── the clock on a timed game ────────────────────────────────────────────── */
/*
   Its own element below the ticker, because the ticker only redraws when something
   happens and a clock that redraws when something happens is not a clock. Words
   while there is plenty of time, digits once the end is close enough to play to,
   and a red pulse for the last minute.
*/
.clock {
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  color: var(--cream-dim);
  min-height: 1.1rem;
  text-align: center;
}

.clock:empty {
  display: none;
}

.clock.close {
  font-size: 1.05rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--yellow);
}

.clock.urgent {
  font-size: 1.15rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #ff5a4f;
  animation: clock-beat 1s ease-in-out infinite;
}

@keyframes clock-beat {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.72; transform: scale(1.06); }
}

@media (prefers-reduced-motion: reduce) {
  .clock.urgent { animation: none; }
}

/* ── the sponsors sheet, centred ──────────────────────────────────────────── */
/*
   It reads as a credits page and the app centres it throughout (`SponsorGrid` is
   a two-column grid; `InfoViews` sets .multilineTextAlignment(.center)). Three
   things were off on a wide screen:

     - group headings inherited left while "Our winners" set its own centre, so
       the sheet alternated alignment down the page;
     - `.sponsor-list` uses auto-fill, which keeps empty tracks, so a group with
       fewer logos than columns packed them to the left;
     - `.btn` is width:100% with max-width:340px, so flex stretch hit the cap and
       left the donate button against the left edge with a gap to its right.
*/
.sponsors {
  text-align: center;
}

.sponsors .sponsor-list {
  /* auto-FIT, not auto-fill: fill keeps the empty tracks, so a group with two
     logos in a three-column sheet left-packs them and justify-content has nothing
     to centre. fit collapses the empty track; the 200px cap stops two tiles
     ballooning to half the sheet each once they are free to grow. */
  grid-template-columns: repeat(auto-fit, minmax(140px, 200px));
  justify-content: center;
}

.sponsors .btn {
  margin-inline: auto;
}

.sponsors hr {
  width: 100%;
}

/* ── confetti cannon ──────────────────────────────────────────────────────── */
/*
   Fired once when a game ends. Over everything, catching nothing: the layer never
   takes a pointer event, so "Back to the start" underneath stays live throughout.
   `confetti.ts` sets the per-piece custom properties; the motion is one keyframe —
   up and outwards fast, then falling and fading.
*/
.confetti {
  position: fixed;
  inset: 0;
  z-index: 75;
  overflow: hidden;
  pointer-events: none;
}

.confetti i {
  position: absolute;
  bottom: 6%;
  width: 9px;
  height: 13px;
  border-radius: 2px;
  opacity: 0;
  will-change: transform, opacity;
  animation: confetti-fly var(--t) cubic-bezier(0.17, 0.62, 0.44, 1) var(--d) forwards;
}

@keyframes confetti-fly {
  0% {
    transform: translate(0, 0) rotate(0deg);
    opacity: 1;
  }
  55% {
    transform: translate(calc(var(--dx) * 0.78), var(--peak)) rotate(calc(var(--spin) * 0.6));
    opacity: 1;
  }
  100% {
    transform: translate(var(--dx), var(--dy)) rotate(var(--spin));
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .confetti { display: none; }
}

/* ── board effects: the GO burst, the barriers, a building landing ────────── */
/*
   Ported from `BoardEffects.swift` (GoBurstView, BarrierDropView) and
   `ActionOverlays.swift` (BuildDropView). The board had only the landing pulse and
   the destination ripple, so passing GO, being sent to the Level Crossing and putting
   a house down all happened in silence as far as the board was concerned — correct,
   and completely inert.

   All three sit in the `effects-over` layer and remove themselves. None of them take
   a pointer event.
*/
.go-burst,
.barriers,
.build-drop {
  position: absolute;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

/* +SN200 rising off GO, a ring spreading behind it. */
.go-burst {
  display: grid;
  place-items: center;
}

.go-ring {
  position: absolute;
  width: 12%;
  aspect-ratio: 1;
  border: 2px solid var(--yellow);
  border-radius: 50%;
  animation: go-ring 1.2s cubic-bezier(0.2, 0.7, 0.4, 1) forwards;
}

.go-chip {
  position: relative;
  padding: 2px 9px;
  font-size: clamp(0.62rem, 2.4vw, 0.95rem);
  font-weight: 900;
  color: var(--charcoal);
  white-space: nowrap;
  background: var(--yellow);
  border: 1.5px solid #fff;
  border-radius: 999px;
  box-shadow: 0 2px 4px #00000059;
  animation: go-rise 1.2s cubic-bezier(0.2, 0.7, 0.4, 1) forwards;
}

@keyframes go-ring {
  0% { transform: scale(0.4); opacity: 0.9; }
  100% { transform: scale(2.6); opacity: 0; }
}

@keyframes go-rise {
  0% { transform: translateY(0); opacity: 1; }
  78% { opacity: 1; }
  100% { transform: translateY(-2.6em); opacity: 0; }
}

/* The Level Crossing moment, over the middle of the board. */
.barriers {
  left: 50%;
  top: 50%;
  display: grid;
  justify-items: center;
  gap: 5%;
  width: 50%;
  padding: 3.5%;
  background: rgb(59 61 67 / 94%);
  border-radius: 14px;
  box-shadow: 0 8px 16px #00000080;
  animation: barriers-in 220ms cubic-bezier(0.2, 1.3, 0.5, 1) both;
}

.barriers.stuck,
.barriers.up { width: 42%; }

.barriers.going {
  animation: barriers-out 400ms ease-in forwards;
}

@keyframes barriers-in {
  from { transform: translate(-50%, -50%) scale(0.8); opacity: 0; }
  to { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

@keyframes barriers-out {
  from { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  to { transform: translate(-50%, -50%) scale(0.92); opacity: 0; }
}

.barriers .lamps {
  display: flex;
  gap: 7%;
}

.barriers .lamps i {
  width: 11px;
  height: 11px;
  background: #e02020;
  border-radius: 50%;
  opacity: 0.2;
  animation: lamp 560ms steps(1, end) infinite;
}

/* The second lamp is the first one's opposite, which is what makes it a crossing
   rather than two bulbs blinking together. */
.barriers .lamps i:nth-child(2) { animation-delay: 280ms; }

.barriers.up .lamps i { animation: none; opacity: 0.15; }

@keyframes lamp {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0.2; }
}

.barriers .gate {
  position: relative;
  width: 62%;
  aspect-ratio: 1.24;
}

.barriers .arm {
  position: absolute;
  left: 0;
  bottom: 18%;
  display: flex;
  width: 97%;
  height: 11%;
  overflow: hidden;
  border-radius: 999px;
  transform-origin: left center;
}

.barriers .arm span { flex: 1 1 0; background: #fff; }
.barriers .arm span:nth-child(odd) { background: #e02020; }

.barriers .post {
  position: absolute;
  left: -3%;
  bottom: 12%;
  width: 12%;
  aspect-ratio: 1;
  background: #fff;
  border-radius: 50%;
}

/* Down: the arm swings from raised to level. Up: the reverse. Stuck: already down,
   and rattling — which is the whole difference between "you've been sent here" and
   "you're still here". */
.barriers.down .arm { animation: arm-down 520ms cubic-bezier(0.3, 1.4, 0.5, 1) 150ms both; }
.barriers.up .arm { animation: arm-up 520ms cubic-bezier(0.3, 1.4, 0.5, 1) 150ms both; }
.barriers.stuck .arm { animation: arm-rattle 90ms ease-in-out 100ms 7 alternate; }

@keyframes arm-down {
  from { transform: rotate(-58deg); }
  to { transform: rotate(0deg); }
}

@keyframes arm-up {
  from { transform: rotate(0deg); }
  to { transform: rotate(-58deg); }
}

@keyframes arm-rattle {
  from { transform: rotate(0deg); }
  to { transform: rotate(-5deg); }
}

.barriers p {
  margin: 0;
  font-size: clamp(0.6rem, 2.6vw, 0.95rem);
  font-weight: 900;
  letter-spacing: 0.02em;
  color: var(--yellow);
}

.barriers.up p { color: var(--green); }

/* A house or hotel landing on the colour band. */
.build-drop {
  width: 7%;
  aspect-ratio: 1;
  background: var(--green);
  border: 1px solid #ffffff8c;
  border-radius: 2px;
  animation: build-drop 520ms cubic-bezier(0.3, 1.5, 0.5, 1) forwards;
}

.build-drop.hotel { background: var(--red); }

@keyframes build-drop {
  0% { transform: translate(-50%, -260%) scale(1.5); opacity: 0; }
  55% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .go-ring,
  .go-chip,
  .barriers,
  .barriers .arm,
  .barriers .lamps i,
  .build-drop {
    animation-duration: 1ms;
    animation-iteration-count: 1;
  }
}

/* ── the opening ──────────────────────────────────────────────────────────── */
/*
   `SplashView.swift` in a browser. Five beats, driven by classes the script adds on
   a timer — s1 "present", s2 the board, s3 the dice, s4 the title, s5 the hospice —
   so every transition below is a plain CSS one and nothing is animated in JS.

   ## The stage

   The app lays this out against `min(width, height)` on a phone that is always
   portrait. A browser is not: on a laptop the same proportions gave a FORMBY 150px
   tall lying across a board that had slid off the bottom of the screen.

   So the whole thing sits on a phone-shaped stage, centred, and every size below is
   in container units — `cqmin` is the stage's short side, which is exactly what `w`
   is in the Swift. On a phone the stage is the screen and nothing has changed; on a
   laptop you get the picture the artwork was drawn for, in the middle, instead of a
   stretched one.
*/
.splash {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--ink);
  cursor: pointer;
  transition: opacity 420ms ease;
}

.splash.going { opacity: 0; pointer-events: none; }

.splash-stage {
  position: relative;
  width: min(100%, 56vh);
  height: 100%;
  container-type: size;
  /* Far enough back that the board is in perspective rather than hurtling at you.
     At 900px the near edge of an 84%-wide board doubles in size and leaves the
     screen, which is what SwiftUI's gentler `perspective: 0.55` never does. */
  perspective: 1500px;
}

.splash-stage > * {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

/* The board, lying face-up on the table and spinning in from below. */
.splash-board {
  top: 60%;
  width: 84cqmin;
  aspect-ratio: 1;
  border-radius: 6px;
  box-shadow: 0 14px 18px #00000099;
  opacity: 0;
  transform: translate(-50%, 65%) rotateX(54deg) rotate(-150deg) scale(0.3);
  transition: transform 900ms cubic-bezier(0.22, 1.2, 0.36, 1), opacity 500ms ease;
}

.splash.s2 .splash-board {
  opacity: 1;
  transform: translate(-50%, -50%) rotateX(54deg) rotate(0deg) scale(1);
}

/* The SM mark starts in the middle, where a launch screen would have left it, then
   goes up out of the way. */
.splash-mark {
  top: 50%;
  width: 38cqmin;
  transform: translate(-50%, -50%);
  transition: top 700ms ease, width 700ms ease;
}

.splash.s2 .splash-mark { top: 10.5%; width: 16cqmin; }

.splash-present {
  /* The mark is 400x243, so at 38cqmin wide it is 23cqmin tall and reaches 11.5cqmin
     below the centre. The app clears that by putting this 78pt down on a 390pt phone
     — a fifth of the width — and at 9 it sat on the logo's feet. */
  top: calc(50% + 20cqmin);
  margin: 0;
  max-width: 92cqw;
  font-size: 2.9cqmin;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
  color: #fff;
  opacity: 0;
  transition: opacity 600ms ease, top 700ms ease, letter-spacing 600ms ease;
}

.splash.s1 .splash-present { opacity: 1; letter-spacing: 0.2em; }
.splash.s2 .splash-present { top: calc(10.5% + 10cqmin); }

/* A double six, thrown with the game's own dice.
   `dice.ts` brings its own camera — `.dice-table` is tilted 27deg, the angle the app's
   SceneKit camera actually sits at — so nothing here tilts them again. All this does
   is put them over the board and set how big a die is. */
.splash-dice {
  top: 55%;
  transform: translate(-50%, -50%);
}

.splash-dice .dice-scene { --die: 11cqmin; }

.splash-title { top: 29%; width: 100%; text-align: center; }

.splash-word {
  display: flex;
  justify-content: center;
  gap: 0.6cqmin;
}

.splash-word span {
  display: block;
  font-size: 17cqmin;
  font-weight: 900;
  line-height: 1;
  color: #fff;
  text-shadow: 0 4px 6px #00000080;
  opacity: 0;
  transform: translateY(-45cqh);
  /* Each letter waits its turn: --n is its index. */
  transition:
    transform 700ms cubic-bezier(0.2, 1.5, 0.4, 1) calc(var(--n) * 70ms),
    opacity 300ms ease calc(var(--n) * 70ms);
}

.splash.s4 .splash-word span { opacity: 1; transform: translateY(0); }

.splash-rule {
  display: block;
  width: 0;
  height: 4px;
  margin: 2cqmin auto;
  background: var(--yellow);
  transition: width 350ms ease 500ms;
}

.splash.s4 .splash-rule { width: 17cqmin; }

.splash-sub {
  margin: 0;
  font-size: 6cqmin;
  font-weight: 700;
  color: var(--yellow);
  opacity: 0;
  letter-spacing: 0;
  transition: opacity 550ms ease 600ms, letter-spacing 550ms ease 600ms;
}

.splash.s4 .splash-sub { opacity: 1; letter-spacing: 0.1em; }

.splash-foot {
  top: 90%;
  display: grid;
  justify-items: center;
  gap: 2cqmin;
  width: 100%;
  opacity: 0;
  transform: translate(-50%, 3cqmin);
  transition: opacity 500ms ease, transform 500ms ease;
}

.splash.s5 .splash-foot { opacity: 1; transform: translate(-50%, 0); }

.splash-edition {
  margin: 0;
  font-size: 2.6cqmin;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: rgb(255 255 255 / 75%);
}

.splash-charity {
  display: flex;
  align-items: center;
  gap: 2cqmin;
  font-size: 3.3cqmin;
  font-weight: 600;
  color: #fff;
}

.splash-charity img {
  height: 6.6cqmin;
  padding: 1cqmin 2cqmin;
  background: #fff;
  border-radius: 999px;
}

/* Reduce Motion: the finished picture, held for a moment. The app does the same. */
.splash.still .splash-board,
.splash.still .splash-present,
.splash.still .splash-dice,
.splash.still .splash-foot { opacity: 1; }

.splash.still .splash-board { transform: translate(-50%, -50%) rotateX(54deg) scale(1); }
.splash.still .splash-mark { top: 10.5%; width: 16cqmin; }
.splash.still .splash-present { top: calc(10.5% + 10cqmin); letter-spacing: 0.2em; }
.splash.still .splash-dice { transform: translate(-50%, -50%); }
.splash.still .splash-word span { opacity: 1; transform: none; }
.splash.still .splash-rule { width: 17cqmin; }
.splash.still .splash-sub { opacity: 1; letter-spacing: 0.1em; }
.splash.still .splash-foot { transform: translate(-50%, 0); }
.splash.still * { transition: none !important; }

/* ── first-run hints ──────────────────────────────────────────────────────── */
/*
   `HintBanner`, GameView.swift:382. One at a time, above the action panel, dismissed
   by reading it. Styled as a note rather than an alert: it is help, not a warning,
   and five of these in alert colours would make a first game feel like a fault.
*/
.hint-host:empty { display: none; }

.hint {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  padding: 11px 12px;
  background: rgb(255 218 6 / 12%);
  border: 1px solid rgb(255 218 6 / 38%);
  border-radius: 14px;
  animation: hint-in 420ms cubic-bezier(0.2, 1.3, 0.5, 1) both;
}

@keyframes hint-in {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.hint > .ico {
  width: 1.45em;
  height: 1.45em;
  margin-top: 1px;
  color: var(--yellow);
  flex: 0 0 auto;
}

.hint-words { flex: 1 1 auto; min-width: 0; }

.hint-title {
  margin: 0 0 2px;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--cream);
}

.hint-message {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--cream-dim);
}

.hint .hint-got {
  flex: 0 0 auto;
  width: auto;
  align-self: center;
  padding: 5px 11px;
  font-size: 0.78rem;
}

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

/* ── the host has gone quiet ──────────────────────────────────────────────── */
/*
   "Host lost, re-establishing contact", with 45 seconds on the clock and two ways
   out. Over everything, including open sheets: a game that may be about to end
   outranks whatever was on screen.

   Deliberately not styled as an error. Nine times in ten the host has put their
   phone down for a moment, and a red alarm would make a pub game feel like an
   outage.
*/
.host-away {
  position: fixed;
  inset: 0;
  z-index: 85;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgb(31 33 36 / 72%);
  backdrop-filter: blur(3px);
}

.host-away-card {
  display: grid;
  justify-items: center;
  gap: 10px;
  width: 100%;
  max-width: 340px;
  padding: 22px 18px;
  text-align: center;
  background: var(--charcoal);
  border: 1.5px solid rgb(255 218 6 / 45%);
  border-radius: 18px;
  box-shadow: 0 12px 28px #0000008c;
  animation: host-away-in 260ms cubic-bezier(0.2, 1.2, 0.5, 1) both;
}

@keyframes host-away-in {
  from { opacity: 0; transform: translateY(10px) scale(0.97); }
  to { opacity: 1; transform: none; }
}

.host-away-card .prompt { margin: 0; color: var(--cream); }

.host-away-count {
  margin: 0;
  font-size: 2.1rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  color: var(--yellow);
}

.host-away-card .small { margin: 0; max-width: 30ch; color: var(--cream-dim); }

.host-away-row {
  display: flex;
  gap: 10px;
  width: 100%;
  margin-top: 4px;
}

.host-away-row .btn { flex: 1 1 0; }

@media (prefers-reduced-motion: reduce) {
  .host-away-card { animation: none; }
}

/* The host has missed a beat. A line, not an alarm — see `HOST_QUIET_MS`. */
.host-quiet {
  min-height: 0;
  font-size: 0.78rem;
  font-weight: 600;
  text-align: center;
  color: var(--cream-dim);
  opacity: 0;
  transition: opacity 240ms ease;
}

.host-quiet.on {
  opacity: 1;
  animation: quiet-breathe 1.8s ease-in-out infinite;
}

@keyframes quiet-breathe {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

@media (prefers-reduced-motion: reduce) {
  .host-quiet.on { animation: none; }
}

/* ── the game is over ─────────────────────────────────────────────────────── */
/*
   The result takes the screen. In the app `GameOverView` is a `fullScreenCover`; on
   the web the end card used to appear in the action panel with the board still pinned
   above it, so the standings and the hospice ask were squeezed into the lower half and
   "Back to the start" sat behind the browser's own toolbar.

   Everything that belongs to a game in progress goes, and the panel is allowed to be
   as tall as it needs and to scroll on its own.
*/
.game.over .topline,
.game.over .board-host,
.game.over .ticker,
.game.over .clock,
.game.over .host-quiet,
.game.over .hint-host,
.game.over .deed-row {
  display: none;
}

.game.over .actions {
  flex: 1 1 auto;
  max-height: none;
  min-height: 0;
  overflow-y: auto;
  border-radius: 0;
  /* Clear of the home indicator and of Safari's floating toolbar, which overlaps the
     bottom of the viewport on iOS and was swallowing the button. */
  padding-bottom: max(28px, calc(env(safe-area-inset-bottom) + 76px));
}
