:root {
  --bg: #0b0d14;
  --bg-2: #10131d;
  --surface: #151a27;
  --surface-2: #1b2132;
  --line: #262e45;
  --line-2: #33405f;
  --text: #e9ebf3;
  --muted: #98a0b8;
  --faint: #6c7591;
  --accent: #ffd36e;
  --accent-ink: #1b1405;
  --accent-2: #ff6fae;
  --good: #7fe0a6;
  --bad: #ff8a8a;
  --radius: 12px;
  --radius-sm: 8px;
  --pixel: "Press Start 2P", ui-monospace, monospace;
  --sans: Inter, -apple-system, "Segoe UI", system-ui, sans-serif;
  --serif: Literata, "Iowan Old Style", Georgia, serif;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

/* the hidden attribute wins over a component's own display (.btn etc.) */
[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  background-image: radial-gradient(1200px 600px at 80% -10%, #1d2340 0%, transparent 60%);
  background-attachment: fixed;
  color: var(--text);
  font: 15px/1.5 var(--sans);
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

h1 {
  font-size: 1.6rem;
  line-height: 1.2;
  margin: 0 0 0.5rem;
  letter-spacing: -0.01em;
}

h2 {
  font-size: 1rem;
  margin: 1.6rem 0 0.6rem;
}

p {
  margin: 0.4rem 0;
}

.muted {
  color: var(--muted);
}

.fine {
  color: var(--faint);
  font-size: 0.82rem;
}

.small {
  font-size: 0.85rem;
}

.eyebrow {
  font-family: var(--pixel);
  font-size: 0.55rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.notice {
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line));
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.8rem;
}

.badge {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 99px;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  color: var(--muted);
  font-size: 0.72rem;
  white-space: nowrap;
}

.badge.hot {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
}

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex: none;
}

.dot.big {
  width: 14px;
  height: 14px;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px max(16px, env(safe-area-inset-left));
  /* the iPhone app draws under the clock: keep the bar below it */
  padding-top: max(10px, env(safe-area-inset-top));
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: var(--pixel);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
}

.brand img {
  image-rendering: pixelated;
}

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

.player-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 6px 12px;
  border-radius: 99px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;
}

.chip-spend {
  color: var(--faint);
  font-weight: 400;
  font-size: 0.8rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 99px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  text-decoration: none;
  cursor: pointer;
  flex: none;
}

.icon-btn.subtle {
  width: 28px;
  height: 28px;
  border-color: transparent;
  background: transparent;
  color: var(--faint);
}

.icon-btn:hover {
  border-color: var(--muted);
  color: var(--text);
}

/* ---------- layout ---------- */

.view {
  padding: 20px 16px 48px;
  max-width: 1280px;
  margin: 0 auto;
}

.panel {
  max-width: 920px;
  margin: 0 auto;
}

.panel.narrow {
  max-width: 560px;
}

.section-title {
  margin-top: 2.2rem;
}

.stack {
  display: grid;
  gap: 12px;
}

/* ---------- forms ---------- */

label {
  display: grid;
  gap: 6px;
  margin: 12px 0;
  font-weight: 600;
  font-size: 0.9rem;
}

input:not([type="radio"]):not([type="checkbox"]),
textarea,
select {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-2);
  background: var(--bg-2);
  font-weight: 400;
}

textarea {
  resize: vertical;
  line-height: 1.5;
}

input:focus,
textarea:focus,
select:focus,
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-2);
  background: var(--surface-2);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.btn:hover:not(:disabled) {
  border-color: var(--muted);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.btn.primary:hover:not(:disabled) {
  background: #ffdf8e;
}

.btn.danger {
  background: #4a1d26;
  border-color: #7a2c3a;
  color: #ffd1d6;
}

.btn.ghost {
  background: transparent;
}

.btn.small {
  padding: 6px 10px;
  font-size: 0.85rem;
}

.btn.big {
  padding: 12px 22px;
  font-size: 1rem;
}

.link {
  border: 0;
  padding: 0;
  background: none;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  font-size: 0.8rem;
}

.link:hover {
  color: var(--text);
}

.form-status {
  min-height: 1.4em;
  color: var(--muted);
}

.form-status.bad,
.status-line.bad {
  color: var(--bad);
}

.inline-form,
.key-form {
  display: flex;
  gap: 8px;
  margin: 10px 0;
}

.inline-form input,
.key-form input {
  flex: 1;
  min-width: 0;
}

.steps {
  padding-left: 1.2rem;
  display: grid;
  gap: 8px;
  margin: 16px 0;
}

.address {
  font-family: ui-monospace, monospace;
  background: var(--bg-2);
  border: 1px solid var(--line);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  user-select: all;
  overflow-wrap: anywhere;
}

/* ---------- players ---------- */

.player-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.player-card {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 16px 10px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
}

.player-card.current,
.player-card:hover {
  border-color: var(--accent);
}

.avatar {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  color: #10131d;
  font-family: var(--pixel);
  font-size: 0.9rem;
}

.player-name {
  font-weight: 700;
}

.avatar.has-face {
  width: 64px;
  height: 64px;
  place-items: end center;
  overflow: hidden;
}

.players-look {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

/* ---------- pixel characters ---------- */

.portrait,
.look-portrait,
.look-figure {
  display: block;
  image-rendering: pixelated;
}

/* a seat's portrait, framed in the seat color (set as --seat) */
.seat-face {
  display: grid;
  place-items: end center;
  flex: none;
  overflow: hidden;
  border-radius: var(--radius-sm);
  border: 1px solid color-mix(in srgb, var(--seat, var(--line-2)) 65%, var(--line));
  background: color-mix(in srgb, var(--seat, var(--surface-2)) 16%, var(--bg-2));
}

.player-chip.with-face {
  padding: 2px 12px 2px 2px;
}

.chip-face {
  border-radius: 99px;
  flex: none;
}

.look-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  height: 34px;
  padding: 0 12px;
  border-radius: 99px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  font-size: 0.85rem;
  text-decoration: none;
  white-space: nowrap;
}

.look-btn:hover {
  border-color: var(--muted);
}

/* the look editor */

.look-grid {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 28px;
  align-items: start;
  margin-top: 18px;
}

.look-side {
  position: sticky;
  top: 74px;
  display: grid;
  gap: 14px;
  max-width: 540px;
}

.look-stage {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: #10131f;
}

.look-portrait,
.look-figure {
  max-width: 100%;
  height: auto;
}

.look-figure {
  cursor: pointer;
}

.look-figure-box {
  display: grid;
  justify-items: center;
  gap: 6px;
}

.look-info {
  display: grid;
  gap: 8px;
}

.look-info .eyebrow {
  margin: 0;
}

.look-desc {
  margin: 0;
  font-family: var(--serif);
  line-height: 1.6;
}

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

.look-fields {
  display: grid;
  gap: 10px;
}

.look-field {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
}

.look-label {
  font-weight: 600;
  font-size: 0.9rem;
}

.stepper {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 8px;
}

.step {
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-2);
  background: var(--surface-2);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
}

.step:hover {
  border-color: var(--muted);
}

.look-value {
  text-align: center;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.look-count {
  margin-left: 8px;
  color: var(--faint);
  font-weight: 400;
  font-size: 0.78rem;
}

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

.swatch {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 6px;
  border: 2px solid var(--line-2);
  background: var(--surface-2);
  cursor: pointer;
}

.swatch:hover {
  border-color: var(--muted);
}

.swatch[aria-pressed="true"] {
  border-color: var(--bg);
  outline: 2px solid var(--accent);
  outline-offset: 0;
}

/* the hair picker: a chip for each group of styles, then the racer's own head
   in every style of the group shown */

.hair-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.hair-chip {
  min-height: 36px;
  padding: 0 7px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--surface-2);
  color: inherit;
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
}

.hair-chip:hover {
  border-color: var(--muted);
}

.hair-chip[aria-pressed="true"] {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 18%, var(--surface-2));
  font-weight: 600;
}

.hair-chip-n {
  margin-left: 2px;
  color: var(--faint);
  font-weight: 400;
  font-size: 0.74rem;
}

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

.hair-tile {
  display: block;
  padding: 0;
  overflow: hidden;
  border-radius: 6px;
  border: 2px solid var(--line-2);
  background: #10131f;
  line-height: 0;
  cursor: pointer;
}

.hair-tile canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 80 / 72;
  image-rendering: pixelated;
}

.hair-tile:hover {
  border-color: var(--muted);
}

.hair-tile[aria-pressed="true"] {
  border-color: var(--bg);
  outline: 2px solid var(--accent);
  outline-offset: 0;
}

.hair-caption {
  margin: 0;
  text-align: center;
  font-size: 0.85rem;
}

@media (max-width: 640px) {
  /* four tiles a row, and tap targets of 44px or more */
  .hair-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .hair-chip {
    min-height: 44px;
  }
}

.look-fields .form-foot {
  margin-top: 8px;
}

.look-fields .form-foot .fine {
  flex-basis: 100%;
  margin: 0;
  text-align: right;
}

.lobby-seat-info {
  display: grid;
  align-content: start;
  justify-items: start;
  min-width: 0;
}

@media (max-width: 899px) {
  .look-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  /* the picture stays in view while you scroll through the pickers, as a
     full-width band (square corners, so nothing peeks around them) */
  .look-side {
    display: contents;
  }

  .look-stage {
    position: sticky;
    top: 58px;
    z-index: 5;
    flex-wrap: nowrap;
    margin: 0 -16px;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }
}

@media (max-width: 899px) and (max-height: 560px) {
  .look-stage {
    position: static;
  }
}

/* ---------- home ---------- */

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

.home-head h1 {
  margin: 0;
}

.story-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.story-card {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  text-decoration: none;
}

.story-card:hover {
  border-color: var(--line-2);
  background: var(--surface-2);
}

.story-card .card-delete {
  justify-self: end;
  margin-top: 4px;
}

.story-card.your-turn {
  border-color: color-mix(in srgb, var(--accent) 60%, var(--line));
}

.story-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.story-card h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.3;
}

.seat-dots {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  margin-top: 4px;
  font-size: 0.85rem;
}

.seat-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.featured-cta {
  display: grid;
  gap: 8px;
  justify-items: start;
  padding: 28px;
  border-radius: var(--radius);
  text-decoration: none;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line));
  background: linear-gradient(135deg, #2a1d10 0%, #1a1420 55%, var(--surface) 100%);
}

.featured-cta strong {
  font-family: var(--pixel);
  font-size: 1.1rem;
  line-height: 1.5;
}

.featured-cta .btn {
  margin-top: 8px;
}

/* ---------- new story ---------- */

.new-story h2 {
  font-family: var(--pixel);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-top: 2rem;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}

.choice {
  display: grid;
  gap: 4px;
  align-content: start;
  text-align: left;
  padding: 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  color: var(--muted);
  font-size: 0.85rem;
}

.choice strong {
  color: var(--text);
  font-size: 0.98rem;
}

.choice.featured {
  grid-column: 1 / -1;
  padding: 20px;
  background: linear-gradient(135deg, #2a1d10 0%, #1a1420 60%, var(--surface) 100%);
}

.choice.featured strong {
  font-family: var(--pixel);
  font-size: 0.95rem;
  line-height: 1.6;
}

.choice:hover {
  border-color: var(--line-2);
}

.choice.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent) inset;
}

.setting-fields {
  margin-top: 8px;
}

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

.chip {
  padding: 5px 10px;
  border-radius: 99px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  font-size: 0.8rem;
  cursor: pointer;
}

.chip:hover {
  border-color: var(--accent);
}

.model-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
}

.model-option {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 10px;
  margin: 0;
  padding: 12px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  font-weight: 400;
}

.model-option input {
  grid-row: span 2;
  accent-color: var(--accent);
}

.model-option:has(input:checked) {
  border-color: var(--accent);
}

.model-name {
  font-weight: 700;
}

.toggle-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 16px;
  padding: 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  font-weight: 400;
  cursor: pointer;
}

.toggle-row input {
  margin-top: 4px;
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.toggle-row span {
  display: grid;
  gap: 2px;
}

.form-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  margin-top: 24px;
  flex-wrap: wrap;
}

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

.play {
  display: grid;
  grid-template-columns: minmax(340px, 520px) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.play-side {
  position: sticky;
  top: 74px;
  display: grid;
  /* rows keep their full height (the panel scrolls), so a full party never
     squeezes the stage under the cards below it */
  grid-auto-rows: max-content;
  gap: 14px;
  max-height: calc(100vh - 90px);
  overflow-y: auto;
  scrollbar-width: thin;
}

.stage-box {
  position: relative;
  width: 100%;
  /* the stage sets its own shape (16-bit: a wide 512 x 216 frame) */
  min-height: 3rem;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #05060a;
  border: 1px solid var(--line);
}

.story-head {
  display: grid;
  gap: 2px;
}

.story-title {
  justify-self: start;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
  cursor: text;
}

.story-title:hover {
  text-decoration: underline dotted;
  text-underline-offset: 4px;
}

.side-title {
  margin: 0 0 6px;
  font-family: var(--pixel);
  font-size: 0.55rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}

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

.seat {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
}

.seat.has-turn {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 7%, var(--surface));
}

.seat-info {
  display: grid;
  flex: 1;
  min-width: 0;
}

.seat-info strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.turn-flag {
  font-family: var(--pixel);
  font-size: 0.5rem;
  color: var(--accent-ink);
  background: var(--accent);
  padding: 4px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

.stand-chip {
  justify-self: start;
  margin-top: 4px;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid var(--line-2);
  background: var(--bg-2);
  font-family: var(--pixel);
  font-size: 0.55rem;
  line-height: 1.8;
  color: var(--accent);
  cursor: pointer;
}

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

.play-main {
  min-width: 0;
}

/* lobby */

.lobby h2 {
  margin-top: 0;
}

.lobby-seats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr));
  gap: 10px;
}

/* the testing select and the outfit roll stay inside the card, whatever its width */
.lobby-seat-info {
  flex: 1 1 0;
  width: 100%;
  gap: 6px;
}

.lobby-seat-info label {
  display: grid;
  gap: 4px;
  width: 100%;
}

.lobby-seat-info select,
.lobby-seat-info .btn {
  box-sizing: border-box;
  max-width: 100%;
}

.lobby-seat-info select {
  width: 100%;
}

