:root {
  /* Storybook Cartography palette */
  --ink: #1f1410;          /* deep walnut, the line color */
  --ink-soft: #3a2718;
  --night: #0d3242;        /* abyssal map ocean */
  --night-2: #06222b;
  --parchment: #f7e9c2;    /* aged-paper page */
  --parchment-2: #eed7a3;
  --parchment-shadow: #c79f5b;
  --leather: #6e3b1f;      /* book-cover binding */
  --leather-deep: #3e1d0a;
  --gold: #d8a13a;         /* gilt edge, embossed seal */
  --gold-bright: #f5c25b;
  --teal: #1d8a8a;
  --moss: #2f5e34;
  --moss-deep: #1c3d1f;
  --tomato: #d24227;       /* wax-seal red */
  --mango: #f4a934;
  --lime: #b8e547;
  --cream: #fff5d8;        /* lit candle warmth */
  --mist: #dff4ff;
  --panel: #f7e9c2;
  --shadow: rgba(20, 12, 8, 0.32);
  --paper-grain:
    radial-gradient(circle at 12% 18%, rgba(110, 59, 31, 0.08) 0 1px, transparent 1px),
    radial-gradient(circle at 78% 42%, rgba(110, 59, 31, 0.06) 0 1px, transparent 1px),
    radial-gradient(circle at 32% 78%, rgba(110, 59, 31, 0.05) 0 1px, transparent 1px),
    radial-gradient(circle at 88% 88%, rgba(110, 59, 31, 0.07) 0 1px, transparent 1px);
  --font-display: "Outfit", "Avenir Next", system-ui, sans-serif;
  --font-body: "Outfit", "Avenir Next", system-ui, sans-serif;
  --font-hand: "Outfit", "Avenir Next", system-ui, sans-serif;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--night-2);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    linear-gradient(180deg, #21554a 0%, #1a4e61 34%, #102a43 72%, #0f1b2f 100%);
  color: var(--cream);
}

body {
  overflow-x: hidden;
}

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

button,
a {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
p {
  margin: 0;
}

img {
  display: block;
  max-width: 100%;
}

.play-app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.play-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  background: rgba(15, 27, 47, 0.9);
  border-bottom: 2px solid rgba(223, 244, 255, 0.12);
  backdrop-filter: blur(12px);
}

.play-app:has(#home-screen.active) .play-topbar {
  position: fixed;
  top: 12px;
  left: 14px;
  right: 14px;
  z-index: 40;
  padding: 0;
  background: transparent;
  border: 0;
  backdrop-filter: none;
  pointer-events: none;
  gap: 10px;
}

/* Brand lockup is hidden on the home scene — the map is the brand. */
.play-app:has(#home-screen.active) .brand-lockup {
  display: none;
}

