/* Neon Inquest: deep inks, desaturated rose and ice blue, and very little else. */

:root {
  --ink-0: #06080d;
  --ink-1: #0b0f16;
  --ink-2: #121822;
  --ink-3: #1b2430;
  --ink-4: #283341;
  --slate: #54606b;
  --slate-light: #8b98a3;
  --rose: #b48d9c;
  --rose-deep: #8a6474;
  --rose-pale: #d8b9c3;
  --ice: #b4d7e6;
  --ice-deep: #81b3d1;
  --ice-pale: #e1f5fe;
  --bone: #e9e6d8;
  --lamp: #c89b4a;
  --alert: #e0a08c;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, Menlo, monospace;

  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--ink-0);
  color: var(--bone);
  font: 400 1.0625rem/1.65 var(--serif);
}

/* Film grain over everything, generated at start-up. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  background-image: var(--grain);
  background-size: 320px 320px;
  image-rendering: pixelated;
}

canvas {
  display: block;
  image-rendering: pixelated;
}

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

button {
  cursor: pointer;
}

h1,
h2,
h3 {
  font-weight: 400;
  margin: 0;
}

:focus-visible {
  outline: 2px solid var(--ice);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.label {
  font: 500 0.6875rem/1.4 var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--slate-light);
}

.divider {
  height: 2px;
  border: 0;
  margin: 0;
  background-image: var(--divider);
  background-size: 100% 100%;
  image-rendering: pixelated;
}

/* ------------------------------------------------ Motion vocabulary */

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

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

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

@keyframes shimmer {
  from {
    transform: translateX(-120%) skewX(-18deg);
  }
  to {
    transform: translateX(320%) skewX(-18deg);
  }
}

@keyframes pop {
  0% {
    transform: scale(0.7);
  }
  60% {
    transform: scale(1.14);
  }
}

@keyframes flash-ice {
  0%,
  45% {
    background: rgba(180, 215, 230, 0.32);
  }
}

@keyframes bump {
  40% {
    color: var(--ice-pale);
    transform: translateY(-2px);
  }
}

@keyframes selected-glow {
  50% {
    box-shadow: 0 0 0 1px var(--ice), 0 0 22px rgba(129, 179, 209, 0.32);
  }
}

@keyframes logo-hum {
  0%,
  91%,
  94%,
  96%,
  100% {
    opacity: 1;
  }
  92%,
  95% {
    opacity: 0.68;
  }
}

/* ------------------------------------------------ Controls */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  min-height: 44px;
  padding: 0.55em 1.4em;
  overflow: hidden;
  border: 1px solid var(--slate);
  background: transparent;
  font: 500 0.75rem/1.2 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ice);
  transition: background-color 120ms linear, border-color 120ms linear, color 120ms linear, transform 120ms ease-out;
}

.btn:hover {
  border-color: var(--ice);
  background: rgba(180, 215, 230, 0.08);
  color: var(--ice-pale);
}

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

/* Lifted above the film grain, which reads as dirt on a bright surface. */
.btn--solid {
  z-index: 51;
  border-color: var(--ice);
  background: var(--ice);
  color: var(--ink-1);
}

.btn--solid:hover {
  border-color: var(--ice-pale);
  background: var(--ice-pale);
  color: var(--ink-1);
}

.btn--solid::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 34%;
  background: rgba(255, 255, 255, 0.45);
  transform: translateX(-120%) skewX(-18deg);
  pointer-events: none;
}

.btn--solid:not(:disabled):hover::after {
  animation: shimmer 620ms ease-out;
}

.btn--google {
  z-index: 51;
  width: 100%;
  border-color: #8e918f;
  background: #131314;
  letter-spacing: 0.04em;
  text-transform: none;
  font-size: 0.875rem;
  color: #e3e3e3;
}

.btn--google:hover {
  border-color: #c4c7c5;
  background: #1f1f20;
  color: #fff;
}

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

.link-btn {
  border: 0;
  padding: 0.25em 0;
  background: none;
  font: 500 0.75rem/1.4 var(--mono);
  letter-spacing: 0.06em;
  color: var(--rose);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.link-btn:hover {
  color: var(--rose-pale);
}

.status {
  min-height: 1.5em;
  margin: 0;
  font: 400 0.8125rem/1.5 var(--mono);
  color: var(--alert);
}

.panel {
  border: 8px solid transparent;
  border-image: var(--frame) 8 / 8px stretch;
  image-rendering: pixelated;
  background: var(--ink-1);
  background-clip: padding-box;
}

dialog.panel {
  max-width: min(420px, calc(100vw - 32px));
  padding: 20px;
  color: var(--bone);
  animation: rise-in 220ms ease-out;
}

dialog.panel p {
  margin: 0 0 16px;
}

dialog.panel h2 {
  font-size: 1.375rem;
  color: var(--ice-pale);
}

dialog.panel::backdrop {
  background: rgba(6, 8, 13, 0.78);
}

.coin {
  width: 18px;
  height: 18px;
  flex: none;
}

.chip {
  display: inline-block;
  padding: 2px 8px;
  border: 1px solid currentcolor;
  font: 500 0.625rem/1.5 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--slate-light);
}

.chip--open,
.chip--active {
  color: var(--ice);
}

.chip--closed {
  color: var(--rose-pale);
}

/* ------------------------------------------------ Home */

.home {
  position: relative;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.home__city {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
}

.home__shade {
  position: fixed;
  inset: 0;
  background: linear-gradient(90deg, rgba(6, 8, 13, 0.92) 0%, rgba(6, 8, 13, 0.78) 44%, rgba(6, 8, 13, 0.3) 72%, rgba(6, 8, 13, 0.5) 100%);
}

.home__sparks {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.72;
  pointer-events: none;
}

.home__layout {
  position: relative;
  flex: 1;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 40px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 400px;
  gap: 56px;
  align-items: center;
}

.home__footer {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 2px 28px;
  padding: 14px 16px;
  background: linear-gradient(0deg, rgba(6, 8, 13, 0.92), rgba(6, 8, 13, 0));
  font: 400 0.75rem/1.5 var(--mono);
  color: var(--slate-light);
}

/* The copy in index.html, visible only until the game has started. */
#app > .home__footer {
  position: fixed;
  inset: auto 0 0;
}

.home__footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 22px;
}

.home__footer a {
  padding: 6px 0;
  color: var(--ice);
  text-decoration: none;
}

.home__footer a:hover {
  color: var(--ice-pale);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.home__pitch {
  display: grid;
  gap: 16px;
  justify-items: start;
}

.logo {
  animation: logo-hum 9s steps(1) infinite, fade-in 900ms ease-out;
  margin-left: -14px;
}

.tagline {
  margin: -12px 0 6px;
  font-size: 1.1875rem;
  font-style: italic;
  color: var(--ice);
  text-shadow: 0 1px 8px var(--ink-0);
  animation: fade-in 900ms ease-out 200ms backwards;
}

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

.pitch__point {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  animation: rise-in 520ms ease-out backwards;
}

.pitch__point:nth-child(1) {
  animation-delay: 320ms;
}

.pitch__point:nth-child(2) {
  animation-delay: 460ms;
}

.pitch__point:nth-child(3) {
  animation-delay: 600ms;
}

.pitch__art {
  position: relative;
  width: 112px;
  height: 112px;
  overflow: hidden;
  border: 1px solid var(--ink-4);
  background: var(--ink-1);
  transition: border-color 160ms linear, transform 200ms ease-out;
}

.pitch__point:hover .pitch__art {
  border-color: var(--rose);
  transform: translateY(-3px);
}

.pitch__canvas {
  width: 112px;
  height: 112px;
}

.pitch__portrait {
  position: absolute;
  left: -64px;
  top: -70px;
  width: 240px;
  height: 336px;
}

.pitch__title {
  font-size: 1.25rem;
  line-height: 1.25;
  color: var(--ice-pale);
}

.pitch__text {
  margin: 4px 0 0;
  font-size: 0.9688rem;
  line-height: 1.5;
  color: var(--rose-pale);
}

.auth-card {
  width: 100%;
  padding: 20px;
  display: grid;
  gap: 14px;
  animation: slide-in-right 560ms ease-out 180ms backwards;
}

.auth-card__title {
  font-size: 1.5rem;
  color: var(--ice-pale);
}

.auth-card__or {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 10px;
  align-items: center;
}

.auth-card__form {
  display: grid;
  gap: 12px;
}

.auth-card__form .btn {
  width: 100%;
}

.auth-card__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.auth-tabs {
  display: flex;
  border-bottom: 1px solid var(--ink-4);
}

.auth-tab {
  flex: 1;
  min-height: 40px;
  padding: 0 8px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  font: 500 0.75rem/1.2 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--slate-light);
  transition: color 120ms linear, border-color 120ms linear;
}