.lobby-seat-info .btn {
  width: 100%;
  white-space: normal;
  line-height: 1.25;
  text-align: center;
}

.lobby-seat {
  display: flex;
  gap: 10px;
  padding: 14px;
  min-height: 84px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
}

.lobby-seat .dot {
  margin-top: 4px;
}

.lobby-seat.empty {
  align-items: center;
  justify-content: center;
  border-style: dashed;
  background: transparent;
}

.lobby-foot {
  display: grid;
  gap: 12px;
  justify-items: start;
  margin-top: 18px;
}

/* feed */

.feed {
  display: grid;
  gap: 18px;
  padding-bottom: 12px;
}

.beat .prose {
  font-family: var(--serif);
  font-size: 1.08rem;
  line-height: 1.75;
}

.prose p {
  margin: 0 0 0.9em;
}

.prose p:last-child {
  margin-bottom: 0;
}

.prose em {
  color: #f3e2b8;
}

.ooc {
  font-family: var(--sans);
  font-size: 0.9em;
  color: var(--muted);
}

.beat-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 14px;
  margin-top: 8px;
  color: var(--faint);
  font-size: 0.78rem;
}

.beat.live .prose:empty::before {
  content: "…";
  color: var(--faint);
}

.cursor {
  display: inline-block;
  width: 8px;
  height: 16px;
  margin-top: 4px;
  background: var(--accent);
  animation: blink 0.9s steps(2) infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.move {
  justify-self: end;
  max-width: 88%;
  padding: 10px 14px;
  border-radius: var(--radius) var(--radius) 4px var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--line-2);
}

.move p {
  margin: 0;
}

.move-who {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
}

.move .badge {
  margin-top: 6px;
}

.ooc-move {
  background: transparent;
  border-style: dashed;
  color: var(--muted);
}

.continue-mark,
.awakening-mark {
  justify-self: center;
  font-size: 0.75rem;
  color: var(--faint);
}

.awakening-mark {
  font-family: var(--pixel);
  font-size: 0.65rem;
  color: var(--accent);
  letter-spacing: 0.06em;
  padding: 10px 0;
}

/* composer */

.composer {
  position: sticky;
  bottom: 0;
  display: grid;
  gap: 8px;
  margin-top: 8px;
  padding: 12px 0 max(12px, env(safe-area-inset-bottom));
  background: linear-gradient(to bottom, transparent, var(--bg) 18px);
}

.composer textarea {
  min-height: 64px;
  background: var(--surface);
}

.composer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.composer-row select {
  width: auto;
  max-width: 220px;
  padding: 8px 10px;
  font-size: 0.85rem;
}

.spacer {
  flex: 1;
}

.turn-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
}

.turn-banner.mine {
  color: var(--text);
  font-weight: 700;
  border-color: color-mix(in srgb, var(--accent) 50%, var(--line));
}

.status-line {
  min-height: 1.2em;
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

/* planning */

.planning {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 18px;
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line));
  background: var(--surface);
  flex-wrap: wrap;
}

.planning > div:nth-child(2) {
  flex: 1;
  min-width: 200px;
}

.pixel-spinner {
  width: 24px;
  height: 24px;
  flex: none;
  background:
    linear-gradient(var(--accent) 0 0) 0 0 / 8px 8px no-repeat,
    linear-gradient(var(--accent-2) 0 0) 16px 16px / 8px 8px no-repeat;
  animation: hop 0.8s steps(4) infinite;
  image-rendering: pixelated;
}

.pixel-spinner.small {
  width: 16px;
  height: 16px;
  background-size: 6px 6px, 6px 6px;
  background-position: 0 0, 10px 10px;
}

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

/* ---------- Stand card ---------- */

.stand-card {
  display: grid;
  gap: 4px;
}

.stand-name {
  margin: 4px 0 0;
  font-family: var(--pixel);
  font-size: clamp(1rem, 4vw, 1.5rem);
  line-height: 1.5;
  color: var(--accent);
  overflow-wrap: anywhere;
}

.manifest {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.05rem;
  margin: 10px 0;
}

.stand-body {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 16px;
  align-items: start;
}

.stat-chart {
  width: 100%;
  max-width: 300px;
}

.stat-ring {
  fill: none;
  stroke: var(--line-2);
  stroke-width: 1;
}

.stat-spoke {
  stroke: var(--line);
}

.stat-label {
  fill: var(--muted);
  font: 8px var(--pixel);
}

.stat-shape {
  fill-opacity: 0.35;
  stroke-width: 2;
}

.stand-facts {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 12px;
  margin: 0;
  font-size: 0.92rem;
}

.stand-facts dt {
  color: var(--faint);
  font-weight: 600;
}

.stand-facts dd {
  margin: 0;
}

/* ---------- modal + toast ---------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(3, 4, 8, 0.72);
  backdrop-filter: blur(3px);
}

.modal {
  width: min(480px, 100%);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 22px;
  border-radius: var(--radius);
  border: 1px solid var(--line-2);
  background: var(--surface);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

.modal.wide {
  width: min(760px, 100%);
}

.modal h2 {
  margin: 0 0 10px;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}

.plan-text {
  white-space: pre-wrap;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--muted);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 60;
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  transition: opacity 0.4s, transform 0.4s;
}

.toast-good {
  border-color: color-mix(in srgb, var(--good) 50%, var(--line));
}

.toast-bad {
  border-color: color-mix(in srgb, var(--bad) 60%, var(--line));
}

.toast.out {
  opacity: 0;
  transform: translate(-50%, 8px);
}

/* ---------- settings ---------- */

.spend-table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.spend-table th,
.spend-table td {
  text-align: left;
  padding: 8px 6px;
  border-bottom: 1px solid var(--line);
}

.spend-table th {
  color: var(--faint);
  font-weight: 600;
  font-size: 0.82rem;
}

/* the admin's limits page (online) */
.limit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.limit-field {
  margin: 4px 0;
}

.limit-person {
  border-top: 1px solid var(--line);
  padding: 10px 0 4px;
}

.limit-who {
  overflow-wrap: anywhere;
}

/* the admin's accounts (online): a locked one and its Open button */
.login-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  border-top: 1px solid var(--line);
  padding: 10px 0;
}

.login-row .limit-who {
  flex: 1 1 10rem;
}

.login-row .login-state {
  flex: 2 1 14rem;
  overflow-wrap: anywhere;
}

.lock-tag {
  color: var(--bad);
}

.login-row .btn {
  min-height: 44px;
  min-width: 64px;
}

.notice .notice-link {
  font-size: inherit;
  color: inherit;
  min-height: 44px;
}

/* ---------- party password page ---------- */

.party-page {
  display: grid;
  place-items: center;
  min-height: 70vh;
}

/* ---------- small screens ---------- */

@media (max-width: 960px) {
  .play {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .play-side {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .party {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }

  .party .side-title {
    grid-column: 1 / -1;
  }

  /* narrow seat cards: the turn flag sits under the name, beside the face */
  .party .seat {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    column-gap: 8px;
    row-gap: 4px;
  }

  .party .seat > :first-child {
    grid-row: 1 / span 2;
  }

  .party .seat .seat-info {
    grid-column: 2;
    grid-row: 1;
  }

  .party .seat .turn-flag {
    grid-column: 2;
    grid-row: 2;
    justify-self: start;
  }

  .party .seat .icon-btn {
    grid-column: 3;
    grid-row: 1 / span 2;
  }

  .seat-info .fine {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

@media (max-width: 600px) {
  body {
    font-size: 14px;
  }

  .view {
    padding: 14px 16px 40px;
  }

  .chip-spend {
    display: none;
  }

  .look-btn {
    width: 34px;
    padding: 0;
    justify-content: center;
  }

  .look-btn-text {
    display: none;
  }

  .look-fields .form-foot .fine {
    text-align: left;
  }

  .beat .prose {
    font-size: 1.02rem;
  }

  .move {
    max-width: 100%;
  }

  .stand-body {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .composer-row .btn {
    flex: 1;
  }

  .composer-row select {
    max-width: none;
    flex-basis: 100%;
  }

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

@media (prefers-reduced-motion: reduce) {
  .cursor,
  .pixel-spinner {
    animation: none;
  }

  .toast {
    transition: none;
  }
}

.featured-cta.static {
  margin-bottom: 12px;
}

.chapter-mark {
  border-top: 1px dashed var(--line-2);
  border-bottom: 1px dashed var(--line-2);
  width: 100%;
  text-align: center;
}

.planner-note {
  margin: 8px 0 0;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px dashed color-mix(in srgb, var(--accent) 45%, var(--line));
  color: var(--muted);
  font-size: 0.85rem;
}

/* ---------- health, food, money, passives ---------- */

.vitals {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}

.vbar {
  position: relative;
  flex: 1;
  height: 6px;
  min-width: 34px;
  border-radius: 2px;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  overflow: hidden;
}

.vfill {
  position: absolute;
  inset: 0 auto 0 0;
  background: #e86a6a;
}

.vbar.food .vfill {
  background: #e8b24a;
}

/* Bars that move (fix/hunger, app.js vitalMove): the bar sits in a wrap that
   carries the +N or -N rising off it */
.vbar-wrap {
  position: relative;
  flex: 1;
  display: flex;
  min-width: 34px;
}

.vbar-wrap .vbar {
  flex: 1;
}

/* the food bar of a starving racer: a slow red pulse round it */
.vbar.food.low {
  border-color: #c4473a;
  animation: vbar-low 1.6s ease-in-out infinite;
}

@keyframes vbar-low {
  50% {
    box-shadow: 0 0 0 2px rgba(196, 71, 58, 0.35);
  }
}

.vchip {
  position: absolute;
  right: 0;
  bottom: 4px;
  z-index: 3;
  padding: 2px 3px 1px;
  font: 8px/1 var(--pixel, ui-monospace, monospace);
  color: #1a1306;
  background: #e8b24a;
  box-shadow: 1px 1px 0 rgba(0, 0, 0, 0.55);
  pointer-events: none;
  white-space: nowrap;
  opacity: 0;
  animation: vchip-rise 1.9s ease-out forwards;
}

.vchip.hp {
  right: auto;
  left: 0;
  background: #e86a6a;
  color: #fff;
}

.vchip.down {
  background: #3a2a24;
  color: #ffb3a8;
}

.vchip.food.down {
  color: #f2c46a;
}

@keyframes vchip-rise {
  0% {
    opacity: 0;
    transform: translateY(4px);
  }
  12% {
    opacity: 1;
    transform: translateY(0);
  }
  70% {
    opacity: 1;
    transform: translateY(-6px);
  }
  100% {
    opacity: 0;
    transform: translateY(-10px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .vbar.food.low {
    animation: none;
  }
  .vchip {
    animation: vchip-fade 1.9s linear forwards;
  }
  @keyframes vchip-fade {
    0%,
    70% {
      opacity: 1;
    }
    100% {
      opacity: 0;
    }
  }
}

.money {
  font-size: 0.72rem;
  color: var(--good);
  font-variant-numeric: tabular-nums;
}

.passives {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.passive-chip {
  padding: 1px 6px;
  border-radius: 99px;
  border: 1px solid var(--line-2);
  background: var(--bg-2);
  color: var(--muted);
  font-size: 0.68rem;
  cursor: pointer;
}

.passive-chip.rare {
  border-color: var(--accent);
  color: var(--accent);
}

/* HANDOVER 60: very rare, overpowered and debuff passives */
.passive-chip.very-rare {
  border-color: #b48ce8;
  color: #b48ce8;
}

.passive-chip.overpowered {
  border-color: #ffd36e;
  color: #1a1206;
  background: linear-gradient(90deg, #ffd36e, #f0a040);
}

.passive-chip.debuff {
  border-color: #b85a4a;
  color: #d88a7a;
  border-style: dashed;
}

.stand-name.small {
  font-size: 0.9rem;
}

/* ---------- clock, strikes, companions, votes ---------- */

.clock {
  margin: 2px 0;
  font-family: var(--pixel);
  font-size: 0.55rem;
  letter-spacing: 0.04em;
  color: var(--accent);
}

.badge.strike {
  margin-top: 4px;
  border-color: #b85a3a;
  color: #ffb08a;
}

.companion {
  display: grid;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--line-2);
}

.companion.gone {
  opacity: 0.5;
}

.vote-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--accent) 50%, var(--line));
  background: color-mix(in srgb, var(--accent) 6%, var(--surface));
}

.vote-question {
  margin: 0;
  font-weight: 700;
  font-size: 1.05rem;
}

.vote-row {
  display: grid;
  gap: 6px;
}

.vote-who {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
}

.vote-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* ---------- race: finish sprint and standings board ---------- */

.sprint-card {
  border-color: color-mix(in srgb, var(--accent-2) 55%, var(--line));
  background: color-mix(in srgb, var(--accent-2) 7%, var(--surface));
}

.sprint-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.btn.tactic {
  display: grid;
  gap: 2px;
  justify-items: start;
  align-content: start;
  text-align: left;
  padding: 8px 10px;
  height: auto;
  min-width: 0;
  white-space: normal;
}

.tactic-label {
  font-weight: 700;
}

.tactic-hint {
  font-size: 0.75rem;
  line-height: 1.3;
  color: var(--muted);
  font-weight: 400;
}

.btn.tactic.primary .tactic-hint {
  color: inherit;
  opacity: 0.8;
}

.standing {
  font-variant-numeric: tabular-nums;
}

.board {
  display: grid;
  gap: 6px;
  min-width: min(360px, 80vw);
}

.board-to {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.board-overall {
  margin-top: 10px;
}

.board-list {
  list-style: none;
  margin: 0;
  padding: 8px;
  display: grid;
  gap: 2px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-2);
  background: var(--bg-2);
  font-family: var(--pixel);
  font-size: 0.6rem;
  line-height: 1.9;
}

.board-row {
  display: grid;
  grid-template-columns: 7.5em 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 1px 6px;
  border-radius: 4px;
}

.board-row.player {
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent);
}

.board-name {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.board-place,
.board-pts {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.board-row.player .board-place,
.board-row.player .board-pts {
  color: inherit;
}

.board-gap {
  text-align: center;
  color: var(--faint);
}

/* ---------- cinema mode (HANDOVER section 27, mockup C "Visual novel") ---------- */

/* The cinema screen takes the whole window: no site header, no page scroll. */
body.cin-on {
  overflow: hidden;
}

body.cin-on .topbar {
  display: none;
}

body.cin-on .view {
  max-width: none;
  padding: 0;
}

/* toasts sit under the top line, clear of the story text; taps go
   through them, and with the menu open they drop clear of its tabs */
body.cin-on .toast {
  top: 64px;
  bottom: auto;
  font-size: 0.9rem;
  pointer-events: none;
}

body.cin-drawer-open .toast {
  top: auto;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 96px);
}

.cin {
  --ink: #0b0d14;
  --ink-a: 11, 13, 20;
  --paper: #f6f1e4;
  --cin-muted: #a9adbf;
  --gold: #ffd36e;
  --gold-hi: #ffe7a3;
  --hp: #e8524a;
  --food: #e9b44c;
  --fs: clamp(18px, calc(12.5px + 0.82vw), 27px);
  --pad: clamp(16px, 3vw, 48px);
  position: fixed;
  inset: 0;
  z-index: 1;
  /* clip, not hidden: nothing (a scrollIntoView) can scroll the screen */
  overflow: hidden;
  overflow: clip;
  background: var(--ink);
  color: var(--paper);
  font: 15px/1.5 var(--sans);
}

.cin[data-size="0"] {
  --fs: clamp(16px, calc(11px + 0.7vw), 23px);
}

.cin[data-size="2"] {
  --fs: clamp(20px, calc(14px + 0.95vw), 31px);
}

.cin button {
  cursor: pointer;
}

.cin .px-icon {
  width: 14px;
  height: 14px;
  flex: none;
  fill: currentColor;
}

.cin-ambient {
  position: absolute;
  inset: -12%;
  width: 124%;
  height: 124%;
  filter: blur(42px) saturate(1.35) brightness(0.42);
  pointer-events: none;
}

.cin-reflect {
  position: absolute;
  filter: blur(7px) saturate(1.2) brightness(0.5);
  opacity: 0.5;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 55%);
  mask-image: linear-gradient(to bottom, #000 0%, transparent 55%);
  pointer-events: none;
}

.cin-picture {
  position: absolute;
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 56px), transparent);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 56px), transparent);
}

/* a picture narrower than the window (a phone held sideways) fades into
   the glow at its sides */
.cin.boxed:not(.tall) .cin-picture {
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 56px), transparent), linear-gradient(to right, transparent, #000 28px, #000 calc(100% - 28px), transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to bottom, #000 calc(100% - 56px), transparent), linear-gradient(to right, transparent, #000 28px, #000 calc(100% - 28px), transparent);
  mask-composite: intersect;
}

.cin-picture .stage-box {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
}

/* the narration replaces the stage's caption box; the top line shows the
   place and the clock instead of its LIVE and clock badges */
.cin-picture [data-stage-caption],
.cin-picture [data-stage-badge] {
  display: none !important;
}

.cin-shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(var(--ink-a), 0.62) 0, rgba(var(--ink-a), 0) 120px),
    linear-gradient(
      to bottom,
      rgba(var(--ink-a), 0) calc(var(--floor, 60vh) - 70px),
      rgba(var(--ink-a), 0.5) calc(var(--floor, 60vh) + 18px),
      rgba(var(--ink-a), 0.84) calc(var(--floor, 60vh) + 96px),
      rgba(var(--ink-a), 0.94) 100%
    ),
    radial-gradient(120% 90% at 50% 40%, transparent 55%, rgba(0, 0, 0, 0.35) 100%);
}