/* Topbar actions — slim glass bar, hairline buttons */
.play-app:has(#home-screen.active) .topbar-actions {
  pointer-events: auto;
  padding: 4px;
  gap: 4px;
  background: rgba(8, 14, 20, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  backdrop-filter: blur(10px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.32);
}

.play-app:has(#home-screen.active) .topbar-button {
  min-height: 0;
  padding: 5px 11px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--cream);
  line-height: 1.1;
  box-shadow: none;
  text-shadow: none;
  transition: background 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.play-app:has(#home-screen.active) .topbar-button:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}

.play-app:has(#home-screen.active) .topbar-link {
  background: var(--gold);
  border-color: rgba(255, 255, 255, 0.18);
  color: #1f1410;
  font-weight: 600;
}

.play-app:has(#home-screen.active) .topbar-link:hover {
  background: var(--gold-bright);
}

.play-app:has(#home-screen.active) .topbar-locked {
  display: none;
}

.brand-lockup {
  display: grid;
  gap: 4px;
}

.brand-badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 2px solid rgba(255, 247, 222, 0.28);
  border-radius: 8px;
  background: rgba(255, 183, 3, 0.12);
  color: var(--cream);
  font-size: 14px;
  font-weight: 500;
  text-transform: uppercase;
}

.brand-note,
.eyebrow {
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0;
  text-transform: uppercase;
}

.brand-note {
  color: rgba(223, 244, 255, 0.8);
}

.eyebrow {
  color: #c3f358;
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.topbar-button,
.ghost-control,
.action-control,
.launch-pill,
.mode-card,
.choice-card,
.nav-control {
  border: 2px solid rgba(22, 33, 28, 0.92);
  border-radius: 8px;
  transition:
    transform 140ms ease,
    background-color 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease;
}

.topbar-button,
.ghost-control {
  min-height: 44px;
  padding: 0 14px;
  background: rgba(255, 247, 222, 0.94);
  color: var(--ink);
  font-weight: 500;
}

.topbar-button:hover,
.ghost-control:hover,
.action-control:hover,
.launch-pill:hover,
.mode-card:hover,
.choice-card:hover,
.nav-control:hover {
  transform: translateY(-1px);
}

.topbar-link {
  display: inline-flex;
  align-items: center;
}

.play-main {
  flex: 1;
  display: block;
}

.play-screen {
  display: none;
}

.play-screen.active {
  display: block;
}

.hidden {
  display: none !important;
}

.night-stage {
  position: relative;
  min-height: calc(100vh - 78px);
  padding: 18px;
  overflow: hidden;
  background:
    radial-gradient(circle at top left, rgba(184, 242, 74, 0.1), transparent 30%),
    radial-gradient(circle at top right, rgba(255, 183, 3, 0.12), transparent 24%),
    linear-gradient(180deg, rgba(255, 247, 222, 0.06), rgba(255, 247, 222, 0)),
    repeating-linear-gradient(
      90deg,
      rgba(223, 244, 255, 0.03) 0 1px,
      transparent 1px 110px
    ),
    linear-gradient(180deg, rgba(28, 96, 86, 0.86), rgba(20, 63, 86, 0.96), rgba(15, 27, 47, 0.98));
}

.play-app:has(#home-screen.active) .night-stage {
  min-height: 100vh;
  padding: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 242, 93, 0.18), transparent 22%),
    radial-gradient(circle at 88% 16%, rgba(84, 201, 218, 0.16), transparent 26%),
    linear-gradient(180deg, #102235 0%, #183c43 46%, #102a2c 100%);
}

.home-world {
  position: relative;
  z-index: 2;
  min-height: calc(100vh - 114px);
  overflow: hidden;
  border: 4px solid rgba(22, 33, 28, 0.88);
  border-radius: 22px;
  background:
    radial-gradient(circle at 22% 16%, rgba(255, 247, 222, 0.26), transparent 20%),
    linear-gradient(180deg, #8edb86 0%, #5eba70 42%, #368460 100%);
  box-shadow:
    0 28px 80px rgba(2, 8, 18, 0.42),
    inset 0 0 0 3px rgba(255, 247, 222, 0.18);
  isolation: isolate;
}

.play-app:has(#home-screen.active) .home-world {
  min-height: 100vh;
  height: 100vh;
  border: 0;
  border-radius: 0;
  background:
    linear-gradient(180deg, rgba(13, 42, 59, 0.2), rgba(6, 20, 30, 0.35)),
    #0d5a76;
  box-shadow: none;
}

.play-app:has(#home-screen.active) .home-world::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(10, 18, 28, 0.26) 0%, rgba(10, 18, 28, 0) 24%),
    linear-gradient(90deg, rgba(10, 18, 28, 0.16) 0%, transparent 20%, transparent 78%, rgba(10, 18, 28, 0.18) 100%),
    radial-gradient(circle at 50% 44%, transparent 0 55%, rgba(5, 12, 18, 0.2) 100%);
}

.home-world canvas {
  position: relative;
  z-index: 0;
  width: 100%;
  height: calc(100vh - 114px);
  min-height: 560px;
  display: block;
  /* Crisp the WEBP without losing the painted feel.
   * -webkit-optimize-contrast keeps edge detail without over-sharpening. */
  image-rendering: -webkit-optimize-contrast;
  filter: contrast(1.06) saturate(1.08);
  touch-action: none;
}

.play-app:has(#home-screen.active) .home-world canvas {
  height: 100vh;
  min-height: 100vh;
  cursor: default;
  image-rendering: -webkit-optimize-contrast;
  filter: contrast(1.06) saturate(1.08);
}

/* Storybook vignette — the play surface looks like a page in a
 * leather-bound atlas. Subtle dark corners + cream inner glow. */
.play-app:has(#home-screen.active) .home-world::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  background:
    radial-gradient(
      ellipse 110% 92% at 50% 50%,
      transparent 0%,
      transparent 58%,
      rgba(20, 8, 0, 0.18) 84%,
      rgba(20, 8, 0, 0.42) 100%
    );
  mix-blend-mode: multiply;
}

/* Map zoom controls — clean dark glass pill, hairline buttons */
.home-world-map-controls {
  position: absolute;
  right: 16px;
  bottom: 18px;
  z-index: 4;
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(8, 14, 20, 0.62);
  backdrop-filter: blur(10px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.36);
}

.home-world-map-controls button {
  min-width: 28px;
  min-height: 28px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--cream);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  text-shadow: none;
  box-shadow: none;
  transition: background 140ms ease, transform 140ms ease;
}

.home-world-map-controls button:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

.home-world-map-controls button:disabled {
  cursor: default;
  opacity: 0.4;
  transform: none;
}

/* Place/NPC detail HUD only appears when the runtime has a real target. */
.home-world-hud {
  display: none;
}

.home-world[data-active-target] .home-world-hud,
.home-world[data-active-place] .home-world-hud,
.home-world[data-active-npc] .home-world-hud {
  display: flex;
}

.home-world-hud > div {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
}

.home-world-hud h1 {
  max-width: none;
  margin: 0;
  color: var(--cream);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-world-hud .eyebrow,
.home-world-hud p:last-child {
  display: none;
}

.home-world-hud .action-control {
  flex: 0 0 auto;
  min-width: 0;
  min-height: 0;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: var(--gold);
  color: #1f1410;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-shadow: none;
  box-shadow: none;
  transition: background 140ms ease, transform 140ms ease;
}

.home-world-hud .action-control:hover {
  background: var(--gold-bright);
  transform: translateY(-1px);
}

.home-world-hud .action-control:disabled {
  cursor: default;
  opacity: 0.45;
  transform: none;
}

.home-world[data-panel-open="true"] .home-world-hud {
  display: none;
}

/* Roster strip is hidden on the home scene — surfaced only inside
 * the adventure runtime where party-switching matters. */
.home-world-roster {
  display: none;
}

/* Home-world art tray — a leather-bound storybook spread.
 * Each icon sits in its own embossed parchment slot; the title is
 * carved into a brass plaque. This panel must read at the same
 * quality bar as the bouncy castle icons it frames. */
/* Home-world art tray hidden — non-interactive teaser that
 * duplicated info already on the map. Will return as a real
 * navigation panel when the rooms become live. */
.home-world-art-tray {
  display: none;
}

.home-world-art-tray p {
  margin: 0 0 4px;
  padding: 0 2px;
  display: block;
  color: rgba(255, 245, 216, 0.6);
  font-size: 9px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.home-world-art-icons {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  margin-top: 0;
}

.home-world-art-icons span {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 2px;
  min-width: 0;
  padding: 2px 0 3px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.home-world-art-icons img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.45));
  animation: castle-bob 4.4s ease-in-out infinite;
}

.home-world-art-icons span:nth-child(2) img { animation-delay: -0.6s; }
.home-world-art-icons span:nth-child(3) img { animation-delay: -1.2s; }
.home-world-art-icons span:nth-child(4) img { animation-delay: -1.8s; }

@keyframes castle-bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-2px); }
}