.auth-tab:hover {
  color: var(--ice);
}

.auth-tab[aria-pressed="true"] {
  border-bottom-color: var(--ice);
  color: var(--ice-pale);
}

.field {
  display: grid;
  gap: 4px;
}

.field input {
  width: 100%;
  min-height: 44px;
  padding: 0.4em 0.7em;
  border: 1px solid var(--ink-4);
  border-radius: 0;
  background: var(--ink-0);
  font: 400 1rem/1.4 var(--mono);
  color: var(--ice-pale);
  transition: border-color 120ms linear;
}

.field input:focus-visible {
  outline-offset: 0;
  border-color: var(--ice);
}

/* ------------------------------------------------ Opening film */

@keyframes gate-weave {
  0% {
    transform: translate(0, 0);
  }
  25% {
    transform: translate(0.6px, -0.4px);
  }
  50% {
    transform: translate(-0.4px, 0.5px);
  }
  75% {
    transform: translate(0.4px, 0.3px);
  }
}

@keyframes projector-flicker {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.965;
  }
}

.film {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 14px;
  padding: 0 16px 40px;
  background: #000;
  animation: fade-in 500ms ease-out;
}

.film__frame {
  position: relative;
  overflow: hidden;
  animation: gate-weave 420ms steps(1) infinite, projector-flicker 180ms steps(2) infinite;
}

.film__vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 58%, rgba(0, 0, 0, 0.6) 100%);
}

.film__caption {
  min-height: 3.2em;
  max-width: 54ch;
  margin: 0;
  text-align: center;
  font-size: 1.125rem;
  line-height: 1.5;
  font-style: italic;
  color: var(--ice-pale);
  opacity: 0;
  transition: opacity 450ms ease-out;
}

.film__caption--on {
  opacity: 1;
}

.film__caption--card {
  font: 500 0.8125rem/1.8 var(--mono);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--rose-pale);
}

.film__caption--emphatic {
  font-size: 1.75rem;
  font-style: normal;
  letter-spacing: 0.24em;
  color: var(--bone);
}

.film__controls {
  position: fixed;
  right: 20px;
  bottom: 16px;
  display: flex;
  gap: 8px;
}

.film__control {
  min-height: 44px;
  padding: 0.4em 1em;
  border: 1px solid var(--ink-4);
  background: rgba(6, 8, 13, 0.7);
  font: 500 0.6875rem/1.2 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--slate-light);
  transition: color 120ms linear, border-color 120ms linear;
}

.film__control:hover {
  border-color: var(--ice);
  color: var(--ice-pale);
}

.film__control--skip {
  color: var(--ice);
}

/* A film shown over the game, as a modal so nothing behind it can be clicked or typed at. */
.film-screen {
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: #000;
}

/* ------------------------------------------------ Character creation */

.creation {
  position: relative;
  min-height: 100dvh;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 24px;
  padding: 32px 16px;
  background: radial-gradient(ellipse at 50% 20%, var(--ink-2), var(--ink-0) 70%);
}

.creation__head {
  text-align: center;
  animation: fade-in 500ms ease-out;
}

.creation__head h1 {
  margin: 4px 0 0;
  font: 400 clamp(1.5rem, 3vw, 2.125rem)/1.2 var(--serif);
  color: var(--ice-pale);
}

.creation__main {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
}

.creation__cards {
  display: grid;
  grid-template-columns: repeat(3, 240px);
  gap: 18px;
  scroll-margin-top: 8px;
}

.creation__prompt {
  margin: 0;
  text-align: center;
  font-style: italic;
  color: var(--rose-pale);
}

/* Once someone is chosen they stand large in the middle, with the other two small beside them. */
.creation--chosen {
  gap: 12px;
  padding-block: 14px;
}

.creation--chosen .creation__head h1 {
  font-size: clamp(1.25rem, 2.2vw, 1.625rem);
}

.creation--chosen .creation__cards {
  grid-template-columns: 120px 240px 120px;
  align-items: center;
  gap: 14px;
}

.creation--chosen .nature-card {
  gap: 6px;
  justify-items: center;
  padding-bottom: 8px;
}

.creation--chosen .nature-card:not([aria-pressed="true"]) {
  opacity: 0.7;
  animation: none;
}

.creation--chosen .nature-card:not([aria-pressed="true"]):hover {
  opacity: 1;
}

.creation--chosen .nature-card:not([aria-pressed="true"]) canvas {
  width: 120px;
  height: 168px;
}

.creation--chosen .nature-card__name {
  padding: 0;
  font-size: 0.75rem;
}

.creation--chosen .nature-card__text {
  display: none;
}

.look-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1.4fr) 200px;
  gap: 10px 24px;
  align-items: start;
  width: min(1040px, 100%);
  padding: 8px 12px;
  animation: rise-in 320ms ease-out backwards;
}

.look-panel__who {
  display: grid;
  gap: 3px;
}

.look-panel__who p {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.32;
  color: var(--bone);
}

.look-panel__who p:first-of-type {
  color: var(--rose-pale);
}

.look-panel h2 {
  font-size: 1.25rem;
  line-height: 1.15;
  color: var(--ice-pale);
}

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

.look-panel .look-swatch {
  width: 36px;
  height: 36px;
}

.look-panel .look-chip {
  min-height: 36px;
}

.look-panel__go {
  display: grid;
  gap: 6px;
  align-self: center;
}

.look-panel__go .status:empty {
  display: none;
}

.look-panel .btn {
  width: 100%;
}

.look-panel__note {
  text-align: center;
}

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

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

.look-swatch {
  position: relative;
  z-index: 51;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--ink-4);
  background: var(--swatch);
  transition: transform 120ms ease-out, box-shadow 120ms linear, border-color 120ms linear;
}

.look-swatch:hover {
  transform: translateY(-2px);
  border-color: var(--rose);
}

.look-swatch[aria-pressed="true"] {
  border-color: var(--ice-pale);
  box-shadow: 0 0 0 2px var(--ink-1), 0 0 0 3px var(--ice);
}

.look-chip {
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid var(--ink-4);
  background: var(--ink-0);
  font: 500 0.6875rem/1.2 var(--mono);
  letter-spacing: 0.04em;
  color: var(--slate-light);
  transition: color 120ms linear, border-color 120ms linear, background-color 120ms linear;
}

.look-chip:hover {
  border-color: var(--rose);
  color: var(--ice);
}

.look-chip[aria-pressed="true"] {
  border-color: var(--ice);
  background: rgba(180, 215, 230, 0.1);
  color: var(--ice-pale);
}

.nature-card {
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 0 0 14px;
  border: 1px solid var(--ink-4);
  background: var(--ink-1);
  text-align: left;
  animation: rise-in 480ms ease-out backwards;
  transition: border-color 120ms linear, transform 180ms ease-out;
}

.nature-card:nth-child(2) {
  animation-delay: 110ms;
}

.nature-card:nth-child(3) {
  animation-delay: 220ms;
}

.nature-card:hover {
  border-color: var(--rose);
  transform: translateY(-5px);
}

.nature-card[aria-pressed="true"] {
  border-color: var(--ice);
  box-shadow: 0 0 0 1px var(--ice);
  animation: selected-glow 2.2s ease-in-out infinite;
}

.nature-card canvas {
  width: 240px;
  height: 336px;
}

.nature-card__name {
  padding: 0 14px;
  font: 500 0.875rem/1.3 var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ice-pale);
}

.nature-card__text {
  padding: 0 14px;
  font-size: 0.9375rem;
  line-height: 1.45;
  color: var(--rose-pale);
}