/* ----- top line: the place and the clock; sound, tables and the menu ----- */

.cin-top {
  position: absolute;
  top: 18px;
  left: max(var(--pad), env(safe-area-inset-left, 0px));
  right: max(var(--pad), env(safe-area-inset-right, 0px));
  z-index: 6;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  pointer-events: none;
}

.cin-top > * {
  pointer-events: auto;
}

.cin-where {
  display: grid;
  flex: 0 1 auto;
  min-width: 0;
  gap: 6px;
  max-width: min(460px, 60vw);
  margin: -8px 0 0 -12px;
  padding: 8px 40px 10px 12px;
  background: linear-gradient(90deg, rgba(var(--ink-a), 0.62), rgba(var(--ink-a), 0.34) 70%, rgba(var(--ink-a), 0));
  text-shadow: 0 1px 0 var(--ink), 0 0 12px rgba(0, 0, 0, 0.7);
}

.cin-where-stage {
  font: 8px/1.4 var(--pixel);
  color: var(--gold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.cin-where-clock {
  font: italic 14px/1.3 var(--serif);
  color: rgba(246, 241, 228, 0.82);
}

.cin-where-clock:empty {
  display: none;
}

.cin-where .planner-note {
  margin: 2px 0 0;
  padding: 0;
  border: 0;
  font: italic 13px/1.35 var(--serif);
  color: rgba(255, 231, 163, 0.85);
}

.cin-where .planner-note .link {
  font: 8px/1 var(--pixel);
  color: var(--gold);
}

.cin-top-right {
  display: flex;
  gap: 8px;
}

.cin-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border: 2px solid rgba(246, 241, 228, 0.16);
  border-radius: 2px;
  background: rgba(var(--ink-a), 0.55);
  color: var(--paper);
  font: 8px/1 var(--pixel);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-decoration: none;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transition: border-color 0.15s, color 0.15s;
}

.cin-icon-btn:hover,
.cin-icon-btn:focus-visible {
  border-color: var(--gold);
  color: var(--gold);
  outline: none;
}

.cin-hall-btn {
  border-color: rgba(127, 224, 166, 0.5);
  color: #a8f0c4;
}

/* the camp's strip and button (HANDOVER section 51): brass, like the camp's panels */
.cin-hall.cin-camp {
  border-left-color: #d9a35a;
  background: linear-gradient(90deg, rgba(217, 163, 90, 0.18), rgba(217, 163, 90, 0));
}

.cin-hall.cin-camp > .px-icon,
.cin-hall.cin-camp .cin-hall-text strong {
  color: #f0c878;
}

.cin-camp-btn {
  border-color: rgba(217, 163, 90, 0.6);
  color: #f0c878;
}

/* ----- the party: round faces with ring bars (outer health, inner food) ----- */

.cin-hud {
  position: absolute;
  right: max(var(--pad), env(safe-area-inset-right, 0px));
  top: 92px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: opacity 0.2s;
}

.cin .hud-seat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--who);
}

.cin .hud-ring {
  position: relative;
  display: block;
  transition: transform 0.15s;
}

.cin .hud-rings {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.cin .hud-rings .trk {
  stroke: rgba(246, 241, 228, 0.14);
}

.cin .hud-rings .bar.hp {
  stroke: var(--hp);
}

.cin .hud-rings .bar.food {
  stroke: var(--food);
}

.cin .hud-face-wrap {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: block;
  border-radius: 50%;
  overflow: hidden;
  line-height: 0;
  background: radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--who) 45%, #1b2132), #10131d 75%);
  box-shadow: 0 0 0 2px rgba(var(--ink-a), 0.9);
}

.cin .hud-face,
.cin-portrait,
.cin .pc-face {
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.cin .hud-dot {
  background: var(--who);
}

.cin .hud-badge {
  position: absolute;
  top: -2px;
  left: -4px;
  padding: 3px 4px 2px;
  font: 8px/1 var(--pixel);
  color: var(--ink);
  background: var(--accent-2);
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.5);
}

/* a starving racer's ring in the cinema: a red pulse and a tag over the ring (on its lower edge on a phone) (fix/hunger) */
.cin .hud-badge.starving {
  top: -7px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  background: #a8322a;
  white-space: nowrap;
}

/* on a phone the bottom bar has no room above or below the rings, so the tag sits on the ring's lower
   edge, small, under the chin */
@media (max-width: 599px) {
  .cin .hud-badge.starving {
    top: auto;
    bottom: 1px;
    padding: 2px 3px 1px;
    font-size: 6px;
  }
}

.cin .hud-badge.starving.collapsing {
  background: #6e1418;
}

.cin .hud-ring.low .hud-rings .bar.food {
  stroke: #d9523f;
  animation: ring-low 1.6s ease-in-out infinite;
}

@keyframes ring-low {
  50% {
    opacity: 0.55;
  }
}

.cin .hud-ring .vchip {
  right: -14px;
  bottom: auto;
  top: 30%;
}

.cin .hud-ring .vchip.hp {
  left: auto;
  top: 6%;
}

.cin .pm-track .vchip {
  bottom: 10px;
}

@media (prefers-reduced-motion: reduce) {
  .cin .hud-ring.low .hud-rings .bar.food {
    animation: none;
  }
}

.cin .hud-badge.dq {
  left: auto;
  right: -4px;
  background: var(--hp);
  color: #fff;
}

.cin .hud-seat.dq .hud-face-wrap {
  filter: grayscale(0.8) brightness(0.7);
}

.cin .hud-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px 3px;
  background: rgba(var(--ink-a), 0.72);
}

.cin .hud-name {
  max-width: 10ch;
  overflow: hidden;
  font: 8px/1 var(--pixel);
  color: var(--who);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cin .hud-money {
  font: 8px/1 var(--pixel);
  color: rgba(246, 241, 228, 0.72);
}

.cin .hud-seat.turn .hud-ring::after {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  box-shadow: 0 0 14px rgba(255, 211, 110, 0.55);
  animation: cin-pulse 1.6s ease-in-out infinite;
}

.cin .hud-seat.turn .hud-tag {
  box-shadow: inset 0 -2px 0 var(--gold);
}

.cin .hud-seat:hover .hud-ring,
.cin .hud-seat:focus-visible .hud-ring {
  transform: scale(1.06);
}

.cin .hud-seat:focus-visible {
  outline: none;
}

/* the keyboard's mark: a paper ring outside the turn glow, and the tag lit */
.cin .hud-seat:focus-visible .hud-ring::before {
  content: "";
  position: absolute;
  inset: -9px;
  border-radius: 50%;
  border: 2px dashed var(--paper);
}

.cin .hud-seat:focus-visible .hud-tag {
  outline: 2px solid var(--paper);
  outline-offset: 1px;
}

/* a short window: the party's column would reach the text, so it turns
   into a row under the top line */
.cin.hud-row .cin-hud {
  top: 66px;
  flex-direction: row;
  gap: 10px;
}

@keyframes cin-pulse {
  50% {
    opacity: 0.45;
  }
}

/* ----- the text area: plate, portrait, pages, the writing space ----- */

.cin-box {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 4;
  display: flex;
  align-items: flex-end;
  gap: clamp(16px, 2vw, 32px);
  padding: 0 max(var(--pad), env(safe-area-inset-right, 0px)) 26px env(safe-area-inset-left, 0px);
}

/* a tall card (a vote, a finish sprint on the host's Mac) climbs over the
   picture: a soft backing keeps it readable */
.cin-box::before {
  content: "";
  position: absolute;
  inset: -90px 0 0;
  z-index: -1;
  background: linear-gradient(to bottom, rgba(var(--ink-a), 0), rgba(var(--ink-a), 0.8) 90px, rgba(var(--ink-a), 0.9));
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

.cin[data-state="card"] .cin-box::before {
  opacity: 1;
}

.cin-portrait-wrap {
  position: relative;
  flex: none;
  align-self: flex-end;
  margin: 0 0 -26px clamp(8px, 2.2vw, 36px);
  line-height: 0;
  filter: drop-shadow(0 0 18px rgba(0, 0, 0, 0.55)) drop-shadow(0 0 1px rgba(0, 0, 0, 0.9));
}

.cin-portrait-wrap::before {
  content: "";
  position: absolute;
  inset: 18% -18% -6% -18%;
  z-index: -1;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--who, #ffd36e) 34%, transparent), transparent);
}

.cin-portrait-wrap.narrator {
  margin-bottom: 0;
  opacity: 0.9;
}

.cin-portrait-wrap.swap {
  animation: cin-slide-in 0.38s ease-out;
}

@keyframes cin-slide-in {
  from {
    opacity: 0;
    transform: translateX(-18px);
  }
}

.cin-col {
  flex: 1;
  min-width: 0;
  max-width: 1000px;
  padding-bottom: 2px;
}

.cin-plate-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-bottom: 14px;
}

.cin-plate {
  --who: var(--gold);
  display: inline-block;
  padding: 9px 14px 8px;
  font: 16px/1 var(--pixel);
  color: var(--who);
  background: rgba(var(--ink-a), 0.82);
  box-shadow:
    inset 0 0 0 2px color-mix(in srgb, var(--who) 70%, transparent),
    4px 4px 0 rgba(0, 0, 0, 0.45);
  clip-path: polygon(0 3px, 3px 3px, 3px 0, calc(100% - 3px) 0, calc(100% - 3px) 3px, 100% 3px, 100% calc(100% - 3px), calc(100% - 3px) calc(100% - 3px), calc(100% - 3px) 100%, 3px 100%, 3px calc(100% - 3px), 0 calc(100% - 3px));
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.5);
}

.cin-plate-sub {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: italic 15px/1 var(--serif);
  color: rgba(246, 241, 228, 0.7);
}

.cin-plate-sub .px-icon {
  color: var(--gold);
}

.cin[data-state="writing"] .cin-plate-sub .px-icon {
  animation: cin-scribble 0.7s steps(2) infinite;
}

@keyframes cin-scribble {
  50% {
    transform: translate(2px, -1px);
  }
}

.cin-pages {
  display: inline-flex;
  gap: 6px;
}

.cin-pages i {
  width: 6px;
  height: 6px;
  background: rgba(246, 241, 228, 0.22);
}

.cin-pages i.done {
  background: rgba(246, 241, 228, 0.55);
}

.cin-pages i.on {
  background: var(--gold);
}

.cin-quick {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

/* over the picture the quick menu sits on a dark backing, so it reads on
   bright sand too */
.cin:not(.tall) .cin-quick {
  padding: 2px 4px;
  background: rgba(var(--ink-a), 0.62);
}

.cin .q {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 8px;
  border: 0;
  background: none;
  color: rgba(246, 241, 228, 0.9);
  font: 8px/1 var(--pixel);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-shadow: 1px 1px 0 var(--ink);
}

.cin .q .px-icon {
  width: 10px;
  height: 10px;
}

.cin .q:hover,
.cin .q:focus-visible,
.cin .q.on {
  color: var(--gold);
  outline: none;
}

.cin .q:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
}