.home-world-art-icons strong {
  max-width: 100%;
  color: rgba(255, 245, 216, 0.85);
  font-size: 8px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.home-world + .stage-copy,
.home-world ~ .kid-selector-band,
.home-world ~ .launch-spotlight,
#home-screen > .ready-play-band,
#home-screen > .world-band {
  display: none;
}

.play-app:has(#home-screen.active) .night-stage::before,
.play-app:has(#home-screen.active) .sky-lights {
  display: none;
}

.home-world-place-panel {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 5;
  width: min(270px, calc(100% - 20px));
  padding: 10px;
  border: 2px solid rgba(22, 33, 28, 0.92);
  background:
    linear-gradient(180deg, rgba(255, 247, 222, 0.96), rgba(244, 229, 190, 0.96));
  color: var(--ink);
  box-shadow:
    0 14px 0 rgba(22, 33, 28, 0.28),
    0 0 0 3px rgba(255, 247, 222, 0.2);
}

.home-world-place-panel h2 {
  margin-top: 4px;
  color: var(--ink);
  font-size: clamp(18px, 2.8vw, 26px);
  line-height: 0.95;
}

.home-world-panel-close {
  position: absolute;
  top: 8px;
  right: 8px;
  min-height: 26px;
  padding: 0 8px;
  border: 2px solid rgba(22, 33, 28, 0.82);
  background: rgba(255, 247, 222, 0.9);
  color: var(--ink);
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
}

.home-world-panel-body {
  margin-top: 7px;
  max-width: 30ch;
  color: rgba(22, 33, 28, 0.74);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.16;
}

.home-world-panel-actions {
  display: grid;
  gap: 7px;
  margin-top: 9px;
}

.home-world-panel-action {
  display: grid;
  gap: 3px;
  width: 100%;
  padding: 8px;
  border: 2px solid rgba(22, 33, 28, 0.9);
  background: rgba(255, 247, 222, 0.9);
  color: var(--ink);
  text-align: left;
  box-shadow: 0 5px 0 rgba(22, 33, 28, 0.2);
}

.home-world-panel-action.primary {
  background: #ffdf6b;
}

.home-world-panel-action:disabled {
  cursor: default;
  opacity: 0.72;
  transform: none;
}

.home-world-panel-action strong {
  font-size: 12px;
  line-height: 1;
}

.home-world-panel-action small {
  color: rgba(22, 33, 28, 0.68);
  font-size: 10px;
  font-weight: 500;
  line-height: 1.2;
}

.night-stage::before,
.loading-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--stage-art);
  background-size: cover;
  background-position: center center;
  opacity: 0.18;
  filter: blur(4px) saturate(1.18);
  transform: scale(1.06);
  pointer-events: none;
}

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

.sky-lights span {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 247, 222, 0.8);
  box-shadow:
    0 0 0 10px rgba(255, 247, 222, 0.04),
    0 0 18px rgba(255, 247, 222, 0.28);
  animation: bob 6s ease-in-out infinite;
}

.sky-lights span:nth-child(1) { top: 8%; left: 7%; animation-delay: 0s; }
.sky-lights span:nth-child(2) { top: 18%; left: 84%; animation-delay: 1.2s; }
.sky-lights span:nth-child(3) { top: 30%; left: 20%; animation-delay: 2.6s; }
.sky-lights span:nth-child(4) { top: 12%; left: 56%; animation-delay: 0.8s; }
.sky-lights span:nth-child(5) { top: 42%; left: 72%; animation-delay: 1.9s; }
.sky-lights span:nth-child(6) { top: 50%; left: 10%; animation-delay: 3.1s; }

.stage-copy {
  position: relative;
  z-index: 1;
  max-width: 880px;
  display: grid;
  gap: 14px;
}

.stage-copy h1 {
  max-width: 12ch;
  font-size: 64px;
  line-height: 0.96;
  color: var(--cream);
  text-wrap: balance;
}

.stage-summary,
.screen-helper,
.panel-copy p,
.band-copy p,
.loading-line {
  max-width: 64ch;
  font-size: 16px;
  line-height: 1.5;
  color: rgba(255, 247, 222, 0.9);
}

.kid-selector-band,
.ready-play-band,
.world-band {
  position: relative;
  z-index: 1;
  margin-top: 26px;
  display: grid;
  gap: 16px;
}

.band-copy {
  display: grid;
  gap: 6px;
}

.band-copy h2,
.screen-head h2,
.panel-copy h3,
.step-copy h3,
.viewer-topline h2,
.loading-copy h2 {
  font-size: 40px;
  line-height: 1;
  color: var(--cream);
}

.kid-portals,
.world-row,
.theme-grid,
.mode-grid,
.choice-grid {
  display: grid;
  gap: 14px;
}

.kid-portals {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.portal-card {
  position: relative;
  display: grid;
  min-height: 286px;
  overflow: hidden;
  padding: 0;
  text-align: left;
  border: 2px solid rgba(255, 247, 222, 0.16);
  background: #153956;
  box-shadow: 0 16px 32px rgba(7, 15, 27, 0.2);
}

.portal-card img {
  width: 100%;
  min-height: 286px;
  object-fit: cover;
  object-position: var(--art-position, center center);
  transform: scale(var(--art-scale, 1));
}

.portal-copy {
  position: absolute;
  inset: auto 0 0 0;
  display: grid;
  gap: 8px;
  padding: 18px;
  background: linear-gradient(180deg, rgba(10, 18, 34, 0) 0%, rgba(10, 18, 34, 0.92) 70%);
}

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

.portal-badge,
.spotlight-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 2px solid rgba(22, 33, 28, 0.92);
  border-radius: 999px;
  background: rgba(255, 247, 222, 0.9);
  color: var(--ink);
  font-size: 11px;
  font-weight: 600;
}

.portal-copy strong {
  font-size: 22px;
  line-height: 1;
  color: var(--cream);
}

.portal-copy span {
  font-size: 13px;
  line-height: 1.4;
  color: rgba(223, 244, 255, 0.92);
}