.creation__foot {
  display: grid;
  gap: 8px;
  justify-items: center;
}

/* ------------------------------------------------ Game shell */

.game {
  height: 100dvh;
  display: grid;
  grid-template-columns: 346px minmax(0, 1fr);
  grid-template-rows: 48px minmax(0, 1fr) 28px;
  background: var(--ink-1);
}

.game__footer {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0 24px;
  padding: 0 12px;
  border-top: 1px solid var(--ink-3);
  background: var(--ink-0);
  font: 400 0.6875rem/1 var(--mono);
  color: var(--slate-light);
}

.game__footer nav {
  display: flex;
  gap: 0 18px;
}

.game__footer a {
  color: var(--ice-deep);
  text-decoration: none;
}

.game__footer a:hover {
  color: var(--ice-pale);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.topbar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 16px;
  border-bottom: 1px solid var(--ink-3);
  background: var(--ink-0);
}

.topbar__logo {
  flex: none;
}

.topbar__place {
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--rose);
}

.topbar__nav {
  display: flex;
  gap: 2px;
}

.nav-btn {
  position: relative;
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  background: none;
  font: 500 0.6875rem/1 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--slate-light);
  transition: color 120ms linear;
}

.nav-btn::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 2px;
  height: 1px;
  background: var(--ice);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 180ms ease-out;
}

.nav-btn:hover:not(:disabled),
.nav-btn[aria-current="page"] {
  color: var(--ice-pale);
}

.nav-btn:hover:not(:disabled)::after,
.nav-btn[aria-current="page"]::after {
  transform: scaleX(1);
}

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

.topbar__balances {
  display: flex;
  gap: 14px;
}

.balance {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: 500 0.8125rem/1 var(--mono);
  color: var(--bone);
}

.balance--bump {
  animation: bump 420ms ease-out;
}

.balance__unit {
  font-size: 0.625rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--slate-light);
}

.topbar__dossier {
  display: none;
}

.menu {
  position: relative;
}

.menu > summary {
  list-style: none;
  cursor: pointer;
  padding: 8px 4px;
  color: var(--ice);
}

.menu > summary::-webkit-details-marker {
  display: none;
}

.menu__panel {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 20;
  width: 230px;
  padding: 8px;
  display: grid;
  gap: 6px;
  animation: rise-in 160ms ease-out;
}

.menu__panel .btn {
  width: 100%;
}

/* Small screens have no room for a footer, so its links wait in here. */
.menu__legal {
  display: none;
  gap: 2px;
  padding-top: 6px;
  border-top: 1px solid var(--ink-3);
  font: 400 0.75rem/1 var(--mono);
}

.menu__legal a {
  display: flex;
  align-items: center;
  min-height: 36px;
  padding: 0 6px;
  color: var(--ice-deep);
  text-decoration: none;
}

.main-area {
  position: relative;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

.main-area > * {
  height: 100%;
  animation: fade-in 260ms ease-out;
}

/* ------------------------------------------------ Dossier */

.dossier {
  min-height: 0;
  overflow-y: auto;
  padding: 0 16px 24px;
  display: grid;
  gap: 14px;
  align-content: start;
  border-right: 1px solid var(--ink-3);
  background: var(--ink-0);
}

/* Portrait and slots stay together, so an outfit change is always visible as it happens. */
.dossier__figure {
  display: grid;
  grid-template-columns: 242px minmax(0, 64px);
  justify-content: center;
  gap: 8px;
  padding-top: 14px;
  padding-bottom: 6px;
  background: var(--ink-0);
}

@media (min-height: 680px) {
  .dossier__figure {
    position: sticky;
    top: 0;
    z-index: 2;
  }
}

.portrait {
  margin: 0;
  border: 1px solid var(--ink-4);
}

.portrait canvas {
  width: 240px;
  height: 336px;
}

.portrait__caption {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 4px 12px;
  padding: 6px 10px;
  border-top: 1px solid var(--ink-4);
}

.portrait__caption strong {
  min-width: 0;
  overflow: hidden;
  font-weight: 500;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ice-pale);
}

.section-title {
  display: block;
  margin-bottom: 6px;
}

.slots {
  display: grid;
  grid-auto-rows: 1fr;
  gap: 3px;
}

.slot {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 0;
  min-height: 46px;
  padding: 1px;
  border: 1px solid var(--ink-3);
  background: var(--ink-1);
  color: var(--slate-light);
  transition: border-color 120ms linear;
}

.slot canvas {
  width: 32px;
  height: 32px;
}

.slot__empty {
  width: 32px;
  height: 32px;
  border: 1px dashed var(--ink-4);
}

.slot__name {
  font: 500 0.5625rem/1.2 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.slot--filled {
  border-color: var(--slate);
  color: var(--ice);
}

.slot--filled:hover {
  border-color: var(--rose);
}

.slot--new canvas {
  animation: pop 320ms ease-out;
}

.slot:disabled {
  cursor: default;
}

.dossier__tabs {
  margin-bottom: 6px;
}

.dossier__tabs .auth-tab {
  padding-inline: 2px;
}

.carry-note {
  margin: 6px 0 0;
  font-size: 0.8125rem;
  line-height: 1.4;
  font-style: italic;
  color: var(--slate-light);
}

.trait-list,
.item-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
}

.trait {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border-left: 2px solid var(--ice-deep);
  background: var(--ink-1);
  font: 500 0.75rem/1.4 var(--mono);
  color: var(--ice);
}

.trait--new {
  animation: flash-ice 1.3s ease-out;
}

.trait canvas {
  width: 14px;
  height: 14px;
  flex: none;
}

.trait small {
  display: block;
  font-size: 0.625rem;
  color: var(--slate-light);
}

.item-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 4px 8px;
  border: 1px solid transparent;
  background: var(--ink-1);
  text-align: left;
  font: 500 0.75rem/1.3 var(--mono);
  color: var(--bone);
  transition: border-color 120ms linear, transform 120ms ease-out;
}

.item-row canvas {
  width: 32px;
  height: 32px;
  flex: none;
}

.item-row .sigil {
  width: 21px;
  height: 21px;
  margin: 0 5.5px;
}

.item-row__action {
  margin-left: auto;
  font-size: 0.625rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--rose);
}

button.item-row:hover:not(:disabled) {
  border-color: var(--rose-deep);
  transform: translateX(2px);
}

.item-row:disabled,
div.item-row {
  cursor: default;
  color: var(--slate-light);
}

.empty-note {
  margin: 0;
  font-size: 0.875rem;
  font-style: italic;
  color: var(--slate-light);
}

/* A fixed height, because a box that grew would push the row under the mouse out from under it. */
.inspect {
  height: 92px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--slate) transparent;
  margin: 0;
  padding: 8px 10px;
  border-left: 2px solid var(--rose-deep);
  font-size: 0.875rem;
  line-height: 1.4;
  color: var(--rose-pale);
}

.inspect strong {
  display: block;
  font: 500 0.6875rem/1.4 var(--mono);
  letter-spacing: 0.08em;
  color: var(--ice-pale);
}

/* ------------------------------------------------ Story */

.stage {
  position: relative;
  min-height: 0;
  display: grid;
  grid-template-rows: clamp(150px, 34vh, 340px) minmax(0, 1fr);
}

/* Across the top of the story for as long as a replay runs, so it cannot be mistaken for the real file. */
.replay-banner {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 14px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--rose);
  background: rgba(6, 8, 13, 0.94);
}

.replay-banner__title {
  padding: 1px 8px;
  border: 1px solid var(--rose);
  font: 500 0.75rem/1.4 var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--rose-pale);
}

.replay-banner__text {
  flex: 1 1 320px;
  font-size: 0.875rem;
  line-height: 1.35;
  color: var(--bone);
}

.stage__backdrop {
  width: 100%;
  height: 100%;
  border-bottom: 1px solid var(--ink-3);
}

.narrative {
  min-height: 0;
  overflow-y: auto;
  padding: 24px 24px 40px;
}

.narrative__column {
  max-width: 66ch;
  margin: 0 auto;
}

.beat {
  margin: 0 0 0.9em;
}