.cin .q-count {
  min-width: 15px;
  padding: 3px 4px 2px;
  font: 8px/1 var(--pixel);
  color: var(--ink);
  background: var(--accent-2);
  text-align: center;
  text-shadow: none;
}

.cin .q .q-count {
  position: absolute;
  top: -4px;
  right: -2px;
}

.cin-text {
  max-width: 37em;
  font: 400 var(--fs) / 1.52 var(--serif);
  color: var(--paper);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.95), 0 0 22px rgba(0, 0, 0, 0.55);
  text-wrap: pretty;
  cursor: pointer;
  outline: none;
}

.cin-text:focus-visible {
  outline: 1px dashed rgba(255, 211, 110, 0.55);
  outline-offset: 8px;
}

/* the page's box: a page longer than this is cut to fit (app.js), so it
   never grows over the riders */
.cin[data-state="read"] .cin-text {
  max-height: max(calc(var(--fs) * 1.52 * 5), calc(100vh - var(--floor, 60vh) - 120px));
  overflow-y: auto;
  scrollbar-width: none;
}

.cin[data-state="read"] .cin-text::-webkit-scrollbar {
  display: none;
}

/* more text below the fold of the box (a card, a page that outgrew it) */
.cin-text.more-below {
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 1.6em), rgba(0, 0, 0, 0.25));
  mask-image: linear-gradient(to bottom, #000 calc(100% - 1.6em), rgba(0, 0, 0, 0.25));
}


.cin-text:empty {
  display: none;
}

/* reading and writing keep a steady five-line box, so the plate never jumps */
.cin[data-state="read"] .cin-text,
.cin[data-state="writing"] .cin-text {
  min-height: calc(var(--fs) * 1.52 * 5);
}

.cin[data-state="card"] .cin-text,
.cin[data-state="wait"] .cin-text {
  cursor: auto;
}

/* cards can be tall (a finish sprint on the host's Mac): they scroll inside */
.cin[data-state="card"] .cin-text {
  max-height: calc(100vh - 230px);
  overflow-y: auto;
  scrollbar-width: thin;
}

.cin-para {
  margin: 0;
}

.cin-para + .cin-para {
  margin-top: 0.6em;
}

.cin-text .qt {
  color: var(--gold-hi);
  font-style: italic;
}

.cin-text em {
  color: #f3e2b8;
}

.cin-text .ooc {
  font-family: var(--sans);
  font-size: 0.8em;
  color: var(--cin-muted);
}

.cin .c {
  opacity: 0;
  transition: opacity 0.14s linear;
}

.cin .c.on {
  opacity: 1;
}

.cin-cue {
  display: inline-flex;
  margin-left: 0.4em;
  vertical-align: -0.05em;
  color: var(--gold);
  opacity: 0;
}

.cin-cue .px-icon {
  width: 0.6em;
  height: 0.6em;
}

.cin-cue.on {
  opacity: 1;
  animation: cin-bob 0.9s steps(2) infinite;
}

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

.cin-stream {
  max-height: calc(var(--fs) * 1.52 * 7);
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 2.6em);
  mask-image: linear-gradient(to bottom, transparent 0, #000 2.6em);
}

.cin-cursor {
  display: inline-block;
  width: 0.48em;
  height: 1em;
  margin-left: 3px;
  vertical-align: -0.14em;
  background: var(--gold);
  box-shadow: 0 0 10px rgba(255, 211, 110, 0.5);
  animation: blink 1s steps(1) infinite;
}

.cin-para.wait {
  font-style: italic;
  color: rgba(246, 241, 228, 0.92);
}

.cin .dots {
  display: inline-flex;
  gap: 0.18em;
  margin-left: 0.12em;
}

.cin .dots i {
  width: 0.16em;
  height: 0.16em;
  background: currentColor;
  animation: cin-dot 1.2s steps(1) infinite;
}

.cin .dots i:nth-child(2) {
  animation-delay: 0.2s;
}

.cin .dots i:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes cin-dot {
  0%,
  60% {
    opacity: 1;
  }
  80% {
    opacity: 0.15;
  }
}

.cin-sub {
  margin: 0.45em 0 0;
  font: italic calc(var(--fs) * 0.68) / 1.4 var(--serif);
  color: rgba(246, 241, 228, 0.62);
}

.cin-sub:first-child {
  margin-top: 0;
  font-size: calc(var(--fs) * 0.85);
  color: rgba(246, 241, 228, 0.85);
}

.cin-recap {
  margin: -4px 0 8px;
  font: italic calc(var(--fs) * 0.66) / 1.4 var(--serif);
  color: rgba(246, 241, 228, 0.5);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
}

.cin-recap:empty,
.cin-actions:empty {
  display: none;
}

/* your turn: the text area becomes the writing space */
.cin-write {
  display: none;
}

.cin[data-state="turn"] .cin-write {
  display: block;
}

.cin[data-state="turn"] .cin-pages {
  display: none;
}

.cin .cin-write textarea {
  display: block;
  width: 100%;
  max-width: 37em;
  min-height: calc(var(--fs) * 1.52 * 2 + 12px);
  max-height: 34vh;
  margin: 0;
  padding: 0 0 10px;
  border: 0;
  border-bottom: 2px solid rgba(255, 211, 110, 0.32);
  border-radius: 0;
  background: transparent;
  color: var(--paper);
  font: 400 var(--fs) / 1.52 var(--serif);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.95), 0 0 22px rgba(0, 0, 0, 0.55);
  caret-color: var(--gold);
  resize: none;
  outline: none;
  overflow-y: auto;
  scrollbar-width: thin;
}

.cin .cin-write textarea:focus {
  border-bottom-color: rgba(255, 211, 110, 0.7);
  outline: none;
}

.cin .cin-write textarea::placeholder {
  font-style: italic;
  color: rgba(246, 241, 228, 0.42);
}

.cin.ooc-mode .cin-write textarea {
  border-bottom-style: dashed;
  font-family: var(--sans);
  font-size: calc(var(--fs) * 0.8);
}

.cin-talkline {
  display: flex;
  align-items: baseline;
  gap: 10px;
  width: 100%;
  max-width: 37em;
  margin-top: 14px;
  padding: 0;
  border: 0;
  background: none;
  font: 14px/1.4 var(--serif);
  color: rgba(246, 241, 228, 0.8);
  text-align: left;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
}

.cin-talkline .px-icon {
  width: 10px;
  height: 10px;
  align-self: center;
  color: rgba(246, 241, 228, 0.5);
}

.cin-talkline b {
  flex: none;
  font: 8px/1 var(--pixel);
  color: var(--who);
}

.cin-talkline span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cin-talkline em {
  margin-left: auto;
  font: 8px/1 var(--pixel);
  font-style: normal;
  color: rgba(246, 241, 228, 0.4);
  white-space: nowrap;
}

.cin-talkline:hover em,
.cin-talkline:focus-visible em {
  color: var(--gold);
}

.cin-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 4px;
  margin-top: 16px;
}

.cin .act {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 11px;
  border: 2px solid transparent;
  border-radius: 0;
  background: none;
  color: rgba(246, 241, 228, 0.86);
  font: 8px/1.2 var(--pixel);
  letter-spacing: 0.03em;
  text-align: left;
  text-decoration: none;
  text-shadow: 1px 1px 0 var(--ink);
  transition: color 0.12s, border-color 0.12s, background 0.12s;
}

.cin .act .px-icon {
  width: 12px;
  height: 12px;
  color: var(--gold);
}

.cin .act:hover:not(:disabled),
.cin .act:focus-visible {
  color: var(--gold-hi);
  border-color: rgba(255, 211, 110, 0.45);
  background: rgba(var(--ink-a), 0.45);
  outline: none;
}

.cin .act.on {
  color: var(--gold);
  border-color: rgba(255, 211, 110, 0.45);
}

.cin .act:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.cin .act.primary {
  margin-right: 8px;
  padding: 10px 16px;
  color: var(--ink);
  background: var(--gold);
  text-shadow: none;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.45);
  clip-path: polygon(0 3px, 3px 3px, 3px 0, calc(100% - 3px) 0, calc(100% - 3px) 3px, 100% 3px, 100% calc(100% - 3px), calc(100% - 3px) calc(100% - 3px), calc(100% - 3px) 100%, 3px 100%, 3px calc(100% - 3px), 0 calc(100% - 3px));
}

.cin .act.primary .px-icon {
  color: var(--ink);
}

.cin .act.primary:hover,
.cin .act.primary:focus-visible {
  background: var(--gold-hi);
  color: var(--ink);
}

.cin .act-hint {
  margin-left: auto;
  font: italic 13px/1.2 var(--serif);
  color: rgba(246, 241, 228, 0.45);
}

.cin .tap-hint {
  display: none;
}

.cin .status-line {
  min-height: 0;
  margin: 8px 0 0;
  font: italic 14px/1.4 var(--serif);
  color: rgba(246, 241, 228, 0.7);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
}

.cin .status-line:empty {
  display: none;
}

.cin .status-line.bad {
  color: #ffb4a8;
}

/* the gambling hall strip */
.cin-hall {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 10px;
  width: fit-content;
  max-width: 100%;
  margin: -4px 0 12px;
  padding: 6px 4px 6px 12px;
  border-left: 3px solid #7fe0a6;
  background: linear-gradient(90deg, rgba(127, 224, 166, 0.14), rgba(127, 224, 166, 0));
}

.cin-hall > .px-icon {
  color: #a8f0c4;
}

.cin-hall .act {
  padding: 6px 8px;
}

.cin-hall-text {
  flex: 0 1 auto;
  margin-right: 6px;
  font: italic 15px/1.3 var(--serif);
  color: rgba(246, 241, 228, 0.85);
}

.cin-hall-text strong {
  font-style: normal;
  color: #a8f0c4;
}

/* the vote and finish sprint cards, set in the story's own type */
.cin-text .vote-card {
  gap: 10px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  cursor: auto;
}

.cin-text .vote-card > .eyebrow {
  display: none;
}

.cin-text .vote-question {
  font: 400 var(--fs) / 1.4 var(--serif);
  color: var(--paper);
}

.cin-text .vote-who {
  font: 8px/1 var(--pixel);
  color: var(--paper);
}

.cin-text .fine {
  margin: 0;
  font: italic 14px/1.4 var(--serif);
  color: rgba(246, 241, 228, 0.6);
}

.cin-text .btn {
  height: auto;
  padding: 10px 13px;
  border: 2px solid rgba(255, 211, 110, 0.45);
  border-radius: 0;
  background: rgba(var(--ink-a), 0.55);
  color: var(--paper);
  font: 8px/1.4 var(--pixel);
  text-shadow: 1px 1px 0 var(--ink);
  white-space: normal;
}

.cin-text .btn:hover:not(:disabled):not(.primary) {
  border-color: var(--gold);
  color: var(--gold-hi);
}

.cin-text .btn.primary {
  border-color: var(--gold);
  background: var(--gold);
  color: var(--ink);
  text-shadow: none;
}

.cin-text .btn.ghost {
  justify-self: start;
  border-color: transparent;
  background: none;
  color: rgba(246, 241, 228, 0.7);
}

.cin-text .sprint-options {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.cin-text .btn.tactic {
  justify-content: start;
}

.cin-text .tactic-label {
  font: 8px/1.4 var(--pixel);
}

.cin-text .tactic-hint {
  font: 13px/1.35 var(--serif);
  color: rgba(246, 241, 228, 0.7);
  text-shadow: none;
}

.cin-text .btn.tactic.primary .tactic-hint {
  color: var(--ink);
}

/* several voters or racers on one screen (the host's Mac): one short row
   each, the tactics' effects said once above them */
.cin-text .vote-card.multi .vote-row {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 4px 12px;
}

/* one width for every name, so the choices line up */
.cin-text .vote-card.multi .vote-who {
  width: 112px;
}

.cin-text .vote-card.multi .vote-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cin-text .vote-card.multi .sprint-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cin-text .vote-card.multi .tactic-hint {
  display: none;
}

.cin-text .vote-card.multi .btn {
  padding: 8px 10px;
}

.cin-text .tactic-legend {
  margin: 0;
  font: italic 14px/1.45 var(--serif);
  color: rgba(246, 241, 228, 0.72);
}

.cin-text .tactic-legend b {
  font: 8px/1 var(--pixel);
  color: var(--gold-hi);
}

/* ----- the side drawer ----- */

.cin-scrim {
  position: absolute;
  inset: 0;
  z-index: 19;
  background: rgba(5, 6, 10, 0.32);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

.cin.drawer-open .cin-scrim {
  opacity: 1;
  pointer-events: auto;
}

.cin.drawer-open .cin-hud {
  opacity: 0;
}

.cin-drawer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  width: min(460px, calc(100vw - 28px));
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, rgba(16, 19, 29, 0.86), rgba(11, 13, 20, 0.92));
  -webkit-backdrop-filter: blur(18px) saturate(1.25);
  backdrop-filter: blur(18px) saturate(1.25);
  border-left: 2px solid rgba(255, 211, 110, 0.22);
  box-shadow: -24px 0 60px rgba(0, 0, 0, 0.45);
  transform: translateX(104%);
  /* hidden only once it has slid out; visible at once when it opens, so
     the keyboard focus can move into it */
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0s linear 0.3s;
  visibility: hidden;
}

.cin.drawer-open .cin-drawer {
  transform: none;
  visibility: visible;
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0s;
}

.dr-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 18px 14px 20px;
}

.dr-title {
  font: 16px/1 var(--pixel);
  color: var(--gold);
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.5);
}

.dr-home {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
  padding: 6px 4px;
  font: 8px/1 var(--pixel);
  color: rgba(246, 241, 228, 0.6);
  text-decoration: none;
}

.dr-home .px-icon {
  width: 10px;
  height: 10px;
}

.dr-home:hover,
.dr-home:focus-visible {
  color: var(--gold);
  outline: none;
}

.dr-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 0 18px 14px 20px;
}

.dr-tab {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 9px;
  border: 2px solid rgba(246, 241, 228, 0.08);
  background: rgba(246, 241, 228, 0.03);
  color: rgba(246, 241, 228, 0.78);
  font: 8px/1.3 var(--pixel);
  text-align: left;
}

.dr-tab .px-icon {
  width: 12px;
  height: 12px;
}

.dr-tab .q-count {
  margin-left: auto;
}

.dr-tab:hover,
.dr-tab:focus-visible {
  border-color: rgba(255, 211, 110, 0.4);
  outline: none;
}