.portal-card.active {
  border-color: var(--mango);
  box-shadow: 0 10px 30px rgba(255, 183, 3, 0.24);
}

.launch-spotlight {
  position: relative;
  z-index: 1;
  margin-top: 24px;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 18px;
  align-items: stretch;
}

.spotlight-art-shell,
.spotlight-copy {
  border: 2px solid rgba(255, 247, 222, 0.14);
  border-radius: 8px;
  overflow: hidden;
}

.spotlight-art-shell {
  min-height: 100%;
  background: rgba(223, 244, 255, 0.08);
}

.spotlight-art-shell img {
  width: 100%;
  height: 100%;
  min-height: 360px;
  object-fit: cover;
  object-position: var(--art-position, center center);
  transform: scale(var(--art-scale, 1));
}

.spotlight-copy {
  display: grid;
  gap: 14px;
  align-content: start;
  padding: 20px;
  background:
    linear-gradient(160deg, rgba(255, 183, 3, 0.16), rgba(20, 184, 166, 0.08)),
    rgba(255, 247, 222, 0.08);
}

.spotlight-copy h2 {
  font-size: 42px;
  line-height: 0.98;
  color: var(--cream);
}

.spotlight-summary {
  max-width: none;
}

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

.launch-dock {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.spotlight-actions {
  margin-top: 4px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.launch-pill,
.launch-link {
  display: grid;
  gap: 4px;
  align-content: center;
  justify-items: start;
  min-height: 88px;
  padding: 0 18px;
  background: rgba(244, 238, 220, 0.96);
  color: var(--ink);
  font-size: 16px;
  font-weight: 600;
  text-align: left;
}

.launch-pill strong,
.launch-link strong {
  font-size: 17px;
  line-height: 1;
}

.launch-pill small,
.launch-link small {
  font-size: 12px;
  line-height: 1.35;
  font-weight: 500;
  color: rgba(22, 33, 28, 0.78);
}

.launch-pill.primary,
.action-control {
  background: var(--mango);
}

.ready-play-band,
.world-band {
  padding: 18px;
  background: rgba(255, 247, 222, 0.08);
  border-top: 2px solid rgba(255, 247, 222, 0.12);
}

.ready-play-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 14px;
}

.ready-companion-deck {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  margin: 14px 0;
}

.ready-companion-card {
  min-height: 100%;
}

.ready-companion-deck .ready-companion-card img {
  aspect-ratio: 1;
}

.ready-play-card {
  overflow: hidden;
  border: 2px solid rgba(255, 247, 222, 0.16);
  background: #102c2f;
  box-shadow: 0 16px 34px rgba(8, 14, 21, 0.24);
}

.ready-play-art {
  position: relative;
  width: 100%;
  overflow: hidden;
  padding: 0;
  border: 0;
  background: #173d5c;
}

.ready-play-art img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.ready-play-art span {
  position: absolute;
  left: 12px;
  bottom: 12px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--mango);
  color: #142238;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
}

.ready-play-copy {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.ready-play-copy h3 {
  color: var(--cream);
  font-size: 24px;
  line-height: 1;
}

.ready-play-copy p {
  color: rgba(255, 247, 222, 0.86);
  line-height: 1.45;
}

.ready-play-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ready-play-status {
  min-height: 20px;
  font-size: 14px;
}

.world-row,
.theme-grid {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.world-card,
.theme-card {
  overflow: hidden;
  padding: 0;
  text-align: left;
  background: #173d5c;
}

.world-card img,
.theme-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: var(--art-position, center center);
  transform: scale(var(--art-scale, 1));
}

.world-copy,
.theme-copy {
  display: grid;
  gap: 6px;
  padding: 14px;
  background: rgba(15, 27, 47, 0.88);
}

.world-copy strong,
.theme-copy strong {
  font-size: 17px;
  color: var(--cream);
}

.world-copy span,
.theme-copy span {
  font-size: 13px;
  line-height: 1.4;
  color: rgba(223, 244, 255, 0.9);
}

.screen-shell,
.viewer-shell,
.loading-shell {
  min-height: calc(100vh - 78px);
  padding: 28px 18px 24px;
}

.screen-head {
  display: grid;
  gap: 14px;
  margin-bottom: 22px;
}

.mode-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: 18px;
}

.mode-card {
  display: grid;
  gap: 8px;
  min-height: 136px;
  padding: 18px;
  background: rgba(223, 244, 255, 0.16);
  color: var(--cream);
  text-align: left;
}

.mode-card strong {
  font-size: 24px;
  line-height: 1;
}

.mode-card span {
  font-size: 14px;
  line-height: 1.45;
  color: rgba(223, 244, 255, 0.88);
}

.mode-card.active,
.theme-card.active,
.choice-card.active {
  border-color: var(--mango);
  background: rgba(255, 183, 3, 0.18);
  box-shadow: 0 12px 26px rgba(255, 183, 3, 0.14);
}

.launch-panel {
  display: grid;
  gap: 18px;
}

.launch-panel-block {
  display: none;
}

.launch-panel-block.active {
  display: grid;
  gap: 14px;
}

.continue-card {
  display: grid;
  gap: 10px;
}

.continue-entry {
  display: grid;
  gap: 6px;
  padding: 18px;
  border: 2px solid rgba(255, 247, 222, 0.14);
  border-radius: 8px;
  background: rgba(223, 244, 255, 0.08);
}

.continue-entry strong {
  font-size: 20px;
  color: var(--cream);
}

.continue-entry span {
  font-size: 14px;
  color: rgba(223, 244, 255, 0.88);
}

.action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.action-bar.dual {
  justify-content: space-between;
}

.action-control {
  min-height: 54px;
  padding: 0 18px;
  color: var(--ink);
  font-weight: 600;
}

.builder-shell {
  display: grid;
  gap: 18px;
}