.beat__ghost {
  visibility: hidden;
}

.beat__who {
  display: block;
  font: 500 0.6875rem/1.8 var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--rose);
}

.beat--speech {
  padding-left: 14px;
  border-left: 1px solid var(--rose-deep);
  color: var(--ice-pale);
}

.beat em {
  color: var(--ice);
}

.choices {
  display: grid;
  gap: 6px;
  margin-top: 1.4em;
  transition: opacity 140ms linear;
}

.choices--leaving {
  opacity: 0.4;
  pointer-events: none;
}

.choices--entering .choice {
  animation: choice-in 260ms ease-out backwards;
}

.choice {
  display: grid;
  grid-template-columns: 1.6em minmax(0, 1fr);
  gap: 4px 8px;
  align-items: baseline;
  width: 100%;
  min-height: 44px;
  padding: 9px 12px;
  border: 0;
  border-left: 2px solid var(--rose-deep);
  background: var(--ink-2);
  text-align: left;
  font-size: 1rem;
  line-height: 1.45;
  color: var(--bone);
  transition: background-color 100ms linear, border-color 100ms linear, transform 140ms ease-out;
}

@keyframes choice-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

.choice:hover {
  border-left-color: var(--ice);
  background: var(--ink-3);
  color: var(--ice-pale);
  transform: translateX(4px);
}

.choice__key {
  font: 500 0.75rem/1 var(--mono);
  color: var(--rose);
}

.choice__meta {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
}

.badge {
  padding: 1px 6px;
  border: 1px solid currentcolor;
  font: 500 0.625rem/1.5 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.badge--trait { color: var(--ice); }
.badge--nature { color: var(--rose-pale); }
.badge--worn { color: var(--lamp); }
.badge--item { color: var(--slate-light); }
.badge--cost { color: var(--alert); }
.badge--earn { color: var(--ice-deep); }
.badge--bond { color: var(--rose); }

.choice--shop {
  border-left-color: var(--lamp);
  background: rgba(200, 155, 74, 0.08);
}

.choice--shop .choice__key {
  color: var(--lamp);
}

.choice--locked {
  border-left-color: var(--ink-4);
  background: transparent;
  color: var(--slate-light);
  cursor: not-allowed;
}

.choice--locked:hover {
  border-left-color: var(--ink-4);
  background: transparent;
  color: var(--slate-light);
  transform: none;
}

.choice__hint {
  grid-column: 2;
  font-size: 0.875rem;
  font-style: italic;
  color: var(--rose);
}

.ending {
  display: grid;
  gap: 12px;
  justify-items: center;
  margin-top: 1.6em;
  text-align: center;
  animation: rise-in 500ms ease-out;
}

.ending .divider {
  width: 100%;
}

.ending__title {
  font-size: 1.625rem;
  line-height: 1.2;
  color: var(--ice-pale);
}

.ending__rewards {
  margin: 0;
  color: var(--rose-pale);
}

.world-report {
  display: grid;
  gap: 8px;
  width: 100%;
  text-align: left;
}

.world-report__note {
  margin: 0;
  font-size: 0.875rem;
  font-style: italic;
  color: var(--rose);
}

/* ------------------------------------------------ Case files */

.hub {
  position: relative;
  overflow: hidden;
}

.hub__city {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hub__shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(6, 8, 13, 0.62), rgba(6, 8, 13, 0.9));
}

.hub__sparks {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.hub__body {
  position: relative;
  height: 100%;
  overflow-y: auto;
  padding: 24px 28px 40px;
}

.hub__head h1,
.shop__head h1 {
  font-size: 2rem;
  line-height: 1.15;
  color: var(--ice-pale);
}

.campaign {
  margin-top: 16px;
}

.campaign__head {
  margin-bottom: 12px;
}

.campaign__head h2 {
  font-size: 1.375rem;
  color: var(--ice-pale);
}

.campaign__head p {
  margin: 2px 0 0;
  color: var(--rose-pale);
}

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

.case-shelf {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(236px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

/* The padding is room for the sheets stacked behind a folder. */
.folder__heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  padding: 0 8px 8px 0;
}

.folder {
  display: flex;
  flex-direction: column;
  padding: 0;
  border: 1px solid var(--ink-4);
  background: var(--ink-1);
  font-size: 1rem;
  text-align: left;
  box-shadow:
    4px 4px 0 -1px var(--ink-1),
    4px 4px 0 0 var(--ink-4),
    8px 8px 0 -1px var(--ink-1),
    8px 8px 0 0 var(--ink-3);
  animation: rise-in 420ms ease-out backwards;
  transition: border-color 140ms linear, transform 180ms ease-out;
}

.folder:hover {
  border-color: var(--rose);
  transform: translateY(-4px);
}

.folder__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px 12px;
}

.folder__top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 4px 8px;
}

.folder__title {
  font-size: 1.375rem;
  line-height: 1.2;
  color: var(--ice-pale);
}

.folder__about {
  font-size: 0.875rem;
  line-height: 1.4;
  color: var(--bone);
}

.folder__progress {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  margin-top: 2px;
}

.folder__progress .carry-meter__pips {
  flex-wrap: wrap;
}

.folder__verb {
  margin-top: auto;
  padding-top: 4px;
  color: var(--ice);
}

.hub__back {
  padding: 0.5em 0;
}

.hub__about {
  margin: 2px 0 0;
  color: var(--rose-pale);
}

.hub__body > .folder__progress,
.gallery > .folder__progress {
  margin-top: 10px;
}

.folder-group {
  margin-top: 18px;
}

.folder-group__head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--ink-3);
  color: var(--rose-pale);
}

.folder-group__count {
  flex: none;
  color: var(--slate-light);
}

@media (max-width: 1140px) {
  .case-shelf {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* An odd folder out would otherwise sit alone on the last row, so the first one takes a row to itself. */
  .case-shelf > .episode,
  .case-shelf > .folder__heading:first-child:nth-last-child(odd) {
    grid-column: 1 / -1;
  }

  .case-shelf > .episode,
  .case-shelf > .folder__heading:first-child:nth-last-child(odd) .folder {
    flex-direction: row;
  }

  .case-shelf > .episode .episode__thumb,
  .case-shelf > .folder__heading:first-child:nth-last-child(odd) .episode__thumb {
    flex: 0 0 38%;
    width: 38%;
    aspect-ratio: auto;
    object-fit: cover;
    border-right: 1px solid var(--ink-3);
    border-bottom: 0;
  }
}

.episode {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--ink-4);
  background: var(--ink-1);
  animation: rise-in 420ms ease-out backwards;
  transition: border-color 140ms linear, transform 180ms ease-out;
}

.episode:hover {
  border-color: var(--rose);
  transform: translateY(-4px);
}

.episode__thumb {
  width: 100%;
  height: auto;
  aspect-ratio: 192 / 72;
  border-bottom: 1px solid var(--ink-3);
}

.episode--locked .episode__thumb,
.episode--unwritten .episode__thumb,
.folder--locked .episode__thumb,
.folder--unwritten .episode__thumb {
  filter: grayscale(1) brightness(0.45);
}

.episode--closed .episode__thumb,
.folder--closed .episode__thumb {
  filter: saturate(0.7) brightness(0.8);
}

.episode__body {
  flex: 1;
  display: grid;
  gap: 6px;
  align-content: start;
  padding: 10px 12px 12px;
}

.episode__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.episode__title {
  font-size: 1.125rem;
  line-height: 1.25;
  color: var(--ice-pale);
}

.episode__teaser,
.episode__hint,
.episode__ending,
.episode__unlocks {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.4;
}

.episode__teaser {
  color: var(--bone);
}

.episode__hint {
  font-style: italic;
  color: var(--rose);
}

.episode__ending {
  color: var(--rose-pale);
}

.episode__unlocks {
  color: var(--slate-light);
}

.episode .btn {
  margin-top: 4px;
}

/* ------------------------------------------------ Gallery */

.gallery {
  overflow-y: auto;
  padding: 24px 28px 40px;
}

.gallery__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(208px, 1fr));
  align-items: start;
  gap: 10px;
}