.dr-tab.on {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(255, 211, 110, 0.08);
}

.dr-panel {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 4px 18px 18px 20px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 211, 110, 0.3) transparent;
}

.dr-foot {
  padding: 12px 18px max(18px, env(safe-area-inset-bottom)) 20px;
  border-top: 1px solid rgba(246, 241, 228, 0.08);
}

.dr-classic {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 4px 12px;
  width: 100%;
  padding: 10px 12px;
  border: 2px solid rgba(246, 241, 228, 0.1);
  background: none;
  color: var(--paper);
  text-align: left;
}

.dr-classic .px-icon {
  grid-row: span 2;
  width: 16px;
  height: 16px;
  color: var(--gold);
}

.dr-classic span {
  font: 8px/1.3 var(--pixel);
}

.dr-classic small {
  font: italic 13px/1.3 var(--serif);
  color: var(--cin-muted);
}

.dr-classic:hover,
.dr-classic:focus-visible {
  border-color: rgba(255, 211, 110, 0.45);
  outline: none;
}

.dr-note {
  margin: 0 0 10px;
  font: italic 14px/1.4 var(--serif);
  color: var(--cin-muted);
}

.cin .lnk {
  padding: 0;
  border: 0;
  background: none;
  color: var(--gold);
  font: 8px/1.4 var(--pixel);
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* party cards */
.cin .pc {
  margin-bottom: 12px;
  padding: 14px;
  border: 2px solid rgba(246, 241, 228, 0.08);
  background: rgba(246, 241, 228, 0.035);
}

.cin .pc.turn {
  border-color: color-mix(in srgb, var(--gold) 60%, transparent);
}

.cin .pc-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
}

.cin .pc-face-wrap {
  line-height: 0;
  padding: 4px 4px 0;
  background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--who) 40%, #1b2132), #10131d 80%);
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--who) 60%, transparent);
}

.cin .pc-id {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.cin .pc-name {
  font: 12px/1.2 var(--pixel);
  color: var(--who);
  overflow-wrap: anywhere;
}

.cin .pc-sub {
  font: italic 14px/1.2 var(--serif);
  color: var(--cin-muted);
}

.cin .pc-race {
  font: 8px/1.3 var(--pixel);
  color: rgba(246, 241, 228, 0.6);
}

.cin .pc-money {
  align-self: start;
  font: 12px/1 var(--pixel);
  color: var(--gold);
}

.cin .pc-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.cin .pc-badge {
  padding: 4px 6px 3px;
  font: 8px/1 var(--pixel);
  color: var(--paper);
  border: 2px solid rgba(246, 241, 228, 0.2);
}

.cin .pc-badge.turn {
  border-color: var(--gold);
  background: var(--gold);
  color: var(--ink);
}

.cin .pc-badge.group {
  border-color: color-mix(in srgb, var(--accent-2) 60%, transparent);
  color: var(--accent-2);
}

.cin .pc-badge.dq {
  border-color: var(--hp);
  background: var(--hp);
  color: #fff;
}

.cin .pc-badge.strike {
  border-color: #b85a3a;
  color: #ffb08a;
}

.cin .pc-meters {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.cin .pm {
  display: grid;
  grid-template-columns: 58px 1fr 28px;
  align-items: center;
  gap: 10px;
}

.cin .pm-l,
.cin .pm-v {
  font: 8px/1 var(--pixel);
  color: rgba(246, 241, 228, 0.7);
}

.cin .pm-v {
  text-align: right;
}

.cin .pm-track {
  position: relative;
  height: 8px;
  background: rgba(246, 241, 228, 0.09);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.4);
}

.cin .pm-track::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(90deg, transparent 0 9px, rgba(var(--ink-a), 0.8) 9px 10px);
}

.cin .pm-fill {
  display: block;
  height: 100%;
}