.smol-builder-shell {
  min-height: calc(100vh - 78px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 16px;
  overflow: hidden;
  padding: 18px;
  background:
    radial-gradient(circle at 18% 18%, rgba(184, 242, 74, 0.24), transparent 26%),
    radial-gradient(circle at 82% 24%, rgba(255, 183, 3, 0.28), transparent 22%),
    linear-gradient(135deg, #0f7a69 0%, #173d5c 44%, #8b2448 100%);
}

.smol-builder-topbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.smol-builder-topbar h2 {
  max-width: 12ch;
  font-size: clamp(38px, 8vw, 78px);
  line-height: 0.9;
  color: var(--cream);
}

.smol-builder-stage {
  display: grid;
  grid-template-columns: minmax(54px, 90px) minmax(0, 1fr) minmax(54px, 90px);
  align-items: center;
  gap: 10px;
  min-height: 0;
}

.smol-builder-arrow {
  width: 100%;
  min-height: min(34vh, 260px);
  border: 3px solid rgba(22, 33, 28, 0.95);
  border-radius: 8px;
  background: var(--mango);
  color: var(--ink);
  font-size: clamp(52px, 12vw, 120px);
  font-weight: 500;
  box-shadow: 0 12px 0 rgba(22, 33, 28, 0.32);
}

.smol-builder-arrow:disabled {
  opacity: 0.45;
  transform: none;
}

.smol-builder-character {
  position: relative;
  display: grid;
  place-items: center;
  min-height: min(58vh, 560px);
  border: 3px solid rgba(22, 33, 28, 0.95);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 247, 222, 0.92), rgba(223, 244, 255, 0.88)),
    repeating-linear-gradient(90deg, rgba(22, 33, 28, 0.08) 0 1px, transparent 1px 48px);
  box-shadow: 0 18px 0 rgba(22, 33, 28, 0.24);
}

.smol-builder-character img {
  position: relative;
  z-index: 1;
  width: min(72vw, 540px);
  max-height: min(56vh, 540px);
  object-fit: contain;
  animation: smol-idle 1.8s ease-in-out infinite;
}

.smol-builder-shadow {
  position: absolute;
  bottom: 8%;
  width: min(42vw, 320px);
  height: 34px;
  border-radius: 999px;
  background: rgba(22, 33, 28, 0.22);
  filter: blur(2px);
}

.smol-builder-console,
.smol-builder-save-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 3px solid rgba(22, 33, 28, 0.95);
  border-radius: 8px;
  background: rgba(255, 247, 222, 0.94);
  color: var(--ink);
}

.smol-builder-option-label {
  font-size: clamp(26px, 5vw, 46px);
  line-height: 1;
  font-weight: 500;
}

.smol-builder-progress {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.smol-builder-progress span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border: 2px solid rgba(22, 33, 28, 0.9);
  border-radius: 8px;
  background: rgba(15, 122, 105, 0.12);
  color: var(--ink);
  font-size: 11px;
  font-weight: 600;
}

.smol-builder-progress span.active {
  background: var(--mango);
}

.smol-builder-progress span.done {
  background: rgba(184, 242, 74, 0.55);
}

.smol-builder-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.smol-builder-save-panel {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.smol-builder-save-panel label {
  display: grid;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.smol-builder-save-panel input {
  min-height: 48px;
  border: 2px solid rgba(22, 33, 28, 0.9);
  border-radius: 8px;
  padding: 0 12px;
  background: #ffffff;
  color: var(--ink);
  font-size: 20px;
  font-weight: 600;
}

.smol-builder-save-panel .screen-helper {
  color: rgba(22, 33, 28, 0.74);
}

@keyframes smol-idle {
  0%,
  100% {
    transform: translateY(0) rotate(-0.4deg) scale(1);
  }
  50% {
    transform: translateY(-10px) rotate(0.6deg) scale(1.018);
  }
}

.builder-remix-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.remix-chip {
  min-height: 40px;
  padding: 0 12px;
  border: 2px solid rgba(22, 33, 28, 0.92);
  border-radius: 8px;
  background: rgba(223, 244, 255, 0.14);
  color: var(--cream);
  font-size: 13px;
  font-weight: 500;
}

.builder-library {
  display: grid;
  gap: 12px;
}

.builder-library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.blueprint-deck {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.picker-deck {
  display: grid;
  gap: 12px;
}

.blueprint-card {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 2px solid rgba(22, 33, 28, 0.92);
  border-radius: 8px;
  background: rgba(223, 244, 255, 0.1);
}

.blueprint-card strong {
  font-size: 18px;
  line-height: 1.05;
  color: var(--cream);
}

.blueprint-card p {
  font-size: 14px;
  line-height: 1.45;
  color: rgba(223, 244, 255, 0.88);
}

.picker-card {
  display: grid;
  gap: 10px;
  overflow: hidden;
  padding: 14px;
  border: 2px solid rgba(22, 33, 28, 0.92);
  border-radius: 8px;
  background: rgba(223, 244, 255, 0.1);
  color: var(--cream);
  text-align: left;
}

.picker-card.active {
  border-color: var(--mango);
  background: rgba(255, 183, 3, 0.18);
  box-shadow: 0 12px 26px rgba(255, 183, 3, 0.14);
}

.picker-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 6px;
}

.picker-card strong {
  font-size: 18px;
  line-height: 1.05;
}

.picker-card p {
  font-size: 14px;
  line-height: 1.45;
  color: rgba(223, 244, 255, 0.88);
}

.picker-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.picker-card-meta span,
.library-empty span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 8px;
  border: 2px solid rgba(22, 33, 28, 0.92);
  border-radius: 8px;
  background: rgba(255, 247, 222, 0.12);
  color: rgba(255, 247, 222, 0.92);
  font-size: 12px;
  font-weight: 500;
}

.library-empty {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 2px dashed rgba(255, 247, 222, 0.18);
  border-radius: 8px;
  background: rgba(223, 244, 255, 0.06);
}

.library-empty p {
  font-size: 14px;
  line-height: 1.45;
  color: rgba(223, 244, 255, 0.88);
}

.library-empty a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 12px;
  border: 2px solid rgba(22, 33, 28, 0.92);
  border-radius: 8px;
  background: rgba(255, 247, 222, 0.96);
  color: var(--ink);
  font-weight: 600;
}