.reel {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--ink-4);
  background: var(--ink-1);
  animation: rise-in 420ms ease-out backwards;
  transition: border-color 140ms linear;
}

.reel:hover {
  border-color: var(--rose);
}

.reel--sealed:hover {
  border-color: var(--ink-4);
}

.reel__poster {
  width: 100%;
  height: auto;
  aspect-ratio: 384 / 160;
  border-bottom: 1px solid var(--ink-3);
  background: var(--ink-0);
}

.reel__body {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 3px;
  align-content: start;
  padding: 6px 8px 8px;
}

.reel__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.reel__time {
  font: 500 0.75rem/1 var(--mono);
  color: var(--slate-light);
}

.reel__title {
  font-size: 1rem;
  line-height: 1.2;
  color: var(--ice-pale);
}

.reel__hint {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.3;
  font-style: italic;
  color: var(--rose);
}

.reel .btn {
  flex: none;
  min-height: 30px;
  padding: 0.2em 0.8em;
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
}

/* ------------------------------------------------ The player's room */

.room {
  overflow-y: auto;
}

.room__scene {
  position: relative;
  height: clamp(150px, 30vh, 280px);
  border-bottom: 1px solid var(--ink-3);
}

.room__picture {
  width: 100%;
  height: 100%;
}

.room__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 12px;
  padding: 8px 28px 6px;
}

.room__head h1 {
  font-size: 1.25rem;
  line-height: 1.2;
  color: var(--ice-pale);
}

.room__blurb {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.3;
  font-style: italic;
  color: var(--rose-pale);
}

.room__notice {
  margin: 0 28px 6px;
  padding: 5px 10px;
  border: 1px solid var(--rose-deep);
  background: var(--ink-1);
  font-size: 0.875rem;
  line-height: 1.35;
  color: var(--bone);
}

.carry-meter {
  margin-left: auto;
  letter-spacing: 0.08em;
}

/* A sibling of the list rather than a grid item, or it could not stay stuck while the list scrolls. */
.room-tabs {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 0 28px;
  border-bottom: 1px solid var(--ink-4);
  background: var(--ink-1);
}

.room-tabs::-webkit-scrollbar {
  display: none;
}

.room-tabs .auth-tab {
  flex: 1 0 auto;
  min-height: 34px;
  padding: 0 7px;
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.room-tabs .auth-tab:disabled {
  color: var(--ink-4);
  cursor: default;
}

.room__list {
  padding: 8px 28px 24px;
}

.carry-meter__pips {
  display: flex;
  gap: 4px;
}

/* ------------------------------------------------ Options */

.options {
  overflow-y: auto;
  padding: 20px 24px 32px;
}

/* One column on a phone; on a wide screen the settings sit side by side, like a desk drawer. */
.options__sections {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  max-width: 1320px;
  margin-top: 10px;
}

@media (min-width: 900px) {
  .options__sections {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas:
      "name language"
      "sound data"
      "room room";
  }
}

@media (min-width: 1280px) {
  .options__sections {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-areas:
      "name language sound"
      "room room data";
  }
}

.options__section--name {
  grid-area: name;
}

.options__section--language {
  grid-area: language;
}

.options__section--sound {
  grid-area: sound;
}

.options__section--room {
  grid-area: room;
}

.options__section--data {
  grid-area: data;
}

@media (max-width: 899px) {
  .options__section {
    grid-area: auto;
  }
}

.options__section {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: 8px;
  height: 100%;
  padding: 12px 14px 14px;
}

.options__section h2 {
  font-size: 1.0625rem;
  line-height: 1.25;
  color: var(--ice-pale);
}

.options__settings {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: center;
  gap: 8px 16px;
}

.options__control {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  min-width: 0;
}

.options__control input[type="range"] {
  width: min(280px, 100%);
  accent-color: var(--ice);
  cursor: pointer;
}

.options__value {
  min-width: 3.5em;
  color: var(--ice-pale);
}

.options__state {
  min-width: 2.5em;
  font: 500 0.875rem/1 var(--mono);
  color: var(--ice-pale);
}

.options__control .btn {
  min-height: 34px;
  padding: 0.3em 1em;
}

.options__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
}

.options__note {
  flex: 1 1 220px;
  max-width: 68ch;
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.45;
  color: var(--bone);
}

.options__room {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  align-items: start;
}

.options__preview {
  flex: 1 1 320px;
  min-width: 0;
  max-width: 460px;
  height: auto;
  aspect-ratio: 384 / 150;
  border: 1px solid var(--ink-3);
}

.options__controls {
  flex: 1 1 260px;
  min-width: 0;
  display: grid;
  gap: 6px;
  justify-items: start;
}

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

.options__tones {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin-top: 4px;
}

.options .look-row {
  gap: 4px;
}

.options .room-pick canvas {
  width: 120px;
  height: 52px;
}

.room-pick {
  display: grid;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--ink-4);
  background: var(--ink-0);
  font: 500 0.6875rem/1.2 var(--mono);
  color: var(--slate-light);
  text-align: left;
  transition: border-color 120ms linear, color 120ms linear;
}

.room-pick canvas {
  width: 144px;
  height: 63px;
}

.room-pick:hover {
  border-color: var(--rose);
}

.room-pick[aria-pressed="true"] {
  border-color: var(--ice);
  color: var(--ice-pale);
}

.room-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  align-items: start;
  gap: 8px;
}

.room-item {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid var(--ink-4);
  background: var(--ink-1);
}

.room-item--worn {
  border-color: var(--slate);
}

.room-item--carried {
  border-color: var(--ice-deep);
}

.room-item__icon {
  display: grid;
  place-items: center;
  height: 44px;
  background: var(--ink-0);
}

.room-item__icon canvas {
  width: 44px;
  height: 44px;
}

.room-item__icon .sigil {
  width: 30px;
  height: 30px;
}

.room-item__text {
  display: grid;
  gap: 2px;
  align-content: start;
}

.room-item__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.room-item h3 {
  font-size: 1rem;
  line-height: 1.2;
  color: var(--ice-pale);
}

.room-item p {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.3;
  color: var(--bone);
}

.room-item__actions {
  display: flex;
  gap: 4px;
  margin-top: 3px;
}

.room-item__actions .btn {
  min-height: 30px;
  padding: 0.2em 0.8em;
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
}

/* ------------------------------------------------ Shop */

.shop,
.profile {
  overflow-y: auto;
  padding: 24px 28px 40px;
}

.shop__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
}

.shop__balance {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: 500 0.875rem/1 var(--mono);
  color: var(--rose-pale);
}

.shop__promise {
  margin: 6px 0 12px;
  font-style: italic;
  color: var(--rose-pale);
}

.shop__tabs {
  margin-bottom: 12px;
  max-width: 560px;
}

.shop__hint {
  margin: 0 0 10px;
  font-size: 0.875rem;
  color: var(--slate-light);
}

.shop__notice {
  margin: 0 0 12px;
  padding: 8px 12px;
  border-left: 2px solid var(--lamp);
  font: 400 0.8125rem/1.5 var(--mono);
  color: var(--lamp);
}

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

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

.product {
  display: grid;
  gap: 6px;
  align-content: start;
  padding: 12px;
  border: 1px solid var(--ink-4);
  background: var(--ink-1);
  animation: rise-in 380ms ease-out backwards;
  transition: border-color 140ms linear, transform 180ms ease-out;
}

.product:hover,
.product:focus-visible {
  border-color: var(--ice-deep);
  transform: translateY(-4px);
}

.product h3,
.bundle h3,
.counter h3 {
  font-size: 1.0625rem;
  line-height: 1.25;
  color: var(--ice-pale);
}

.product p,
.bundle p {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.4;
  color: var(--rose-pale);
}

.product .btn,
.product .chip {
  justify-self: start;
  margin-top: 4px;
}

.product__icon {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border: 1px solid var(--ink-3);
  background: var(--ink-0);
}

.product__icon canvas {
  width: 64px;
  height: 64px;
}

.product__icon .sigil {
  width: 28px;
  height: 28px;
}