.cin .pm.hp .pm-fill {
  background: linear-gradient(var(--hp) 0 50%, #c63d38 50%);
}

.cin .pm.food .pm-fill {
  background: linear-gradient(var(--food) 0 50%, #c99636 50%);
}

.cin .pc-horse {
  margin: 12px 0 0;
  font: italic 14px/1.3 var(--serif);
  color: var(--cin-muted);
}

.cin .pc-h {
  margin: 16px 0 8px;
  font: 8px/1.3 var(--pixel);
  color: rgba(246, 241, 228, 0.48);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cin .pc-passives {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cin .ps {
  display: block;
  width: 100%;
  padding: 9px 11px;
  border: 0;
  border-left: 3px solid rgba(246, 241, 228, 0.25);
  background: rgba(246, 241, 228, 0.03);
  color: inherit;
  text-align: left;
}

.cin .ps:hover,
.cin .ps:focus-visible {
  background: rgba(246, 241, 228, 0.07);
  outline: none;
}

.cin .ps.rare {
  border-left-color: var(--gold);
  background: linear-gradient(90deg, rgba(255, 211, 110, 0.13), rgba(255, 211, 110, 0.02));
}

.cin .ps-name {
  font: 8px/1.4 var(--pixel);
  color: var(--paper);
}

.cin .ps.rare .ps-name {
  color: var(--gold);
}

.cin .ps.very-rare {
  border-left-color: #b48ce8;
  background: linear-gradient(90deg, rgba(180, 140, 232, 0.14), rgba(180, 140, 232, 0.02));
}

.cin .ps.very-rare .ps-name {
  color: #cfaef5;
}

.cin .ps.overpowered {
  border-left-color: #ffd36e;
  background: linear-gradient(90deg, rgba(255, 211, 110, 0.3), rgba(240, 160, 64, 0.06));
  box-shadow: inset 0 0 0 1px rgba(255, 211, 110, 0.35);
}

.cin .ps.overpowered .ps-name {
  color: #ffe9a8;
}

.cin .ps.debuff {
  border-left-color: #b85a4a;
  background: linear-gradient(90deg, rgba(184, 90, 74, 0.14), rgba(184, 90, 74, 0.02));
}

.cin .ps.debuff .ps-name {
  color: #e4a090;
}

.cin .ps-tag {
  margin-left: 8px;
  padding: 2px 4px;
  font: 8px/1 var(--pixel);
  color: var(--ink);
  background: var(--gold);
}

.cin .ps-fx {
  display: block;
  margin-top: 5px;
  font: 14px/1.4 var(--serif);
  color: var(--cin-muted);
}

.cin .pc-stand {
  display: block;
  width: 100%;
  padding: 11px 12px;
  border: 2px solid color-mix(in srgb, var(--who) 50%, transparent);
  background: linear-gradient(135deg, color-mix(in srgb, var(--who) 16%, transparent), rgba(43, 79, 192, 0.03));
  color: inherit;
  text-align: left;
}

.cin .pc-stand:hover,
.cin .pc-stand:focus-visible {
  border-color: var(--who);
  outline: none;
}

.cin .st-name {
  display: block;
  font: 600 18px/1.2 var(--serif);
  color: color-mix(in srgb, var(--who) 70%, #fff);
}

.cin .st-stats {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
  margin: 10px 0 8px;
}

.cin .st-stat {
  display: grid;
  justify-items: center;
  gap: 5px;
  padding: 6px 0;
  background: rgba(var(--ink-a), 0.5);
}

.cin .st-k {
  font: 8px/1 var(--pixel);
  color: var(--faint);
}

.cin .st-v {
  font: 12px/1 var(--pixel);
  color: var(--gold);
}

.cin .st-ab,
.cin .pc-none {
  display: block;
  margin: 0;
  font: 14px/1.45 var(--serif);
  color: var(--cin-muted);
}

.cin .pc-none {
  font-style: italic;
}

.cin .pc-remove {
  margin-top: 14px;
  color: #ffb4a8;
}

.cin .pc-comp {
  display: grid;
  gap: 2px;
  margin-bottom: 8px;
  padding: 8px 10px;
  border: 2px dashed rgba(246, 241, 228, 0.12);
}

.cin .pc-comp strong {
  font: 8px/1.4 var(--pixel);
  color: var(--paper);
}

.cin .pc-comp span {
  font: italic 14px/1.4 var(--serif);
  color: var(--cin-muted);
}

.cin .pc-comp.gone {
  opacity: 0.5;
}

/* the story log: the full feed with replay, branch, retry and undo */
.cin-drawer .feed {
  gap: 14px;
}

.cin-drawer .beat {
  padding: 0 0 4px 12px;
  border-left: 2px solid rgba(246, 241, 228, 0.08);
}

.cin-drawer .beat:last-of-type,
.cin-drawer .beat.live {
  border-left-color: var(--gold);
}

.cin-drawer .beat .prose {
  font-size: 16px;
  line-height: 1.55;
  color: rgba(246, 241, 228, 0.88);
}

.cin-drawer .beat-meta {
  margin-top: 6px;
  color: rgba(246, 241, 228, 0.45);
}

.cin-drawer .beat-meta .link {
  color: var(--gold);
  font: 8px/1.6 var(--pixel);
  text-underline-offset: 4px;
}

.cin-drawer .move {
  max-width: 94%;
  padding: 8px 12px;
  border-radius: 0;
  border: 0;
  border-right: 3px solid rgba(246, 241, 228, 0.25);
  background: rgba(246, 241, 228, 0.04);
  font: italic 15px/1.5 var(--serif);
}

.cin-drawer .move-who {
  font: 8px/1 var(--pixel);
  color: rgba(246, 241, 228, 0.7);
}

.cin-drawer .meanwhile {
  font-family: var(--serif);
}

/* standings */
.cin-drawer .bd .eyebrow {
  margin: 4px 0 6px;
}

.cin-drawer .board-to {
  margin: 0 0 12px;
  font: italic 14px/1.4 var(--serif);
  color: var(--cin-muted);
}

.cin-drawer .board-list {
  border: 0;
  background: rgba(var(--ink-a), 0.45);
}

.cin-drawer .board {
  min-width: 0;
}

/* table talk */
.cin-drawer .talk {
  margin: 0;
  gap: 12px;
}

.cin-drawer .talk .side-title {
  display: none;
}

.cin-drawer .talk-list {
  max-height: none;
  padding: 0;
  border: 0;
  background: none;
  gap: 10px;
  font: 15px/1.45 var(--serif);
}

.cin-drawer .talk-who {
  margin-right: 4px;
  font: 8px/1 var(--pixel);
  color: var(--paper);
  vertical-align: 0.15em;
}

.cin-drawer .talk-form input {
  padding: 8px 0;
  border: 0;
  border-bottom: 2px solid rgba(255, 211, 110, 0.32);
  border-radius: 0;
  background: transparent;
  font: 16px/1.4 var(--serif);
  caret-color: var(--gold);
}

.cin-drawer .talk-form input:focus {
  border-bottom-color: var(--gold);
  outline: none;
}

.cin-drawer .talk-form .btn {
  border: 2px solid var(--gold);
  border-radius: 0;
  background: var(--gold);
  color: var(--ink);
  font: 8px/1 var(--pixel);
}

/* sound and settings */
.cin .sd {
  display: grid;
  gap: 18px;
  padding-top: 4px;
}

.cin .sd .dr-note {
  margin: -8px 0 0;
}

.cin .sd-row {
  display: grid;
  gap: 10px;
  margin: 0;
  font: 8px/1 var(--pixel);
  color: rgba(246, 241, 228, 0.78);
}

.cin .sd-row select {
  border-radius: 0;
  border: 2px solid rgba(246, 241, 228, 0.12);
  background: rgba(var(--ink-a), 0.6);
  font: 14px/1.3 var(--sans);
}

.cin .sd-range {
  width: 100%;
  accent-color: var(--gold);
}

.cin .sg {
  display: grid;
  gap: 10px;
}

.cin .sg-l {
  font: 8px/1 var(--pixel);
  color: rgba(246, 241, 228, 0.78);
}

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

.cin .sg-b {
  padding: 9px 10px;
  border: 2px solid rgba(246, 241, 228, 0.1);
  background: rgba(246, 241, 228, 0.03);
  color: rgba(246, 241, 228, 0.78);
  font: 8px/1 var(--pixel);
}

.cin .sg-b.on {
  border-color: var(--gold);
  background: rgba(255, 211, 110, 0.08);
  color: var(--gold);
}

.cin .dr-btns {
  display: grid;
  justify-items: start;
  gap: 4px;
  margin-top: -6px;
}

/* ----- a phone held sideways: everything tighter ----- */

.cin.short {
  --fs: 15px;
  --pad: 16px;
}

.cin.short .cin-top {
  top: 10px;
}

.cin.short .cin-where {
  gap: 4px;
}

.cin.short .cin-where-clock {
  font-size: 12px;
}

.cin.short .cin-icon-btn .lbl {
  display: none;
}

.cin.short .cin-hud {
  top: 54px;
  flex-direction: row;
  gap: 6px;
}

.cin.short .hud-tag {
  display: none;
}

.cin.short .cin-box {
  padding-bottom: max(10px, env(safe-area-inset-bottom, 0px));
}

.cin.short .cin-portrait-wrap {
  margin-bottom: -10px;
}

.cin.short .cin-plate-row {
  margin-bottom: 8px;
}

.cin.short .cin-plate {
  padding: 7px 10px 6px;
  font-size: 11px;
}

.cin.short[data-state="read"] .cin-text,
.cin.short[data-state="writing"] .cin-text {
  min-height: calc(var(--fs) * 1.52 * 3);
}

.cin.short[data-state="read"] .cin-text {
  max-height: max(calc(var(--fs) * 1.52 * 3), calc(100vh - var(--floor, 60vh) - 100px));
}

.cin.short .cin-stream {
  max-height: calc(var(--fs) * 1.52 * 4);
}

.cin.short .cin-actions {
  margin-top: 8px;
}

.cin.short .cin-recap {
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* the camp and gambling hall strip keeps to one line, so the box does not climb into the top line */
.cin.short .cin-hall {
  flex-wrap: nowrap;
  margin: -2px 0 6px;
  padding-block: 3px;
  /* the box sits over the picture here: a dark backing keeps the words readable */
  background: linear-gradient(90deg, rgba(8, 10, 16, 0.78), rgba(8, 10, 16, 0.5) 70%, rgba(8, 10, 16, 0));
}

.cin.short .cin-hall .act {
  flex: none;
  padding: 4px 8px;
  white-space: nowrap;
}

.cin.short .cin-hall-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* (and the one-line recap gives the camp strip its room) */
.cin.short .cin-camp:not([hidden]) + .cin-recap {
  display: none;
}

.cin.short[data-state="wait"] .cin-sub,
.cin.short .cin-talkline em {
  display: none;
}

.cin.short .cin-talkline {
  margin-top: 6px;
}

.cin.short .act-hint {
  display: none;
}

.cin.short .cin-write textarea {
  max-height: 22vh;
}

.cin.short[data-state="card"] .cin-text {
  max-height: calc(100vh - 150px);
}

/* ----- a phone held upright: the picture across the top, the story under it ----- */

.cin.tall {
  --pad: 16px;
  --fs: 19px;
}

.cin.tall[data-size="0"] {
  --fs: 17px;
}

.cin.tall[data-size="2"] {
  --fs: 21px;
}

.cin.tall .cin-top {
  top: max(30px, env(safe-area-inset-top));
}

.cin.tall .cin-picture {
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 18px, #000 calc(100% - 44px), transparent);
  mask-image: linear-gradient(to bottom, transparent 0, #000 18px, #000 calc(100% - 44px), transparent);
}

.cin.tall .cin-where {
  max-width: none;
  padding-right: 16px;
}

.cin.tall .cin-where-clock {
  font-size: 13px;
}

.cin.tall .cin-icon-btn .lbl {
  display: none;
}

.cin-bar:empty {
  display: none;
}

.cin.tall .cin-box {
  top: calc(var(--pic-bottom) + 26px);
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto auto minmax(0, max-content) auto minmax(0, 1fr) auto auto auto;
  align-items: start;
  gap: 0 12px;
  padding: 0 16px calc(env(safe-area-inset-bottom, 0px) + 8px);
}

.cin.tall .cin-col {
  display: contents;
}

.cin.tall .cin-portrait-wrap {
  grid-row: 1;
  grid-column: 1;
  align-self: end;
  margin: -30px 0 0;
}

.cin.tall .cin-plate-row {
  grid-row: 1;
  grid-column: 2;
  align-self: end;
  margin: 0 0 4px;
  gap: 8px 10px;
}

.cin.tall .cin-plate {
  padding: 8px 11px 7px;
  font-size: 12px;
}

.cin.tall .cin-plate-sub {
  font-size: 14px;
}

.cin.tall .cin-hall,
.cin.tall .cin-camp {
  grid-row: 2;
  grid-column: 1 / -1;
  margin: 12px 0 0;
}

.cin.tall .cin-recap {
  grid-row: 3;
  grid-column: 1 / -1;
  margin: 14px 0 0;
}

.cin.tall .cin-text {
  grid-row: 4;
  grid-column: 1 / -1;
  align-self: stretch;
  min-height: 0;
  max-height: none;
  margin-top: 16px;
  overflow-y: auto;
  scrollbar-width: none;
}

.cin.tall[data-state="turn"] .cin-text {
  display: none;
}

.cin.tall .cin-write {
  grid-row: 4;
  grid-column: 1 / -1;
  margin-top: 12px;
}

.cin.tall .cin-write textarea {
  max-height: 30vh;
}

.cin.tall .cin-talkline {
  grid-row: 5;
  grid-column: 1 / -1;
  flex-wrap: wrap;
}

.cin.tall .cin-talkline em {
  display: none;
}

.cin.tall .cin-actions {
  grid-row: 7;
  grid-column: 1 / -1;
  gap: 4px 2px;
  margin-top: 10px;
}

.cin.tall .status-line {
  grid-row: 8;
  grid-column: 1 / -1;
}

.cin.tall .act {
  padding: 8px;
}

.cin.tall .cin-text .sprint-options {
  grid-template-columns: 1fr 1fr;
}

.cin.tall .cin-text .btn.tactic {
  padding: 8px 9px;
}

/* the host's finish sprint on a phone: each racer's name over two rows of
   two tactics */
.cin.tall .cin-text .sprint-card.multi .vote-row {
  grid-template-columns: minmax(0, 1fr);
}

.cin.tall .cin-text .sprint-card.multi .sprint-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.cin.tall .cin-text .tactic-hint {
  font-size: 12px;
}

.cin.tall .cin-text .vote-question {
  font-size: calc(var(--fs) * 0.9);
}

.cin.tall .act.primary {
  margin-right: 4px;
}

.cin.tall .act-hint {
  display: none;
}

.cin.tall .tap-hint {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  /* as tall as a button, so "Skip ahead" joins the row without moving the text */
  min-height: 34px;
  font: 8px/1 var(--pixel);
  color: rgba(246, 241, 228, 0.42);
  letter-spacing: 0.08em;
  animation: blink 1.6s steps(1) infinite;
}

.cin.tall[data-state="read"] .cin-actions {
  flex-wrap: nowrap;
}

.cin.tall .cin-bar {
  grid-row: 9;
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 10px -6px 0;
  padding-top: 8px;
  border-top: 1px solid rgba(246, 241, 228, 0.08);
}

.cin.tall .cin-hud {
  position: static;
  flex-direction: row;
  min-width: 0;
  gap: 4px;
}

.cin.tall .hud-tag {
  display: none;
}

.cin.tall .cin-quick {
  flex: none;
  margin: 0;
  gap: 0;
}

/* the Menu button is already at the top right */
.cin.tall .q-menu {
  display: none;
}

.cin.tall .q {
  flex-direction: column;
  gap: 7px;
  min-width: 46px;
  padding: 8px 4px;
}

.cin.tall .q .px-icon {
  width: 14px;
  height: 14px;
}

.cin.tall .cin-drawer {
  width: calc(100vw - 24px);
}

.cin.tall .dr-head {
  padding-top: max(34px, env(safe-area-inset-top));
}

.cin.tall .dr-tabs {
  gap: 5px;
  padding: 0 14px 12px 16px;
}

.cin.tall .dr-tab {
  flex-direction: column;
  gap: 7px;
  padding: 10px 4px;
  text-align: center;
}

.cin.tall .dr-tab .q-count {
  position: absolute;
  top: 4px;
  right: 4px;
}

/* ----- a phone's keyboard is up: the move box gets the screen ----- */

.cin.kbd .cin-picture,
.cin.kbd .cin-reflect,
.cin.kbd .cin-top,
.cin.kbd .cin-hud,
.cin.kbd .cin-bar,
.cin.kbd .cin-recap,
.cin.kbd .cin-hall,
.cin.kbd .cin-camp,
.cin.kbd .cin-talkline,
.cin.kbd .cin-portrait-wrap {
  display: none;
}

.cin.kbd .cin-box {
  top: 0;
  padding-top: 12px;
  background: rgba(var(--ink-a), 0.55);
}

.cin.kbd.tall .cin-box {
  top: 0;
  grid-template-rows: auto 0 0 minmax(0, 1fr) 0 0 auto auto 0;
}

.cin.kbd.tall .cin-plate-row {
  grid-column: 1 / -1;
}

.cin.kbd:not(.tall) .cin-box {
  align-items: stretch;
  padding-left: max(var(--pad), env(safe-area-inset-left, 0px));
}

.cin.kbd:not(.tall) .cin-col {
  display: flex;
  flex-direction: column;
}

.cin.kbd .cin-write {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  align-self: stretch;
  min-height: 0;
  margin-top: 8px;
}

.cin.kbd .cin-write textarea {
  flex: 1 1 auto;
  height: auto !important;
  max-height: none;
}

.cin.kbd .cin-actions {
  margin-top: 8px;
}

/* ----- a big screen: the small pixel labels grow by half (crisp on a
   Retina screen, where 12px is three device pixels to the font's two) ----- */

@media (min-width: 1600px) and (min-height: 860px) {
  .cin .q,
  .cin .hud-name,
  .cin .hud-money,
  .cin .hud-badge,
  .cin .act,
  .cin .tap-hint,
  .cin-where-stage,
  .cin-icon-btn,
  .cin-talkline b,
  .cin-talkline em,
  .cin-text .vote-who,
  .cin-text .btn,
  .cin-text .tactic-label,
  .cin-text .tactic-legend b {
    font-size: 12px;
  }

  .cin .q .px-icon,
  .cin .act .px-icon {
    width: 14px;
    height: 14px;
  }

  .cin-where {
    max-width: min(640px, 60vw);
  }

  .cin-text .vote-card.multi .vote-who {
    width: 160px;
  }

  .cin-text .fine,
  .cin-text .tactic-legend,
  .cin-talkline,
  .cin .status-line {
    font-size: 16px;
  }
}

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

/* The remove button sits in the card's corner so it never covers the bars. */
.seat {
  position: relative;
}

.seat > .icon-btn.subtle {
  position: absolute;
  top: 4px;
  right: 4px;
}

.seat .seat-info {
  padding-right: 18px;
}

/* ---------- gambling hall ---------- */

.hall-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid color-mix(in srgb, var(--good) 45%, var(--line));
  background: color-mix(in srgb, var(--good) 8%, var(--surface));
}

.hall-banner-text {
  flex: 1 1 200px;
}

.hall {
  display: grid;
  gap: 12px;
}

.hall-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.hall-head h2 {
  margin: 0;
  font-family: var(--serif);
}

.hall-money {
  font-family: var(--pixel);
  font-size: 0.7rem;
  color: var(--good);
}

.seg {
  display: flex;
  gap: 4px;
  padding: 3px;
  border-radius: 99px;
  border: 1px solid var(--line-2);
  background: var(--bg-2);
  width: fit-content;
  max-width: 100%;
  overflow-x: auto;
}

.seg-btn {
  padding: 6px 14px;
  border: 0;
  border-radius: 99px;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.seg-btn.on {
  background: var(--surface-2);
  color: var(--text);
}

.table-felt {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 14px;
  border: 3px solid #5a3a1c;
  background:
    radial-gradient(ellipse at 50% 30%, #2f7a4a 0%, #1f5a36 60%, #174429 100%);
  color: #f4f1e8;
}

.table-felt .fine {
  color: #cfe3d2;
}

.hand-row {
  display: grid;
  grid-template-columns: 4.5em 1fr auto;
  align-items: center;
  gap: 10px;
}

.hand-label {
  font-family: var(--pixel);
  font-size: 0.6rem;
  color: #f2d070;
}

.hand-value {
  font-family: var(--pixel);
  font-size: 0.8rem;
}

.cards {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 62px;
}

.card {
  display: grid;
  place-items: center;
  align-content: center;
  width: 44px;
  height: 62px;
  border-radius: 5px;
  border: 2px solid #1a1420;
  background: #f7efd9;
  color: #1a1420;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.35);
  font-family: var(--pixel);
  line-height: 1.2;
}

.card.red {
  color: #c2302a;
}

.card-rank {
  font-size: 0.75rem;
}

.card-suit {
  font-size: 1.1rem;
  font-family: var(--sans);
}

.card.back {
  background:
    repeating-linear-gradient(45deg, #8a2a2a 0 4px, #6a1c1c 4px 8px);
  border-color: #f7efd9;
  outline: 2px solid #1a1420;
  outline-offset: -4px;
}

.peek-note {
  margin: 0;
  font-size: 0.8rem;
  color: #f2d070;
}

.hand-result {
  margin: 0;
  font-family: var(--pixel);
  font-size: 0.7rem;
  line-height: 1.6;
}

.hand-result.win {
  color: var(--good);
}

.hand-result.lose {
  color: var(--bad);
}

.table-felt .hand-result.win {
  color: #a8ffbf;
}

.table-felt .hand-result.lose {
  color: #ffb4a8;
}

.bet-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.bet-label {
  font-weight: 700;
  margin-right: 2px;
}

.bet-row .chip {
  color: var(--text);
}

.bet-row .chip.on {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 20%, var(--surface));
}

.bet-input {
  width: 6em;
  padding: 6px 8px;
  color: var(--text);
  background: var(--bg-2);
}

.slot-machine {
  display: grid;
  gap: 10px;
  justify-items: center;
  padding: 14px;
  border-radius: 14px;
  border: 3px solid #7a5418;
  background: linear-gradient(#c9902e, #8a5a1a);
  color: #1a1420;
}

.slot-machine .bet-row {
  justify-content: center;
}

.slot-machine .fine {
  color: #2a1a08;
  text-align: center;
}

.slot-machine .hand-result {
  color: #1a1420;
  text-align: center;
}

.slot-top {
  font-family: var(--pixel);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  padding: 6px 10px;
  border-radius: 6px;
  background: #1a1420;
  color: #ffd84a;
}

.reels {
  display: flex;
  gap: 8px;
  padding: 8px;
  border-radius: 8px;
  background: #1a1420;
}

.reel {
  width: 72px;
  height: 72px;
  image-rendering: pixelated;
  border-radius: 4px;
}

.hall-feed .eyebrow {
  margin-bottom: 4px;
}

.feed-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2px;
  font-size: 0.85rem;
  color: var(--muted);
}

.feed-list .win {
  color: var(--good);
}

.feed-list .lose {
  color: var(--bad);
}

.hall-error {
  margin: 0;
  color: var(--bad);
}

@media (max-width: 480px) {
  .hand-row {
    grid-template-columns: 1fr auto;
  }
  .hand-label {
    grid-column: 1 / -1;
  }
  .card {
    width: 38px;
    height: 54px;
  }
  .reel {
    width: 64px;
    height: 64px;
  }
}

/* ---------- split parties ---------- */

.meanwhile {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  margin: 6px 0;
  padding: 8px 12px;
  border-left: 3px solid var(--line-2);
  color: var(--muted);
  font-style: italic;
}

.meanwhile .eyebrow {
  font-style: normal;
}

.meanwhile.live {
  border-left-color: var(--accent);
}

.badge.group {
  border-color: color-mix(in srgb, var(--accent-2) 50%, var(--line));
  color: var(--accent-2);
}

.seat-info .badge {
  justify-self: start;
  width: fit-content;
}

/* ---------- table talk ---------- */

.talk {
  display: grid;
  gap: 6px;
  margin-top: 12px;
}

.talk-list {
  list-style: none;
  margin: 0;
  padding: 8px 10px;
  display: grid;
  gap: 4px;
  max-height: 180px;
  overflow-y: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--bg-2);
  font-size: 0.88rem;
  overflow-wrap: anywhere;
}

.talk-who {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 700;
}

.talk-text {
  color: var(--text);
}

.talk-form {
  display: flex;
  gap: 6px;
}

.talk-form input {
  flex: 1;
  min-width: 0;
}

.home-head {
  flex-wrap: wrap;
}

.home-head h1 {
  flex: 1 1 auto;
}

.horse-line {
  color: var(--muted);
}

/* the rounds in the gun at hand, in the classic layout's party list */
.side-ammo {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 2px 0;
}

.side-ammo canvas {
  display: block;
  flex: none;
  padding: 2px;
  background: #120a06;
  image-rendering: pixelated;
}

/* ---------- suggestions and journal ---------- */

.choices {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 2px 0 6px;
}

.choice {
  display: inline-flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0 6px;
  max-width: 100%;
  padding: 6px 10px;
  border-radius: 99px;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line-2));
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
  color: var(--text);
  font: inherit;
  font-size: 0.85rem;
  text-align: left;
  cursor: pointer;
}

.choice:hover {
  border-color: var(--accent);
}

.journal-link {
  justify-self: start;
  font-size: 0.8rem;
}

.journal {
  display: grid;
  gap: 8px;
}

.journal-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.journal-list li {
  display: grid;
  gap: 2px;
  padding-left: 10px;
  border-left: 2px solid color-mix(in srgb, var(--accent) 50%, var(--line));
}

.journal-when {
  font-family: var(--pixel);
  font-size: 0.55rem;
  color: var(--muted);
}

.journal-text {
  font-family: var(--serif);
  line-height: 1.5;
}

.journal-facts-title {
  margin-top: 6px;
}

.journal-facts {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

.choice-kind {
  flex: none;
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--accent) 80%, #7a5418);
  color: #1b1405;
  font-family: var(--pixel);
  font-size: 0.55rem;
  vertical-align: 1px;
}

/* cinema: the journal button on a party card, suggestions over the picture */
.cin .pc-journal {
  justify-self: start;
  margin: 2px 0 4px;
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  background: rgba(20, 16, 10, 0.55);
  color: var(--accent);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}

.cin .cin-write .choices {
  margin-bottom: 8px;
}

.cin .cin-write .choice {
  background: rgba(14, 12, 20, 0.72);
  border-color: rgba(255, 211, 110, 0.45);
  color: #f6f1e4;
}

/* cinema: the journal book under the party portraits */
.cin .hud-book {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.cin .hud-book .book-icon {
  width: 48px;
  height: 48px;
  image-rendering: pixelated;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.55));
  transition: transform 0.15s;
}

.cin .hud-book:hover .book-icon,
.cin .hud-book:focus-visible .book-icon {
  transform: translateY(-2px) rotate(-4deg);
}

.cin .hud-book:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.cin .hud-book.fresh .book-icon {
  animation: book-nudge 2.4s ease-in-out infinite;
}

.cin .hud-book .book-new {
  position: absolute;
  top: -4px;
  right: -6px;
  min-width: 18px;
  padding: 2px 4px;
  border-radius: 99px;
  background: #c0392b;
  color: #fff;
  font-family: var(--pixel);
  font-size: 0.5rem;
  line-height: 1.4;
  text-align: center;
}

@keyframes book-nudge {
  0%,
  80%,
  100% {
    transform: none;
  }
  85% {
    transform: rotate(-8deg);
  }
  90% {
    transform: rotate(6deg);
  }
  95% {
    transform: rotate(-3deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .cin .hud-book.fresh .book-icon {
    animation: none;
  }
}

/* ---------- the journal as a leather book ---------- */

.journal-book {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  padding: 14px;
  border-radius: 10px;
  background: linear-gradient(#6b3a1f, #4a2614);
  box-shadow: inset 0 0 0 2px #2a160c, inset 0 0 0 4px #8a5530, 0 10px 24px rgba(0, 0, 0, 0.5);
}

.jb-page {
  position: relative;
  min-height: 320px;
  max-height: 60vh;
  overflow-y: auto;
  padding: 18px 20px 22px;
  background: #f1e3c2;
  color: #2a1a10;
  background-image: repeating-linear-gradient(transparent 0 27px, rgba(122, 84, 24, 0.14) 27px 28px);
}

.jb-left {
  border-radius: 6px 0 0 6px;
  box-shadow: inset -10px 0 14px -10px rgba(60, 30, 10, 0.55);
}

.jb-right {
  border-radius: 0 6px 6px 0;
  box-shadow: inset 10px 0 14px -10px rgba(60, 30, 10, 0.55);
}

.jb-title,
.jb-name {
  margin: 0 0 10px;
  font-family: var(--pixel);
  font-size: 0.8rem;
  color: #7a3e22;
}

.jb-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.jb-when {
  display: block;
  font-family: var(--pixel);
  font-size: 0.5rem;
  color: #8a6a44;
  margin-bottom: 2px;
}

.jb-text,
.jb-empty {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1rem;
  line-height: 1.55;
}

.jb-empty {
  color: #6a5034;
}

.jb-ribbon {
  position: absolute;
  top: -2px;
  right: 22px;
  width: 10px;
  height: 46px;
  background: #c0392b;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 82%, 0 100%);
}

.jb-sheet-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.jb-frame {
  padding: 4px;
  background: #c9902e;
  box-shadow: inset 0 0 0 2px #7a5418;
  border-radius: 4px;
}

.jb-face {
  display: block;
  image-rendering: pixelated;
  background: #2a1a10;
}

.jb-sub {
  margin: 0;
  font-size: 0.85rem;
  color: #6a5034;
}

.jb-facts {
  display: grid;
  gap: 4px;
  margin: 0;
}

.jb-fact {
  display: grid;
  grid-template-columns: 5.5em 1fr;
  gap: 8px;
  font-size: 0.9rem;
  line-height: 1.4;
}

.jb-fact dt {
  font-family: var(--pixel);
  font-size: 0.5rem;
  color: #8a6a44;
  padding-top: 4px;
}

.jb-fact dd {
  margin: 0;
  font-family: var(--serif);
}

.jb-h {
  margin: 12px 0 4px;
  font-family: var(--pixel);
  font-size: 0.55rem;
  color: #7a3e22;
}

.jb-passives {
  margin: 0;
  padding-left: 16px;
  font-size: 0.85rem;
  line-height: 1.5;
}

.jb-passives li.rare strong {
  color: #9a6a10;
}

.jb-passives li.very-rare strong {
  color: #6a3aa8;
}

.jb-passives li.overpowered strong {
  color: #b86a00;
}

.jb-passives li.debuff strong {
  color: #9a3a2a;
}

@media (max-width: 640px) {
  .journal-book {
    grid-template-columns: 1fr;
    padding: 10px;
  }
  .jb-left {
    border-radius: 6px 6px 0 0;
  }
  .jb-right {
    border-radius: 0 0 6px 6px;
  }
  .jb-page {
    max-height: none;
    min-height: 0;
  }
}

/* phones: four racers plus the journal book scroll sideways instead of pushing the quick menu off */
.cin.tall .cin-hud {
  flex: 1 1 auto;
  overflow-x: auto;
  scrollbar-width: none;
}
.cin.tall .cin-hud::-webkit-scrollbar {
  display: none;
}

/* ---------- votes: long options wrap and stay readable (owner: "if the vote's choice is long it's cut off") ---------- */

.vote-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 8px;
}

.vote-options:not(.sprint-options) .btn {
  justify-content: flex-start;
  height: auto;
  min-height: 44px;
  padding: 10px 14px;
  text-align: left;
  white-space: normal;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

/* cinema: the options in the story's own serif, large enough to read at a glance */
.cin-text .vote-options:not(.sprint-options) .btn {
  font: 16px/1.4 var(--serif);
  letter-spacing: 0;
}

.cin-text .vote-options:not(.sprint-options) .btn.primary {
  font-weight: 600;
}

.cin-text .vote-card.multi .vote-options:not(.sprint-options) {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
}

@media (max-width: 640px) {
  .vote-options {
    grid-template-columns: 1fr;
  }
}

/* phones: the voter's name sits above their options, so the options get the full width */
.cin.tall .cin-text .vote-card.multi .vote-row {
  grid-template-columns: 1fr;
  gap: 6px;
}
.cin.tall .cin-text .vote-card.multi .vote-who {
  width: auto;
}

/* ----- the route: progress bar and map (HANDOVER section 35) ----- */

.route-bar {
  display: grid;
  gap: 5px;
  width: 100%;
  margin: 8px 0 4px;
  padding: 9px 11px 8px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.route-bar:hover {
  border-color: var(--accent);
}

.route-bar:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.route-ends,
.route-km {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.route-ends > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.route-ends .route-to {
  text-align: right;
}

.route-km b {
  color: var(--accent);
  font-weight: 600;
}

.route-track {
  position: relative;
  height: 6px;
  border-radius: 3px;
  background: repeating-linear-gradient(90deg, #4a3d33 0 4px, #2d2620 4px 8px);
}

.route-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: 3px;
  background: linear-gradient(#e0473f, #a32a26);
}

.route-pin {
  position: absolute;
  top: 50%;
  left: 0;
  width: 10px;
  height: 10px;
  background: #ffd64b;
  border: 2px solid #3a2412;
  transform: translate(-50%, -50%) rotate(45deg);
}

/* in the cinema it sits under the date, in the dark band */
.route-bar.in-cinema {
  gap: 4px;
  margin: 2px 0 0;
  padding: 0;
  border: 0;
  background: none;
  max-width: 320px;
}

.route-bar.in-cinema .route-ends {
  font: 7px/1.4 var(--pixel);
  letter-spacing: 0.04em;
  color: rgba(246, 241, 228, 0.78);
}

.route-bar.in-cinema .route-km {
  font: italic 12px/1.2 var(--serif);
  color: rgba(246, 241, 228, 0.78);
}

.route-bar.in-cinema .route-km b {
  font: 7px/1.6 var(--pixel);
  font-style: normal;
  color: var(--gold, #ffd36e);
}

.route-bar.in-cinema .route-track {
  height: 4px;
}

.route-bar.in-cinema .route-pin {
  width: 8px;
  height: 8px;
}

.route-bar.in-cinema:hover .route-km b {
  text-decoration: underline;
}

.route-modal {
  display: grid;
  gap: 10px;
}

.route-frame {
  border: 3px solid #3a2412;
  border-radius: 6px;
  overflow: hidden;
  background: #35618f;
}

.route-map {
  display: block;
  width: 100%;
  height: auto;
  image-rendering: pixelated;
}

.route-summary {
  margin: 0;
  font-family: var(--serif);
  font-size: 1rem;
}

.route-stages {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.route-stages li {
  display: grid;
  grid-template-columns: 26px minmax(0, 1.1fr) minmax(0, 1.4fr) auto;
  gap: 4px 10px;
  align-items: baseline;
  padding: 5px 8px;
  border-radius: 6px;
  font-size: 0.85rem;
  color: var(--muted);
  text-align: left;
}

.route-stages .rs-n {
  font: 8px/1 var(--pixel);
  color: var(--faint);
}

.route-stages .rs-title {
  color: var(--text);
}

.route-stages .rs-km {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.route-stages li.done .rs-n,
.route-stages li.done .rs-title {
  color: #e0736c;
}

.route-stages li.now {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--text);
}

.route-stages li.now .rs-n,
.route-stages li.now .rs-km {
  color: var(--accent);
}

@media (max-width: 700px) {
  .route-frame {
    overflow-x: auto;
    overscroll-behavior-x: contain;
  }

  .route-map {
    width: 720px;
    max-width: none;
  }
}

@media (max-width: 560px) {
  .route-stages li {
    grid-template-columns: 22px minmax(0, 1fr) auto;
  }

  .route-stages .rs-way {
    grid-column: 2 / -1;
    grid-row: 2;
    font-size: 0.78rem;
  }
}

.modal.wide:has(.route-modal) {
  width: min(1000px, 100%);
}

/* ----- what a racer carries: the pack in the party card and the journal (HANDOVER section 51, part B) ----- */
.pk {
  display: grid;
  gap: 8px;
  margin: 0 0 8px;
}

.pk-part {
  padding: 6px 8px 8px;
  background: rgba(42, 26, 20, 0.55);
  border: 2px solid #120a06;
  box-shadow: inset 2px 2px 0 rgba(106, 70, 48, 0.8), inset -2px -2px 0 rgba(29, 17, 10, 0.9);
}

.pk-part.over {
  border-color: #c8323c;
}

.pk-h {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 6px;
  font: 8px/1.4 var(--pixel);
  color: #ffd64b;
}

.pk-h small {
  font: 7px/1.4 var(--pixel);
  color: #d8c49a;
}

.pk-empty {
  margin: 0;
  font: 8px/1.4 var(--pixel);
  color: #d8c49a;
  opacity: 0.7;
}

.pk-open {
  justify-self: start;
  padding: 8px 12px;
  min-height: 36px;
  font: 8px/1.4 var(--pixel);
  color: #2a1608;
  background: #d8b46a;
  border: 0;
  border-radius: 0;
  cursor: pointer;
  box-shadow: inset 0 0 0 2px #120a06, inset 2px 2px 0 #f3d894, inset -2px -2px 0 #9b7a3a;
}

.pk-open:hover {
  background: #ecc980;
}

.pk-open:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.pack-screen {
  padding: 10px;
  background: #3a2418;
  box-shadow: inset 0 0 0 3px #120a06, inset 3px 3px 0 #6a4630, inset -3px -3px 0 #1d110a;
}

/* Relics and debuffs on the racer cards (HANDOVER 60, 61) */
.badge.vampire,
.pc-badge.vampire {
  background: #5a0e1a;
  color: #ffd6dc;
  border-color: #a8202c;
}

/* A vampire who earned the sun (HANDOVER 80): the same blood red, with a sun-gold edge */
.badge.sunwalker,
.pc-badge.sunwalker {
  background: #5a0e1a;
  color: #ffe9a8;
  border-color: #e0b040;
}

/* The Ripple (Hamon): sunlit gold on a dark chip, a small sun before the word */
.badge.hamon,
.pc-badge.hamon {
  background: #2a2208;
  color: #ffd64b;
  border-color: #ffd64b;
}
.badge.hamon::before,
.pc-badge.hamon::before {
  content: "\2600\FE0E ";
}

.badge.heaven,
.pc-badge.heaven {
  background: #2a2240;
  color: #e8dcff;
  border-color: #b48ce8;
}

.badge.craving,
.pc-badge.craving {
  background: transparent;
  color: #d88a7a;
  border: 1px dashed #b85a4a;
}

/* Starving or collapsing from hunger (lib/hunger.js): it passes with a meal, so dashed, in the food bar's amber */
.badge.starving,
.pc-badge.starving {
  background: transparent;
  color: #e8b24a;
  border: 1px dashed #c99636;
}

/* The strange arrow's cut (HANDOVER 76): it passes like a craving, so it is dashed too, in amber */
.badge.fever,
.pc-badge.fever {
  background: transparent;
  color: #f0b46a;
  border: 1px dashed #d9822b;
}

/* Who says a line (main idea 20): a small name tag before each quote, in
   the speaker's stage colour (public/speakers.js marks the quotes). */
.who {
  display: inline-block;
  margin-right: 0.45em;
  padding: 0.18em 0.42em 0.1em;
  border-radius: 2px;
  font-family: "Press Start 2P", ui-monospace, Menlo, monospace;
  font-size: 0.52em;
  font-style: normal;
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1.45;
  vertical-align: 0.22em;
  white-space: nowrap;
  color: #0b0d14;
  background: #c5cada;
}
.who.c-red { background: #ff978f; }
.who.c-orange { background: #ffb774; }
.who.c-yellow { background: #ffdb73; }
.who.c-green { background: #95e08e; }
.who.c-blue { background: #92c6ff; }
.who.c-purple { background: #c9a6ff; }
.who.c-pink { background: #ffa3d2; }
.who.c-brown { background: #dcae84; }
.who.c-white { background: #f2ede0; }
.who.c-black { background: #9aa0b8; }
.who.c-gray { background: #c5cada; }

/* what the picked bloodline does (testing) */
.lobby-seat-info .blood-effect {
  font-size: 0.8rem;
  line-height: 1.35;
  color: var(--muted, #9aa0b4);
}

/* The Stands tab: every form a racer's Stand has had, first to now */
.cin .sf-seat {
  margin: 0 0 18px;
}

.cin .sf-who {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0 0 8px;
  font: 600 18px/1.2 var(--serif);
  color: color-mix(in srgb, var(--who) 70%, #fff);
}

.cin .sf-sub {
  font: 8px/1 var(--pixel);
  color: var(--cin-muted);
  text-transform: uppercase;
}

.cin .sf-row {
  display: flex;
  gap: 6px;
  margin: 0;
  padding: 0 0 6px;
  list-style: none;
  overflow-x: auto;
  scroll-snap-type: x proximity;
}

.cin .sf-step {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  scroll-snap-align: start;
}

.cin .sf-arrow {
  font: 12px/1 var(--pixel);
  color: var(--cin-muted);
}

.cin .sf-card {
  display: grid;
  justify-items: center;
  gap: 6px;
  width: 116px;
  padding: 8px 6px 10px;
  border: 2px solid color-mix(in srgb, var(--who) 40%, transparent);
  background: rgba(var(--ink-a), 0.45);
  color: inherit;
  text-align: center;
  cursor: pointer;
}

.cin .sf-card.now {
  border-color: var(--who);
}

.cin .sf-card.holy {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px rgba(255, 214, 75, 0.35), 0 0 14px rgba(255, 214, 75, 0.35);
}

.cin .sf-card:hover,
.cin .sf-card:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
}

.cin .sf-art {
  width: 96px;
  height: 128px;
  image-rendering: pixelated;
}

.cin .sf-label {
  font: 7px/1.3 var(--pixel);
  color: var(--gold);
  text-transform: uppercase;
}

.cin .sf-card:not(.holy) .sf-label {
  color: var(--cin-muted);
}

.cin .sf-name {
  font: 600 14px/1.2 var(--serif);
}

/* Fast forward (lib/ride.js): a small button under the route bar, and its card */
.ride-btn {
  display: inline-flex;
  justify-self: start;
  width: max-content;
  align-items: center;
  gap: 6px;
  margin: 4px 0 0;
  padding: 4px 8px 3px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: 7px/1.4 var(--pixel);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
}

.ride-btn .px-icon {
  width: 9px;
  height: 9px;
  fill: currentColor;
}

.ride-btn.in-cinema {
  border-color: rgba(246, 241, 228, 0.35);
  background: rgba(11, 13, 20, 0.55);
  color: var(--gold, #ffd36e);
}

.ride-btn:hover,
.ride-btn:focus-visible {
  border-color: var(--gold, #ffd36e);
  outline: none;
}

.ride-opts {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.ride-opt {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.ride-opt strong {
  font-weight: 600;
}

.ride-opt span {
  font-size: 0.86em;
  color: var(--muted, #9aa0bc);
}

.ride-opt:hover,
.ride-opt:focus-visible {
  border-color: var(--gold, #ffd36e);
  outline: none;
}

.ride-quiet {
  display: block;
  margin-top: 12px;
  font-size: 0.9em;
  cursor: pointer;
}

/* the days a ride skipped, told by the narrator: a small heading over the beat */
.recap-head {
  margin: 0 0 6px;
  color: var(--muted, #9aa0bc);
  font: 7px/1.4 var(--pixel);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* what the road gave on a told ride: a compact card under the recap (lib/road.js) */
.road-sum {
  margin: 10px 0 2px;
  padding: 8px 10px;
  border: 1px solid var(--line-2);
  border-left: 3px solid var(--gold, #ffd36e);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 0.86rem;
}

.road-sum-head {
  margin: 0 0 4px;
  color: var(--gold, #ffd36e);
  font: 7px/1.4 var(--pixel);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.road-sum ul {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.road-sum li b {
  color: var(--muted, #9aa0bc);
  font-weight: 600;
}

/* a ride stopped at an encounter: the choice */
.road-card {
  border-color: color-mix(in srgb, var(--gold, #ffd36e) 55%, var(--line));
  background: color-mix(in srgb, var(--gold, #ffd36e) 6%, var(--surface));
}

.road-card .road-miss {
  margin: 0;
}

/* "Put it to a vote": small, under the choice */
.road-card .road-vote {
  justify-self: start;
}

.road-mark {
  color: var(--muted, #9aa0bc);
}

.cin-text .road-card {
  border: 0;
  background: none;
}

/* the ride cutscene shows the whole map, even on a phone (no sideways scroll) */
.ride-cut-frame {
  overflow: hidden;
}

.route-map.ride-cut {
  width: 100%;
  max-width: 100%;
  cursor: pointer;
}

.ride-cut-line {
  text-align: center;
}

body:has(.ride-cut-modal) .toast.toast-info {
  display: none;
}

/* ----- the ride on a phone: a vertical trail instead of the map (public/ridetrail.js) ----- */
.rt-rail {
  position: relative;
  display: grid;
  gap: 6px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.rt-rail.rt-done *,
.rt-rail.rt-done .rt-step {
  transition: none !important;
}

.rt-day {
  font-family: "Press Start 2P", ui-monospace, Menlo, monospace;
  font-size: 0.6rem;
  letter-spacing: 0.04em;
  color: #3a2412;
  background: #f6ecd0;
  border: 2px solid #3a2412;
  padding: 6px 8px;
  width: max-content;
  margin-left: auto;
}

.rt-scroll {
  max-height: min(52vh, 420px);
  min-height: 150px;
  overflow-y: auto;
  scrollbar-width: none;
  background: #ecdcaf;
  border: 3px solid #3a2412;
  border-radius: 6px;
  color: #2a1c12;
}

.rt-scroll::-webkit-scrollbar {
  display: none;
}

.rt-inner {
  position: relative;
  padding: 14px 10px 40px 54px;
}

.rt-line {
  position: absolute;
  left: 24px;
  top: 32px;
  bottom: 48px;
  width: 4px;
  background: repeating-linear-gradient(to bottom, #6f5642 0 4px, transparent 4px 8px);
}

.rt-fill {
  width: 4px;
  height: 0;
  background: #c8322f;
  box-shadow: 1px 0 0 #7a1d1f;
  transition: height 0.5s ease-out;
}

.rt-pin {
  position: absolute;
  left: 8px;
  top: 0;
  width: 36px;
  height: 36px;
  image-rendering: pixelated;
  transition: transform 0.55s ease-in-out;
  z-index: 2;
}

.rt-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
}

.rt-step {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.rt-step.in {
  opacity: 1;
  transform: none;
}

.rt-sprite {
  width: 36px;
  height: 36px;
  image-rendering: pixelated;
}

.rt-body {
  display: grid;
  gap: 2px;
  font-family: var(--serif);
  font-size: 0.92rem;
  line-height: 1.25;
}

.rt-body b {
  font-family: "Press Start 2P", ui-monospace, Menlo, monospace;
  font-size: 0.55rem;
  font-weight: 400;
  line-height: 1.5;
}

.rt-step.stop .rt-body b {
  color: #fff;
  background: #c8322f;
  padding: 3px 6px;
  width: max-content;
}

.rt-step.stop .rt-sprite {
  animation: rt-pulse 0.9s steps(2, end) infinite;
}

.rt-step.camp .rt-sprite {
  animation: rt-flicker 0.6s steps(2, end) infinite;
}

.rt-hint {
  margin: 0;
  min-height: 1.4em;
  text-align: center;
  font-size: 0.72rem;
  color: var(--muted, #9a9aa5);
}

@keyframes rt-pulse {
  50% {
    transform: scale(1.18);
  }
}

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

@media (prefers-reduced-motion: reduce) {
  .rt-step,
  .rt-pin,
  .rt-fill {
    transition: none;
  }

  .rt-step.stop .rt-sprite,
  .rt-step.camp .rt-sprite {
    animation: none;
  }
}

/* the rounds in a racer's gun, under their face in the party column (HANDOVER section 81, part B) */
.cin .hud-ammo { display: block; padding: 3px; line-height: 0; background: rgba(var(--ink-a), 0.72); box-shadow: inset 0 -2px 0 var(--who); }
.cin .hud-ammo canvas { display: block; image-rendering: pixelated; image-rendering: crisp-edges; }

/* ---------- the phone chat (owner, 2026-10-19: on a phone the game is a chat, like OOC) ----------
   A pinned top (the bar and a strip of the stage), the story as a chat, the move box pinned at the bottom;
   the party, map and settings open in a sheet. Only phones and the iPhone app get it (app.js chatOn). */

body.chat-on .topbar {
  display: none;
}

body.chat-on .view {
  max-width: none;
  padding: 0;
}

.play.chat {
  display: block;
}

.chat-top {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.chat-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: max(8px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) 8px max(10px, env(safe-area-inset-left));
}

.chat-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
}

.chat-head {
  flex: 1;
  display: grid;
  min-width: 0;
}

.chat-where {
  overflow: hidden;
  font-family: var(--pixel);
  font-size: 0.55rem;
  line-height: 1.6;
  color: var(--accent);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.chat-clock {
  overflow: hidden;
  font-family: var(--serif);
  font-size: 0.82rem;
  color: var(--muted);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.chat-vitals {
  flex: none;
  width: 92px;
}

.chat-vitals .vitals {
  display: grid;
  gap: 3px;
  font-size: 0.72rem;
}

.chat-top.typing .chat-scene,
.chat-top.typing .chat-pic {
  display: none;
}

.chat-scene .stage-box {
  border: 0;
  border-radius: 0;
}

.chat-top .px-icon,
.chat-sheet .px-icon {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.chat-pic {
  display: block;
  width: 100%;
  padding: 2px 0 3px;
  border: 0;
  background: none;
  color: var(--faint);
  font: inherit;
  font-size: 0.72rem;
  cursor: pointer;
}

.play.chat .play-main {
  padding: 14px max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
}

.play.chat .feed {
  gap: 16px;
}

.play.chat .beat .prose {
  font-size: 1.02rem;
  line-height: 1.65;
}

.play.chat .move {
  max-width: 85%;
  background: color-mix(in srgb, var(--accent) 14%, var(--surface-2));
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line-2));
}

.play.chat .composer {
  z-index: 10;
  margin: 8px calc(-1 * max(16px, env(safe-area-inset-left))) 0;
  padding: 10px max(16px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: var(--bg);
  border-top: 1px solid var(--line);
}

.play.chat .composer {
  gap: 8px;
}

.play.chat .turn-banner {
  padding: 0;
  border: 0;
  background: none;
  font-size: 0.8rem;
}

/* the suggestions as one row that scrolls sideways, edge to edge */
.play.chat .choices {
  flex-wrap: nowrap;
  gap: 6px;
  margin: 0 calc(-1 * max(16px, env(safe-area-inset-left)));
  padding: 0 max(16px, env(safe-area-inset-left)) 2px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}

.play.chat .choices::-webkit-scrollbar {
  display: none;
}

.play.chat .choice {
  flex: none;
  width: max-content;
  max-width: 78vw;
  min-height: 40px;
  align-items: center;
  padding: 7px 12px;
  border-radius: 14px;
  font-size: 0.88rem;
  line-height: 1.3;
  scroll-snap-align: start;
}

.chat-write {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

/* 16px or more, or iOS zooms the page into the box */
.chat-write textarea {
  flex: 1;
  min-width: 0;
  height: 44px;
  min-height: 44px;
  max-height: 30vh;
  padding: 10px 12px;
  font-size: 16px;
  line-height: 1.4;
  resize: none;
}

.chat-send {
  flex: none;
  min-height: 44px;
}

.chat-more {
  gap: 4px 16px;
  font-size: 0.85rem;
}

.chat-more .link {
  min-height: 32px;
}

.chat-more select {
  max-width: 150px;
  padding: 4px 8px;
  font-size: 0.8rem;
}

.chat-sheet {
  position: fixed;
  inset: auto 0 0;
  width: 100%;
  max-width: none;
  max-height: 86vh;
  margin: 0;
  padding: 0 max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  overflow-y: auto;
  border: 1px solid var(--line-2);
  border-bottom: 0;
  border-radius: 16px 16px 0 0;
  background: var(--surface);
  color: var(--text);
}

.chat-sheet::backdrop {
  background: rgb(0 0 0 / 55%);
}

.chat-sheet-top {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0 10px;
  background: var(--surface);
}

.chat-sheet-title {
  font-family: var(--pixel);
  font-size: 0.7rem;
  color: var(--accent);
}

.chat-sheet-body {
  display: grid;
  gap: 16px;
}

.play.chat .beat-meta .bm-big {
  display: none;
}

.play.chat .beat-meta:not(:has(> :not(.bm-big))) {
  display: none;
}