.blueprint-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.blueprint-card-actions .ghost-control,
.blueprint-card-actions .action-control {
  min-height: 40px;
  padding: 0 12px;
}

.builder-progress {
  display: grid;
  gap: 8px;
}

.builder-progress-copy {
  font-size: 14px;
  font-weight: 500;
  color: rgba(223, 244, 255, 0.9);
}

.builder-progress-bar,
.loading-progress {
  height: 14px;
  border: 2px solid rgba(255, 247, 222, 0.18);
  border-radius: 999px;
  background: rgba(255, 247, 222, 0.08);
  overflow: hidden;
}

.builder-progress-bar span,
.loading-progress span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--teal), var(--mango), var(--tomato));
  transition: width 220ms ease;
}

.builder-stage {
  display: grid;
}

.builder-step {
  display: none;
  gap: 14px;
}

.builder-step.active {
  display: grid;
}

.step-copy {
  display: grid;
  gap: 8px;
}

.choice-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.choice-card {
  min-height: 116px;
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 16px;
  background: rgba(223, 244, 255, 0.12);
  color: var(--cream);
  text-align: left;
}

.choice-card strong {
  font-size: 18px;
  line-height: 1.05;
}

.choice-card span {
  font-size: 14px;
  line-height: 1.45;
  color: rgba(223, 244, 255, 0.88);
}

.builder-freeform {
  display: grid;
  gap: 10px;
}

.builder-simple-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.field-stack {
  display: grid;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--cream);
}

textarea,
input {
  width: 100%;
  border: 2px solid rgba(22, 33, 28, 0.92);
  border-radius: 8px;
  background: rgba(255, 247, 222, 0.96);
  color: var(--ink);
}

textarea {
  width: 100%;
  min-height: 112px;
  resize: vertical;
  padding: 14px;
}

input {
  min-height: 48px;
  padding: 0 14px;
}

.loading-shell {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: 24px;
  align-items: center;
  overflow: hidden;
}

.loading-game-panel {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 3px solid rgba(22, 33, 28, 0.95);
  border-radius: 8px;
  background: rgba(255, 247, 222, 0.14);
  box-shadow: 0 20px 0 rgba(22, 33, 28, 0.18);
}

.loading-game-topline,
.loading-game-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.loading-game-topline p:last-child {
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: rgba(255, 247, 222, 0.94);
  color: var(--ink);
  font-weight: 500;
}

.loading-game-canvas {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 3px solid rgba(22, 33, 28, 0.95);
  border-radius: 8px;
  background: #173d5c;
  touch-action: manipulation;
}

.story-ready-button {
  min-height: 54px;
  padding: 0 18px;
  border: 3px solid rgba(22, 33, 28, 0.95);
  border-radius: 8px;
  background: #b8f24a;
  color: var(--ink);
  font-size: 18px;
  font-weight: 500;
  box-shadow: 0 7px 0 rgba(22, 33, 28, 0.3);
}

.loading-machine {
  position: relative;
  z-index: 1;
  max-width: 740px;
  width: 100%;
  justify-self: center;
}

.machine-window {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 18px;
  border: 2px solid rgba(22, 33, 28, 0.92);
  border-radius: 8px 8px 0 0;
  background:
    repeating-linear-gradient(
      90deg,
      rgba(255, 247, 222, 0.14) 0 4px,
      rgba(255, 247, 222, 0.02) 4px 18px
    ),
    #153956;
}

.machine-floor {
  height: 18px;
  border: 2px solid rgba(22, 33, 28, 0.92);
  border-top: none;
  border-radius: 0 0 8px 8px;
  background: #ffb703;
}

.machine-reel {
  aspect-ratio: 1;
  border: 2px solid rgba(22, 33, 28, 0.92);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 247, 222, 0.92), rgba(255, 247, 222, 0.2)),
    #14b8a6;
  animation: reelSpin 2.8s linear infinite;
}

.reel-two {
  animation-duration: 2.2s;
}

.reel-three {
  animation-duration: 1.8s;
}

.loading-copy {
  position: relative;
  z-index: 1;
  max-width: 640px;
  justify-self: center;
  display: grid;
  gap: 14px;
  text-align: center;
}

.loading-gags {
  display: grid;
  justify-items: center;
  gap: 10px;
}

.viewer-shell {
  display: grid;
  gap: 18px;
}

.viewer-topline {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.viewer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.viewer-stage {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 58px;
  gap: 12px;
  align-items: center;
}

.viewer-art {
  overflow: hidden;
  padding: 0;
  background: #0c1524;
  position: relative;
}

.viewer-art img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  transform-origin: center center;
  transition: transform 380ms ease, opacity 220ms ease;
}

.viewer-art.motion-a img {
  animation: sceneDriftA 10s ease-in-out infinite;
}

.viewer-art.motion-b img {
  animation: sceneDriftB 11s ease-in-out infinite;
}

.viewer-art.motion-c img {
  animation: sceneDriftC 12s ease-in-out infinite;
}

.viewer-art.is-refreshing img {
  opacity: 0.88;
}

.nav-control {
  min-height: 88px;
  padding: 0;
  background: rgba(255, 247, 222, 0.94);
  color: var(--ink);
  font-size: 34px;
  font-weight: 600;
}

.narration-band {
  display: grid;
  gap: 12px;
  padding: 16px 18px;
  border: 2px solid rgba(22, 33, 28, 0.92);
  border-radius: 8px;
  background: rgba(255, 247, 222, 0.96);
  color: var(--ink);
}

.viewer-quality-band {
  display: grid;
  gap: 10px;
  padding: 14px 16px 16px;
  border: 2px solid rgba(255, 247, 222, 0.24);
  border-radius: 8px;
  background: rgba(12, 21, 36, 0.72);
  color: var(--cream);
}

.viewer-quality-band.hidden {
  display: none;
}