.shop__grid--rooms {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.product__room {
  width: 100%;
  height: auto;
  aspect-ratio: 320 / 140;
  margin-bottom: 4px;
}

.product--pack {
  justify-items: center;
  text-align: center;
  padding: 20px 12px;
}

.product--pack .btn {
  justify-self: stretch;
}

.product__neon {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: 500 1.5rem/1 var(--mono);
  color: var(--rose-pale);
}

.bundle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 12px 14px;
  border: 1px solid var(--rose-deep);
  background: rgba(138, 100, 116, 0.1);
  animation: rise-in 380ms ease-out backwards;
}

.bundle__items {
  margin-top: 4px !important;
  color: var(--slate-light) !important;
}

.supporter-offer {
  max-width: 560px;
  padding: 18px 20px;
  display: grid;
  gap: 8px;
  justify-items: start;
  animation: rise-in 420ms ease-out backwards;
}

.supporter-offer h2 {
  font-size: 1.5rem;
  color: var(--ice-pale);
}

.supporter-offer ul {
  margin: 0;
  padding-left: 1.1em;
  color: var(--rose-pale);
}

.supporter-offer li {
  margin: 4px 0;
}

.supporter-offer p {
  margin: 0;
  color: var(--rose-pale);
}

.checkout__price {
  font: 500 1.5rem/1.2 var(--mono);
  color: var(--ice-pale);
}

.checkout__terms {
  margin: 0 0 12px;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--slate-light);
}

.checkout__terms a {
  color: var(--ice);
}

dialog.counter {
  width: min(560px, calc(100vw - 32px));
  max-width: min(560px, calc(100vw - 32px));
}

/* Only the stock scrolls, so the way out can never end up below the edge of the screen. */
dialog.counter[open] {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
}

.counter__head,
.counter__foot {
  flex: none;
}

.counter__foot {
  padding-top: 12px;
}

.counter .status:empty,
.gallery .status:empty {
  display: none;
}

.counter__greeting {
  padding-left: 12px;
  border-left: 1px solid var(--rose-deep);
  color: var(--ice-pale);
}

.counter__list {
  flex: 1 1 auto;
  min-height: 0;
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  align-content: start;
  gap: 8px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.counter__row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.counter__text p {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.35;
  color: var(--rose-pale);
}

/* ------------------------------------------------ Profile */

.profile__content {
  display: grid;
  gap: 12px;
  margin-top: 8px;
}

/* The Profile reads as a file rather than a poster: small tabs, tiles and cards. */
.profile .shop__head h1 {
  font-size: 1.625rem;
}

.profile .shop__tabs {
  margin-bottom: 6px;
  max-width: 420px;
}

.profile .shop__tabs .auth-tab {
  min-height: 32px;
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
}

.profile .supporter-offer {
  padding: 10px 14px;
  gap: 6px;
}

.profile .supporter-offer h2 {
  font-size: 1.125rem;
}

.profile .supporter-offer p {
  font-size: 0.875rem;
}

.profile .supporter-offer .btn {
  min-height: 36px;
  padding: 0.35em 1em;
  font-size: 0.6875rem;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
}

.stat-tile {
  display: grid;
  gap: 1px;
  padding: 7px 10px;
  border: 1px solid var(--ink-4);
  background: var(--ink-1);
  animation: rise-in 380ms ease-out backwards;
}

.stat-tile strong {
  font: 500 1.125rem/1.15 var(--mono);
  color: var(--ice-pale);
}

.profile__section {
  font-size: 1rem;
  color: var(--ice-pale);
}

.decision-list {
  display: grid;
  gap: 8px;
}

.decision {
  display: grid;
  gap: 5px;
  padding: 8px 10px;
  border: 1px solid var(--ink-4);
  background: var(--ink-1);
}

.decision h3 {
  font-size: 0.9375rem;
  line-height: 1.3;
  color: var(--bone);
}

.decision__row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.8125rem;
  color: var(--slate-light);
}

.decision__row em {
  font-style: normal;
  font-size: 0.6875rem;
  color: var(--ice);
}

.decision__row strong {
  font: 500 0.8125rem/1.5 var(--mono);
}

.decision__option--mine .decision__row {
  color: var(--bone);
}

.decision__track {
  height: 4px;
  background: var(--ink-3);
}

.decision__bar {
  display: block;
  width: 0;
  height: 100%;
  background: var(--slate);
  transition: width 700ms ease-out;
}

.decision__option--mine .decision__bar {
  background: var(--ice);
}

/* ------------------------------------------------ The record of choices */

.file-categories {
  columns: 2 320px;
  column-gap: 12px;
}

.file-category {
  break-inside: avoid;
  margin-bottom: 12px;
  padding: 10px 14px 12px;
  border: 1px solid var(--ink-4);
  border-top: 2px solid var(--rose);
  background: var(--ink-1);
  animation: rise-in 380ms ease-out backwards;
}

.file-category h2 {
  margin-bottom: 6px;
  font: 500 0.75rem/1.3 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--rose-pale);
}

.file-category ul {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.file-category li {
  padding-left: 12px;
  border-left: 1px solid var(--ink-4);
  font-size: 0.9375rem;
  line-height: 1.35;
  color: var(--bone);
}

/* ------------------------------------------------ Relations */

.relation-list {
  display: grid;
  gap: 14px;
}

.relation-search {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
}

.relation-search input {
  flex: 1 1 280px;
  max-width: 520px;
  min-height: 40px;
  padding: 0.4em 0.7em;
  border: 1px solid var(--ink-4);
  border-radius: 0;
  background: var(--ink-0);
  font: 400 0.9375rem/1.4 var(--mono);
  color: var(--ice-pale);
  transition: border-color 120ms linear;
}

.relation-search input::placeholder {
  color: var(--slate);
}

.relation-search input:focus-visible {
  outline-offset: 0;
  border-color: var(--ice);
}

.relation mark {
  padding: 0 1px;
  background: rgba(180, 215, 230, 0.22);
  color: var(--ice-pale);
}

/* What a person is, set apart from the line about them so it reads as a label and not as prose. */
.person-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  margin: 2px 0 4px;
  padding: 0;
  list-style: none;
}

.person-tag {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 2px 7px;
  border: 1px solid var(--ink-4);
  background: var(--ink-0);
  font: 500 0.6875rem/1.5 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: help;
}

.person-tag__kind {
  color: var(--slate-light);
}

.person-tag__value {
  color: var(--bone);
}

.person-tag--make {
  border-color: var(--ice-deep);
}

.person-tag--make .person-tag__value {
  color: var(--ice);
}

.person-tag--authority {
  border-color: var(--rose-deep);
}

.person-tag--authority .person-tag__value {
  color: var(--rose-pale);
}

.relation {
  display: grid;
  grid-template-columns: 144px minmax(0, 1fr);
  gap: 18px;
  padding: 14px;
  border: 1px solid var(--ink-4);
  background: var(--ink-1);
  animation: rise-in 420ms ease-out backwards;
  transition: border-color 140ms linear;
}

.relation:hover {
  border-color: var(--rose-deep);
}

.relation__art {
  position: relative;
  width: 144px;
  height: 168px;
  overflow: hidden;
  border: 1px solid var(--ink-3);
}

.relation__portrait {
  position: absolute;
  left: -48px;
  top: -40px;
  width: 240px;
  height: 336px;
}

.relation__body {
  display: grid;
  gap: 4px;
  align-content: start;
  min-width: 0;
}

.relation__name {
  font-size: 1.5rem;
  line-height: 1.2;
  color: var(--ice-pale);
}

.relation__about {
  margin: 0 0 6px;
  font-style: italic;
  font-size: 0.9375rem;
  color: var(--slate-light);
}

.relation__bond {
  padding: 8px 12px;
  border-left: 2px solid var(--rose);
  background: rgba(138, 100, 116, 0.08);
}

.relation__bond h3 {
  font-size: 1.25rem;
  line-height: 1.25;
  color: var(--rose-pale);
}

.relation__bond p {
  margin: 2px 0 0;
  font-size: 0.9375rem;
  line-height: 1.4;
  color: var(--bone);
}

.relation__threads {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px 16px;
  margin: 10px 0 8px;
}

.bond-thread {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1px 10px;
  align-items: center;
}

.bond-thread__pips {
  display: flex;
  justify-content: flex-end;
  gap: 3px;
}

.bond-pip {
  width: 12px;
  height: 5px;
  background: var(--ink-3);
}

.bond-pip--on {
  background: var(--ice-deep);
}

.bond-thread__stage {
  grid-column: 1 / -1;
  font: 500 0.8125rem/1.3 var(--mono);
  color: var(--ice-pale);
}

.bond-thread__text {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.35;
  color: var(--slate-light);
}

.relation__open {
  justify-self: start;
  min-height: 34px;
  margin-top: 6px;
  padding: 0.3em 1em;
  font-size: 0.6875rem;
}

.relation__matches {
  display: grid;
  gap: 2px;
  margin-top: 4px;
}

.relation__matches ul {
  margin: 0;
  padding-left: 1.1em;
  font-size: 0.875rem;
  line-height: 1.35;
  color: var(--rose-pale);
}

/* A person's file: the words on the left, scrolling if there are many, and the portrait on the right. */
dialog.person-file {
  width: min(1000px, calc(100vw - 32px));
  max-width: none;
  height: min(600px, calc(100dvh - 40px));
  max-height: none;
  padding: 0;
  overflow: visible;
  border: 1px solid var(--ink-4);
  background: var(--ink-1);
  color: var(--bone);
}

dialog.person-file[open] {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
}

dialog.person-file::backdrop {
  background: rgba(6, 8, 13, 0.84);
}

.person-file__info {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--slate) transparent;
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 14px 20px 22px;
}

.person-file__back {
  justify-self: start;
  margin-bottom: 4px;
}

.person-file__name {
  font-size: 1.75rem;
  line-height: 1.15;
  color: var(--ice-pale);
}

.person-file__section {
  display: grid;
  gap: 6px;
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--ink-3);
}

/* One grid for every row, so all the meanings start in the same column. */
.person-file__tags {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: baseline;
  gap: 6px 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.person-file__tags li {
  display: contents;
}

.person-file__tags .person-tag {
  justify-self: start;
}

.person-file__tags p {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.35;
  color: var(--slate-light);
}

.person-file__title {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.25;
  color: var(--rose-pale);
}

.person-file__text {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.4;
}

.person-file__section .relation__threads {
  margin: 0;
}

.person-file__memories {
  display: grid;
  gap: 4px;
  margin: 0;
  padding-left: 1.1em;
  font-size: 0.9375rem;
  line-height: 1.4;
  color: var(--rose-pale);
}

.person-file__art {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow: hidden;
  border-left: 1px solid var(--ink-3);
  background: radial-gradient(ellipse at 50% 35%, var(--ink-2), var(--ink-0) 75%);
}

.person-file__portrait {
  flex: none;
  width: 360px;
  height: 504px;
  margin-top: 24px;
}

/* ------------------------------------------------ Bond pop-ups */

@keyframes bond-popup-life {
  0% {
    opacity: 0;
    transform: translateY(26px);
  }
  6%,
  90% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(10px);
  }
}

.bond-popups {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 46;
  display: grid;
  gap: 8px;
  justify-items: end;
  pointer-events: none;
}

.bond-popup {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  width: min(300px, calc(100vw - 32px));
  padding: 8px 12px 8px 8px;
  border: 1px solid var(--rose-deep);
  border-left-width: 3px;
  background: var(--ink-2);
  color: var(--bone);
  animation: bond-popup-life 6.5s ease-out forwards;
}

.bond-popup canvas {
  width: 64px;
  height: 64px;
}

.bond-popup--met {
  border-color: var(--ice);
}

.bond-popup--shift {
  border-color: var(--rose-pale);
  box-shadow: 0 0 22px rgba(180, 141, 156, 0.28);
}

.bond-popup--memory {
  border-color: var(--ink-4);
  border-left-color: var(--rose-deep);
}

/* The quietest card: something moved, and the player is not told what. */
.bond-popup--quiet {
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 10px;
  width: min(260px, calc(100vw - 32px));
  padding: 5px 10px 5px 5px;
  border-color: var(--ink-4);
  border-left-color: var(--slate);
}

.bond-popup--quiet canvas {
  width: 40px;
  height: 40px;
}

.bond-popup--quiet .bond-popup__text strong {
  font-size: 0.9375rem;
}

.bond-popup__text {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.bond-popup__text strong {
  font: 400 1.0625rem/1.25 var(--serif);
  color: var(--ice-pale);
}

.bond-popup__detail {
  font-size: 0.875rem;
  line-height: 1.3;
  color: var(--rose-pale);
}

/* ------------------------------------------------ Toasts */

@keyframes toast-life {
  0% {
    opacity: 0;
    transform: translateX(24px);
  }
  8%,
  88% {
    opacity: 1;
    transform: translateX(0);
  }
  100% {
    opacity: 0;
    transform: translateX(14px);
  }
}

.toasts {
  position: fixed;
  top: 58px;
  right: 16px;
  z-index: 45;
  display: grid;
  gap: 6px;
  justify-items: end;
  pointer-events: none;
}

.toast {
  max-width: min(360px, calc(100vw - 32px));
  padding: 8px 14px;
  border-left: 2px solid var(--ice-deep);
  background: var(--ink-2);
  font: 500 0.8125rem/1.4 var(--mono);
  color: var(--bone);
  animation: toast-life 3.4s ease-out forwards;
}

.toast--gain {
  border-left-color: var(--ice);
  color: var(--ice-pale);
}

.toast--loss {
  border-left-color: var(--alert);
  color: var(--alert);
}

.toast--trait {
  border-left-color: var(--ice);
}

.toast--item {
  border-left-color: var(--rose);
  color: var(--rose-pale);
}

/* ------------------------------------------------ Small screens */

@media (max-width: 1180px) {
  .balance__unit,
  .topbar__logo {
    display: none;
  }
}

@media (max-width: 960px) {
  .home__shade {
    background: linear-gradient(180deg, rgba(6, 8, 13, 0.5) 0%, rgba(6, 8, 13, 0.82) 60%, rgba(6, 8, 13, 0.92) 100%);
  }

  .home__layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    padding: 24px 16px;
    align-content: start;
    justify-items: stretch;
  }

  .home__pitch {
    display: contents;
  }

  .logo {
    order: 1;
    justify-self: center;
    margin-left: 0;
  }

  .tagline {
    order: 2;
    text-align: center;
  }

  .auth-card {
    order: 3;
    animation-name: rise-in;
  }

  .pitch {
    order: 4;
  }
}