.viewer-quality-band.is-repaired {
  border-color: rgba(165, 243, 113, 0.72);
  background: rgba(34, 82, 48, 0.45);
}

.viewer-quality-band.is-warning {
  border-color: rgba(255, 200, 87, 0.86);
  background: rgba(91, 54, 21, 0.48);
}

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

.viewer-quality-head h3 {
  font-size: 26px;
  line-height: 1;
  color: var(--cream);
}

.viewer-quality-score {
  display: inline-flex;
  min-width: 88px;
  justify-content: center;
  padding: 8px 10px;
  border: 2px solid rgba(255, 247, 222, 0.72);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: uppercase;
}

.viewer-quality-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.viewer-quality-chip {
  display: inline-flex;
  padding: 7px 9px;
  border: 2px solid rgba(255, 247, 222, 0.18);
  border-radius: 8px;
  background: rgba(255, 247, 222, 0.12);
  color: var(--cream);
  font-size: 13px;
  font-weight: 500;
}

.viewer-quality-toggle {
  justify-self: start;
  min-height: 38px;
  padding: 8px 11px;
  border: 2px solid rgba(255, 247, 222, 0.42);
  border-radius: 8px;
  background: rgba(255, 247, 222, 0.12);
  color: var(--cream);
  font-size: 13px;
  font-weight: 600;
}

.viewer-quality-details {
  display: grid;
  gap: 12px;
  padding-top: 4px;
}

.viewer-quality-details.hidden {
  display: none;
}

.viewer-quality-detail-section {
  display: grid;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 247, 222, 0.22);
}

.viewer-quality-detail-section h4 {
  color: var(--cream);
  font-size: 16px;
  line-height: 1.1;
}

.viewer-quality-detail-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  max-width: 360px;
  color: rgba(255, 247, 222, 0.84);
  font-size: 14px;
}

.viewer-quality-note {
  margin: 0;
  max-width: 780px;
  color: rgba(255, 247, 222, 0.84);
  font-size: 14px;
  line-height: 1.35;
}

.viewer-video-band {
  display: grid;
  gap: 12px;
  padding: 16px 18px 18px;
  border: 2px solid rgba(255, 247, 222, 0.18);
  border-radius: 8px;
  background: rgba(223, 244, 255, 0.08);
}

.viewer-video-band.movie-mode {
  gap: 16px;
  padding: 18px;
  border-color: rgba(255, 213, 74, 0.7);
  background:
    linear-gradient(135deg, rgba(255, 213, 74, 0.18), rgba(20, 184, 166, 0.1)),
    rgba(8, 16, 28, 0.88);
  box-shadow:
    0 22px 46px rgba(0, 0, 0, 0.28),
    inset 0 0 0 1px rgba(255, 247, 222, 0.12);
}

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

.viewer-video-head h3 {
  font-size: 28px;
  line-height: 1;
  color: var(--cream);
}

.viewer-reel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.viewer-reel-actions .hidden {
  display: none;
}

.viewer-reel-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.viewer-video-current.hidden {
  display: none;
}

.viewer-video-band.movie-mode .viewer-video-current {
  position: relative;
}

.viewer-video-band.movie-mode .viewer-video-current::before,
.viewer-video-band.movie-mode .viewer-video-current::after {
  content: "";
  display: block;
  height: 18px;
  border-radius: 6px;
  background:
    repeating-linear-gradient(
      90deg,
      rgba(255, 247, 222, 0.9) 0 18px,
      rgba(8, 16, 28, 0.9) 18px 36px
    );
  opacity: 0.84;
}

.viewer-video-current video {
  width: 100%;
  border: 2px solid rgba(22, 33, 28, 0.92);
  border-radius: 8px;
  background: #08101c;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.viewer-video-band.movie-mode .viewer-video-current video {
  border-color: rgba(255, 247, 222, 0.92);
  border-radius: 4px;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.42);
}

.viewer-video-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 12px;
}

.viewer-video-card {
  display: grid;
  gap: 10px;
  padding: 10px;
  text-align: left;
  background: rgba(255, 247, 222, 0.96);
  color: var(--ink);
}

.viewer-video-card.active {
  border-color: var(--mango);
  box-shadow: 0 10px 20px rgba(8, 16, 28, 0.18);
}

.viewer-video-band.movie-mode .viewer-video-card {
  transform: scale(0.98);
  opacity: 0.72;
}

.viewer-video-band.movie-mode .viewer-video-card.active {
  opacity: 1;
}

.viewer-video-card img,
.viewer-video-placeholder {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 6px;
  object-fit: cover;
}

.viewer-video-placeholder {
  display: grid;
  place-items: center;
  background:
    linear-gradient(180deg, rgba(20, 184, 166, 0.26), rgba(16, 42, 67, 0.94)),
    #153956;
  color: var(--cream);
  font-weight: 600;
}

.viewer-video-copy {
  display: grid;
  gap: 4px;
}

.viewer-video-copy strong {
  font-size: 16px;
  line-height: 1.05;
}

.viewer-video-copy span {
  font-size: 13px;
  line-height: 1.4;
  color: rgba(22, 33, 28, 0.8);
}

.viewer-cast-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.viewer-cast-chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 10px;
  border: 2px solid rgba(22, 33, 28, 0.92);
  border-radius: 8px;
  background: rgba(223, 244, 255, 0.14);
  color: var(--cream);
  font-size: 13px;
  font-weight: 500;
}

.narration-topline {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
}

.viewer-narration {
  font-size: 28px;
  line-height: 1.46;
  color: var(--ink);
}

.viewer-dialogue {
  display: grid;
  gap: 8px;
}

.viewer-dialogue.hidden {
  display: none;
}

.dialogue-chip {
  padding: 10px 12px;
  border-left: 4px solid var(--tomato);
  background: rgba(20, 184, 166, 0.08);
  font-size: 15px;
  line-height: 1.45;
}

.dialogue-chip strong {
  margin-right: 6px;
}