@media (max-width: 860px) {
  .creation {
    align-content: start;
  }

  .creation__cards {
    grid-template-columns: minmax(0, 360px);
    width: 100%;
    justify-content: center;
  }

  .nature-card {
    grid-template-columns: 120px minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    column-gap: 2px;
    padding: 0;
  }

  .nature-card canvas {
    grid-row: 1 / span 2;
    width: 120px;
    height: 168px;
  }

  .nature-card__name {
    align-self: end;
    padding-top: 12px;
  }

  .nature-card__text {
    padding-bottom: 12px;
  }

  .creation--chosen .creation__cards {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr) minmax(0, 1fr);
    width: min(100%, 360px);
    gap: 8px;
  }

  .creation--chosen .nature-card {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto;
    column-gap: 0;
    padding: 0 0 6px;
  }

  .creation--chosen .nature-card canvas,
  .creation--chosen .nature-card:not([aria-pressed="true"]) canvas {
    grid-row: auto;
    width: 100%;
    height: auto;
    aspect-ratio: 120 / 168;
  }

  .creation--chosen .nature-card__name {
    align-self: auto;
    padding: 0;
    font-size: 0.6875rem;
    letter-spacing: 0.08em;
  }

  .game {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 48px minmax(0, 1fr) 48px;
  }

  .game__footer {
    display: none;
  }

  .menu__legal {
    display: grid;
  }

  .topbar {
    gap: 10px;
    padding: 0 10px;
  }

  .topbar__nav {
    grid-row: 3;
    position: fixed;
    inset: auto 0 0 0;
    z-index: 35;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    height: 48px;
    border-top: 1px solid var(--ink-3);
    background: var(--ink-0);
  }

  .nav-btn {
    padding: 0 4px;
    font-size: 0.625rem;
    letter-spacing: 0.06em;
  }

  .nav-btn::after {
    left: 25%;
    right: 25%;
  }

  .topbar__dossier {
    display: inline-flex;
    min-height: 34px;
    padding: 0.3em 0.8em;
  }

  .dossier {
    position: fixed;
    inset: 48px 0 48px 0;
    z-index: 30;
    display: none;
    border-right: 0;
  }

  .game--dossier-open .dossier {
    display: grid;
  }

  .main-area {
    grid-column: 1;
  }

  .stage {
    grid-template-rows: clamp(120px, 26vh, 220px) minmax(0, 1fr);
  }

  .narrative {
    padding: 16px 16px 32px;
  }

  .hub__body,
  .gallery,
  .options,
  .guide,
  .shop,
  .profile {
    padding: 16px 16px 32px;
  }

  .folder__about {
    display: none;
  }

  .gallery__grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .reel {
    flex-direction: row;
  }

  .reel__poster {
    flex: 0 0 36%;
    width: 36%;
    aspect-ratio: auto;
    object-fit: cover;
    border-right: 1px solid var(--ink-3);
    border-bottom: 0;
  }

  .reel--sealed .reel__poster {
    object-fit: contain;
  }

  .room__scene {
    height: clamp(110px, 20vh, 170px);
  }

  .room__head {
    padding: 6px 16px 4px;
  }

  .carry-meter {
    margin-left: 0;
  }

  .room__notice {
    margin-inline: 16px;
  }

  .room-tabs {
    padding: 0 10px;
  }

  .room__list {
    padding: 8px 16px 24px;
  }

  .room-items {
    grid-template-columns: minmax(0, 1fr);
  }

  dialog.counter {
    width: calc(100vw - 16px);
    max-width: calc(100vw - 16px);
    padding: 8px;
  }

  dialog.counter[open] {
    max-height: calc(100vh - 16px);
    max-height: calc(100dvh - 16px);
  }

  .counter h2 {
    font-size: 1.125rem;
  }

  dialog.panel .counter__greeting {
    margin-bottom: 10px;
    font-size: 0.875rem;
    line-height: 1.35;
  }

  .counter__foot {
    padding-top: 8px;
  }

  .counter__foot .btn {
    width: 100%;
  }

  .counter__row {
    grid-template-columns: 44px minmax(0, 1fr) auto;
    gap: 10px;
  }

  .counter .product__icon,
  .counter .product__icon canvas {
    width: 44px;
    height: 44px;
  }

  .counter h3 {
    font-size: 0.9375rem;
  }

  .counter__text p {
    font-size: 0.8125rem;
    line-height: 1.3;
  }

  .counter__buy {
    min-height: 36px;
    padding: 0.3em 0.7em;
    letter-spacing: 0.06em;
  }

  .counter__unit {
    display: none;
  }

  .bond-popups {
    right: 8px;
    bottom: 56px;
  }

  .relation {
    grid-template-columns: minmax(0, 1fr);
  }

  .relation__art {
    justify-self: center;
  }

  /* On a phone the portrait sits above the words instead of beside them. */
  dialog.person-file {
    width: calc(100vw - 16px);
    height: calc(100dvh - 16px);
  }

  dialog.person-file[open] {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 190px minmax(0, 1fr);
  }

  .person-file__art {
    order: -1;
    border-left: 0;
    border-bottom: 1px solid var(--ink-3);
  }

  .person-file__portrait {
    width: 240px;
    height: 336px;
    margin-top: 0;
  }

  .person-file__info {
    padding: 10px 14px 18px;
  }

  .person-file__tags {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 4px;
  }

  .look-panel {
    grid-template-columns: minmax(0, 1fr);
    max-width: 440px;
  }

  .look-panel .look-swatch {
    width: 44px;
    height: 44px;
  }

  .look-panel .look-chip {
    min-height: 44px;
  }
}

/* A phone on its side is wide enough for the desktop layout, but not tall enough for a footer. */
@media (min-width: 861px) and (max-height: 500px) {
  .game {
    grid-template-rows: 48px minmax(0, 1fr);
  }

  .game__footer {
    display: none;
  }

  .menu__legal {
    display: grid;
  }
}

@media (max-height: 520px) {
  dialog.panel .counter__greeting {
    display: none;
  }
}

@media (max-width: 480px) {
  .topbar__place {
    display: none;
  }

  .topbar__balances {
    margin-right: auto;
  }

  .game__footer .legal__copyright {
    display: none;
  }

  .game__footer {
    font-size: 0.625rem;
  }

  .film__caption {
    font-size: 1rem;
  }
}

@media (max-width: 359px) {
  .dossier__figure {
    grid-template-columns: 242px;
  }

  .slots {
    grid-template-columns: repeat(4, 1fr);
  }

  .creation__cards {
    grid-template-columns: minmax(0, 1fr);
  }

  .nature-card {
    grid-template-columns: 90px minmax(0, 1fr);
  }

  .nature-card canvas {
    width: 90px;
    height: 126px;
  }

  .pitch__point {
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 12px;
  }
}

/* ------------------------------------------------ Language, names and the Guide */

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

.language-picker .look-chip {
  min-height: 34px;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
}

.auth-card__language,
.creation__language {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.auth-card__language {
  justify-content: flex-end;
}

.creation__language {
  justify-content: center;
  margin-top: 10px;
}

.field__hint {
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--slate-light);
}

.name-field {
  width: 100%;
  max-width: 360px;
}

.look-panel__go .name-field {
  justify-self: center;
}

.options__row--name {
  display: grid;
  gap: 8px;
}

.options__name-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px;
}

.options__name-form .name-field {
  flex: 1 1 180px;
  max-width: none;
}

.options__name-form .btn {
  min-height: 44px;
  padding: 0.3em 1em;
}

.options__name-form .status {
  flex: 1 0 100%;
  margin: 0;
}

.options__name-form .status:empty {
  display: none;
}

.guide {
  overflow-y: auto;
  padding: 24px 28px 40px;
}

.guide__tools {
  display: grid;
  gap: 10px;
  max-width: 860px;
  margin-top: 12px;
}

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

.guide__search {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 42px;
  padding: 0.4em 0.8em;
  border: 1px solid var(--ink-4);
  border-radius: 0;
  background: var(--ink-0);
  font: 400 0.9375rem/1.4 var(--mono);
  color: var(--ice-pale);
}

.guide__search:focus-visible {
  outline-offset: 0;
  border-color: var(--ice);
}

.guide__count {
  flex: 0 0 auto;
}

.guide__filters {
  flex-wrap: wrap;
}

.guide__filters .auth-tab {
  flex: 0 1 auto;
  min-height: 34px;
  padding: 0 12px;
  font-size: 0.6875rem;
}

.guide .empty-note {
  max-width: 860px;
  margin-top: 12px;
}

.guide__topics {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  max-width: 860px;
  margin-top: 12px;
}

.guide__topic[hidden] {
  display: none;
}

.guide mark {
  padding: 0 1px;
  background: rgba(180, 215, 230, 0.22);
  color: var(--ice-pale);
}

.guide__topic {
  padding: 0;
}

.guide__title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 16px;
  font: 400 1.125rem/1.3 var(--serif);
  color: var(--ice-pale);
  cursor: pointer;
  list-style: none;
}

.guide__title::-webkit-details-marker {
  display: none;
}

.guide__title::before {
  content: "+";
  flex: 0 0 auto;
  width: 1.2em;
  font-family: var(--mono);
  color: var(--rose);
  transition: transform 160ms ease-out;
}

.guide__topic[open] > .guide__title::before {
  content: "-";
}

.guide__title:hover {
  color: var(--ice);
}

.guide__text {
  display: grid;
  gap: 10px;
  padding: 0 16px 16px calc(16px + 1.2em + 10px);
  max-width: 76ch;
}

.guide__text p {
  margin: 0;
  line-height: 1.6;
  color: var(--bone);
}

@media (max-width: 720px) {
  .guide__text {
    padding-left: 16px;
  }

  .auth-card__language {
    justify-content: flex-start;
  }
}

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