.is-muted .machine-reel,
.is-muted .sky-lights span {
  animation-play-state: paused;
}

@keyframes bob {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }
}

@keyframes reelSpin {
  0% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-6px) rotate(180deg);
  }

  100% {
    transform: translateY(0) rotate(360deg);
  }
}

@keyframes sceneDriftA {
  0%,
  100% {
    transform: scale(1.04) translate3d(0, 0, 0);
  }

  50% {
    transform: scale(1.09) translate3d(-1.8%, -1.2%, 0);
  }
}

@keyframes sceneDriftB {
  0%,
  100% {
    transform: scale(1.05) translate3d(0, 0, 0);
  }

  50% {
    transform: scale(1.1) translate3d(1.6%, -1%, 0);
  }
}

@keyframes sceneDriftC {
  0%,
  100% {
    transform: scale(1.04) translate3d(0, 0, 0);
  }

  50% {
    transform: scale(1.08) translate3d(0.8%, -1.6%, 0);
  }
}

@media (max-width: 900px) {
  .stage-copy h1 {
    max-width: 12ch;
    font-size: 42px;
  }

  .band-copy h2,
  .screen-head h2,
  .panel-copy h3,
  .step-copy h3,
  .viewer-topline h2,
  .loading-copy h2 {
    font-size: 34px;
  }

  .viewer-narration {
    font-size: 24px;
  }

  .viewer-video-head h3 {
    font-size: 24px;
  }

  .builder-simple-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .builder-library-grid {
    grid-template-columns: 1fr;
  }

  .smol-builder-save-panel {
    grid-template-columns: 1fr;
  }

  .launch-spotlight {
    grid-template-columns: 1fr;
  }

  .loading-shell {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 720px) {
  .play-topbar,
  .night-stage,
  .ready-play-band,
  .world-band,
  .screen-shell,
  .viewer-shell,
  .loading-shell,
  .smol-builder-shell {
    padding-left: 14px;
    padding-right: 14px;
  }

  .stage-copy h1,
  .band-copy h2,
  .screen-head h2,
  .panel-copy h3,
  .step-copy h3,
  .viewer-topline h2,
  .loading-copy h2 {
    font-size: 34px;
  }

  .viewer-narration {
    font-size: 21px;
  }

  .viewer-video-head h3 {
    font-size: 22px;
  }

  .spotlight-copy h2 {
    font-size: 34px;
  }

  .builder-simple-grid {
    grid-template-columns: 1fr;
  }

  .action-bar.dual {
    justify-content: flex-start;
  }

  .action-control,
  .ghost-control,
  .launch-pill,
  .topbar-button {
    width: 100%;
    justify-content: center;
  }

  .launch-pill,
  .launch-link {
    justify-items: center;
    text-align: center;
  }

  .play-app:has(#home-screen.active) .play-topbar {
    padding-left: 8px;
    padding-right: 8px;
  }

  .play-app:has(#home-screen.active) .topbar-actions {
    width: auto;
    max-width: calc(100vw - 18px);
    gap: 4px;
  }

  .play-app:has(#home-screen.active) .topbar-button {
    width: auto;
    min-height: 28px;
    padding: 5px 7px;
    font-size: 10px;
  }

  .play-app:has(#home-screen.active) .topbar-locked {
    display: none;
  }

  .play-app:has(#home-screen.active) .brand-note {
    display: none;
  }

  .play-app:has(#home-screen.active) .brand-badge {
    min-height: 28px;
    padding: 0 8px;
    font-size: 11px;
  }

  .play-app:has(#home-screen.active) .home-world-roster {
    top: 72px;
    left: 8px;
    right: 8px;
    gap: 4px;
  }

  .play-app:has(#home-screen.active) .home-world-roster span {
    min-height: 28px;
    padding: 2px 6px 2px 3px;
    font-size: 8px;
  }

  .play-app:has(#home-screen.active) .home-world-roster img {
    width: 22px;
    height: 22px;
  }

  .play-app:has(#home-screen.active) .home-world-art-tray {
    display: none;
  }

  .play-app:has(#home-screen.active) .home-world-map-controls {
    right: 8px;
    bottom: 118px;
    gap: 4px;
    padding: 4px;
  }

  .play-app:has(#home-screen.active) .home-world-map-controls button {
    min-width: 34px;
    min-height: 32px;
    font-size: 11px;
  }

  .play-app:has(#home-screen.active) .home-world-hud {
    left: 8px;
    bottom: 8px;
    width: min(190px, calc(100% - 16px));
    padding: 7px;
  }

  .play-app:has(#home-screen.active) .home-world-hud .action-control {
    width: auto;
    min-width: 74px;
    min-height: 32px;
    padding: 6px 8px;
    font-size: 9px;
  }

  .play-app:has(#home-screen.active) .home-world-hud h1 {
    font-size: 15px;
  }

  .play-app:has(#home-screen.active) .home-world-hud p:last-child {
    display: none;
  }

  .play-app:has(#home-screen.active) .home-world-place-panel {
    right: 8px;
    bottom: 8px;
    width: min(230px, calc(100% - 16px));
    max-height: 42vh;
    overflow: auto;
  }

  .play-app:has(#home-screen.active) .home-world-place-panel h2 {
    font-size: 17px;
  }

  .viewer-topline,
  .viewer-actions {
    display: grid;
  }

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

  .smol-builder-topbar {
    grid-template-columns: 1fr;
  }

  .smol-builder-stage {
    grid-template-columns: 52px minmax(0, 1fr) 52px;
    gap: 8px;
  }

  .smol-builder-arrow {
    min-height: 220px;
    font-size: 58px;
  }

  .smol-builder-character {
    min-height: 360px;
  }

  .smol-builder-character img {
    width: min(76vw, 360px);
  }

  .smol-builder-console {
    grid-template-columns: 1fr;
  }

  .smol-builder-actions {
    justify-content: stretch;
  }

  .viewer-art img {
    aspect-ratio: 4 / 5;
  }
}
