:root {
  --studio-hue: 84;
  --studio-surface-1: hsl(75 20% 96%);
  --studio-surface-2: hsl(96 16% 90%);
  --studio-surface-3: hsl(48 20% 86%);
  --studio-paper: hsl(70 23% 98%);
  --studio-ink: hsl(78 10% 8%);
  --studio-muted: hsl(75 8% 36%);
  --studio-rule: hsl(76 11% 10% / 0.2);
  --studio-accent: hsl(83 31% 38%);
  --studio-glass: hsl(72 25% 97% / 0.72);
  --studio-glass-strong: hsl(72 25% 98% / 0.94);
  --studio-shadow: hsl(76 18% 13% / 0.16);
  --studio-geometry-a: hsl(102 26% 57% / 0.23);
  --studio-geometry-b: hsl(45 37% 57% / 0.21);
  --studio-geometry-c: hsl(184 24% 60% / 0.18);
  --studio-sans: Arial, Helvetica, sans-serif;
  --studio-display: Georgia, "Times New Roman", serif;
  --studio-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
svg { display: block; }

.studio-theme {
  min-height: 100svh;
  overflow-x: hidden;
  color: var(--studio-ink);
  background:
    linear-gradient(90deg, transparent 49.94%, var(--studio-rule) 50%, transparent 50.06%),
    radial-gradient(circle at 77% 13%, var(--studio-geometry-a), transparent 31%),
    linear-gradient(132deg, var(--studio-surface-1), var(--studio-surface-2) 54%, var(--studio-surface-3));
  font-family: var(--studio-sans);
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  background: var(--studio-ink);
  color: var(--studio-paper);
  transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--studio-accent) 80%, white);
  outline-offset: 4px;
}

.studio-geometry {
  position: fixed;
  z-index: 0;
  inset: 0;
  overflow: hidden;
  contain: strict;
  pointer-events: none;
}
.studio-geometry span {
  position: absolute;
  width: 62vw;
  height: 48vh;
  will-change: transform;
}
.studio-geometry span:nth-child(1) {
  top: -13vh; left: -15vw;
  clip-path: polygon(12% 0, 100% 16%, 78% 100%, 0 72%);
  background: var(--studio-geometry-a);
  animation: drift-a 21s ease-in-out infinite alternate;
}
.studio-geometry span:nth-child(2) {
  top: 18vh; right: -21vw;
  clip-path: polygon(23% 0, 100% 30%, 69% 100%, 0 62%);
  background: var(--studio-geometry-b);
  animation: drift-b 25s ease-in-out infinite alternate;
}
.studio-geometry span:nth-child(3) {
  bottom: -17vh; left: 18vw;
  clip-path: polygon(0 23%, 74% 0, 100% 76%, 17% 100%);
  background: var(--studio-geometry-c);
  animation: drift-c 18s ease-in-out infinite alternate;
}
.studio-geometry span:nth-child(4) {
  top: 54vh; left: -31vw;
  clip-path: polygon(10% 0, 100% 14%, 89% 100%, 0 70%);
  background: color-mix(in srgb, var(--studio-geometry-a) 58%, transparent);
  animation: drift-d 23s ease-in-out infinite alternate;
}
.studio-geometry span:nth-child(5) {
  top: -19vh; right: 12vw;
  width: 22vw;
  clip-path: polygon(50% 0, 100% 100%, 0 76%);
  background: color-mix(in srgb, var(--studio-geometry-c) 65%, transparent);
  animation: drift-e 19s ease-in-out infinite alternate;
}
.geometry-paused .studio-geometry span { animation-play-state: paused; }

.studio-content {
  position: relative;
  z-index: 1;
  width: min(1440px, calc(100% - 48px));
  margin-inline: auto;
}
.studio-meta {
  color: var(--studio-muted);
  font-family: var(--studio-mono);
  font-size: 0.7rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
.studio-glass {
  border: 1px solid color-mix(in srgb, var(--studio-ink) 17%, transparent);
  background: var(--studio-glass);
  box-shadow: inset 0 1px 0 color-mix(in srgb, white 70%, transparent), 0 18px 55px var(--studio-shadow);
  backdrop-filter: blur(18px) saturate(125%);
  -webkit-backdrop-filter: blur(18px) saturate(125%);
}

.game-catalogue {
  min-height: 100svh;
  padding-block: 24px;
}
.site-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px;
  align-items: end;
  padding: clamp(16px, 2.6vw, 34px) 2px clamp(24px, 3.4vw, 44px);
}
.site-wordmark h1 {
  margin: 0;
  font-family: var(--studio-display);
  font-size: clamp(4rem, 8vw, 7.25rem);
  font-weight: 400;
  letter-spacing: -0.075em;
  line-height: 0.78;
}
.site-byline {
  display: inline-block;
  margin-top: 18px;
  color: var(--studio-muted);
  font-family: var(--studio-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-decoration-color: color-mix(in srgb, var(--studio-accent) 55%, transparent);
  text-underline-offset: 5px;
}
.site-byline:hover { color: var(--studio-ink); }
.site-actions, .site-links { display: flex; align-items: center; }
.site-actions { flex-wrap: wrap; justify-content: flex-end; gap: 12px 22px; }
.site-links { gap: 20px; }
.site-links a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  color: var(--studio-muted);
  font-size: 0.86rem;
  text-decoration-color: color-mix(in srgb, var(--studio-accent) 55%, transparent);
  text-underline-offset: 5px;
  transition: color 180ms ease, transform 180ms ease;
}
.site-links a:hover, .site-links a:focus-visible { color: var(--studio-ink); transform: translateY(-1px); }
.randomize-button {
  min-height: 46px;
  padding: 10px 18px;
  border: 1px solid var(--studio-ink);
  border-radius: 11px;
  background: var(--studio-ink);
  color: var(--studio-paper);
  cursor: pointer;
  font-weight: 700;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}
.randomize-button:hover, .randomize-button:focus-visible { background: var(--studio-accent); }
.randomize-button:active { transform: translateY(1px) scale(0.98); }
.game-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: clamp(250px, 29vw, 390px);
  border-top: 1px solid var(--studio-rule);
  border-left: 1px solid var(--studio-rule);
  background: hsl(70 24% 98% / 0.22);
  box-shadow: 0 24px 80px var(--studio-shadow);
}
.game-card {
  min-width: 0;
  min-height: 0;
  border-right: 1px solid var(--studio-rule);
  border-bottom: 1px solid var(--studio-rule);
}
.game-card__button {
  position: relative;
  display: grid;
  width: 100%;
  height: 100%;
  min-height: 0;
  grid-template-rows: 1fr auto;
  place-items: center;
  gap: clamp(14px, 2vw, 26px);
  padding: clamp(20px, 3vw, 44px);
  overflow: hidden;
  border: 0;
  background: hsl(var(--game-hue) 26% 96% / 0.44);
  color: var(--studio-ink);
  cursor: pointer;
  isolation: isolate;
  text-align: center;
}
.game-card__button:disabled { cursor: default; opacity: 0.72; }
.game-card__button::after {
  position: absolute;
  z-index: -1;
  inset: 12% 9% 24%;
  background: hsl(var(--game-hue) 36% 63% / 0.28);
  clip-path: polygon(18% 0, 100% 13%, 82% 100%, 0 77%);
  content: "";
  transform: rotate(-4deg) scale(0.82);
  transition: transform 700ms cubic-bezier(0.22, 1, 0.36, 1), clip-path 700ms cubic-bezier(0.22, 1, 0.36, 1);
}
.game-card__button:not(:disabled):hover::after,
.game-card__button:not(:disabled):focus-visible::after { clip-path: polygon(2% 0, 100% 3%, 97% 100%, 0 96%); transform: rotate(0) scale(1.08); }
.game-card__preview {
  display: grid;
  width: clamp(142px, 16vw, 220px);
  aspect-ratio: 10 / 7;
  place-items: center;
  align-self: end;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--studio-ink) 13%, transparent);
  border-radius: 14px;
  background: color-mix(in srgb, var(--studio-paper) 46%, transparent);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.7), 0 10px 24px rgb(8 14 31 / 0.12);
}
.game-card__icon { display: grid; width: 100%; height: 100%; place-items: center; }
.game-card__icon svg { display: block; width: 100%; height: 100%; transition: transform 650ms cubic-bezier(0.22, 1, 0.36, 1); }
.game-card__icon--tarot { background: #10162a; }
.game-card__tarot-art {
  display: block;
  width: 38%;
  height: auto;
  border-radius: 3px;
  box-shadow: 5px 6px 0 rgb(8 14 31 / 0.4), 0 12px 24px rgb(8 14 31 / 0.32);
  image-rendering: crisp-edges;
  image-rendering: pixelated;
  transition: transform 650ms cubic-bezier(0.22, 1, 0.36, 1);
}
.game-card__weight-art {
  display: grid;
  width: 100%;
  height: 100%;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 5px;
  padding: 9px;
  background: linear-gradient(145deg, #eef3ee, #b6c7c4);
  transition: transform 650ms cubic-bezier(0.22, 1, 0.36, 1);
}
.game-card__weight-art img { width: 100%; height: 100%; min-width: 0; object-fit: contain; }
.game-card__weight-art span { font-family: var(--studio-mono); font-size: clamp(0.58rem, 0.8vw, 0.72rem); letter-spacing: 0.08em; text-transform: uppercase; }
.game-card__icon--kats-and-mice { background: #e9c5a3; }
.game-card__km-art { display: block; width: 100%; height: 100%; object-fit: cover; image-rendering: crisp-edges; image-rendering: pixelated; transition: transform 650ms cubic-bezier(0.22, 1, 0.36, 1); }
.game-card__button:not(:disabled):hover .game-card__icon svg { transform: scale(1.06); }
.game-card__button:not(:disabled):hover .game-card__tarot-art { transform: translateY(-8px) rotate(-3deg) scale(0.96); }
.game-card__button:not(:disabled):hover .game-card__weight-art { transform: scale(1.06); }
.game-card__button:not(:disabled):hover .game-card__km-art { transform: scale(1.045); }
.game-card__outfit-art {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: linear-gradient(152deg, #e9e2d6, #b9c9bf);
  transition: transform 650ms cubic-bezier(0.22, 1, 0.36, 1);
}
.game-card__outfit-art img { position: absolute; display: block; object-fit: contain; filter: drop-shadow(0 5px 5px rgb(30 38 33 / 0.2)); }
.game-card__outfit-dress { bottom: -9%; left: 31%; width: 48%; height: 105%; }
.game-card__outfit-hat { top: 9%; left: 4%; width: 31%; height: 34%; transform: rotate(-8deg); }
.game-card__outfit-shoes { right: 0; bottom: 5%; width: 39%; height: 30%; transform: rotate(4deg); }
.game-card__button:not(:disabled):hover .game-card__outfit-art { transform: scale(1.045); }
.game-card__icon--open-plan { background: #150d24; }
.game-card__open-plan-art { display: block; width: 80%; height: 100%; object-fit: contain; filter: saturate(1.18) contrast(1.08); transition: transform 650ms steps(4, end); }
.game-card__button:not(:disabled):hover .game-card__open-plan-art { transform: scale(1.08) rotate(-1deg); }
.game-card__icon--castle { background: #d7cbb3; }
.game-card__castle-art {
  display: block;
  width: 126%;
  height: 100%;
  object-fit: cover;
  object-position: 68% center;
  filter: saturate(0.82) contrast(1.08);
  clip-path: polygon(2% 4%, 98% 0, 100% 95%, 4% 100%);
  transition: transform 650ms steps(4, end);
}
.game-card__button:not(:disabled):hover .game-card__castle-art { transform: translateX(-3%) scale(1.07) rotate(-1deg); }
.game-card__icon--party { background: #16262b; }
.game-card__icon--stained-glass { background: #1a1116; }
.game-card__icon--bonsai { background: #d9c3ad; }
.game-card__icon--bake { background: #c8ab7d; }
.game-card__icon--worldfall { background: #e0a94e; }
.game-card__icon--fly { background: #0c0e12; }
.game-card__glass-art,
.game-card__bonsai-art,
.game-card__party-art,
.game-card__bake-art,
.game-card__worldfall-art,
.game-card__fly-art,
.game-card__rubble-art {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 650ms cubic-bezier(0.22, 1, 0.36, 1);
}
.game-card__glass-art { filter: saturate(1.06) contrast(1.04); }
.game-card__bonsai-art { filter: saturate(1.04); }
.game-card__party-art { filter: saturate(1.04); }
.game-card__button:not(:disabled):hover .game-card__glass-art,
.game-card__button:not(:disabled):hover .game-card__bonsai-art,
.game-card__button:not(:disabled):hover .game-card__party-art,
.game-card__button:not(:disabled):hover .game-card__bake-art,
.game-card__button:not(:disabled):hover .game-card__worldfall-art,
.game-card__button:not(:disabled):hover .game-card__fly-art,
.game-card__button:not(:disabled):hover .game-card__rubble-art,
.game-card__button:not(:disabled):hover .game-card__dragon-art { transform: scale(1.06); }
.game-card__dragon-art { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 650ms cubic-bezier(0.22, 1, 0.36, 1); }
.game-card__tag { display: inline-block; margin-left: 6px; padding: 1px 7px 2px; border-radius: 999px; background: #ffd83d; color: #1c1430; font-size: 0.6rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; vertical-align: middle; }
.game-card__redcat-art {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #c6ae83;
  transition: transform 650ms cubic-bezier(0.22, 1, 0.36, 1);
}
.game-card__redcat-floor { width: 100%; height: 100%; object-fit: cover; filter: sepia(0.18) contrast(1.05) brightness(0.8); }
.game-card__redcat-dress { position: absolute; right: 12%; bottom: -20%; width: 31%; height: 112%; object-fit: contain; filter: drop-shadow(7px 7px 3px rgb(26 14 12 / 0.38)); transform: rotate(4deg); }
.game-card__redcat-art i { position: absolute; width: 12px; height: 12px; border: 2px dashed #310d0d; border-radius: 50%; background: #a20f18; box-shadow: 17px 6px 0 -3px #a20f18; }
.game-card__redcat-art i:nth-of-type(1) { top: 30%; right: 24%; }
.game-card__redcat-art i:nth-of-type(2) { top: 48%; right: 18%; transform: scale(0.72); }
.game-card__redcat-art i:nth-of-type(3) { right: 27%; bottom: 18%; transform: scale(0.56); }
.game-card__button:not(:disabled):hover .game-card__redcat-art { transform: scale(1.045); }
.game-card__name {
  align-self: start;
  max-width: 13ch;
  font-family: var(--studio-display);
  font-size: clamp(1.65rem, 2.5vw, 2.8rem);
  font-weight: 400;
  letter-spacing: -0.05em;
  line-height: 0.94;
}

.game-dialog {
  width: 100vw;
  max-width: none;
  height: 100svh;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: hsl(var(--game-hue, 80) 24% 94%);
  color: hsl(var(--game-hue, 80) 12% 8%);
}
.game-dialog::backdrop { background: rgb(9 12 9 / 0.56); backdrop-filter: blur(5px); }
.game-dialog[open] { animation: dialog-in 420ms cubic-bezier(0.22, 1, 0.36, 1); }
.game-dialog__chrome { position: fixed; z-index: 4; top: 16px; left: 50%; display: flex; height: 48px; align-items: center; gap: 10px; padding: 5px 14px 5px 5px; border-radius: 16px; transform: translateX(-50%); }
.game-dialog:is([data-game="sunset"], [data-game="weight"], [data-game="before"], [data-game="crossing"]) .game-dialog__chrome { padding-right: 5px; }
.game-dialog:is([data-game="sunset"], [data-game="weight"], [data-game="before"], [data-game="crossing"]) .game-dialog__count { display: none; }
.icon-button { display: grid; width: 38px; height: 38px; place-items: center; border: 0; border-radius: 11px; background: transparent; color: inherit; cursor: pointer; }
.icon-button:hover { background: rgb(255 255 255 / 0.46); }
.icon-button svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.music-button { display: flex; min-height: 38px; align-items: center; gap: 7px; padding: 7px 9px; border: 0; border-radius: 11px; background: transparent; color: inherit; font-family: var(--studio-mono); font-size: 0.62rem; letter-spacing: 0.05em; white-space: nowrap; text-transform: uppercase; cursor: pointer; }
.music-button:hover { background: rgb(255 255 255 / 0.46); }
.music-button svg { width: 18px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.music-button[aria-pressed="false"] .music-button__waves { opacity: 0.25; }
.music-button[aria-pressed="true"] .music-button__slash { display: none; }
.music-button[hidden] { display: none; }
.game-dialog__count { white-space: nowrap; }
.game-view { height: 100%; overflow: auto; overscroll-behavior: contain; }
.game-loading, .game-error { display: grid; min-height: 100%; place-content: center; padding: 70px 24px; text-align: center; }
.game-error h2 { margin: 12px 0; font-family: var(--studio-display); font-size: clamp(3rem, 7vw, 7rem); font-weight: 400; letter-spacing: -0.06em; }
.has-game-open { overflow: hidden; }

.toast { position: fixed; z-index: 40; right: 20px; bottom: 20px; max-width: min(360px, calc(100% - 40px)); padding: 13px 17px; background: var(--studio-ink); color: var(--studio-paper); font-size: 0.86rem; opacity: 0; pointer-events: none; transform: translateY(16px); transition: opacity 180ms ease, transform 180ms ease; }
.toast.is-visible { opacity: 1; transform: translateY(0); }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.game-page {
  --game-ink: hsl(var(--game-hue) 14% 9%);
  --game-muted: hsl(var(--game-hue) 9% 34%);
  --game-rule: hsl(var(--game-hue) 12% 12% / 0.22);
  --game-paper: hsl(var(--game-hue) 24% 97%);
  min-height: 100%;
  padding: clamp(104px, 10vw, 148px) max(24px, calc((100vw - 1400px) / 2)) 70px;
  color: var(--game-ink);
  background:
    linear-gradient(90deg, transparent 49.94%, var(--game-rule) 50%, transparent 50.06%),
    radial-gradient(circle at 82% 8%, hsl(calc(var(--game-hue) + 35) 42% 70% / 0.32), transparent 28%),
    linear-gradient(135deg, hsl(var(--game-hue) 25% 95%), hsl(calc(var(--game-hue) + 17) 22% 88%));
}
.game-eyebrow {
  margin: 0;
  color: var(--game-muted);
  font-family: var(--studio-mono);
  font-size: 0.69rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
.game-intro {
  display: grid;
  grid-template-columns: minmax(120px, 0.27fr) minmax(0, 1.18fr) minmax(250px, 0.55fr);
  gap: clamp(22px, 3vw, 52px);
  align-items: end;
  margin-bottom: clamp(52px, 8vw, 96px);
}
.game-intro h1 {
  margin: 0;
  font-family: var(--studio-display);
  font-size: clamp(4.2rem, 8.8vw, 10rem);
  font-weight: 400;
  letter-spacing: -0.075em;
  line-height: 0.78;
}
.game-intro h1 i { font-weight: 400; }
.game-intro > p:last-child { max-width: 38ch; margin: 0; color: var(--game-muted); font-size: 1.02rem; line-height: 1.58; }
.game-workspace {
  display: grid;
  min-height: 610px;
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, 0.5fr);
  border: 1px solid var(--game-rule);
  background: var(--game-paper);
  box-shadow: 0 32px 90px hsl(var(--game-hue) 20% 15% / 0.16);
}
.game-stage { position: relative; min-width: 0; min-height: 550px; overflow: hidden; border-right: 1px solid var(--game-rule); }
/* Absolute so the canvas never feeds its own bitmap height back into the grid
   row that sizes it (that loop otherwise inflates the stage to thousands of px
   in browsers where height:100% resolves against an auto-sized grid track). */
.game-stage canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; min-height: 550px; touch-action: none; }
.game-panel { display: flex; min-width: 0; flex-direction: column; gap: 34px; padding: clamp(26px, 3.4vw, 52px); }
.brief-block { padding-bottom: 28px; border-bottom: 1px solid var(--game-rule); }
.brief-block h2 { margin: 16px 0 10px; font-family: var(--studio-display); font-size: clamp(2rem, 3.4vw, 3.8rem); font-weight: 400; letter-spacing: -0.05em; line-height: 0.96; }
.brief-block p { margin: 0; color: var(--game-muted); line-height: 1.48; }
.control-stack { display: grid; gap: 22px; }
.range-control { display: grid; grid-template-columns: 1fr auto; gap: 8px 14px; align-items: center; font-size: 0.82rem; }
.range-control input { grid-column: 1 / -1; width: 100%; accent-color: hsl(var(--game-hue) 35% 38%); cursor: ew-resize; }
.range-control output { font-family: var(--studio-mono); font-size: 0.73rem; }
.game-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.primary-action, .quiet-action {
  min-height: 46px;
  padding: 11px 16px;
  border: 1px solid var(--game-ink);
  background: var(--game-ink);
  color: var(--game-paper);
  cursor: pointer;
}
.quiet-action { border-color: var(--game-rule); background: transparent; color: var(--game-ink); }
.primary-action:hover, .primary-action:focus-visible { background: hsl(var(--game-hue) 30% 28%); }
.quiet-action:hover, .quiet-action:focus-visible { background: hsl(var(--game-hue) 26% 88%); }
.primary-action:disabled, .quiet-action:disabled { cursor: not-allowed; opacity: 0.42; }
.game-result { display: grid; gap: 7px; margin-top: auto; padding: 18px 0 0; border-top: 1px solid var(--game-rule); color: var(--game-muted); line-height: 1.42; }
.game-result strong { color: var(--game-ink); font-family: var(--studio-display); font-size: 1.45rem; font-weight: 400; }

.sunset-experience { position: relative; width: 100%; height: 100%; min-height: 100svh; overflow: hidden; background: #07101c; }
.sunset-experience canvas { display: block; width: 100%; height: 100%; min-height: 100svh; touch-action: none; cursor: grab; }
.sunset-experience canvas.is-dragging { cursor: grabbing; }
.sunset-experience canvas:focus-visible { outline: 2px solid rgb(255 247 213 / 0.9); outline-offset: -6px; }
.sunset-hint, .weight-hint {
  position: absolute;
  left: 18px;
  bottom: 18px;
  margin: 0;
  padding: 9px 12px;
  border: 1px solid rgb(255 255 255 / 0.22);
  background: rgb(7 13 22 / 0.46);
  color: rgb(255 255 245 / 0.88);
  font-family: var(--studio-mono);
  font-size: 0.64rem;
  letter-spacing: 0.08em;
  pointer-events: none;
  text-transform: uppercase;
  backdrop-filter: blur(12px);
  transition: opacity 260ms ease, transform 260ms ease;
}
.sunset-hint.is-hidden, .weight-hint.is-hidden { opacity: 0; transform: translateY(8px); }
.stage-note { position: absolute; top: 18px; left: 18px; display: flex; gap: 8px; padding: 8px 10px; background: rgb(14 20 23 / 0.62); color: white; font-family: var(--studio-mono); font-size: 0.65rem; letter-spacing: 0.06em; text-transform: uppercase; }

.weight-experience { position: relative; width: 100%; height: 100%; min-height: 100svh; overflow: hidden; background: #a6b7ba; }
.weight-experience canvas { display: block; width: 100%; height: 100%; min-height: 100svh; touch-action: none; cursor: grab; }
.weight-experience canvas.is-dragging { cursor: grabbing; }
.weight-experience canvas:focus-visible { outline: 2px solid rgb(255 250 213 / 0.9); outline-offset: -6px; }
.weight-hint { border-color: rgb(226 239 237 / 0.24); background: rgb(13 27 31 / 0.48); color: rgb(239 246 239 / 0.9); }
.weight-credit { position: absolute; right: 16px; bottom: 14px; color: rgb(235 244 240 / 0.42); font-family: var(--studio-mono); font-size: 0.5rem; letter-spacing: 0.07em; text-decoration: none; text-transform: uppercase; }
.weight-credit:hover, .weight-credit:focus-visible { color: rgb(255 255 245 / 0.88); }

.before-experience {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 100svh;
  overflow: hidden;
  background: #d7bd91;
  color: #302119;
  isolation: isolate;
}
.before-experience canvas {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 100svh;
  touch-action: none;
  user-select: none;
}
.before-experience.can-intervene canvas { cursor: grab; }
.before-experience.is-dragging canvas { cursor: grabbing; }
.before-experience canvas:focus-visible { outline: 2px solid rgb(255 250 214 / 0.96); outline-offset: -7px; }
.before-heading {
  position: absolute;
  z-index: 2;
  top: clamp(26px, 4vw, 58px);
  left: clamp(20px, 4vw, 66px);
  max-width: 520px;
  pointer-events: none;
  transition: opacity 380ms ease, transform 500ms cubic-bezier(0.22, 1, 0.36, 1);
}
.before-heading.is-quiet { opacity: 0.24; transform: translateY(-8px); }
.before-heading p {
  margin: 0 0 12px;
  font-family: var(--studio-mono);
  font-size: 0.64rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
.before-heading h1 {
  margin: 0;
  font-family: var(--studio-display);
  font-size: clamp(3.5rem, 7.8vw, 8.4rem);
  font-weight: 400;
  letter-spacing: -0.075em;
  line-height: 0.72;
}
.before-heading h1 i { font-weight: 400; }
.before-message {
  position: absolute;
  z-index: 2;
  bottom: clamp(58px, 7.5vh, 86px);
  left: clamp(16px, 3vw, 46px);
  display: grid;
  max-width: min(500px, calc(100% - 32px));
  gap: 4px;
  padding: 12px 15px;
  border: 1px solid rgb(255 247 216 / 0.25);
  background: rgb(45 29 22 / 0.76);
  box-shadow: 0 15px 38px rgb(40 21 13 / 0.18);
  color: #fff8df;
  pointer-events: none;
  backdrop-filter: blur(10px);
}
.before-message strong { font-family: var(--studio-display); font-size: clamp(1.05rem, 1.7vw, 1.42rem); font-weight: 400; }
.before-message span { color: rgb(255 248 224 / 0.68); font-family: var(--studio-mono); font-size: 0.57rem; letter-spacing: 0.06em; text-transform: uppercase; }
.before-timeline {
  position: absolute;
  z-index: 2;
  right: clamp(16px, 3vw, 46px);
  bottom: 23px;
  left: clamp(16px, 3vw, 46px);
  display: grid;
  grid-template-columns: 1fr 28px;
  gap: 10px;
  align-items: center;
  color: rgb(255 247 217 / 0.78);
  font-family: var(--studio-mono);
  font-size: 0.59rem;
  letter-spacing: 0.08em;
  pointer-events: none;
}
.before-timeline__track { height: 2px; overflow: hidden; background: rgb(255 247 217 / 0.28); }
.before-timeline__track i { display: block; width: 0; height: 100%; background: #fff8d9; box-shadow: 0 0 16px rgb(255 240 167 / 0.68); }
.before-outcome {
  position: absolute;
  z-index: 3;
  top: 18%;
  right: clamp(24px, 5vw, 76px);
  display: grid;
  width: min(390px, calc(100% - 48px));
  gap: 9px;
  padding: clamp(20px, 3vw, 34px);
  border: 1px solid rgb(61 39 27 / 0.2);
  background: rgb(255 249 228 / 0.91);
  box-shadow: 0 28px 80px rgb(48 25 15 / 0.3);
  backdrop-filter: blur(14px);
}
.before-outcome[hidden] { display: none; }
.before-outcome strong { font-family: var(--studio-display); font-size: clamp(2rem, 3.5vw, 3.5rem); font-weight: 400; letter-spacing: -0.045em; line-height: 0.92; }
.before-outcome span { color: rgb(51 35 27 / 0.68); line-height: 1.45; }
.before-outcome button {
  justify-self: start;
  min-height: 46px;
  margin-top: 10px;
  padding: 10px 14px;
  border: 1px solid #302119;
  background: #302119;
  color: #fff8df;
  cursor: pointer;
}
.before-outcome button:hover, .before-outcome button:focus-visible { background: #6f334d; }
.before-experience[data-outcome="saved"] .before-outcome { background: rgb(237 246 219 / 0.93); }
.before-experience[data-outcome="pencil-rain"] .before-outcome { background: rgb(224 240 236 / 0.93); }
.before-experience[data-outcome="biscuit-avalanche"] .before-outcome { background: rgb(249 231 196 / 0.94); }
.before-experience[data-outcome] .before-message { opacity: 0; }

/* Screen ASMR — a full-bleed, tactile screen-protector install ritual. */
.defender-experience { position: relative; width: 100%; height: 100%; min-height: 100svh; overflow: hidden; background: #10151c; }
.defender-experience canvas { display: block; width: 100%; height: 100%; min-height: 100svh; touch-action: none; cursor: default; }
.defender-experience canvas:focus-visible { outline: 2px solid hsl(214 90% 72% / 0.9); outline-offset: -6px; }
.defender-act {
  position: absolute; top: 18px; left: 18px; padding: 7px 11px;
  border: 1px solid rgb(255 255 255 / 0.16); background: rgb(10 16 24 / 0.5);
  color: rgb(226 238 252 / 0.92); font-family: var(--studio-mono); font-size: 0.62rem;
  letter-spacing: 0.12em; text-transform: uppercase; backdrop-filter: blur(10px);
}
.defender-hint {
  position: absolute; left: 18px; bottom: 18px; margin: 0; max-width: min(60ch, calc(100% - 36px));
  padding: 9px 12px; border: 1px solid rgb(255 255 255 / 0.2); background: rgb(9 14 22 / 0.5);
  color: rgb(226 238 252 / 0.9); font-family: var(--studio-mono); font-size: 0.64rem;
  letter-spacing: 0.08em; text-transform: uppercase; pointer-events: none; backdrop-filter: blur(12px);
  transition: opacity 260ms ease, transform 260ms ease;
}
.defender-hint.is-hidden { opacity: 0; transform: translateY(8px); }
.defender-advance {
  position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 1;
  min-height: 46px; padding: 12px 22px; border: 1px solid hsl(214 60% 74% / 0.5);
  background: hsl(214 68% 60% / 0.18); color: #eaf3ff; font-family: var(--studio-mono);
  font-size: 0.72rem; letter-spacing: 0.09em; text-transform: uppercase; cursor: pointer;
  backdrop-filter: blur(12px); box-shadow: 0 10px 30px rgb(8 14 22 / 0.4);
  transition: background 180ms ease, transform 180ms ease; animation: defender-rise 320ms cubic-bezier(0.22, 1, 0.36, 1);
}
.defender-advance:hover, .defender-advance:focus-visible { background: hsl(214 70% 62% / 0.32); transform: translateX(-50%) translateY(-2px); }
@keyframes defender-rise { from { opacity: 0; transform: translateX(-50%) translateY(12px); } }
.defender-result {
  position: absolute; inset: 0; z-index: 2; display: grid; place-content: center; gap: 8px;
  padding: 40px 28px; text-align: center; backdrop-filter: blur(6px);
  background: radial-gradient(circle at 50% 28%, rgb(22 32 46 / 0.5), rgb(8 12 18 / 0.85));
  animation: defender-fade 360ms ease;
}
@keyframes defender-fade { from { opacity: 0; } }
.defender-result__eyebrow { margin: 0; color: hsl(214 40% 78%); font-family: var(--studio-mono); font-size: 0.64rem; letter-spacing: 0.14em; text-transform: uppercase; }
.defender-result h2 { margin: 6px 0 4px; justify-self: center; max-width: 15ch; color: #f2f7ff; font-family: var(--studio-display); font-size: clamp(2.6rem, 6vw, 4.6rem); font-weight: 400; letter-spacing: -0.04em; line-height: 0.94; }
.defender-result__detail { max-width: 42ch; margin: 0 auto; color: rgb(214 228 244 / 0.82); font-size: 1rem; line-height: 1.55; }
.defender-result__stats { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 16px 0 6px; padding: 0; list-style: none; }
.defender-result__stats li { display: grid; gap: 3px; padding: 9px 14px; border: 1px solid rgb(255 255 255 / 0.14); background: rgb(255 255 255 / 0.05); }
.defender-result__stats span { color: rgb(200 216 234 / 0.7); font-family: var(--studio-mono); font-size: 0.56rem; letter-spacing: 0.09em; text-transform: uppercase; }
.defender-result__stats strong { color: #eaf2fc; font-family: var(--studio-mono); font-size: 0.8rem; font-weight: 500; }
.defender-replay {
  justify-self: center; margin-top: 14px; min-height: 48px; padding: 13px 26px;
  border: 1px solid #eaf3ff; background: #eaf3ff; color: #10151c; font-family: var(--studio-mono);
  font-size: 0.74rem; letter-spacing: 0.08em; text-transform: uppercase; cursor: pointer;
  transition: background 160ms ease, transform 160ms ease;
}
.defender-replay:hover, .defender-replay:focus-visible { background: #fff; transform: translateY(-2px); }
.defender-result[data-band="flawless"] .defender-result__eyebrow { color: hsl(150 55% 70%); }
.defender-result[data-band="cursed"] .defender-result__eyebrow { color: hsl(320 58% 76%); }
/* Author display rules would otherwise defeat the [hidden] attribute. */
.defender-result[hidden], .defender-advance[hidden] { display: none; }

.game-page--apology { --game-hue: 345; }
.apology-scene { display: grid; grid-template-columns: minmax(0, 1fr) 210px; align-items: stretch; border: 1px solid var(--game-rule); background: var(--game-paper); }
.apology-prompt { padding: clamp(26px, 4vw, 58px); }
.apology-prompt h2 { margin: 18px 0 12px; font-family: var(--studio-display); font-size: clamp(2.4rem, 5vw, 5.6rem); font-weight: 400; letter-spacing: -0.055em; line-height: 0.92; }
.apology-prompt > p:last-child { max-width: 55ch; margin-bottom: 0; color: var(--game-muted); font-size: 1.04rem; line-height: 1.56; }
.apology-face { display: grid; place-items: center; align-content: center; gap: 14px; border-left: 1px solid var(--game-rule); background: hsl(var(--game-hue) 32% 88%); }
.apology-face span { font-family: var(--studio-display); font-size: 6rem; line-height: 1; }
.apology-face small { font-family: var(--studio-mono); letter-spacing: 0.09em; text-transform: uppercase; }
.apology-workspace { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(340px, 0.95fr); margin-top: 18px; border: 1px solid var(--game-rule); background: var(--game-paper); }
.apology-composer, .phrase-bank { min-width: 0; padding: clamp(26px, 4vw, 54px); }
.apology-composer { display: flex; min-height: 560px; flex-direction: column; border-right: 1px solid var(--game-rule); }
.selected-phrases { display: grid; gap: 9px; margin: 28px 0; }
.selected-phrases button { display: grid; grid-template-columns: 29px 1fr; gap: 12px; align-items: start; padding: 14px; border: 1px solid var(--game-rule); background: hsl(var(--game-hue) 24% 94%); color: var(--game-ink); cursor: pointer; text-align: left; line-height: 1.42; }
.selected-phrases button span { font-family: var(--studio-mono); font-size: 0.67rem; }
.empty-composer { margin: 0; padding: 24px 0; color: var(--game-muted); font-family: var(--studio-display); font-size: 1.5rem; }
.apology-reaction { display: grid; gap: 10px; min-height: 105px; margin-top: auto; padding: 22px 0; border-top: 1px solid var(--game-rule); color: var(--game-muted); line-height: 1.5; }
.apology-reaction strong { color: var(--game-ink); font-family: var(--studio-display); font-size: 1.75rem; font-weight: 400; }
.phrase-bank > div { display: grid; gap: 8px; margin-top: 28px; }
.phrase { display: grid; grid-template-columns: 94px 1fr; gap: 12px; align-items: start; padding: 13px 0; border: 0; border-bottom: 1px solid var(--game-rule); background: transparent; color: var(--game-ink); cursor: pointer; text-align: left; line-height: 1.4; }
.phrase span { color: var(--game-muted); font-family: var(--studio-mono); font-size: 0.63rem; letter-spacing: 0.05em; text-transform: uppercase; }
.phrase:hover:not(:disabled), .phrase:focus-visible:not(:disabled) { padding-left: 8px; background: hsl(var(--game-hue) 28% 93%); }
.phrase:disabled { cursor: default; opacity: 0.35; }

.coffee-gate {
  --coffee-cream: #f2ede1;
  --coffee-ink: #21140d;
  position: relative;
  display: grid;
  min-height: 100svh;
  overflow: hidden;
  place-items: center start;
  padding: clamp(110px, 12vw, 170px) max(28px, calc((100vw - 1380px) / 2));
  background:
    linear-gradient(90deg, rgb(26 15 9 / 0.08) 1px, transparent 1px) 50% / 12.5vw 100%,
    radial-gradient(circle at 74% 38%, #ce8a44 0, #9a5935 22%, transparent 48%),
    linear-gradient(128deg, #efe7d6 0 48%, #b66f43 48% 100%);
  color: var(--coffee-ink);
  isolation: isolate;
}
.coffee-gate__wash { position: absolute; inset: 0; z-index: -1; background: linear-gradient(115deg, rgb(255 255 255 / 0.24), transparent 42%); pointer-events: none; }
.coffee-gate__content { z-index: 2; width: min(690px, 55vw); }
.coffee-gate__status { display: flex; gap: 10px; align-items: center; margin: 0 0 30px; font-family: var(--studio-mono); font-size: 0.7rem; letter-spacing: 0.11em; text-transform: uppercase; }
.coffee-gate__status::before { width: 9px; height: 9px; border-radius: 50%; background: #b84623; box-shadow: 0 0 0 5px rgb(184 70 35 / 0.12); content: ""; }
.coffee-gate h1 { max-width: 7.5ch; margin: 0; font-family: var(--studio-display); font-size: clamp(5rem, 10vw, 10.5rem); font-weight: 400; letter-spacing: -0.08em; line-height: 0.76; }
.coffee-gate h1 i { display: block; font-weight: 400; color: #8f321c; }
.coffee-gate__lead { max-width: 32ch; margin: clamp(34px, 5vw, 62px) 0 12px; font-family: var(--studio-display); font-size: clamp(1.65rem, 2.7vw, 2.9rem); letter-spacing: -0.035em; line-height: 1.02; }
.coffee-gate__detail { max-width: 57ch; margin: 0; color: rgb(33 20 13 / 0.66); font-size: 0.96rem; line-height: 1.55; }
.coffee-gate__facts { display: grid; max-width: 620px; grid-template-columns: repeat(3, 1fr); margin-top: 34px; border-block: 1px solid rgb(33 20 13 / 0.24); }
.coffee-gate__facts span { display: grid; gap: 5px; padding: 14px 16px 14px 0; }
.coffee-gate__facts span + span { padding-left: 16px; border-left: 1px solid rgb(33 20 13 / 0.24); }
.coffee-gate__facts small, .coffee-gate__accept small { color: rgb(33 20 13 / 0.54); font-family: var(--studio-mono); font-size: 0.59rem; letter-spacing: 0.08em; text-transform: uppercase; }
.coffee-gate__facts strong { font-family: var(--studio-mono); font-size: 0.73rem; font-weight: 500; }
.coffee-gate__accept { display: flex; width: min(100%, 620px); min-height: 70px; align-items: center; justify-content: space-between; gap: 24px; margin-top: 18px; padding: 16px 19px; border: 1px solid var(--coffee-ink); background: var(--coffee-ink); color: var(--coffee-cream); cursor: pointer; text-align: left; }
.coffee-gate__accept span { font-family: var(--studio-display); font-size: 1.3rem; }
.coffee-gate__accept small { color: rgb(242 237 225 / 0.56); }
.coffee-gate__accept:hover, .coffee-gate__accept:focus-visible { background: #7d2e1c; }
.coffee-gate__accept:disabled { cursor: wait; opacity: 0.76; }
.coffee-gate.is-loading .coffee-gate__status::before { animation: coffee-gate-pulse 800ms ease-in-out infinite alternate; }
.coffee-gate__cup { position: absolute; right: clamp(1vw, 7vw, 10vw); bottom: 13vh; width: clamp(270px, 31vw, 520px); aspect-ratio: 1; transform: rotate(-5deg); }
.coffee-gate__vessel { position: absolute; z-index: 3; right: 17%; bottom: 12%; width: 62%; height: 64%; border-radius: 8% 8% 34% 31% / 7% 7% 18% 20%; background: linear-gradient(105deg, #bfc0b9 0, #f6f1e6 36%, #dedcd2 72%, #aba99f 100%); box-shadow: inset -18px -10px 30px rgb(40 23 12 / 0.18), 0 40px 45px rgb(41 19 8 / 0.3); clip-path: polygon(3% 0, 97% 0, 86% 100%, 16% 100%); }
.coffee-gate__coffee { position: absolute; z-index: 4; top: 21.5%; right: 18.5%; width: 59%; height: 15%; border: 8px solid #eae6dd; border-radius: 50%; background: radial-gradient(ellipse at 34% 27%, #ca7b38 0 2%, transparent 3%), radial-gradient(ellipse at 62% 60%, #d69a55 0 4%, transparent 5%), radial-gradient(ellipse at 47% 40%, #9f4e1f, #4b1607 45%, #180805 76%); box-shadow: inset 0 8px 9px rgb(255 213 141 / 0.24), 0 3px 4px rgb(49 22 10 / 0.2); }
.coffee-gate__handle { position: absolute; z-index: 2; right: 3%; bottom: 30%; width: 30%; height: 35%; border: clamp(17px, 2.2vw, 34px) solid #d7d5cc; border-left-width: 12px; border-radius: 50%; box-shadow: 12px 16px 20px rgb(50 21 8 / 0.18); }
.coffee-gate__shadow { position: absolute; right: 3%; bottom: 3%; width: 89%; height: 13%; border-radius: 50%; background: rgb(48 20 8 / 0.32); filter: blur(18px); }
.coffee-gate__steam { position: absolute; z-index: 1; top: -3%; width: 18%; height: 34%; border: 7px solid rgb(255 249 235 / 0.44); border-block-color: transparent; border-radius: 50%; filter: blur(2px); animation: coffee-steam 2.8s ease-in-out infinite alternate; }
.coffee-gate__steam--one { left: 36%; }
.coffee-gate__steam--two { left: 54%; animation-delay: -1.4s; }
.coffee-gate__mobile-mark { display: grid; width: 76px; height: 108px; place-items: end center; margin-top: 36px; border: 2px solid currentColor; border-radius: 12px; }
.coffee-gate__mobile-mark span { width: 22px; height: 3px; margin-bottom: 8px; border-radius: 2px; background: currentColor; }
.coffee-gate__mobile-mark i { position: absolute; width: 112px; height: 2px; align-self: center; background: #a33b22; transform: rotate(-48deg); }
.coffee-gate--error { background: linear-gradient(135deg, #e9e2d6, #c98f6e); }

.game-page--coffee { --game-hue: 32; }
.game-workspace--coffee { grid-template-columns: minmax(0, 1.72fr) minmax(310px, 0.48fr); background: #f2eee4; }
.game-stage--coffee { min-height: 680px; background: #17100c; }
.game-stage--coffee canvas { min-height: 680px; cursor: grab; }
.game-stage--coffee canvas.is-dragging { cursor: grabbing; }
.game-stage--coffee canvas:focus-visible { outline: 2px solid rgb(255 239 208 / 0.9); outline-offset: -6px; }
.coffee-hud { position: absolute; top: 18px; right: 18px; display: flex; gap: 18px; padding: 11px 13px; border: 1px solid rgb(30 32 28 / 0.2); background: rgb(248 245 236 / 0.88); backdrop-filter: blur(8px); }
.coffee-hud { border-color: rgb(255 240 216 / 0.2); background: rgb(24 17 13 / 0.62); color: #f8efe1; }
.coffee-hud span { display: grid; gap: 3px; }
.coffee-hud small { color: rgb(28 31 28 / 0.58); font-family: var(--studio-mono); font-size: 0.59rem; letter-spacing: 0.07em; text-transform: uppercase; }
.coffee-hud small { color: rgb(248 239 225 / 0.56); }
.coffee-hud strong { font-family: var(--studio-mono); font-size: 0.72rem; }
.coffee-swirl-indicator { margin: -4px; padding: 4px; }
.coffee-swirl-indicator.is-swirling { background: rgb(204 111 47 / 0.23); }
.coffee-swirl-indicator.is-swirling strong { color: #ffc987; }
.coffee-gpu-badge { position: absolute; top: 19px; left: 18px; display: flex; align-items: center; gap: 7px; padding: 8px 10px; border: 1px solid rgb(255 240 216 / 0.18); background: rgb(24 17 13 / 0.58); color: #f8efe1; font-family: var(--studio-mono); letter-spacing: 0.06em; text-transform: uppercase; backdrop-filter: blur(8px); }
.coffee-gpu-badge i { width: 7px; height: 7px; border-radius: 50%; background: #d69555; box-shadow: 0 0 12px #ed9c47; }
.coffee-gpu-badge span { font-size: 0.61rem; }
.coffee-gpu-badge small { color: rgb(248 239 225 / 0.48); font-size: 0.55rem; }
.game-stage--coffee .stage-note { top: auto; bottom: 18px; border: 1px solid rgb(255 240 216 / 0.16); background: rgb(24 17 13 / 0.62); backdrop-filter: blur(8px); }
.coffee-renderer-alert { position: absolute; z-index: 3; inset: 0; display: grid; place-content: center; gap: 8px; padding: 32px; background: rgb(20 13 9 / 0.88); color: #f6eee0; text-align: center; }
.coffee-renderer-alert[hidden] { display: none; }
.coffee-renderer-alert strong { font-family: var(--studio-display); font-size: 2rem; font-weight: 400; }
.coffee-renderer-alert span { color: rgb(246 238 224 / 0.65); }
.coffee-panel { gap: 28px; }
.coffee-panel-status { display: grid; gap: 20px; }
.coffee-progress-block { display: grid; gap: 8px; padding-bottom: 18px; border-bottom: 1px solid var(--game-rule); }
.coffee-progress-header { display: flex; align-items: center; justify-content: space-between; }
.coffee-progress-text { color: var(--game-muted); font-family: var(--studio-mono); font-size: 0.76rem; }
.coffee-progress-track { width: 100%; height: 6px; overflow: hidden; border: 1px solid var(--game-rule); background: hsl(var(--game-hue) 15% 88%); }
.coffee-progress-fill { width: 0; height: 100%; background: linear-gradient(90deg, #6f2514, #c46f32); transition: width 150ms linear; }
.coffee-stage-tags { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 4px; }
.coffee-stage-tags span { padding: 4px 2px; border: 1px solid transparent; color: var(--game-muted); font-family: var(--studio-mono); font-size: 0.58rem; letter-spacing: 0.04em; text-align: center; text-transform: uppercase; }
.coffee-stage-tags span.is-active { border-color: var(--game-rule); background: hsl(var(--game-hue) 32% 90%); color: var(--game-ink); font-weight: 700; }
.coffee-tactile-legend { display: grid; gap: 8px; padding: 12px 14px; border: 1px solid var(--game-rule); background: hsl(var(--game-hue) 20% 95%); }
.legend-row { display: grid; grid-template-columns: 105px 1fr; gap: 8px; align-items: center; font-size: 0.75rem; }
.legend-key { color: var(--game-muted); font-family: var(--studio-mono); font-size: 0.62rem; letter-spacing: 0.05em; text-transform: uppercase; }
.legend-desc { color: var(--game-ink); line-height: 1.3; }
.coffee-result-content { display: grid; gap: 6px; line-height: 1.45; }
.coffee-result-content strong { font-family: var(--studio-display); font-size: 1.22rem; font-weight: 400; }
.coffee-result-content span { color: var(--game-muted); font-size: 0.88rem; }
.coffee-scorecard { display: grid; gap: 12px; }
.scorecard-header { display: flex; align-items: center; gap: 10px; }
.scorecard-badge { padding: 3px 7px; border-radius: 2px; font-family: var(--studio-mono); font-size: 0.62rem; font-weight: 700; letter-spacing: 0.08em; }
.scorecard-badge.badge--good { background: #2a5a3a; color: #f2faef; }
.scorecard-badge.badge--mid { background: #875c1c; color: #fff8e8; }
.scorecard-badge.badge--bad { background: #7a2622; color: #fdf0ee; }
.scorecard-title { font-family: var(--studio-display); font-size: 1.45rem; font-weight: 400; line-height: 1.1; }
.scorecard-detail { margin: 0; color: var(--game-muted); font-size: 0.9rem; line-height: 1.45; }
.scorecard-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding-top: 10px; border-top: 1px solid var(--game-rule); }
.scorecard-stat { display: grid; gap: 3px; }
.scorecard-stat small { color: var(--game-muted); font-family: var(--studio-mono); font-size: 0.56rem; letter-spacing: 0.06em; text-transform: uppercase; }
.scorecard-stat strong { color: var(--game-ink); font-family: var(--studio-mono); font-size: 0.86rem; }

@keyframes coffee-steam { from { opacity: 0.3; transform: translateY(12px) scaleX(0.85); } to { opacity: 0.75; transform: translateY(-10px) scaleX(1.1); } }
@keyframes coffee-gate-pulse { to { background: #f0a555; box-shadow: 0 0 0 9px rgb(240 165 85 / 0.18); } }

.game-page--skip {
  --game-hue: 182;
  --game-ink: hsl(182 18% 10%);
  --game-paper: hsl(182 24% 97%);
}

.skip-experience {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 100svh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #14282c;
}
.skip-experience canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 100svh;
  touch-action: none;
  cursor: crosshair;
}
.skip-experience canvas:focus-visible {
  outline: 2px solid rgb(215 245 240 / 0.85);
  outline-offset: -6px;
}
.skip-hud {
  position: absolute;
  top: clamp(14px, 3vw, 24px);
  left: clamp(14px, 3vw, 28px);
  right: auto;
  z-index: 2;
  display: flex;
  gap: 16px;
  padding: 10px 14px;
  border: 1px solid rgb(215 245 240 / 0.2);
  border-radius: 12px;
  background: rgb(15 35 38 / 0.72);
  backdrop-filter: blur(10px);
  color: #ebf7f5;
}
.skip-hud__badge {
  display: grid;
  gap: 3px;
}
.skip-hud small {
  color: rgb(185 225 220 / 0.65);
  font-family: var(--studio-mono);
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.skip-hud strong {
  font-family: var(--studio-mono);
  font-size: 0.76rem;
  font-weight: 500;
}

.skip-hint {
  position: absolute;
  left: clamp(14px, 3vw, 28px);
  bottom: clamp(14px, 3vw, 24px);
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 13px;
  border: 1px solid rgb(215 245 240 / 0.18);
  border-radius: 10px;
  background: rgb(15 35 38 / 0.65);
  backdrop-filter: blur(8px);
  color: rgb(235 248 245 / 0.88);
  font-family: var(--studio-mono);
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  pointer-events: none;
  transition: opacity 240ms ease;
}
.skip-hint.is-hidden {
  opacity: 0;
}
.skip-hint__arrow {
  color: #9fe8df;
}

.skip-outcome {
  position: absolute;
  left: 50%;
  bottom: clamp(24px, 6vw, 48px);
  transform: translateX(-50%);
  z-index: 3;
  display: grid;
  gap: 10px;
  width: min(440px, calc(100vw - 32px));
  padding: 24px 28px;
  border: 1px solid rgb(215 245 240 / 0.22);
  border-radius: 16px;
  background: rgb(12 30 33 / 0.88);
  backdrop-filter: blur(14px);
  color: #edf9f7;
  text-align: center;
  box-shadow: 0 20px 48px rgb(0 0 0 / 0.45);
  animation: skip-pop 320ms cubic-bezier(0.2, 0.9, 0.3, 1);
}
.skip-outcome[hidden] {
  display: none !important;
}
.skip-outcome__eyebrow {
  margin: 0;
  color: rgb(170 220 215 / 0.7);
  font-family: var(--studio-mono);
  font-size: 0.62rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
.skip-outcome h2 {
  margin: 0;
  font-family: var(--studio-display);
  font-size: clamp(1.8rem, 3.4vw, 2.4rem);
  font-weight: 400;
  letter-spacing: -0.04em;
  line-height: 1.1;
  color: #f4fbf9;
}
.skip-outcome p {
  margin: 0;
  color: rgb(200 235 230 / 0.85);
  font-size: 0.92rem;
  line-height: 1.45;
}
.skip-outcome__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 8px 0 4px;
  padding: 10px 0;
  border-top: 1px solid rgb(215 245 240 / 0.15);
  border-bottom: 1px solid rgb(215 245 240 / 0.15);
}
.skip-outcome__stats div {
  display: grid;
  gap: 3px;
}
.skip-outcome__stats small {
  color: rgb(160 210 205 / 0.65);
  font-family: var(--studio-mono);
  font-size: 0.58rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.skip-outcome__stats strong {
  font-family: var(--studio-mono);
  font-size: 0.86rem;
  color: #9fe8df;
}
.skip-outcome__actions {
  display: flex;
  justify-content: center;
  margin-top: 4px;
}
.skip-outcome .primary-action {
  min-height: 44px;
  padding: 10px 22px;
  border: 1px solid #ebf7f5;
  border-radius: 8px;
  background: #ebf7f5;
  color: #0c2024;
  font-family: var(--studio-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease;
}
.skip-outcome .primary-action:hover,
.skip-outcome .primary-action:focus-visible {
  background: #fff;
  transform: translateY(-2px);
}
@keyframes skip-pop {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(14px) scale(0.96);
  }
}

.game-page--moon {
  --game-hue: 253;
  --game-ink: hsl(247 18% 10%);
  --game-paper: hsl(250 26% 97%);
}

.moon-experience {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 100svh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #050711;
}
.moon-experience canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 100svh;
  touch-action: none;
  cursor: crosshair;
}
.moon-experience canvas:focus-visible {
  outline: 2px solid rgb(215 235 255 / 0.85);
  outline-offset: -6px;
}
.moon-hud {
  position: absolute;
  top: clamp(14px, 3vw, 24px);
  right: clamp(14px, 3vw, 28px);
  z-index: 2;
  display: flex;
  gap: 16px;
  padding: 10px 14px;
  border: 1px solid rgb(235 240 255 / 0.16);
  border-radius: 12px;
  background: rgb(11 15 28 / 0.72);
  backdrop-filter: blur(10px);
  color: #edf2fb;
}
.moon-hud__badge {
  display: grid;
  gap: 3px;
}
.moon-hud small {
  color: rgb(210 225 245 / 0.6);
  font-family: var(--studio-mono);
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.moon-hud strong {
  font-family: var(--studio-mono);
  font-size: 0.76rem;
  font-weight: 500;
}
.moon-hud strong[data-kind="stable"] { color: #dff0a6; }
.moon-hud strong[data-kind="eccentric"] { color: #bde8f5; }
.moon-hud strong[data-kind="wide"] { color: #c4d7f8; }
.moon-hud strong[data-kind="escape"] { color: #a4bfe8; }
.moon-hud strong[data-kind="impact"] { color: #fca28b; }

.moon-hint {
  position: absolute;
  left: clamp(14px, 3vw, 28px);
  bottom: clamp(14px, 3vw, 24px);
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 13px;
  border: 1px solid rgb(235 240 255 / 0.14);
  border-radius: 10px;
  background: rgb(11 15 28 / 0.65);
  backdrop-filter: blur(8px);
  color: rgb(237 242 251 / 0.88);
  font-family: var(--studio-mono);
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  pointer-events: none;
  transition: opacity 240ms ease;
}
.moon-hint.is-hidden {
  opacity: 0;
}
.moon-hint__arrow {
  color: #dff0a6;
}

.moon-outcome {
  position: absolute;
  left: 50%;
  bottom: clamp(24px, 6vw, 48px);
  transform: translateX(-50%);
  z-index: 3;
  display: grid;
  gap: 10px;
  width: min(440px, calc(100vw - 32px));
  padding: 24px 28px;
  border: 1px solid rgb(235 240 255 / 0.2);
  border-radius: 16px;
  background: rgb(11 15 28 / 0.88);
  backdrop-filter: blur(14px);
  color: #edf2fb;
  text-align: center;
  box-shadow: 0 20px 48px rgb(0 0 0 / 0.5);
  animation: moon-pop 320ms cubic-bezier(0.2, 0.9, 0.3, 1);
}
.moon-outcome[hidden] {
  display: none !important;
}
.moon-outcome__eyebrow {
  margin: 0;
  color: rgb(190 205 235 / 0.68);
  font-family: var(--studio-mono);
  font-size: 0.62rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
.moon-outcome h2 {
  margin: 0;
  font-family: var(--studio-display);
  font-size: clamp(1.8rem, 3.4vw, 2.4rem);
  font-weight: 400;
  letter-spacing: -0.04em;
  line-height: 1.1;
  color: #f6f9fe;
}
.moon-outcome p {
  margin: 0;
  color: rgb(215 228 245 / 0.82);
  font-size: 0.92rem;
  line-height: 1.45;
}
.moon-outcome__actions {
  display: flex;
  justify-content: center;
  margin-top: 6px;
}
.moon-outcome .primary-action {
  min-height: 44px;
  padding: 10px 22px;
  border: 1px solid #edf2fb;
  border-radius: 8px;
  background: #edf2fb;
  color: #0c101d;
  font-family: var(--studio-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease;
}
.moon-outcome .primary-action:hover,
.moon-outcome .primary-action:focus-visible {
  background: #fff;
  transform: translateY(-2px);
}
@keyframes moon-pop {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(14px) scale(0.96);
  }
}

/* Tarot Cards — Tarot Experience */
.tarot-experience [hidden],
.tarot-table [hidden],
.tarot-workspace [hidden],
.tarot-question-area[hidden],
.tarot-selected-question[hidden],
.tarot-deck-area[hidden],
.tarot-fan-area[hidden],
.tarot-spread-area[hidden],
.tarot-synthesis[hidden] {
  display: none !important;
}

.tarot-experience {
  --tarot-bg: #0a0e1a;
  --tarot-table: #101b35;
  --tarot-wine: #721f35;
  --tarot-wine-light: #9c3547;
  --tarot-parchment: #f0dfb5;
  --tarot-parchment-dark: #d8bd83;
  --tarot-gold: #d69b32;
  --tarot-gold-dim: #ad7627;
  --tarot-gold-bright: #ffd66b;
  --tarot-silver: #d6dbea;
  --tarot-ink: #101524;
  --tarot-ink-soft: #2c364f;
  position: relative;
  display: flex;
  min-height: 100svh;
  flex-direction: column;
  padding: clamp(90px, 10vw, 130px) max(20px, calc((100vw - 1280px) / 2)) 60px;
  color: var(--tarot-parchment);
  background:
    radial-gradient(ellipse at 50% 10%, #1e2948 0%, transparent 60%),
    radial-gradient(circle at 85% 85%, #2a1122 0%, transparent 50%),
    linear-gradient(180deg, #090d17 0%, #0d1322 50%, #080c16 100%);
  isolation: isolate;
}

.tarot-experience--loading {
  align-items: center;
  justify-content: center;
  min-height: 100svh;
}
.tarot-asset-state {
  display: flex;
  width: min(520px, 100%);
  min-height: 300px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 36px;
  border: 1px solid rgb(214 155 50 / 0.38);
  background: rgb(9 16 33 / 0.8);
  box-shadow: inset 0 0 60px rgb(0 0 0 / 0.45);
  text-align: center;
}
.tarot-asset-state h1 {
  margin: 4px 0 12px;
  color: var(--tarot-parchment);
  font-family: var(--studio-display);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 400;
}
.tarot-asset-state p:last-of-type {
  max-width: 38ch;
  margin: 0;
  color: var(--tarot-silver);
  line-height: 1.55;
}
.tarot-asset-state .tarot-btn { margin-top: 24px; }
.tarot-asset-state__spark {
  width: 18px;
  height: 18px;
  margin-bottom: 22px;
  border: 1px solid var(--tarot-gold-bright);
  background: var(--tarot-gold);
  box-shadow: 0 0 24px rgb(255 214 107 / 0.55);
  transform: rotate(45deg);
  animation: tarot-asset-pulse 1.4s ease-in-out infinite alternate;
}

.tarot-intro {
  margin-bottom: clamp(24px, 4vw, 42px);
}
.tarot-intro .game-eyebrow {
  color: var(--tarot-gold);
}
.tarot-title {
  margin: 0 0 12px;
  font-family: var(--studio-display);
  font-size: clamp(3rem, 7vw, 6.5rem);
  font-weight: 400;
  letter-spacing: -0.06em;
  line-height: 0.9;
  color: var(--tarot-parchment);
}
.tarot-title i {
  color: var(--tarot-gold-bright);
  font-style: italic;
}
.tarot-desc {
  max-width: 58ch;
  margin: 0;
  color: var(--tarot-silver);
  font-size: clamp(0.95rem, 1.8vw, 1.12rem);
  line-height: 1.55;
  opacity: 0.88;
}

.tarot-question-area {
  display: grid;
  gap: 28px;
  padding: clamp(8px, 2vw, 20px);
  background: rgb(7 14 30 / 0.5);
}
.tarot-question-intro { max-width: 620px; }
.tarot-question-intro h2 {
  margin: 5px 0 8px;
  color: var(--tarot-parchment);
  font-family: var(--studio-display);
  font-size: clamp(2rem, 4vw, 3.4rem);
  font-weight: 400;
  letter-spacing: -0.04em;
}
.tarot-question-intro > p:last-child {
  margin: 0;
  color: var(--tarot-silver);
  line-height: 1.5;
}
.tarot-question-groups { display: grid; gap: 24px; }
.tarot-question-group { display: grid; gap: 10px; }
.tarot-question-group h3 {
  margin: 0;
  color: var(--tarot-gold);
  font-family: var(--studio-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}
.tarot-question-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.tarot-question {
  min-height: 58px;
  padding: 13px 15px;
  border: 1px solid rgb(214 155 50 / 0.34);
  background: rgb(8 15 32 / 0.76);
  color: var(--tarot-parchment);
  cursor: pointer;
  font: inherit;
  line-height: 1.35;
  text-align: left;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}
.tarot-question:hover, .tarot-question:focus-visible {
  border-color: var(--tarot-gold-bright);
  background: rgb(33 42 70 / 0.9);
  outline: none;
  transform: translateY(-1px);
}
.tarot-selected-question {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 6px 14px;
  align-items: center;
  margin-bottom: 18px;
  padding: 12px 14px;
  border: 1px solid rgb(214 155 50 / 0.38);
  background: rgb(7 14 30 / 0.78);
}
.tarot-selected-question > span,
.tarot-selected-question > small {
  color: var(--tarot-gold);
  font-family: var(--studio-mono);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.tarot-selected-question > strong {
  color: var(--tarot-parchment);
  font-family: var(--studio-display);
  font-size: 1.12rem;
  font-weight: 500;
}
.tarot-selected-question > small {
  grid-column: 2 / 3;
  color: var(--tarot-silver);
  letter-spacing: 0;
  line-height: 1.4;
  text-transform: none;
}
.tarot-selected-question button {
  grid-column: 3;
  grid-row: 1 / span 2;
  padding: 8px 10px;
  border: 1px solid rgb(214 155 50 / 0.48);
  background: transparent;
  color: var(--tarot-gold-bright);
  cursor: pointer;
  font-family: var(--studio-mono);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.tarot-selected-question button:hover, .tarot-selected-question button:focus-visible {
  border-color: var(--tarot-gold-bright);
  background: rgb(214 155 50 / 0.12);
}

.tarot-table {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 520px;
  padding: clamp(20px, 3.5vw, 44px);
  overflow: hidden;
  border: 1px solid rgb(214 155 50 / 0.5);
  border-radius: 6px;
  background: #101b35;
  box-shadow: inset 0 0 90px rgb(0 0 0 / 0.66), 0 24px 60px rgb(0 0 0 / 0.48);
}

.tarot-table__atmosphere {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.tarot-table__background {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: crisp-edges;
  image-rendering: pixelated;
}
.tarot-table__atmosphere::after {
  position: absolute;
  inset: 0;
  content: "";
  background: rgb(5 10 24 / 0.18);
  box-shadow: inset 0 0 80px rgb(0 0 0 / 0.52);
}
.tarot-table__decorations {
  position: absolute;
  z-index: 1;
  top: 2%;
  right: 1%;
  width: min(38vw, 330px);
  height: auto;
  opacity: 0.9;
  filter: drop-shadow(0 8px 10px rgb(0 0 0 / 0.28));
  image-rendering: crisp-edges;
  image-rendering: pixelated;
  animation: tarot-atmosphere-drift 6s ease-in-out infinite alternate;
}
.tarot-workspace {
  position: relative;
  z-index: 2;
}

/* Stage 1: Deck Area */
.tarot-deck-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 440px;
  padding: 40px 20px;
  text-align: center;
}
.tarot-deck {
  position: relative;
  width: 140px;
  height: 222px;
  cursor: pointer;
  outline: none;
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.tarot-deck:hover, .tarot-deck:focus-visible {
  transform: translateY(-8px) scale(1.03);
}
.tarot-deck:focus-visible {
  outline: 3px solid var(--tarot-gold-bright);
  outline-offset: 8px;
  border-radius: 8px;
}
.tarot-deck__layer {
  position: absolute;
  inset: 0;
  border-radius: 6px;
  border: 1px solid var(--tarot-gold-dim);
  overflow: hidden;
  background: var(--tarot-table);
  box-shadow: 0 10px 25px rgb(0 0 0 / 0.5);
}
.tarot-deck__layer--3 {
  transform: translate(6px, 6px);
  border-color: #2b1d12;
}
.tarot-deck__layer--2 {
  transform: translate(3px, 3px);
  border-color: #4a341b;
}
.tarot-deck__layer--1 {
  transform: translate(0, 0);
  overflow: hidden;
}
.tarot-card__back-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: crisp-edges;
  image-rendering: pixelated;
}
.tarot-deck-prompt {
  margin-top: 32px;
}
.tarot-prompt-text {
  margin: 0 0 16px;
  color: var(--tarot-silver);
  font-family: var(--studio-display);
  font-size: 1.45rem;
  letter-spacing: -0.01em;
}

/* Stage 2: Fan Area */
.tarot-fan-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-bottom: 24px;
  margin-bottom: 20px;
  border-bottom: 1px dashed rgb(212 175 55 / 0.2);
}
.tarot-fan-header {
  margin-bottom: 24px;
}
.tarot-fan-instructions {
  margin: 0;
  color: var(--tarot-gold-bright);
  font-family: var(--studio-mono);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.tarot-fan-container {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  height: 170px;
  padding: 10px 0 20px;
  width: 100%;
  overflow-x: auto;
  overflow-y: visible;
}
.tarot-fan-card {
  position: relative;
  width: 82px;
  height: 130px;
  margin-inline: -14px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  transform-origin: 50% 120%;
  transform: translateY(var(--fan-y, 0)) rotate(var(--fan-rot, 0deg));
  transition: transform 0.2s ease, filter 0.2s ease, opacity 0.3s ease;
  flex-shrink: 0;
}
.tarot-fan-card .tarot-card__back-image {
  width: 100%;
  height: 100%;
  border-radius: 5px;
  box-shadow: 0 6px 16px rgb(0 0 0 / 0.4);
}
.tarot-fan-card:hover:not(:disabled), .tarot-fan-card:focus-visible:not(:disabled) {
  z-index: 10;
  transform: translateY(-24px) scale(1.18) rotate(0deg);
  filter: drop-shadow(0 0 12px var(--tarot-gold-bright));
  outline: none;
}
.tarot-fan-card:disabled {
  opacity: 0.18;
  cursor: default;
  pointer-events: none;
  transform: translateY(16px) scale(0.9);
}

/* Stage 3 & 4: Spread Slots */
.tarot-spread-area {
  display: flex;
  flex-direction: column;
  gap: 32px;
}
.tarot-slots-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(14px, 2.5vw, 28px);
  align-items: start;
}
.tarot-slot {
  display: flex;
  flex-direction: column;
  padding: clamp(14px, 2vw, 20px);
  border: 1px solid rgb(212 175 55 / 0.2);
  border-radius: 4px;
  background: rgb(15 22 41 / 0.7);
}
.tarot-slot__header {
  display: flex;
  flex-direction: column;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgb(212 175 55 / 0.15);
}
.tarot-slot__number {
  color: var(--tarot-gold);
  font-family: var(--studio-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.tarot-slot__title {
  color: var(--tarot-parchment);
  font-family: var(--studio-display);
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  font-weight: 400;
  margin: 4px 0 2px;
}
.tarot-slot__subtitle {
  color: var(--tarot-silver);
  font-family: var(--studio-mono);
  font-size: 0.65rem;
  letter-spacing: 0.04em;
  opacity: 0.75;
}

.tarot-slot__card-holder {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 225px;
  padding: 10px 0;
}
.tarot-slot__placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 125px;
  height: 198px;
  border: 1.5px dashed rgb(212 175 55 / 0.35);
  border-radius: 6px;
  background: rgb(12 18 34 / 0.4);
}
.tarot-slot__placeholder-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1px solid var(--tarot-gold);
  margin-bottom: 8px;
}
.tarot-slot__placeholder-text {
  color: var(--tarot-gold-dim);
  font-family: var(--studio-mono);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Placed Cards & 3D Flip */
.tarot-placed-card {
  position: relative;
  width: 130px;
  height: 206px;
  perspective: 1000px;
  cursor: pointer;
  outline: none;
}
.tarot-placed-card:focus-visible {
  outline: 3px solid var(--tarot-gold-bright);
  outline-offset: 4px;
  border-radius: 8px;
}
.tarot-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.65s cubic-bezier(0.34, 1.56, 0.64, 1);
  border-radius: 6px;
  box-shadow: 0 10px 30px rgb(0 0 0 / 0.45);
}
.tarot-placed-card.is-flipped .tarot-card-inner {
  transform: rotateY(180deg);
}
.tarot-card-front, .tarot-card-back {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 6px;
  overflow: hidden;
}
.tarot-card-back {
  transform: rotateY(0deg);
}
.tarot-card-front {
  transform: rotateY(180deg);
  background: var(--tarot-parchment);
  color: var(--tarot-ink);
  display: flex;
  flex-direction: column;
}

.tarot-card__face-inner {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--tarot-parchment);
}
.tarot-card__numeral {
  position: absolute;
  z-index: 2;
  top: 7px;
  left: 50%;
  min-width: 24px;
  padding: 2px 6px;
  border: 1px solid rgb(173 118 39 / 0.55);
  background: rgb(240 223 181 / 0.92);
  font-family: var(--studio-display);
  font-size: 0.78rem;
  font-weight: 700;
  color: #664012;
  letter-spacing: 0.1em;
  line-height: 1;
  text-align: center;
  transform: translateX(-50%);
}
.tarot-card__art {
  position: absolute;
  inset: 0;
  transition: transform 0.3s ease;
}
.tarot-card__art.is-reversed-art {
  transform: rotate(180deg);
}
.tarot-card__face-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: crisp-edges;
  image-rendering: pixelated;
}
.tarot-card__label {
  position: absolute;
  z-index: 2;
  right: 8px;
  bottom: 7px;
  left: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 5px 4px 4px;
  border: 1px solid rgb(173 118 39 / 0.58);
  background: rgb(240 223 181 / 0.94);
  text-align: center;
}
.tarot-card__name {
  font-family: var(--studio-display);
  font-size: 0.73rem;
  font-weight: 700;
  color: var(--tarot-ink);
  line-height: 1.15;
}
.tarot-card__badge {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 2px;
  font-family: var(--studio-mono);
  font-size: 0.52rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.tarot-card__badge.is-upright-badge {
  background: #e2ecd9;
  color: #2b5722;
}
.tarot-card__badge.is-reversed-badge {
  background: #f6e2e2;
  color: #852222;
}

/* Individual Reading Panels */
.tarot-card-reading-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgb(212 175 55 / 0.2);
  animation: panel-fade-in 0.4s ease-out;
}
.tarot-reading__header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.tarot-reading__name {
  font-family: var(--studio-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--tarot-gold-bright);
}
.tarot-reading__orientation {
  font-family: var(--studio-mono);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.tarot-reading__orientation.is-upright {
  color: #85e085;
}
.tarot-reading__orientation.is-reversed {
  color: #e09090;
}
.tarot-reading__keywords {
  margin: 0;
  color: var(--tarot-silver);
  font-family: var(--studio-mono);
  font-size: 0.64rem;
  letter-spacing: 0.04em;
  opacity: 0.85;
}
.tarot-reading__text {
  margin: 0;
  color: var(--tarot-parchment);
  font-size: 0.88rem;
  line-height: 1.48;
}

/* Spread Controls */
.tarot-spread-controls {
  display: flex;
  justify-content: center;
  padding: 10px 0;
}

/* Buttons */
.tarot-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  border: 1px solid var(--tarot-gold);
  font-family: var(--studio-mono);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s ease;
}
.tarot-btn.primary-action {
  background: var(--tarot-gold);
  color: var(--tarot-ink);
  font-weight: 700;
}
.tarot-btn.primary-action:hover, .tarot-btn.primary-action:focus-visible {
  background: var(--tarot-gold-bright);
  box-shadow: 0 0 16px rgb(250 225 136 / 0.4);
}
.tarot-btn.secondary-action {
  background: rgb(212 175 55 / 0.12);
  color: var(--tarot-gold-bright);
}
.tarot-btn.secondary-action:hover, .tarot-btn.secondary-action:focus-visible {
  background: rgb(212 175 55 / 0.24);
}

/* Stage 5: Synthesis Card */
.tarot-synthesis {
  margin-top: 14px;
}
.tarot-synthesis__card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: clamp(24px, 4vw, 40px);
  border: 1px solid rgb(212 175 55 / 0.35);
  border-radius: 4px;
  background: rgb(15 22 41 / 0.85);
  color: var(--tarot-parchment);
}
.tarot-synthesis__title {
  margin: 0;
  font-family: var(--studio-display);
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  font-weight: 400;
  letter-spacing: -0.03em;
  color: var(--tarot-gold-bright);
}
.tarot-synthesis__text {
  max-width: 68ch;
  margin: 0;
  font-size: clamp(1rem, 1.8vw, 1.15rem);
  line-height: 1.6;
  color: var(--tarot-parchment);
}
.tarot-synthesis__evidence {
  max-width: 72ch;
  margin: 0;
  color: var(--tarot-silver);
  line-height: 1.55;
}
.tarot-synthesis__action {
  display: grid;
  gap: 6px;
  max-width: 72ch;
  padding: 15px 17px;
  border-left: 3px solid var(--tarot-gold-bright);
  background: rgb(214 155 50 / 0.1);
}
.tarot-synthesis__action small {
  color: var(--tarot-gold);
  font-family: var(--studio-mono);
  font-size: 0.64rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
.tarot-synthesis__action p { margin: 0; color: var(--tarot-parchment); line-height: 1.5; }
.tarot-synthesis__flow {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  padding: 16px 0;
  border-block: 1px solid rgb(212 175 55 / 0.2);
}
.tarot-synthesis__node {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.tarot-synthesis__node-label {
  color: var(--tarot-gold);
  font-family: var(--studio-mono);
  font-size: 0.64rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.tarot-synthesis__node-name {
  font-family: var(--studio-display);
  font-size: 0.96rem;
  color: var(--tarot-parchment);
}
.tarot-synthesis__node-summary {
  color: var(--tarot-silver);
  font-size: 0.78rem;
  line-height: 1.35;
  opacity: 0.85;
}
.tarot-synthesis__disclaimer {
  margin: 0;
  color: var(--tarot-silver);
  font-family: var(--studio-mono);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  opacity: 0.7;
}
.tarot-synthesis__actions {
  margin-top: 10px;
}

@keyframes tarot-asset-pulse {
  from { opacity: 0.55; transform: rotate(45deg) scale(0.78); }
  to { opacity: 1; transform: rotate(45deg) scale(1); }
}

@keyframes tarot-atmosphere-drift {
  from { transform: translate3d(0, -2px, 0); opacity: 0.82; }
  to { transform: translate3d(-3px, 3px, 0); opacity: 0.94; }
}

/* ==========================================================================
   The Red String Department
   ========================================================================== */

.game-page--red-string {
  --game-hue: 162;
  --rs-board-bg: #1c2e26;
  --rs-board-felt: #243b31;
  --rs-board-grid: #182821;
  --rs-paper-cream: #faf7ee;
  --rs-paper-aged: #f2ece0;
  --rs-paper-tag: #decfb1;
  --rs-paper-sticky: #fbf5cd;
  --rs-paper-blueprint: #1d3342;
  --rs-ink-dark: #19211d;
  --rs-ink-muted: #4d5752;
  --rs-string-red: #c22727;
  --rs-string-glow: #ff4747;
  --rs-pin-brass: #d9a334;
  --rs-pin-red: #b82424;
  --rs-border-rule: #364a40;
}

.rs-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--game-rule);
}

.rs-title {
  margin: 4px 0 0;
  font-family: var(--studio-display);
  font-size: clamp(2.4rem, 5vw, 4.4rem);
  font-weight: 400;
  letter-spacing: -0.06em;
  line-height: 0.92;
}

.rs-case-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rs-case-select-wrap {
  position: relative;
}

.rs-select {
  min-height: 42px;
  padding: 8px 32px 8px 12px;
  border: 1px solid var(--game-ink);
  background: var(--game-paper);
  color: var(--game-ink);
  font-family: var(--studio-mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  cursor: pointer;
  border-radius: 2px;
  appearance: auto;
}

.rs-nav-btn {
  min-height: 42px;
  padding: 8px 14px;
  font-family: var(--studio-mono);
  font-size: 0.76rem;
}

/* Incident Bar */
.rs-incident-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  margin-bottom: 24px;
  padding: 18px 24px;
  border: 1px solid var(--game-ink);
  background: var(--rs-paper-cream);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.rs-incident-badge-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}

.rs-tag {
  display: inline-block;
  padding: 3px 8px;
  background: var(--game-ink);
  color: var(--game-paper);
  font-family: var(--studio-mono);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rs-solved-badge {
  display: inline-block;
  padding: 3px 8px;
  border: 1px solid #1f6e43;
  background: #e8f5ed;
  color: #1f6e43;
  font-family: var(--studio-mono);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.rs-solved-badge[hidden],
.rs-closed-card[hidden] {
  display: none !important;
}

.rs-case-title {
  margin: 0 0 6px;
  font-family: var(--studio-display);
  font-size: clamp(1.4rem, 2.5vw, 2.1rem);
  font-weight: 400;
  letter-spacing: -0.03em;
}

.rs-case-summary {
  margin: 0;
  color: var(--rs-ink-muted);
  font-size: 0.94rem;
  line-height: 1.48;
  max-width: 80ch;
}

/* Spool Widget */
.rs-spool-widget {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  border: 1px solid var(--game-rule);
  background: #ede6d6;
  border-radius: 4px;
}

.rs-spool-icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

.rs-spool-info {
  display: flex;
  flex-direction: column;
}

.rs-spool-count {
  font-family: var(--studio-display);
  font-size: 1.35rem;
  line-height: 1;
  color: var(--game-ink);
}

.rs-spool-count strong {
  color: var(--rs-string-red);
}

.rs-spool-label {
  margin-top: 3px;
  font-family: var(--studio-mono);
  font-size: 0.64rem;
  letter-spacing: 0.07em;
  color: var(--rs-ink-muted);
}

/* Workspace Layout */
.rs-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(340px, 0.55fr);
  gap: 24px;
  align-items: start;
}

/* Evidence Board */
.rs-board-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rs-board-wrapper {
  position: relative;
  border: 2px solid #14211a;
  background: var(--rs-board-bg);
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.55), 0 16px 48px rgba(0, 0, 0, 0.18);
  border-radius: 4px;
  overflow: hidden;
}

.rs-board {
  position: relative;
  min-height: 640px;
  padding: 28px 24px 36px;
  background-color: var(--rs-board-felt);
  background-image: 
    linear-gradient(var(--rs-board-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--rs-board-grid) 1px, transparent 1px);
  background-size: 40px 40px;
}

.rs-string-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
}

.rs-string-group {
  cursor: pointer;
}

.rs-string-shadow {
  fill: none;
  stroke: rgba(0, 0, 0, 0.35);
  stroke-width: 4px;
  stroke-linecap: round;
  transform: translateY(2.5px);
}

.rs-string-line {
  fill: none;
  stroke: var(--rs-string-red);
  stroke-width: 2.8px;
  stroke-linecap: round;
  transition: stroke 150ms ease, stroke-width 150ms ease, filter 150ms ease;
}

.rs-string-line--active {
  stroke: #ff3838;
  stroke-width: 3.2px;
  stroke-dasharray: 6 3;
  animation: rsDash 0.8s linear infinite;
  filter: drop-shadow(0 0 6px rgba(255, 56, 56, 0.7));
}

.rs-string-knot--needle {
  fill: #ff4747;
  stroke: #ffffff;
  stroke-width: 1.5px;
  filter: drop-shadow(0 0 4px rgba(255, 71, 71, 0.8));
}

@keyframes rsDash {
  to {
    stroke-dashoffset: -18;
  }
}

.rs-string-knot {
  fill: #801818;
  stroke: #1a211e;
  stroke-width: 1.2px;
}

.rs-string-hit {
  fill: none;
  stroke: transparent;
  stroke-width: 32px;
  pointer-events: stroke;
  cursor: pointer;
}

.rs-string-group:hover .rs-string-line,
.rs-string-hit:focus-visible + .rs-string-line,
.rs-string-group.is-selected .rs-string-line {
  stroke: var(--rs-string-glow);
  stroke-width: 3.8px;
  filter: drop-shadow(0 0 5px rgba(255, 60, 60, 0.7));
}

.rs-string-hit:focus-visible {
  outline: 2px dashed #ffffff;
}

.rs-board-instructions {
  padding: 4px 8px;
  color: var(--game-muted);
}

/* Evidence Container Grid */
.rs-evidence-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 24px 18px;
  position: relative;
  z-index: 5;
}

/* Evidence Card Types */
.rs-evidence-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--rs-ink-dark);
  background: var(--rs-paper-cream);
  color: var(--rs-ink-dark);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.22);
  transition: transform 140ms ease, box-shadow 140ms ease, outline 140ms ease, border-color 140ms ease;
  cursor: pointer;
  user-select: none;
}

.rs-evidence-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.32);
}

.rs-evidence-card.is-pin-selected {
  outline: 3px solid #ff4747;
  box-shadow: 0 0 16px rgba(255, 71, 71, 0.45);
  transform: translateY(-3px);
}

.rs-evidence-card.is-target-hover {
  outline: 2px dashed #ff6b6b;
  box-shadow: 0 0 14px rgba(255, 107, 107, 0.6), 0 8px 22px rgba(0, 0, 0, 0.35);
  transform: translateY(-3px) scale(1.02);
}

/* Pin Wrap & Pin Button */
.rs-evidence-pin-wrap {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
}

.rs-evidence-pin-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.rs-pin-head {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ff6b6b, var(--rs-pin-red) 70%, #540e0e);
  border: 1.5px solid #1a211e;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4), inset 0 0 0 1.5px var(--rs-pin-brass);
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.rs-evidence-pin-btn:hover .rs-pin-head,
.rs-evidence-pin-btn:focus-visible .rs-pin-head,
.rs-evidence-card.is-pin-selected .rs-pin-head {
  transform: scale(1.22);
  box-shadow: 0 0 8px #ff4747, 0 3px 7px rgba(0, 0, 0, 0.5);
}

.rs-evidence-body {
  display: flex;
  flex-direction: column;
  padding: 16px 12px 14px;
}

.rs-evidence-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px dashed rgba(0, 0, 0, 0.2);
}

.rs-evidence-type {
  font-family: var(--studio-mono);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--rs-ink-muted);
}

.rs-evidence-meta {
  font-family: var(--studio-mono);
  font-size: 0.62rem;
  color: var(--rs-ink-muted);
}

.rs-evidence-main {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.rs-evidence-prop-svg {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
}

.rs-evidence-text {
  flex: 1;
  min-width: 0;
}

.rs-evidence-title {
  margin: 0 0 4px;
  font-family: var(--studio-display);
  font-size: 0.94rem;
  line-height: 1.25;
}

.rs-evidence-desc {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.38;
  color: #2b3631;
}

/* Specific Card Styling per type */
.rs-evidence--receipt {
  background: #faf8f2;
  font-family: var(--studio-mono);
  border-style: solid;
  border-top-style: dashed;
}
.rs-evidence--receipt .rs-evidence-title { font-family: var(--studio-mono); font-size: 0.84rem; }

.rs-evidence--photo {
  background: #fbfaf5;
  padding: 4px;
  border: 4px solid #fbfaf5;
  box-shadow: 0 6px 14px rgba(0,0,0,0.3);
}
.rs-evidence--photo .rs-evidence-body { padding: 8px; background: #faf8f0; }

.rs-evidence--memo {
  background: #f6f1e5;
  border-left: 3px solid #6b5c46;
}

.rs-evidence--sticky {
  background: var(--rs-paper-sticky);
  border-color: #d1c890;
}

.rs-evidence--blueprint {
  background: var(--rs-paper-blueprint);
  color: #e5f1f7;
  border-color: #0e1c26;
}
.rs-evidence--blueprint .rs-evidence-header { border-bottom-color: rgba(255,255,255,0.2); }
.rs-evidence--blueprint .rs-evidence-type,
.rs-evidence--blueprint .rs-evidence-meta,
.rs-evidence--blueprint .rs-evidence-desc { color: #b7d5e6; }

.rs-evidence--tag {
  background: var(--rs-paper-tag);
  border-color: #8c7c5c;
  clip-path: polygon(10px 0, 100% 0, 100% 100%, 0 100%, 0 10px);
}

.rs-evidence--calendar {
  background: #fcfbf7;
  border-top: 5px solid #9e2b2b;
}

/* Sidebar Styling */
.rs-sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.rs-sidebar-heading {
  margin: 0 0 12px;
  font-family: var(--studio-display);
  font-size: 1.25rem;
  font-weight: 400;
  letter-spacing: -0.02em;
}

.rs-suspects-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rs-suspect-card {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--game-ink);
  background: var(--rs-paper-cream);
  color: var(--game-ink);
  text-align: left;
  cursor: pointer;
  border-radius: 2px;
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}

.rs-suspect-card:hover {
  transform: translateX(2px);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.rs-suspect-card.is-selected {
  outline: 2px solid var(--game-ink);
  background: #ede6d6;
  border-left: 5px solid var(--rs-string-red);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.14);
}

.rs-suspect-portrait-wrap {
  width: 56px;
  height: 56px;
  border: 1px solid #1a211e;
  overflow: hidden;
  background: #ded7c6;
  border-radius: 2px;
}

.rs-suspect-portrait {
  width: 100%;
  height: 100%;
}

.rs-suspect-role {
  display: block;
  font-family: var(--studio-mono);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  color: var(--rs-ink-muted);
  text-transform: uppercase;
}

.rs-suspect-name {
  display: block;
  font-size: 0.95rem;
  margin: 1px 0 3px;
}

.rs-suspect-statement {
  margin: 0;
  font-size: 0.74rem;
  line-height: 1.3;
  color: #3b423e;
  font-style: italic;
}

/* Filing Panel & Status */
.rs-filing-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.rs-status-box {
  padding: 14px;
  border: 1px solid var(--game-ink);
  background: #faf7ed;
  line-height: 1.4;
  font-size: 0.85rem;
  border-radius: 2px;
}

.rs-status-badge {
  display: inline-block;
  margin-bottom: 6px;
  padding: 2px 7px;
  background: var(--game-ink);
  color: var(--game-paper);
  font-family: var(--studio-mono);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.rs-status-box[data-state="rejected"] {
  border-color: var(--rs-string-red);
  background: #fdf2f2;
}
.rs-status-box[data-state="rejected"] .rs-status-badge {
  background: var(--rs-string-red);
}

.rs-status-box[data-state="closed"] {
  border-color: #1f6e43;
  background: #f0f7f2;
}
.rs-status-box[data-state="closed"] .rs-status-badge {
  background: #1f6e43;
}

.rs-status-box[data-state="hint"] {
  border-color: #695628;
  background: #fcf9ec;
}
.rs-status-box[data-state="hint"] .rs-status-badge {
  background: #695628;
}

.rs-status-text {
  margin: 0;
  color: #26312c;
}

.rs-actions-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rs-submit-action {
  width: 100%;
  font-size: 0.96rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.rs-secondary-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.rs-hint-action, .rs-clear-action {
  font-size: 0.76rem;
  padding: 8px 10px;
}

/* Case Closed Banner */
.rs-closed-card {
  position: relative;
  margin-top: 14px;
  padding: 20px;
  border: 2px solid #1f6e43;
  background: #f7faf8;
  box-shadow: 0 8px 24px rgba(31, 110, 67, 0.12);
  border-radius: 3px;
  animation: panel-fade-in 220ms ease;
}

.rs-closed-stamp {
  position: absolute;
  top: 14px;
  right: 14px;
  padding: 3px 9px;
  border: 2px solid var(--rs-string-red);
  color: var(--rs-string-red);
  font-family: var(--studio-sans);
  font-size: 0.85rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  transform: rotate(-6deg);
  opacity: 0.9;
}

.rs-closed-title {
  margin: 0 0 10px;
  font-family: var(--studio-display);
  font-size: 1.15rem;
  color: #1a422c;
}

.rs-resolution-content {
  margin: 0 0 14px;
  font-size: 0.86rem;
  line-height: 1.48;
  color: #203328;
}

.rs-aftermath-wrapper {
  padding: 10px;
  margin-bottom: 16px;
  background: #e9f2ec;
  border-left: 3px solid #1f6e43;
  font-size: 0.78rem;
  line-height: 1.4;
}

.rs-aftermath-tag {
  display: block;
  font-family: var(--studio-mono);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  color: #1f6e43;
  margin-bottom: 3px;
}

.rs-advance-btn {
  width: 100%;
  background: #1f6e43;
  border-color: #1f6e43;
}
.rs-advance-btn:hover {
  background: #155231;
}

/* Responsive Overrides */
@media (max-width: 960px) {
  .tarot-slots-grid {
    grid-template-columns: 1fr;
  }
  .tarot-synthesis__flow {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .tarot-experience {
    padding: 85px 12px 34px;
  }
  .tarot-table {
    padding: 14px 10px 18px;
  }
  .tarot-question-grid { grid-template-columns: 1fr; }
  .tarot-question-area { padding-inline: 2px; }
  .tarot-question { min-height: 52px; }
  .tarot-selected-question { grid-template-columns: 1fr auto; }
  .tarot-selected-question > span { grid-column: 1 / -1; }
  .tarot-selected-question > strong { grid-column: 1; }
  .tarot-selected-question > small { grid-column: 1 / -1; }
  .tarot-selected-question button { grid-column: 2; grid-row: 2; }
  .tarot-table__decorations { width: 235px; opacity: 0.72; }
  .tarot-fan-container {
    height: 150px;
  }
  .tarot-fan-card {
    width: 68px;
    height: 108px;
    margin-inline: -18px;
  }
  .tarot-placed-card {
    width: 132px;
    height: 209px;
  }
}

@media (max-height: 700px) and (min-width: 681px) {
  .tarot-experience { padding-top: 72px; padding-bottom: 28px; }
  .tarot-intro { margin-bottom: 20px; }
  .tarot-title { font-size: clamp(2.8rem, 10vh, 4.6rem); }
  .tarot-table { min-height: 430px; padding-block: 18px; }
  .tarot-deck-area { min-height: 370px; padding-block: 20px; }
}

@keyframes drift-a { from { transform: translate3d(-12px, -8px, 0) rotate(-5deg); } to { transform: translate3d(18px, 14px, 0) rotate(3deg); } }
@keyframes drift-b { from { transform: translate3d(16px, -12px, 0) rotate(7deg); } to { transform: translate3d(-20px, 18px, 0) rotate(-2deg); } }
@keyframes drift-c { from { transform: translate3d(-18px, 10px, 0) rotate(-4deg); } to { transform: translate3d(14px, -20px, 0) rotate(4deg); } }
@keyframes drift-d { from { transform: translate3d(-9px, -14px, 0) rotate(5deg); } to { transform: translate3d(19px, 8px, 0) rotate(-3deg); } }
@keyframes drift-e { from { transform: translate3d(5px, -13px, 0) rotate(-7deg); } to { transform: translate3d(-11px, 17px, 0) rotate(2deg); } }
@keyframes dialog-in { from { opacity: 0; transform: translateY(24px) scale(0.985); } }

@media (max-width: 960px) {
  .rs-workspace {
    grid-template-columns: 1fr;
  }
  .game-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: clamp(230px, 48vw, 340px);
  }
  .game-card__button { gap: 14px; padding: clamp(14px, 2.5vw, 24px); }
  .game-card__preview { width: clamp(116px, 22vw, 174px); }
  .game-card__name { font-size: clamp(1.4rem, 3.6vw, 2.15rem); }
  .game-intro { grid-template-columns: 0.28fr 1fr; }
  .game-intro > p:last-child { grid-column: 2; }
  .game-workspace { grid-template-columns: 1fr; }
  .game-stage { border-right: 0; border-bottom: 1px solid var(--game-rule); }
  .apology-workspace { grid-template-columns: 1fr; }
  .apology-composer { min-height: 480px; border-right: 0; border-bottom: 1px solid var(--game-rule); }
  .game-stage--coffee, .game-stage--coffee canvas,
  .game-stage--skip, .game-stage--skip canvas,
  .game-stage--moon, .game-stage--moon canvas { min-height: 610px; }
  .coffee-gate { background: radial-gradient(circle at 88% 38%, #ce8a44, transparent 45%), linear-gradient(128deg, #efe7d6, #c6845d); }
  .coffee-gate__content { width: min(680px, 72vw); }
  .coffee-gate__cup { right: -12vw; opacity: 0.52; }
  .coffee-gate__content > * { position: relative; z-index: 1; }
  .game-workspace--coffee { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .rs-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin-bottom: 14px;
    padding-bottom: 12px;
  }
  .rs-title {
    font-size: clamp(1.65rem, 6.5vw, 2.5rem);
    line-height: 1.05;
    word-break: break-word;
  }
  .rs-case-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
  }
  .rs-case-select-wrap {
    order: 1;
    width: 100%;
  }
  .rs-case-nav > .rs-nav-btn:first-of-type {
    order: 2;
    flex: 1;
  }
  .rs-case-nav > .rs-nav-btn:last-of-type {
    order: 3;
    flex: 1;
  }
  .rs-nav-btn {
    min-height: 38px;
    padding: 6px 12px;
    font-size: 0.76rem;
    text-align: center;
  }
  .rs-select {
    width: 100%;
    min-height: 38px;
    padding: 6px 10px;
    font-size: 0.76rem;
  }
  .rs-incident-bar {
    grid-template-columns: 1fr;
    padding: 14px 16px;
    gap: 14px;
  }
  .rs-board {
    min-height: 480px;
    padding: 16px 10px 20px;
  }
  .rs-evidence-container {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .rs-suspect-card {
    grid-template-columns: 48px 1fr;
    padding: 8px 10px;
  }
  .rs-suspect-portrait-wrap {
    width: 48px;
    height: 48px;
  }
  .studio-content { width: calc(100% - 20px); }
  .game-catalogue { padding-block: 10px; }
  .site-header { grid-template-columns: 1fr; gap: 18px; padding: 24px 2px 26px; }
  .site-wordmark h1 { font-size: clamp(3.8rem, 20vw, 6.4rem); }
  .site-byline { margin-top: 14px; }
  .site-actions { justify-content: space-between; }
  .game-grid { grid-auto-rows: clamp(210px, 61vw, 270px); }
  .game-card__button { gap: 10px; padding: 12px 10px; }
  .game-card__preview { width: clamp(104px, 38vw, 148px); }
  .game-card__name { font-size: clamp(1.08rem, 5.5vw, 1.55rem); }
  .game-dialog__chrome { top: 8px; }
  .game-page { padding: 92px 14px 34px; }
  .game-intro { grid-template-columns: 1fr; gap: 22px; margin-bottom: 42px; }
  .game-intro > p:last-child { grid-column: auto; }
  .game-intro h1 { font-size: clamp(3.65rem, 20vw, 6rem); }
  .game-workspace { min-height: 0; }
  .game-stage, .game-stage canvas { min-height: 420px; }
  .sunset-hint, .weight-hint { right: 12px; bottom: 12px; left: auto; }
  .defender-act { top: 12px; left: 12px; }
  .defender-hint { left: 12px; right: 12px; bottom: 12px; max-width: none; }
  .defender-advance { bottom: 66px; }
  .weight-credit { display: none; }
  .before-heading { top: 80px; left: 18px; }
  .before-heading h1 { font-size: clamp(3.15rem, 15vw, 4.8rem); line-height: 0.75; }
  .before-message { right: 12px; bottom: 59px; left: 12px; max-width: none; }
  .before-message strong { font-size: 1.05rem; }
  .before-message span { max-width: 48ch; }
  .before-timeline { right: 14px; bottom: 21px; left: 14px; }
  .before-outcome { top: 37%; right: 12px; bottom: auto; left: 12px; width: auto; padding: 20px; }
  .before-outcome strong { font-size: clamp(1.9rem, 9vw, 2.7rem); }
  .game-panel { padding: 26px 20px; }
  .apology-scene { grid-template-columns: 1fr; }
  .apology-face { min-height: 150px; border-top: 1px solid var(--game-rule); border-left: 0; }
  .apology-face span { font-size: 4.5rem; }
  .apology-composer, .phrase-bank { padding: 26px 20px; }
  .phrase { grid-template-columns: 78px 1fr; }
  .game-stage--coffee, .game-stage--coffee canvas,
  .game-stage--skip, .game-stage--skip canvas,
  .game-stage--moon, .game-stage--moon canvas { min-height: 500px; }
  .coffee-hud { top: 12px; right: 12px; gap: 11px; padding: 8px 9px; }
  .skip-hud { top: 66px; left: 12px; right: auto; gap: 11px; padding: 8px 11px; }
  .moon-hud { top: 66px; right: 12px; left: auto; gap: 11px; padding: 8px 11px; }
  .game-stage--coffee .stage-note { top: auto; bottom: 12px; }
  .coffee-gate { place-items: start; padding: 102px 22px 48px; background: linear-gradient(145deg, #efe7d6 0 64%, #c6845d 64%); }
  .coffee-gate__content { width: 100%; }
  .coffee-gate h1 { font-size: clamp(4.2rem, 20vw, 6.2rem); }
  .coffee-gate__lead { margin-top: 32px; }
  .coffee-gate__facts { grid-template-columns: 1fr; }
  .coffee-gate__facts span + span { padding-left: 0; border-top: 1px solid rgb(33 20 13 / 0.24); border-left: 0; }
  .coffee-gate__accept { align-items: flex-start; flex-direction: column; gap: 5px; }
  .coffee-gate__cup { right: -90px; bottom: -36px; width: 310px; opacity: 0.2; }
  .coffee-gpu-badge { display: none; }
  .coffee-hud { right: 12px; left: 12px; justify-content: space-between; }
  .coffee-hud span:last-child { display: none; }
  .coffee-intro h1 { font-size: clamp(3.25rem, 17vw, 5.5rem); }
}

@media (max-height: 560px) {
  .before-heading { top: 18px; left: 22px; }
  .before-heading p { display: none; }
  .before-heading h1 { font-size: clamp(2.4rem, 8.5vh, 4rem); line-height: 0.8; }
  .before-message { bottom: 48px; padding: 8px 11px; }
  .before-message strong { font-size: 1rem; }
  .before-timeline { bottom: 16px; }
  .before-outcome { top: 76px; right: 22px; bottom: auto; width: min(350px, calc(100% - 44px)); padding: 16px; }
  .before-outcome strong { font-size: clamp(1.55rem, 6vh, 2.2rem); }
  .before-outcome span { font-size: 0.84rem; }
  .before-outcome button { min-height: 42px; margin-top: 4px; padding: 8px 12px; }
}

@media (hover: none), (pointer: coarse) {
  .game-card__button::after { clip-path: polygon(2% 0, 100% 3%, 97% 100%, 0 96%); transform: rotate(0) scale(1.04); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
}

/* The Red Catalogue ------------------------------------------------------- */
.redcat-experience {
  --redcat-paper: #e5d5b7;
  --redcat-paper-light: #f1e7d4;
  --redcat-ink: #211815;
  --redcat-red: #a20f18;
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 100svh;
  overflow: hidden;
  background: #a89370;
  color: var(--redcat-ink);
  isolation: isolate;
}
.redcat-experience::after {
  position: absolute;
  z-index: 3;
  inset: 0;
  background:
    repeating-radial-gradient(circle at 18% 23%, rgb(43 25 18 / 0.07) 0 0.6px, transparent 0.8px 4px),
    linear-gradient(90deg, rgb(255 255 255 / 0.035), transparent 35%, rgb(31 16 12 / 0.055));
  content: "";
  opacity: 0.42;
  pointer-events: none;
}
.redcat-experience canvas {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 100svh;
  touch-action: none;
  cursor: crosshair;
}
.redcat-experience canvas:focus-visible { outline: 3px solid #f3dfb0; outline-offset: -7px; }
.redcat-hud {
  position: absolute;
  z-index: 5;
  top: 78px;
  right: 18px;
  left: 18px;
  display: grid;
  grid-template-columns: auto auto minmax(120px, 1fr) auto auto auto;
  gap: 12px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid rgb(36 22 17 / 0.45);
  background: rgb(236 220 191 / 0.96);
  box-shadow: 7px 8px 0 rgb(48 27 19 / 0.18);
  clip-path: polygon(0.4% 3%, 99.7% 0, 100% 93%, 0.7% 100%);
  pointer-events: none;
}
.redcat-hud__issue,
.redcat-count,
.redcat-weapon { display: grid; gap: 1px; }
.redcat-weapon {
  grid-template-columns: 1fr auto;
  align-items: baseline;
  column-gap: 10px;
}
.redcat-weapon strong { grid-column: 1 / -1; }
.redcat-hud__issue span,
.redcat-count span,
.redcat-weapon span {
  color: #735b48;
  font-family: var(--studio-mono);
  font-size: 0.54rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.redcat-hud__issue strong,
.redcat-count strong,
.redcat-weapon strong { font-family: var(--studio-display); font-size: 0.98rem; font-weight: 400; }
.redcat-health { display: flex; gap: 4px; }
.redcat-health.is-hit { animation: redcat-hud-shake 0.32s ease-out; }
@keyframes redcat-hud-shake {
  20% { transform: translateX(-4px); }
  45% { transform: translateX(4px); }
  70% { transform: translateX(-2px); }
}
.redcat-weapon.is-stamped strong { display: inline-block; animation: redcat-weapon-stamp 0.26s ease-out; }
@keyframes redcat-weapon-stamp {
  0% { transform: scale(1.4) rotate(-4deg); }
  100% { transform: scale(1) rotate(0deg); }
}
.redcat-health i {
  display: block;
  width: 13px;
  height: 20px;
  border: 1px solid #463024;
  background: #c5b18e;
  clip-path: polygon(5% 3%, 95% 0, 100% 91%, 54% 100%, 0 87%);
  transform: rotate(2deg);
}
.redcat-health i:nth-child(even) { transform: rotate(-3deg); }
.redcat-health i.is-full { background: var(--redcat-red); box-shadow: inset 5px 0 0 rgb(255 255 255 / 0.12); }
.redcat-progress { height: 8px; overflow: hidden; border: 1px solid #5c4638; background: #c7b593; }
.redcat-progress i { display: block; width: 100%; height: 100%; background: var(--redcat-red); transform: scaleX(0); transform-origin: 0 50%; transition: transform 120ms linear; }
.redcat-weapon {
  position: relative;
  min-width: 96px;
  padding: 5px 28px 5px 10px;
  border: 1px solid #5e4234;
  background: rgb(246 235 215 / 0.58);
  color: inherit;
  cursor: pointer;
  pointer-events: auto;
  text-align: left;
  transform: rotate(-1deg);
}
.redcat-weapon::after {
  position: absolute;
  top: 50%;
  right: 8px;
  content: "⇄";
  font-family: var(--studio-mono);
  font-size: 0.72rem;
  transform: translateY(-50%);
}
.redcat-weapon:hover,
.redcat-weapon:focus-visible { background: #f5e5c6; }
.redcat-weapon:disabled { cursor: default; opacity: 0.72; }
.redcat-weapon em {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
  color: #8a4a3c;
  font-family: var(--studio-mono);
  font-size: 0.72rem;
  font-style: normal;
  line-height: 1;
}
.redcat-weapon em.is-low { color: var(--redcat-red); font-weight: 700; }

.redcat-weapon-card {
  position: absolute;
  z-index: 6;
  right: 20px;
  bottom: 26px;
  width: min(280px, 46vw);
  padding: 14px 16px;
  border: 1px solid #3d2b22;
  background: var(--redcat-paper-light, #f4ead2);
  box-shadow: 9px 11px 0 rgb(28 15 12 / 0.26);
  clip-path: polygon(2% 2%, 99% 0, 100% 95%, 1% 100%);
  opacity: 0;
  pointer-events: none;
  transform: rotate(-1.2deg) translateY(10px);
  transition: opacity 220ms ease, transform 220ms ease;
}
.redcat-weapon-card[hidden] { display: none; }
.redcat-weapon-card.is-shown { opacity: 1; transform: rotate(-1.2deg) translateY(0); }
.redcat-weapon-card span {
  color: var(--redcat-red);
  font-family: var(--studio-mono);
  font-size: 0.54rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.redcat-weapon-card strong {
  display: block;
  margin: 2px 0 6px;
  font-family: var(--studio-display);
  font-size: 1.24rem;
  font-weight: 400;
}
.redcat-weapon-card p { margin: 0 0 8px; font-size: 0.82rem; line-height: 1.35; }
.redcat-weapon-card small { color: #735b48; font-family: var(--studio-mono); font-size: 0.6rem; }
@media (prefers-reduced-motion: reduce) {
  .redcat-weapon-card { transition: none; }
}

.redcat-pause-button {
  display: grid;
  gap: 1px;
  padding: 5px 10px;
  border: 1px solid #5e4234;
  background: rgb(246 235 215 / 0.58);
  color: inherit;
  cursor: pointer;
  pointer-events: auto;
  text-align: left;
  transform: rotate(1deg);
}
.redcat-pause-button span {
  color: #735b48;
  font-family: var(--studio-mono);
  font-size: 0.54rem;
  letter-spacing: 0.08em;
}
.redcat-pause-button strong { font-family: var(--studio-display); font-size: 0.98rem; font-weight: 400; }
.redcat-pause-button:hover,
.redcat-pause-button:focus-visible { background: #f5e5c6; }
.redcat-pause-button[aria-pressed="true"] { background: var(--redcat-red); color: #f7ecd6; }
.redcat-pause-button[aria-pressed="true"] span { color: rgb(247 236 214 / 0.75); }

.redcat-intro,
.redcat-paused,
.redcat-result {
  position: absolute;
  z-index: 7;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: auto;
  padding: 90px 18px 30px;
  background: rgb(33 22 18 / 0.58);
  backdrop-filter: blur(6px) saturate(0.7);
}
.redcat-intro[hidden],
.redcat-paused[hidden],
.redcat-result[hidden] { display: none; }
.redcat-intro__card,
.redcat-paused .redcat-result__card,
.redcat-result__card {
  position: relative;
  width: min(650px, 100%);
  padding: clamp(26px, 4.5vw, 50px);
  border: 1px solid #3d2b22;
  background:
    linear-gradient(89deg, transparent 49.8%, rgb(77 48 34 / 0.1) 50%, transparent 50.2%),
    var(--redcat-paper-light);
  box-shadow: 17px 21px 0 rgb(28 15 12 / 0.3), inset 0 0 60px rgb(111 72 43 / 0.09);
  clip-path: polygon(1.2% 0.8%, 99.2% 0, 100% 96.7%, 52% 99.2%, 1% 97.5%, 0 44%);
  transform: rotate(-0.45deg);
}
.redcat-intro__card::before,
.redcat-result__card::before {
  position: absolute;
  top: -8px;
  left: 38%;
  width: 96px;
  height: 23px;
  background: rgb(200 179 137 / 0.84);
  content: "";
  transform: rotate(2deg);
}
.redcat-kicker,
.redcat-result__card > span {
  margin: 0;
  color: var(--redcat-red);
  font-family: var(--studio-mono);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}
.redcat-intro h1 {
  margin: 17px 0 20px;
  font-family: var(--studio-display);
  font-size: clamp(4.3rem, 11vw, 7.6rem);
  font-weight: 400;
  letter-spacing: -0.085em;
  line-height: 0.69;
}
.redcat-intro h1 i { color: var(--redcat-red); font-weight: 400; }
.redcat-intro__card > p:not(.redcat-kicker) { max-width: 52ch; margin: 0; color: #594536; line-height: 1.5; }
.redcat-intro__rules {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin: 25px 0 22px;
  border-top: 1px solid rgb(60 40 31 / 0.3);
  border-left: 1px solid rgb(60 40 31 / 0.3);
}
.redcat-intro__rules span { display: grid; gap: 3px; padding: 10px 12px; border-right: 1px solid rgb(60 40 31 / 0.3); border-bottom: 1px solid rgb(60 40 31 / 0.3); font-size: 0.75rem; }
.redcat-intro__rules b { font-family: var(--studio-mono); font-size: 0.57rem; letter-spacing: 0.07em; text-transform: uppercase; }
.redcat-intro__levels {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 10px;
}
.redcat-intro__levels button:last-child {
  border-color: #374237;
  background: #596956;
  box-shadow: 5px 5px 0 rgb(34 48 35 / 0.2);
}
.redcat-intro__levels button:last-child:hover,
.redcat-intro__levels button:last-child:focus-visible { background: #3e4d3d; }
.redcat-intro__card button,
.redcat-result__card button {
  min-height: 50px;
  padding: 12px 18px;
  border: 1px solid #260d0d;
  background: var(--redcat-red);
  color: #fff7e8;
  cursor: pointer;
  font-weight: 800;
  box-shadow: 5px 5px 0 rgb(55 20 16 / 0.2);
  transform: rotate(0.5deg);
}
.redcat-intro__card button:hover,
.redcat-intro__card button:focus-visible,
.redcat-result__card button:hover,
.redcat-result__card button:focus-visible { background: #731016; }
.redcat-intro__card button:disabled { cursor: wait; opacity: 0.55; }
.redcat-intro__card small { display: block; margin-top: 12px; color: #705b49; font-size: 0.67rem; }
.redcat-result__card { width: min(560px, 100%); text-align: center; transform: rotate(0.7deg); }
.redcat-result__card > span { display: inline-block; padding: 7px 10px; border: 3px double currentColor; transform: rotate(-3deg); }
.redcat-result__card[data-redcat-band="defeat"] > span { color: #4c4037; }
.redcat-result__card h2 { margin: 24px auto 12px; font-family: var(--studio-display); font-size: clamp(3rem, 8vw, 5.7rem); font-weight: 400; letter-spacing: -0.07em; line-height: 0.82; }
.redcat-result__card > p { max-width: 42ch; margin: 0 auto; color: #665140; line-height: 1.5; }
.redcat-reward {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  grid-template-rows: auto auto auto;
  gap: 3px 14px;
  align-items: center;
  width: min(390px, 100%);
  margin: 19px auto 0;
  padding: 10px 14px 10px 10px;
  border: 2px dashed #7f1520;
  background: #dfcda9;
  box-shadow: 6px 7px 0 rgb(58 37 27 / 0.16);
  text-align: left;
  transform: rotate(-1deg);
  animation: redcat-reward-land 360ms steps(3, end) both;
}
.redcat-reward[hidden] { display: none; }
.redcat-reward > span {
  align-self: end;
  color: #7f1520;
  font-family: var(--studio-mono);
  font-size: 0.55rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
.redcat-reward > strong { font-family: var(--studio-display); font-size: 1.55rem; font-weight: 400; line-height: 1; }
.redcat-reward > small { align-self: start; color: #624d3d; font-size: 0.68rem; }
.redcat-reward__art {
  grid-row: 1 / 4;
  display: grid;
  place-items: center;
  width: 92px;
  height: 62px;
  overflow: hidden;
  background: rgb(246 234 211 / 0.46);
  clip-path: polygon(2% 5%, 97% 0, 100% 92%, 7% 100%);
}
.redcat-reward__art img { display: block; width: 88px; max-height: 58px; object-fit: contain; filter: drop-shadow(4px 4px 2px rgb(45 28 21 / 0.3)); transform: rotate(-3deg); }
.redcat-reward__staple {
  position: relative;
  display: block;
  width: 72px;
  height: 25px;
  border: 2px solid #34251f;
  background: #9b2830;
  box-shadow: 4px 4px 0 rgb(45 28 21 / 0.25);
  clip-path: polygon(0 5%, 91% 0, 100% 42%, 38% 70%, 28% 100%, 12% 93%);
  transform: rotate(-5deg);
}
.redcat-reward__staple::after { position: absolute; top: 5px; right: 9px; width: 18px; height: 4px; background: #d6c5a2; content: ""; }
.redcat-result__card dl { display: grid; grid-template-columns: repeat(3, 1fr); margin: 26px 0; border-top: 1px solid rgb(58 37 28 / 0.35); border-left: 1px solid rgb(58 37 28 / 0.35); }
.redcat-result__card dl div { display: grid; gap: 5px; padding: 12px 8px; border-right: 1px solid rgb(58 37 28 / 0.35); border-bottom: 1px solid rgb(58 37 28 / 0.35); }
.redcat-result__card dt { color: #705b49; font-family: var(--studio-mono); font-size: 0.53rem; letter-spacing: 0.06em; text-transform: uppercase; }
.redcat-result__card dd { margin: 0; font-family: var(--studio-display); font-size: 1.35rem; }
.redcat-boss-intro {
  position: absolute;
  z-index: 8;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 108px 18px 28px;
  background: rgb(29 17 14 / 0.48);
  backdrop-filter: blur(3px) saturate(0.65);
}
.redcat-boss-intro[hidden],
.redcat-boss-bar[hidden] { display: none; }
.redcat-boss-intro__card {
  width: min(530px, 100%);
  padding: 28px clamp(22px, 5vw, 44px);
  border: 2px solid #402a22;
  background: var(--redcat-paper-light);
  box-shadow: 13px 15px 0 rgb(29 16 12 / 0.34);
  clip-path: polygon(0 4%, 98% 0, 100% 93%, 3% 100%);
  text-align: center;
  transform: rotate(-0.8deg);
  animation: redcat-boss-arrive 520ms steps(4, end) both;
}
.redcat-boss-intro__card span,
.redcat-boss-bar em {
  color: var(--redcat-red);
  font-family: var(--studio-mono);
  font-size: 0.59rem;
  font-style: normal;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.redcat-boss-intro__card strong {
  display: block;
  margin: 9px 0 4px;
  font-family: var(--studio-display);
  font-size: clamp(2.7rem, 8vw, 5.2rem);
  font-weight: 400;
  letter-spacing: -0.065em;
  line-height: 0.86;
}
.redcat-boss-intro__card p { margin: 16px 0; color: #654837; font-family: var(--studio-display); font-size: 1.25rem; }
.redcat-boss-intro__card button {
  min-width: 150px;
  min-height: 44px;
  padding: 9px 18px;
  border: 1px solid #2c1714;
  background: var(--redcat-red);
  color: #fff7e8;
  cursor: pointer;
  box-shadow: 4px 5px 0 rgb(55 20 16 / 0.2);
  font-weight: 800;
}
.redcat-boss-bar {
  position: absolute;
  z-index: 6;
  top: 142px;
  left: 50%;
  width: min(680px, calc(100% - 36px));
  padding: 9px 13px 11px;
  border: 1px solid #38241d;
  background: rgb(235 217 184 / 0.95);
  box-shadow: 7px 8px 0 rgb(43 23 17 / 0.24);
  clip-path: polygon(1% 0, 100% 5%, 99% 94%, 0 100%);
  transform: translateX(-50%) rotate(0.35deg);
  pointer-events: none;
}
.redcat-boss-bar > div { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; margin-bottom: 5px; }
.redcat-boss-bar strong { font-family: var(--studio-display); font-size: 1.05rem; font-weight: 400; }
.redcat-boss-bar > i { display: block; height: 17px; overflow: hidden; border: 2px solid #422c23; background: #725d4a; }
.redcat-boss-bar > i > b { display: block; width: 100%; height: 100%; background: repeating-linear-gradient(90deg, #a20f18 0 23px, #831018 23px 26px); transform: scaleX(1); transform-origin: 0 50%; transition: transform 140ms steps(3, end); }
.redcat-touch {
  position: absolute;
  z-index: 6;
  right: 15px;
  bottom: max(16px, env(safe-area-inset-bottom));
  left: 15px;
  display: none;
  justify-content: space-between;
  pointer-events: none;
}
.redcat-touch button {
  width: 58px;
  height: 58px;
  border: 1px solid rgb(42 24 18 / 0.65);
  border-radius: 50%;
  background: rgb(232 214 181 / 0.82);
  color: #2b1d18;
  box-shadow: 4px 5px 0 rgb(36 20 15 / 0.22);
  touch-action: none;
  pointer-events: auto;
  font-family: var(--studio-mono);
  font-size: 1.15rem;
  font-weight: 900;
}
.redcat-touch button[data-redcat-touch="right"] { margin-right: auto; margin-left: 8px; }
.redcat-touch button[data-redcat-jump] { margin-left: 8px; }

@media (max-width: 820px), (pointer: coarse) {
  .redcat-touch { display: flex; }
  .redcat-hud { top: 74px; right: 9px; left: 9px; grid-template-columns: auto minmax(42px, 1fr) auto auto; gap: 6px; padding: 7px 8px; }
  .redcat-hud__issue { display: none; }
  .redcat-count { min-width: 43px; text-align: center; }
  .redcat-count span { font-size: 0.42rem; letter-spacing: 0.03em; }
  .redcat-count strong { font-family: var(--studio-mono); font-size: 0.68rem; }
  .redcat-health { gap: 2px; }
  .redcat-health i { width: 9px; height: 15px; }
  .redcat-weapon { min-width: 84px; padding: 3px 24px 3px 7px; }
  .redcat-weapon span { display: none; }
  .redcat-weapon strong { font-size: 0.85rem; }
  .redcat-boss-bar { top: 126px; width: calc(100% - 22px); }
}

@media (max-width: 520px) {
  .redcat-intro,
  .redcat-result { place-items: start center; padding: 82px 10px 24px; }
  .redcat-intro__card,
  .redcat-result__card { padding: 25px 20px 28px; }
  .redcat-intro h1 { margin-block: 16px 18px; font-size: clamp(3.9rem, 19vw, 5.4rem); }
  .redcat-intro__rules { grid-template-columns: 1fr 1fr; margin-block: 18px; }
  .redcat-intro__rules span { padding: 8px; font-size: 0.67rem; }
  .redcat-intro__levels { grid-template-columns: 1fr; }
  .redcat-intro__card button,
  .redcat-result__card button { width: 100%; }
  .redcat-result__card dl { grid-template-columns: 1fr; }
  .redcat-result__card dl div { grid-template-columns: 1fr auto; align-items: center; text-align: left; }
  .redcat-reward { grid-template-columns: 74px minmax(0, 1fr); gap: 2px 10px; }
  .redcat-reward__art { width: 74px; height: 56px; }
  .redcat-reward__art img { width: 72px; }
  .redcat-touch button { width: 54px; height: 54px; }
  .redcat-boss-intro { place-items: start center; padding: 126px 10px 24px; }
  .redcat-boss-intro__card { padding: 24px 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .redcat-progress i { transition: none; }
  .redcat-intro,
  .redcat-result { backdrop-filter: none; }
  .redcat-reward,
  .redcat-boss-intro__card { animation: none; }
  .redcat-boss-bar > i > b { transition: none; }
}

@keyframes redcat-reward-land {
  from { opacity: 0; transform: translateY(-22px) rotate(4deg) scale(0.92); }
  to { opacity: 1; transform: translateY(0) rotate(-1deg) scale(1); }
}

@keyframes redcat-boss-arrive {
  from { opacity: 0; transform: translateY(-46px) rotate(4deg) scale(0.84); }
  to { opacity: 1; transform: translateY(0) rotate(-0.8deg) scale(1); }
}

@supports not (backdrop-filter: blur(1px)) {
  .studio-glass { background: var(--studio-glass-strong); }
}

/* Beyond the Crossing --------------------------------------------------- */

.crossing {
  --crossing-ink: #241f2c;
  --crossing-paper: #f7eee6;
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 100svh;
  overflow: hidden;
  background: linear-gradient(180deg, #9dc0e0, #dbd3e0 52%, #fadfd0);
  font-family: var(--studio-sans);
}
.crossing__canvas {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 100svh;
  cursor: grab;
  touch-action: none;
}
.crossing.is-walking .crossing__canvas:active { cursor: grabbing; }
.crossing__canvas:focus-visible { outline: 3px solid #fff; outline-offset: -6px; }

.crossing__veil {
  position: absolute;
  z-index: 3;
  display: grid;
  inset: 0;
  padding: clamp(78px, 12vw, 120px) clamp(22px, 6vw, 90px) clamp(34px, 6vw, 70px);
  place-content: center start;
  background:
    radial-gradient(circle at 22% 42%, rgb(255 245 238 / 0.94), rgb(247 232 236 / 0.86) 42%, rgb(129 120 156 / 0.72));
  backdrop-filter: blur(3px);
}
.crossing__intro { max-width: 34rem; }
.crossing__eyebrow {
  margin: 0;
  color: #7a5f70;
  font-family: var(--studio-mono);
  font-size: 0.69rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}
.crossing__intro h1 {
  margin: 10px 0 18px;
  color: var(--crossing-ink);
  font-family: var(--studio-display);
  font-size: clamp(3rem, 8vw, 6.4rem);
  font-weight: 400;
  letter-spacing: -0.06em;
  line-height: 0.86;
}
.crossing__intro h1 i { color: #b8586b; font-weight: 400; }
.crossing__lead { max-width: 32ch; margin: 0 0 24px; color: #453b4c; font-size: 1.04rem; line-height: 1.56; }
.crossing__keys {
  display: flex;
  flex-wrap: wrap;
  margin: 0 0 26px;
  padding: 0;
  gap: 9px 16px;
  color: #5a4b5c;
  font-size: 0.84rem;
  list-style: none;
}
.crossing__keys span {
  display: inline-block;
  margin-right: 6px;
  padding: 3px 8px;
  border: 1px solid rgb(60 45 62 / 0.32);
  border-radius: 6px;
  font-family: var(--studio-mono);
  font-size: 0.72rem;
}
.crossing__begin, .crossing__quiet {
  min-height: 48px;
  padding: 12px 22px;
  border: 1px solid var(--crossing-ink);
  border-radius: 4px;
  background: var(--crossing-ink);
  color: var(--crossing-paper);
  font-size: 0.96rem;
  cursor: pointer;
}
.crossing__quiet { background: transparent; color: var(--crossing-ink); border-color: rgb(36 31 44 / 0.34); }
.crossing__begin:hover:not(:disabled) { background: #3d3149; }
.crossing__quiet:hover { background: rgb(36 31 44 / 0.08); }
.crossing__begin:disabled { cursor: progress; opacity: 0.5; }
.crossing__note { margin: 16px 0 0; color: #6b5c6c; font-size: 0.8rem; line-height: 1.5; }

.crossing [hidden] { display: none; }

.crossing__hud { position: absolute; z-index: 2; inset: 0; pointer-events: none; }
.crossing__hud > * { pointer-events: auto; }

.crossing__chip {
  position: absolute;
  top: 18px;
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid rgb(255 255 255 / 0.5);
  border-radius: 19px;
  background: rgb(40 33 50 / 0.44);
  color: #fdf6ef;
  font-size: 0.78rem;
  cursor: pointer;
  backdrop-filter: blur(7px);
}
.crossing__chip--left { left: 18px; }
.crossing__chip--right { right: 18px; }
.crossing__chip:hover { background: rgb(40 33 50 / 0.66); }

.crossing__hint {
  position: absolute;
  bottom: 26px;
  left: 50%;
  display: grid;
  gap: 4px;
  padding: 11px 18px;
  border-radius: 14px;
  background: rgb(40 33 50 / 0.42);
  color: #fdf6ef;
  font-size: 0.8rem;
  text-align: center;
  transform: translateX(-50%);
  backdrop-filter: blur(7px);
  transition: opacity 900ms ease, visibility 900ms;
}
.crossing__hint p { margin: 0; }
.crossing__hint span { font-family: var(--studio-mono); font-size: 0.74rem; opacity: 0.85; }
.crossing__hint-touch { display: none; }
.crossing__hint.is-faded { visibility: hidden; opacity: 0; }

.crossing__prompt {
  position: absolute;
  bottom: 96px;
  left: 50%;
  margin: 0;
  padding: 11px 20px;
  border: 1px solid rgb(255 255 255 / 0.44);
  border-radius: 22px;
  background: rgb(32 26 42 / 0.62);
  color: #fff6ec;
  font-size: 0.92rem;
  transform: translateX(-50%);
  backdrop-filter: blur(7px);
}
.crossing__prompt.is-passive { border-color: rgb(255 190 120 / 0.66); background: rgb(96 42 34 / 0.66); }

.crossing__caption {
  position: absolute;
  top: 74px;
  left: 50%;
  max-width: min(30rem, calc(100% - 44px));
  margin: 0;
  padding: 10px 18px;
  border-radius: 13px;
  background: rgb(40 33 50 / 0.46);
  color: #fdf6ef;
  font-family: var(--studio-display);
  font-size: 1.06rem;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, -8px);
  transition: opacity 420ms ease, transform 420ms ease;
  backdrop-filter: blur(7px);
}
.crossing__caption.is-visible { opacity: 1; transform: translate(-50%, 0); }

.crossing__interact {
  position: absolute;
  right: 22px;
  bottom: 44px;
  min-width: 132px;
  min-height: 66px;
  padding: 14px 22px;
  border: 2px solid rgb(255 255 255 / 0.66);
  border-radius: 33px;
  background: rgb(184 88 107 / 0.9);
  color: #fff;
  font-size: 0.92rem;
  cursor: pointer;
}
.crossing__stick {
  position: absolute;
  width: 132px;
  height: 132px;
  border: 2px solid rgb(255 255 255 / 0.4);
  border-radius: 50%;
  background: rgb(40 33 50 / 0.26);
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.crossing__stick span {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: rgb(255 246 236 / 0.72);
  transform: translate(-50%, -50%);
}

.crossing__ending {
  position: absolute;
  z-index: 4;
  display: grid;
  inset: 0;
  place-content: center;
  padding: 30px;
  background: radial-gradient(circle at 50% 46%, rgb(58 44 74 / 0.16), rgb(30 24 44 / 0.5));
  animation: crossing-ending-in 1200ms ease both;
}
.crossing__ending-card {
  max-width: 32rem;
  padding: clamp(26px, 4vw, 44px);
  border-radius: 6px;
  background: rgb(250 242 236 / 0.96);
  text-align: center;
}
.crossing__ending-card h2 {
  margin: 12px 0 26px;
  color: var(--crossing-ink);
  font-family: var(--studio-display);
  font-size: clamp(1.9rem, 4.4vw, 3.1rem);
  font-weight: 400;
  letter-spacing: -0.04em;
  line-height: 1.02;
}
.crossing__ending-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

.crossing--failed { display: grid; place-content: center; padding: 40px 24px; text-align: center; }
.crossing--failed .crossing__intro { max-width: 30rem; }

@keyframes crossing-ending-in { from { opacity: 0; } to { opacity: 1; } }

@media (pointer: coarse) {
  .crossing__hint p:first-child { display: none; }
  .crossing__hint-touch { display: block; }
  .crossing__prompt { bottom: 128px; font-size: 0.86rem; }
}

@media (max-width: 640px) {
  .crossing__veil { padding: 74px 22px 30px; place-content: center start; }
  .crossing__intro h1 { font-size: clamp(2.6rem, 13vw, 4rem); }
  .crossing__lead { font-size: 0.96rem; }
  .crossing__caption { top: 68px; font-size: 0.95rem; }
  .crossing__interact { right: 16px; bottom: 34px; min-width: 116px; min-height: 60px; }
  .crossing__chip { font-size: 0.74rem; }
}

@media (prefers-reduced-motion: reduce) {
  .crossing__ending { animation: none; }
  .crossing__caption { transition: opacity 200ms ease; }
}

/* Kats and Mice - a full-bleed domestic-history lane battle. */
.km-loading {
  display: grid;
  min-height: 100svh;
  place-content: center;
  justify-items: center;
  gap: 12px;
  padding: 90px 24px 40px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 30%, rgb(255 213 141 / 0.45), transparent 31%),
    linear-gradient(145deg, #f5ddbc, #9eb09c);
  color: #34241d;
  text-align: center;
}
.km-loading h1 { max-width: 12ch; margin: 0; font-family: var(--studio-display); font-size: clamp(3rem, 8vw, 6.5rem); font-weight: 400; letter-spacing: -0.06em; line-height: 0.88; }
.km-loading p { margin: 0; }
.km-loading__crumb { width: 26px; height: 20px; border-radius: 62% 38% 55% 45%; background: #9e6740; box-shadow: 13px 7px 0 -5px #6d432e, -13px 9px 0 -7px #c38a52; animation: km-crumb 900ms ease-in-out infinite alternate; }
.km-loading--error { background: linear-gradient(145deg, #f3ddc5, #c58a7f); }

.km-game {
  --km-ink: #281d1d;
  --km-paper: #fff2d8;
  --km-cream: #fff4dc;
  --km-kat: #a33c4f;
  --km-kat-bright: #efb94f;
  --km-mouse: #315c43;
  --km-mouse-bright: #78bd83;
  position: relative;
  display: grid;
  width: 100%;
  height: 100%;
  min-height: 100svh;
  grid-template-rows: auto minmax(260px, 1fr) auto;
  gap: 10px;
  padding: 76px 14px 14px;
  overflow: hidden;
  background: #2f241f;
  color: var(--km-paper);
  isolation: isolate;
}
.km-game button { font: inherit; }
.km-game button:focus-visible { outline: 3px solid #fff2a7; outline-offset: 3px; }
.km-game.is-paused::after { position: absolute; z-index: 8; inset: 0; display: grid; place-content: center; background: rgb(25 18 20 / 0.42); color: white; content: "Battle paused"; font-family: var(--studio-mono); font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; }

.km-tour {
  position: absolute;
  z-index: 11;
  inset: 0;
  pointer-events: auto;
}
.km-tour[hidden] { display: none !important; }
.km-tour.is-centered { display: grid; place-items: center; padding: 76px 18px 18px; background: rgb(24 17 21 / 0.76); backdrop-filter: blur(8px); }
.km-tour__card {
  position: absolute;
  z-index: 2;
  display: grid;
  width: min(390px, calc(100% - 28px));
  gap: 10px;
  padding: 24px;
  border: 1px solid rgb(255 240 207 / 0.48);
  border-radius: 17px;
  background: linear-gradient(145deg, rgb(58 38 34 / 0.98), rgb(31 25 29 / 0.98));
  box-shadow: 0 24px 70px rgb(14 8 10 / 0.48);
  color: var(--km-cream);
}
.km-tour.is-centered .km-tour__card { position: relative; }
.km-tour__card h2 { margin: 0; font-family: var(--studio-display); font-size: clamp(2rem, 4vw, 3.2rem); font-weight: 400; letter-spacing: -0.04em; line-height: 0.94; }
.km-tour__card > p:not(.km-kicker) { margin: 0; color: rgb(255 244 218 / 0.76); font-size: 0.9rem; line-height: 1.5; }
.km-tour__close { position: absolute; top: 9px; right: 10px; width: 34px; height: 34px; border: 0; border-radius: 50%; background: transparent; color: rgb(255 244 218 / 0.68); cursor: pointer; font-size: 1.35rem; line-height: 1; }
.km-tour__close:hover, .km-tour__close:focus-visible { background: rgb(255 244 218 / 0.12); color: #fff4dc; }
.km-tour__actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 5px; padding-top: 13px; border-top: 1px solid rgb(255 244 218 / 0.16); }
.km-tour__actions > span { display: flex; gap: 7px; }
.km-tour__actions button { min-height: 42px; padding: 9px 13px; border: 1px solid rgb(255 244 218 / 0.28); border-radius: 9px; background: transparent; color: #fff2d8; cursor: pointer; }
.km-tour__actions .km-primary { border-color: #ffe4a3; background: #f0b84f; color: #2a1c19; }
.km-tour__actions button:hover, .km-tour__actions button:focus-visible { border-color: #ffe4a3; background: rgb(255 244 218 / 0.12); }
.km-tour__actions .km-primary:hover, .km-tour__actions .km-primary:focus-visible { background: #ffd372; }
.km-game .is-tour-layer { z-index: 9; pointer-events: none; }
.km-stage.is-tour-layer { overflow: visible; }
.km-game .is-tour-target {
  position: relative;
  z-index: 10;
  outline: 3px solid #fff2a7;
  outline-offset: 5px;
  box-shadow: 0 0 0 9999px rgb(20 13 17 / 0.7), 0 0 34px rgb(255 220 130 / 0.72);
  pointer-events: none;
}

.km-hud {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
}
.km-hq-card, .km-resources {
  min-width: 0;
  border: 1px solid rgb(255 244 218 / 0.2);
  border-radius: 12px;
  background: rgb(36 25 23 / 0.74);
  box-shadow: inset 0 1px rgb(255 255 255 / 0.1), 0 7px 24px rgb(20 13 11 / 0.18);
  backdrop-filter: blur(12px) saturate(115%);
}
.km-hq-card { display: grid; grid-template-columns: minmax(0, 1fr); gap: 7px; padding: 9px 12px; }
.km-hq-card > span { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 8px; }
.km-hq-card > span img { width: 24px; height: 24px; flex: 0 0 auto; object-fit: contain; image-rendering: pixelated; }
.km-hq-card strong { font-family: var(--studio-display); font-size: 1.12rem; font-weight: 400; }
.km-hq-card small { overflow: hidden; color: rgb(255 244 218 / 0.64); font-family: var(--studio-mono); font-size: 0.57rem; letter-spacing: 0.05em; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.km-hq-card--mouse { text-align: right; }
.km-hq-card progress { width: 100%; height: 7px; overflow: hidden; border: 0; border-radius: 999px; background: rgb(255 255 255 / 0.14); }
.km-hq-card progress::-webkit-progress-bar { border-radius: inherit; background: rgb(255 255 255 / 0.14); }
.km-hq-card--kat progress::-webkit-progress-value { border-radius: inherit; background: linear-gradient(90deg, var(--km-kat), var(--km-kat-bright)); }
.km-hq-card--mouse progress::-webkit-progress-value { border-radius: inherit; background: linear-gradient(90deg, var(--km-mouse), var(--km-mouse-bright)); }
.km-hq-card--kat progress::-moz-progress-bar { background: var(--km-kat-bright); }
.km-hq-card--mouse progress::-moz-progress-bar { background: var(--km-mouse-bright); }
.km-resources { display: grid; min-width: 145px; grid-template-columns: repeat(2, minmax(58px, 1fr)); align-items: center; }
.km-resources span { display: grid; justify-items: center; padding: 7px 12px; }
.km-resources span + span { border-left: 1px solid rgb(255 244 218 / 0.16); }
.km-resources small { color: rgb(255 244 218 / 0.62); font-family: var(--studio-mono); font-size: 0.55rem; letter-spacing: 0.08em; text-transform: uppercase; }
.km-resources strong { font-family: var(--studio-display); font-size: 1.2rem; font-weight: 400; }
.km-resources progress { width: 62px; height: 3px; overflow: hidden; border: 0; border-radius: 99px; background: rgb(255 255 255 / 0.12); }
.km-resources progress::-webkit-progress-bar { background: rgb(255 255 255 / 0.12); }
.km-resources progress::-webkit-progress-value { background: #efb94f; }
.km-resources progress::-moz-progress-bar { background: #efb94f; }

.km-stage { position: relative; min-height: 0; overflow: hidden; border: 1px solid rgb(255 244 218 / 0.2); border-radius: 16px; background: #d8bea0; box-shadow: 0 18px 46px rgb(18 11 10 / 0.28); }
.km-stage canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; cursor: grab; image-rendering: pixelated; touch-action: none; }
.km-stage canvas.is-dragging { cursor: grabbing; }
.km-stage canvas:focus-visible { outline: 3px solid rgb(255 242 167 / 0.96); outline-offset: -7px; }
.km-status { position: absolute; z-index: 2; right: 10px; bottom: 10px; left: 10px; width: fit-content; max-width: calc(100% - 20px); margin: 0; padding: 7px 10px; border: 1px solid rgb(255 246 222 / 0.22); border-radius: 9px; background: rgb(40 27 24 / 0.66); color: rgb(255 246 226 / 0.9); font-family: var(--studio-mono); font-size: 0.58rem; letter-spacing: 0.045em; pointer-events: none; text-transform: uppercase; backdrop-filter: blur(8px); }
.km-camera-controls { position: absolute; z-index: 3; top: 10px; left: 50%; display: flex; gap: 4px; padding: 4px; border: 1px solid rgb(255 244 218 / 0.25); border-radius: 11px; background: rgb(37 26 25 / 0.7); transform: translateX(-50%); backdrop-filter: blur(10px); }
.km-camera-controls button { min-width: 42px; min-height: 38px; padding: 7px 10px; border: 0; border-radius: 8px; background: transparent; color: #fff2d8; cursor: pointer; font-family: var(--studio-mono); font-size: 0.6rem; letter-spacing: 0.04em; text-transform: uppercase; }
.km-camera-controls button:hover, .km-camera-controls button:focus-visible, .km-camera-controls button[aria-pressed="true"] { background: rgb(239 185 82 / 0.23); }
.km-camera-controls span { color: rgb(255 244 218 / 0.52); }
.km-game[data-km-state="title"] .km-camera-controls { display: none; }
.km-game[data-km-state="title"] .km-command { visibility: hidden; }

.km-title-card {
  position: absolute;
  z-index: 4;
  top: 50%;
  left: 50%;
  display: grid;
  width: min(580px, calc(100% - 30px));
  max-height: calc(100% - 30px);
  gap: 13px;
  padding: clamp(22px, 3.5vw, 38px);
  overflow: auto;
  border: 1px solid rgb(255 244 213 / 0.45);
  border-radius: 18px;
  background: linear-gradient(145deg, rgb(63 37 30 / 0.88), rgb(43 28 27 / 0.91));
  box-shadow: inset 0 1px rgb(255 255 255 / 0.14), 0 28px 80px rgb(31 17 14 / 0.42);
  color: var(--km-cream);
  transform: translate(-50%, -50%);
  backdrop-filter: blur(16px) saturate(120%);
}
.km-title-card[hidden] { display: none; }
.km-kicker { margin: 0; color: #e9b768; font-family: var(--studio-mono); font-size: 0.61rem; letter-spacing: 0.12em; text-transform: uppercase; }
.km-title-card h2 { margin: 0; font-family: var(--studio-display); font-size: clamp(3.3rem, 8vw, 6.7rem); font-weight: 400; letter-spacing: -0.08em; line-height: 0.72; }
.km-title-card h2 i { color: #efb34f; font-weight: 400; }
.km-title-card > p:not(.km-kicker) { max-width: 44ch; margin: 0; color: rgb(255 244 218 / 0.76); line-height: 1.45; }
.km-title-card ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px 18px; margin: 5px 0 2px; padding: 0; list-style: none; }
.km-title-card li { display: flex; align-items: baseline; gap: 8px; color: rgb(255 244 218 / 0.82); font-size: 0.84rem; }
.km-title-card li span { color: #dca75e; font-family: var(--studio-mono); font-size: 0.56rem; }
.km-primary { min-height: 48px; justify-self: start; padding: 12px 19px; border: 1px solid #ffe4a3; border-radius: 11px; background: #f0b84f; box-shadow: inset 0 1px rgb(255 255 255 / 0.35), 0 8px 22px rgb(23 13 11 / 0.28); color: #2a1c19; cursor: pointer; font-weight: 700; }
.km-primary:hover, .km-primary:focus-visible { background: #ffd372; }
.km-result-stats { display: flex; gap: 28px; margin: 0; }
.km-result-stats div { display: grid; }
.km-result-stats dt { color: rgb(255 244 218 / 0.58); font-family: var(--studio-mono); font-size: 0.57rem; letter-spacing: 0.08em; text-transform: uppercase; }
.km-result-stats dd { margin: 0; font-family: var(--studio-display); font-size: 1.4rem; }

.km-transition-card { position: absolute; z-index: 5; top: 50%; left: 50%; display: grid; width: min(440px, calc(100% - 28px)); gap: 7px; padding: 22px; border: 1px solid rgb(255 234 180 / 0.5); border-radius: 16px; background: linear-gradient(145deg, rgb(53 34 31 / 0.9), rgb(28 24 31 / 0.92)); box-shadow: 0 26px 70px rgb(20 12 14 / 0.44); color: #fff2d8; text-align: center; transform: translate(-50%, -50%); backdrop-filter: blur(15px); }
.km-transition-card[hidden] { display: none; }
.km-transition-card strong { font-family: var(--studio-display); font-size: clamp(1.8rem, 5vw, 3.2rem); font-weight: 400; line-height: 0.95; }
.km-transition-card small { color: rgb(255 242 216 / 0.7); line-height: 1.4; }
.km-transition-card button { justify-self: center; }

.km-command { position: relative; z-index: 3; display: grid; grid-template-columns: minmax(0, 1fr) minmax(330px, 0.34fr); gap: 10px; }
.km-unit-controls { display: grid; min-width: 0; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.km-power-controls { display: flex; min-width: 0; min-height: 72px; gap: 7px; }
.km-unit-button, .km-special-button, .km-evolve-button { position: relative; display: grid; min-width: 0; min-height: 72px; align-content: center; gap: 3px; padding: 10px 12px; overflow: hidden; border: 1px solid rgb(255 244 218 / 0.26); border-radius: 12px; background: rgb(48 33 29 / 0.92); color: var(--km-cream); cursor: pointer; text-align: left; }
.km-unit-button::after, .km-special-button::after, .km-evolve-button::after { position: absolute; right: -24px; bottom: -34px; width: 82px; height: 82px; border-radius: 50%; background: rgb(235 178 79 / 0.12); content: ""; }
.km-unit-button:hover:not(:disabled), .km-unit-button:focus-visible, .km-special-button:hover:not(:disabled), .km-special-button:focus-visible, .km-evolve-button:hover:not(:disabled), .km-evolve-button:focus-visible { border-color: #efc16d; background: #4d332b; }
.km-unit-button:disabled, .km-special-button:disabled, .km-evolve-button:disabled { cursor: not-allowed; opacity: 0.52; }
.km-unit-button.is-unaffordable { border-style: dashed; }
.km-unit-button strong, .km-special-button strong, .km-evolve-button strong { position: relative; z-index: 1; overflow: hidden; font-family: var(--studio-display); font-size: clamp(0.9rem, 1.3vw, 1.13rem); font-weight: 400; text-overflow: ellipsis; white-space: nowrap; }
.km-unit-button small, .km-special-button small, .km-evolve-button small { position: relative; z-index: 1; color: rgb(255 244 218 / 0.62); font-family: var(--studio-mono); font-size: 0.52rem; letter-spacing: 0.04em; text-transform: uppercase; }
.km-hotkey { position: absolute; z-index: 2; top: 6px; right: 7px; padding: 2px 5px; border: 1px solid rgb(255 244 218 / 0.2); border-radius: 5px; color: rgb(255 244 218 / 0.55); font-family: var(--studio-mono); font-size: 0.48rem; letter-spacing: 0.04em; text-transform: uppercase; }
.km-special-button { border-color: rgb(239 184 79 / 0.48); background: linear-gradient(135deg, #6e3c33, #3e2b29); }
.km-special-button, .km-evolve-button { flex: 1 1 0; }
.km-evolve-button { min-height: 58px; border-color: rgb(121 216 204 / 0.55); background: linear-gradient(135deg, #176f72, #29474c); }
.km-evolve-button[hidden] { display: none; }

.km-doctrine { position: absolute; z-index: 7; inset: 0; display: grid; min-height: 100%; place-items: center; padding: 76px 18px 18px; overflow: auto; background: rgb(24 17 21 / 0.78); backdrop-filter: blur(15px); }
.km-doctrine[hidden] { display: none; }
.km-doctrine-dialog { display: grid; width: min(1020px, 100%); gap: 10px; padding: clamp(18px, 3vw, 30px); border: 1px solid rgb(255 240 207 / 0.34); border-radius: 19px; background: rgb(42 30 31 / 0.96); box-shadow: 0 30px 90px rgb(13 8 11 / 0.5); }
.km-doctrine-dialog h2 { margin: 0; font-family: var(--studio-display); font-size: clamp(2rem, 5vw, 4rem); font-weight: 400; letter-spacing: -0.04em; line-height: 0.92; }
.km-doctrine-dialog > p:not(.km-kicker) { margin: 0 0 6px; color: rgb(255 240 216 / 0.7); }
.km-doctrine-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.km-doctrine-card { display: grid; min-width: 0; gap: 8px; padding: clamp(16px, 2.5vw, 25px); border: 1px solid rgb(255 240 214 / 0.25); border-radius: 15px; background: #5c3038; color: #fff3dd; cursor: pointer; text-align: left; }
.km-doctrine-card--zoomie { background: #125e68; }
.km-doctrine-card:hover, .km-doctrine-card:focus-visible { border-color: #ffe199; transform: translateY(-2px); }
.km-doctrine-card__crest { width: 64px; height: 64px; object-fit: contain; image-rendering: pixelated; }
.km-doctrine-card > strong { font-family: var(--studio-display); font-size: clamp(1.6rem, 4vw, 2.8rem); font-weight: 400; line-height: 0.95; }
.km-doctrine-card > em { color: #ffd899; font-family: var(--studio-display); font-size: 1rem; }
.km-doctrine-card > span { color: rgb(255 244 224 / 0.75); font-size: 0.75rem; line-height: 1.35; }
.km-doctrine-card > span b { color: #fff5e1; font-family: var(--studio-mono); font-size: 0.57rem; letter-spacing: 0.05em; text-transform: uppercase; }
.km-doctrine-card .km-doctrine-card__summary { color: #fff4de; font-size: 0.9rem; }
.km-doctrine-card .km-doctrine-card__lineup { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; margin-top: 3px; }
.km-doctrine-card__lineup > span { display: grid; min-width: 0; gap: 2px; align-content: end; padding: 6px; border: 1px solid rgb(255 255 255 / 0.16); border-radius: 8px; background: rgb(31 19 20 / 0.2); }
.km-doctrine-card__lineup img { width: 100%; height: 58px; object-fit: contain; image-rendering: pixelated; }
.km-doctrine-card__lineup small { color: rgb(255 244 224 / 0.55); font-family: var(--studio-mono); font-size: 0.45rem; letter-spacing: 0.05em; text-transform: uppercase; }
.km-doctrine-card__lineup b { overflow: hidden; color: #fff5e1; font-family: var(--studio-display); font-size: 0.75rem; font-weight: 400; line-height: 0.95; text-overflow: ellipsis; }
.km-doctrine-card .km-doctrine-card__choose { margin-top: 5px; padding-top: 10px; border-top: 1px solid rgb(255 255 255 / 0.2); color: #ffe49c; font-weight: 700; }
.km-doctrine-loading, .km-doctrine-error { grid-column: 1 / -1; padding: 36px; border: 1px dashed rgb(255 240 214 / 0.3); border-radius: 13px; color: rgb(255 243 220 / 0.7); text-align: center; }

@keyframes km-crumb { to { transform: translateY(-7px) rotate(7deg); } }

@media (max-width: 720px) {
  .km-game { grid-template-rows: auto minmax(270px, 1fr) auto; gap: 8px; padding: 66px 8px 8px; }
  .km-tour.is-centered { padding: 66px 8px 8px; }
  .km-tour:not(.is-centered) .km-tour__card { width: auto; max-height: calc(100% - 76px); overflow: auto; }
  .km-tour__card { padding: 20px; }
  .km-tour__card h2 { font-size: clamp(1.9rem, 9vw, 2.8rem); }
  .km-hud { grid-template-columns: 1fr 1fr; gap: 6px; }
  .km-resources { grid-column: 1 / -1; grid-row: 1; min-width: 0; }
  .km-hq-card { grid-row: 2; padding: 7px 9px; }
  .km-hq-card strong { font-size: 0.98rem; }
  .km-hq-card small { max-width: 15ch; font-size: 0.49rem; }
  .km-stage { border-radius: 12px; }
  .km-title-card { gap: 10px; padding: 20px; }
  .km-title-card h2 { font-size: clamp(3.25rem, 16vw, 5rem); }
  .km-title-card ul { gap: 5px 12px; }
  .km-title-card li { font-size: 0.7rem; }
  .km-command { grid-template-columns: 1fr; gap: 6px; }
  .km-power-controls { min-height: 52px; }
  .km-unit-controls { gap: 5px; }
  .km-unit-button { min-height: 66px; padding: 8px; }
  .km-special-button, .km-evolve-button { min-height: 52px; padding: 8px 10px; }
  .km-unit-button strong, .km-special-button strong, .km-evolve-button strong { padding-right: 18px; font-size: 0.84rem; }
  .km-unit-button small, .km-special-button small, .km-evolve-button small { font-size: 0.45rem; }
  .km-status { right: 7px; bottom: 7px; left: 7px; font-size: 0.48rem; }
  .km-camera-controls { top: 7px; }
  .km-camera-controls button { min-height: 42px; }
  .km-doctrine { padding: 66px 8px 8px; }
  .km-doctrine-grid { grid-template-columns: 1fr; }
  .km-doctrine-card__lineup img { height: 48px; }
}

@media (max-width: 420px) {
  .km-title-card ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .km-title-card li { gap: 5px; font-size: 0.64rem; }
  .km-unit-button strong { white-space: normal; line-height: 0.92; }
  .km-hq-card small { max-width: 12ch; }
}

@media (max-height: 690px) and (min-width: 721px) {
  .km-game { grid-template-rows: auto minmax(230px, 1fr) auto; padding-top: 66px; }
  .km-title-card { gap: 8px; padding: 18px 24px; }
  .km-title-card h2 { font-size: clamp(3rem, 11vh, 5rem); }
  .km-title-card ul { margin: 0; }
  .km-unit-button, .km-special-button, .km-evolve-button { min-height: 60px; }
}

/* One Outfit, Long Day */
.game-dialog[data-game="outfit"] .game-dialog__chrome { padding-right: 5px; }
.game-dialog[data-game="outfit"] .game-dialog__count { display: none; }

.outfit-day-gate {
  --outfit-ink: #1b2621;
  --outfit-paper: #f5f0e7;
  position: relative;
  isolation: isolate;
  display: grid;
  min-height: 100%;
  overflow: hidden;
  align-content: end;
  padding: 86px clamp(20px, 4vw, 64px) clamp(26px, 5vw, 68px);
  background: #26332d;
  color: var(--outfit-paper);
}
.outfit-day-gate__base,
.outfit-day-gate__preview,
.outfit-day-gate__wash { position: absolute; inset: 0; }
.outfit-day-gate__base,
.outfit-day-gate__preview {
  z-index: -3;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: saturate(0.8) contrast(1.04);
  transform: scale(1.025);
}
.outfit-day-gate__preview {
  z-index: -2;
  opacity: 0;
  transition: opacity 420ms ease, transform 900ms cubic-bezier(0.16, 1, 0.3, 1);
}
.outfit-day-gate__wash {
  z-index: -1;
  background:
    linear-gradient(180deg, rgb(18 27 23 / 0.2) 0%, rgb(18 27 23 / 0.38) 48%, rgb(18 27 23 / 0.9) 100%),
    linear-gradient(90deg, rgb(18 27 23 / 0.44), transparent 70%);
}
.outfit-day-gate__content { width: min(1340px, 100%); margin-inline: auto; }
.outfit-day-gate h1 {
  max-width: 9ch;
  margin: 0 0 clamp(28px, 5vw, 62px);
  font-family: var(--studio-display);
  font-size: clamp(3.7rem, 8.5vw, 9rem);
  font-weight: 400;
  letter-spacing: -0.065em;
  line-height: 0.82;
  text-wrap: balance;
}
.outfit-day-gate__choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.outfit-day-gate__choices button {
  min-height: 76px;
  padding: 16px 18px;
  border: 0;
  border-top: 1px solid rgb(245 240 231 / 0.48);
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-family: var(--studio-display);
  font-size: clamp(1.12rem, 1.6vw, 1.65rem);
  font-weight: 400;
  line-height: 1.05;
  text-align: left;
  transition: background 180ms ease, padding-left 240ms cubic-bezier(0.16, 1, 0.3, 1);
}
.outfit-day-gate__choices button:hover,
.outfit-day-gate__choices button:focus-visible {
  padding-left: 28px;
  background: rgb(245 240 231 / 0.14);
}
.outfit-day-gate:has([data-outfit-day="0"]:is(:hover, :focus-visible)) [data-outfit-preview="0"],
.outfit-day-gate:has([data-outfit-day="1"]:is(:hover, :focus-visible)) [data-outfit-preview="1"],
.outfit-day-gate:has([data-outfit-day="2"]:is(:hover, :focus-visible)) [data-outfit-preview="2"],
.outfit-day-gate:has([data-outfit-day="3"]:is(:hover, :focus-visible)) [data-outfit-preview="3"],
.outfit-day-gate:has([data-outfit-day="4"]:is(:hover, :focus-visible)) [data-outfit-preview="4"],
.outfit-day-gate:has([data-outfit-day="5"]:is(:hover, :focus-visible)) [data-outfit-preview="5"] {
  opacity: 1;
  transform: scale(1);
}

.outfit-experience {
  --outfit-ink: #1b2621;
  --outfit-muted: #5e665f;
  --outfit-paper: #f5f0e7;
  --outfit-paper-deep: #e6ded0;
  --outfit-green: #355f4d;
  --outfit-rust: #9b4f40;
  --outfit-rule: rgb(27 38 33 / 0.2);
  min-height: 100%;
  padding: 86px clamp(14px, 2.4vw, 38px) 42px;
  color: var(--outfit-ink);
  background:
    linear-gradient(90deg, transparent 49.95%, rgb(27 38 33 / 0.08) 50%, transparent 50.05%),
    radial-gradient(circle at 83% 7%, rgb(72 113 91 / 0.2), transparent 27%),
    linear-gradient(145deg, #eef1e9, #ded8cb 63%, #cbc7bb);
}
.outfit-assembly-shell { width: min(1480px, 100%); margin-inline: auto; }
.outfit-assembly-header {
  display: grid;
  grid-template-columns: minmax(230px, 0.45fr) minmax(0, 1.55fr);
  gap: clamp(24px, 4vw, 68px);
  align-items: end;
  margin-bottom: 24px;
}
.outfit-assembly-header h1 {
  margin: 0;
  font-family: var(--studio-display);
  font-size: clamp(3.4rem, 6vw, 6.8rem);
  font-weight: 400;
  letter-spacing: -0.065em;
  line-height: 0.84;
}
.outfit-assembly-header button {
  display: grid;
  gap: 4px;
  padding: 12px 0;
  border: 0;
  border-block: 1px solid var(--outfit-rule);
  background: transparent;
  color: var(--outfit-ink);
  cursor: pointer;
  text-align: left;
}
.outfit-assembly-header button:hover,
.outfit-assembly-header button:focus-visible { padding-left: 10px; background: #dce6dc; }
.outfit-assembly-header button span { color: var(--outfit-muted); font-family: var(--studio-mono); font-size: 0.58rem; letter-spacing: 0.08em; text-transform: uppercase; }
.outfit-assembly-header button strong { font-family: var(--studio-display); font-size: 1.12rem; font-weight: 400; }
.outfit-workspace--wardrobe .outfit-wardrobe { padding-bottom: 30px; }

.outfit-face-prompt {
  position: fixed;
  z-index: 3;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 84px 20px 24px;
  background: rgb(20 29 25 / 0.68);
  backdrop-filter: blur(7px);
}
.outfit-face-prompt__card {
  width: min(560px, 100%);
  padding: clamp(28px, 5vw, 58px);
  border: 1px solid var(--outfit-rule);
  background: var(--outfit-paper);
  box-shadow: 16px 18px 0 rgb(20 29 25 / 0.28);
  animation: outfit-prompt-in 300ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
.outfit-face-prompt h2 {
  margin: 0 0 28px;
  font-family: var(--studio-display);
  font-size: clamp(3.5rem, 8vw, 6.5rem);
  font-weight: 400;
  letter-spacing: -0.065em;
  line-height: 0.84;
}
.outfit-face-prompt__card > div { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@keyframes outfit-prompt-in { from { opacity: 0; transform: translateY(18px) scale(0.97); } }
.outfit-header {
  display: grid;
  width: min(1480px, 100%);
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.36fr);
  gap: 28px;
  align-items: end;
  margin: 0 auto 26px;
}
.outfit-header h1 {
  margin: 7px 0 0;
  font-family: var(--studio-display);
  font-size: clamp(3.2rem, 6vw, 6.4rem);
  font-weight: 400;
  letter-spacing: -0.065em;
  line-height: 0.82;
}
.outfit-header h1 i { color: var(--outfit-green); font-weight: 400; }
.outfit-header > p { max-width: 42ch; margin: 0; color: var(--outfit-muted); line-height: 1.55; }
.outfit-workspace {
  display: grid;
  width: min(1480px, 100%);
  min-height: 720px;
  grid-template-columns: minmax(250px, 0.68fr) minmax(330px, 0.86fr) minmax(420px, 1.12fr);
  margin-inline: auto;
  border: 1px solid var(--outfit-rule);
  background: rgb(247 243 235 / 0.86);
  box-shadow: 0 28px 80px rgb(32 43 37 / 0.16);
}
.outfit-workspace--wardrobe { grid-template-columns: minmax(350px, 0.72fr) minmax(580px, 1.28fr); }
.outfit-brief,
.outfit-stage,
.outfit-wardrobe { min-width: 0; padding: clamp(20px, 2.3vw, 34px); }
.outfit-brief { border-right: 1px solid var(--outfit-rule); background: rgb(246 240 229 / 0.72); }
.outfit-day-picker { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 16px 0 28px; border-top: 1px solid var(--outfit-rule); border-left: 1px solid var(--outfit-rule); }
.outfit-day-picker button {
  display: grid;
  min-height: 62px;
  grid-template-columns: 28px 1fr;
  gap: 7px;
  align-items: start;
  padding: 9px 8px;
  border: 0;
  border-right: 1px solid var(--outfit-rule);
  border-bottom: 1px solid var(--outfit-rule);
  background: transparent;
  color: var(--outfit-ink);
  cursor: pointer;
  text-align: left;
}
.outfit-day-picker button:hover,
.outfit-day-picker button:focus-visible,
.outfit-day-picker button.is-current { background: #dce6dc; }
.outfit-day-picker button.is-current { box-shadow: inset 3px 0 var(--outfit-green); }
.outfit-day-picker span { color: var(--outfit-muted); font-family: var(--studio-mono); font-size: 0.57rem; letter-spacing: 0.08em; }
.outfit-day-picker strong { font-family: var(--studio-display); font-size: 0.92rem; font-weight: 400; line-height: 1.05; }
.outfit-day-copy > span { color: var(--outfit-muted); font-family: var(--studio-mono); font-size: 0.61rem; letter-spacing: 0.08em; text-transform: uppercase; }
.outfit-day-copy h2 { margin: 9px 0; font-family: var(--studio-display); font-size: clamp(2.2rem, 3.4vw, 3.9rem); font-weight: 400; letter-spacing: -0.055em; line-height: 0.9; }
.outfit-day-copy p { margin: 0; color: var(--outfit-muted); line-height: 1.48; }
.outfit-stops { display: grid; gap: 0; margin: 28px 0 0; padding: 0; border-top: 1px solid var(--outfit-rule); list-style: none; }
.outfit-stops li { display: grid; grid-template-columns: 28px 1fr; gap: 9px; padding: 15px 0; border-bottom: 1px solid var(--outfit-rule); }
.outfit-stops li > span { color: var(--outfit-rust); font-family: var(--studio-mono); font-size: 0.61rem; }
.outfit-stops strong { font-family: var(--studio-display); font-size: 1.12rem; font-weight: 400; }
.outfit-stops p { margin: 4px 0 7px; color: var(--outfit-muted); font-size: 0.79rem; line-height: 1.42; }
.outfit-stops small { color: var(--outfit-green); font-family: var(--studio-mono); font-size: 0.55rem; letter-spacing: 0.05em; text-transform: uppercase; }

.outfit-stage {
  position: relative;
  display: flex;
  overflow: hidden;
  align-items: center;
  flex-direction: column;
  border-right: 1px solid var(--outfit-rule);
  background:
    radial-gradient(ellipse at 50% 45%, rgb(255 255 255 / 0.82), transparent 55%),
    repeating-linear-gradient(90deg, transparent 0 39px, rgb(27 38 33 / 0.035) 40px),
    #e2e2da;
}
.outfit-stage__label { display: flex; width: 100%; align-items: baseline; justify-content: space-between; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--outfit-rule); }
.outfit-stage__label span { color: var(--outfit-muted); font-family: var(--studio-mono); font-size: 0.58rem; letter-spacing: 0.09em; text-transform: uppercase; }
.outfit-stage__label strong { font-family: var(--studio-display); font-size: 0.98rem; font-weight: 400; text-align: right; }
.outfit-figure { position: relative; width: min(94%, 350px); aspect-ratio: 0.64; margin: 12px auto 0; flex: 0 0 auto; }
.outfit-figure__puppet,
.outfit-figure__mannequin,
.outfit-figure__layers { position: absolute; inset: 0; }
.outfit-figure__puppet { transform-origin: 50% 84%; }
.outfit-figure__mannequin { z-index: 0; }
.outfit-figure__layers { z-index: 1; }
.outfit-figure__mannequin span { position: absolute; display: block; background: #c3c1b7; box-shadow: inset -9px -6px 14px rgb(68 70 64 / 0.1); }
.outfit-figure__head { top: 3%; left: 41%; width: 18%; height: 13%; border-radius: 48% 48% 44% 44% / 42% 42% 55% 55%; }
.outfit-figure__neck { top: 14%; left: 46.5%; width: 7%; height: 7%; border-radius: 4px; }
.outfit-figure__torso { top: 19%; left: 34%; width: 32%; height: 34%; clip-path: polygon(18% 0, 82% 0, 100% 72%, 74% 100%, 26% 100%, 0 72%); }
.outfit-figure__arm { top: 21%; width: 7%; height: 40%; border-radius: 50% 50% 38% 38%; transform-origin: 50% 4%; }
.outfit-figure__arm--left { left: 31%; transform: rotate(7deg); }
.outfit-figure__arm--right { right: 31%; transform: rotate(-7deg); }
.outfit-figure__leg { top: 49%; width: 8.5%; height: 39%; border-radius: 0 0 42% 42%; }
.outfit-figure__leg--left { left: 40%; transform: rotate(1.5deg); }
.outfit-figure__leg--right { right: 40%; transform: rotate(-1.5deg); }
.outfit-figure__stand { top: 85%; left: 49.25%; width: 1.5%; height: 11%; background: #777a72 !important; box-shadow: none !important; }
.outfit-figure__stand::after { position: absolute; right: -370%; bottom: 0; width: 840%; height: 5px; border-radius: 50%; background: #777a72; content: ""; }
.outfit-piece { position: absolute; z-index: var(--piece-layer); top: var(--piece-top); left: var(--piece-left); display: block; width: var(--piece-width); max-width: none; height: auto; filter: drop-shadow(0 5px 5px rgb(30 36 32 / 0.2)); pointer-events: none; transform: translateX(-50%) rotate(var(--piece-rotate)); transform-origin: 50% 20%; }
.outfit-stage__selection { width: 100%; min-height: 54px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--outfit-rule); }
.outfit-selection-empty { margin: 0; color: var(--outfit-muted); font-family: var(--studio-display); font-size: 1.05rem; text-align: center; }
.outfit-layer-panel header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.outfit-layer-panel header strong,
.outfit-layer-panel header span { font-family: var(--studio-mono); font-size: 0.54rem; letter-spacing: 0.08em; text-transform: uppercase; }
.outfit-layer-panel header span { color: var(--outfit-muted); }
.outfit-layer-panel ol { display: grid; gap: 3px; margin: 0; padding: 0; list-style: none; }
.outfit-layer-panel li { display: grid; min-width: 0; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 7px; align-items: center; padding: 4px 0; border-top: 1px solid rgb(27 38 33 / 0.1); }
.outfit-layer-panel__number { color: var(--outfit-rust); font-family: var(--studio-mono); font-size: 0.53rem; }
.outfit-layer-panel__name { display: grid; min-width: 0; }
.outfit-layer-panel__name small { color: var(--outfit-muted); font-family: var(--studio-mono); font-size: 0.46rem; letter-spacing: 0.06em; text-transform: uppercase; }
.outfit-layer-panel__name strong { overflow: hidden; font-size: 0.68rem; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.outfit-layer-panel__actions { display: grid; grid-template-columns: 1fr 1fr; }
.outfit-layer-panel__actions button { min-height: 28px; padding: 3px 7px; border: 1px solid var(--outfit-rule); background: var(--outfit-paper); color: var(--outfit-ink); cursor: pointer; font-family: var(--studio-mono); font-size: 0.48rem; text-transform: uppercase; }
.outfit-layer-panel__actions button + button { border-left: 0; }
.outfit-layer-panel__actions button:hover,
.outfit-layer-panel__actions button:focus-visible { background: #dce6dc; }
.outfit-layer-panel__actions button:disabled { cursor: not-allowed; opacity: 0.28; }
.outfit-stage__actions { display: grid; width: 100%; grid-template-columns: 1fr auto; gap: 8px; margin-top: 13px; }
.outfit-face-day,
.outfit-clear { min-height: 46px; padding: 11px 14px; border: 1px solid var(--outfit-ink); cursor: pointer; }
.outfit-face-day { background: var(--outfit-ink); color: var(--outfit-paper); }
.outfit-clear { background: transparent; color: var(--outfit-ink); }
.outfit-face-day:hover,
.outfit-face-day:focus-visible { background: var(--outfit-green); }
.outfit-clear:hover,
.outfit-clear:focus-visible { background: #dce6dc; }
.outfit-face-day:disabled,
.outfit-clear:disabled { cursor: not-allowed; opacity: 0.38; }
.outfit-requirement { min-height: 17px; margin: 8px 0 0; color: var(--outfit-muted); font-size: 0.71rem; text-align: center; }

.outfit-wardrobe { display: flex; flex-direction: column; background: var(--outfit-paper); }
.outfit-wardrobe__heading h2 { margin: 8px 0; font-family: var(--studio-display); font-size: clamp(2rem, 3vw, 3.3rem); font-weight: 400; letter-spacing: -0.045em; line-height: 0.95; }
.outfit-wardrobe__heading > p:last-child { max-width: 55ch; margin: 0; color: var(--outfit-muted); font-size: 0.85rem; line-height: 1.45; }
.outfit-rack-tabs { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); margin-top: 22px; border-top: 1px solid var(--outfit-rule); border-left: 1px solid var(--outfit-rule); }
.outfit-rack-tabs button { min-height: 42px; padding: 7px 4px; border: 0; border-right: 1px solid var(--outfit-rule); border-bottom: 1px solid var(--outfit-rule); background: transparent; color: var(--outfit-muted); cursor: pointer; font-family: var(--studio-mono); font-size: clamp(0.5rem, 0.7vw, 0.63rem); letter-spacing: 0.04em; text-transform: uppercase; }
.outfit-rack-tabs button:hover,
.outfit-rack-tabs button:focus-visible,
.outfit-rack-tabs button.is-current { background: #dce6dc; color: var(--outfit-ink); }
.outfit-rack-tabs button.is-current { box-shadow: inset 0 -3px var(--outfit-green); }
.outfit-style-filter { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 12px; }
.outfit-style-filter > span { margin-right: 3px; color: var(--outfit-muted); font-family: var(--studio-mono); font-size: 0.54rem; letter-spacing: 0.08em; text-transform: uppercase; }
.outfit-style-filter button { min-height: 29px; padding: 5px 9px; border: 1px solid var(--outfit-rule); border-radius: 99px; background: transparent; color: var(--outfit-muted); cursor: pointer; font-family: var(--studio-mono); font-size: 0.54rem; }
.outfit-style-filter button:hover,
.outfit-style-filter button:focus-visible,
.outfit-style-filter button.is-current { border-color: var(--outfit-green); background: #dce6dc; color: var(--outfit-ink); }
.outfit-rack { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.outfit-garment {
  display: grid;
  min-width: 0;
  min-height: 270px;
  scroll-margin-top: 82px;
  grid-template-rows: 1fr auto auto auto auto;
  gap: 4px;
  padding: 9px;
  border: 1px solid var(--outfit-rule);
  background: #ebe5d9;
  color: var(--outfit-ink);
  cursor: pointer;
  text-align: left;
}
.outfit-garment:hover,
.outfit-garment:focus-visible { background: #e0e8df; }
.outfit-garment.is-selected { border-color: var(--outfit-green); background: #d7e2d8; box-shadow: inset 0 0 0 2px var(--outfit-green); }
.outfit-garment__image { display: grid; min-height: 160px; overflow: hidden; place-items: center; background: rgb(255 255 255 / 0.45); }
.outfit-garment__image img { display: block; width: 100%; height: 154px; object-fit: contain; filter: drop-shadow(0 4px 4px rgb(33 39 35 / 0.16)); transition: transform 260ms ease; }
.outfit-garment:hover .outfit-garment__image img,
.outfit-garment:focus-visible .outfit-garment__image img { transform: translateY(-3px); }
.outfit-garment__style { justify-self: start; padding: 3px 6px; border: 1px solid currentColor; border-radius: 99px; color: var(--outfit-rust); font-family: var(--studio-mono); font-size: 0.47rem; letter-spacing: 0.04em; line-height: 1; text-transform: uppercase; }
.outfit-garment strong { font-family: var(--studio-display); font-size: 1rem; font-weight: 400; line-height: 1.04; }
.outfit-garment small { color: var(--outfit-muted); font-family: var(--studio-mono); font-size: 0.54rem; }
.outfit-garment > span:last-child { color: var(--outfit-green); font-family: var(--studio-mono); font-size: 0.51rem; line-height: 1.25; text-transform: uppercase; }
.outfit-rack-note,
.outfit-credits-note { margin: 9px 0 0; color: var(--outfit-muted); font-size: 0.66rem; line-height: 1.4; }
.outfit-rack-pages { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--outfit-rule); }
.outfit-rack-pages button { min-height: 32px; padding: 6px 10px; border: 1px solid var(--outfit-rule); background: transparent; color: var(--outfit-ink); cursor: pointer; font-family: var(--studio-mono); font-size: 0.57rem; text-transform: uppercase; }
.outfit-rack-pages button:hover,
.outfit-rack-pages button:focus-visible { border-color: var(--outfit-green); background: #dce6dc; }
.outfit-rack-pages button:disabled { cursor: not-allowed; opacity: 0.38; }
.outfit-rack-pages span { color: var(--outfit-muted); font-family: var(--studio-mono); font-size: 0.56rem; letter-spacing: 0.04em; text-align: center; text-transform: uppercase; }
.outfit-catalogue-progress { display: grid; gap: 7px; margin-top: auto; padding-top: 14px; border-top: 1px solid var(--outfit-rule); color: var(--outfit-muted); font-family: var(--studio-mono); font-size: 0.58rem; letter-spacing: 0.04em; text-transform: uppercase; }
.outfit-catalogue-progress strong { color: var(--outfit-ink); font-size: 0.74rem; }
.outfit-catalogue-progress progress { width: 100%; height: 5px; overflow: hidden; appearance: none; border: 0; border-radius: 99px; background: #d8d2c6; }
.outfit-catalogue-progress progress::-webkit-progress-bar { background: #d8d2c6; }
.outfit-catalogue-progress progress::-webkit-progress-value { background: var(--outfit-green); }
.outfit-catalogue-progress progress::-moz-progress-bar { background: var(--outfit-green); }
.outfit-credits-note { margin-top: 8px; }

/* The consequence walk */
.outfit-journey { width: min(1480px, 100%); margin-inline: auto; overflow: hidden; border: 1px solid var(--outfit-rule); background: var(--outfit-paper); box-shadow: 0 28px 80px rgb(32 43 37 / 0.16); }
.outfit-journey__header { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(480px, 1.2fr); gap: clamp(24px, 5vw, 80px); align-items: end; padding: clamp(22px, 3vw, 42px); }
.outfit-journey__header h2 { margin: 7px 0 8px; font-family: var(--studio-display); font-size: clamp(2.6rem, 5vw, 5.8rem); font-weight: 400; letter-spacing: -0.055em; line-height: 0.86; }
.outfit-journey__header p:last-child { max-width: 56ch; margin: 0; color: var(--outfit-muted); line-height: 1.5; }
.outfit-journey__progress { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; padding: 0; border-top: 1px solid var(--outfit-rule); list-style: none; }
.outfit-journey__progress li { display: grid; min-width: 0; gap: 6px; padding: 12px 12px 0; border-right: 1px solid var(--outfit-rule); color: var(--outfit-muted); }
.outfit-journey__progress li:last-child { border-right: 0; }
.outfit-journey__progress span { width: 23px; height: 23px; border: 1px solid currentColor; border-radius: 50%; font-family: var(--studio-mono); font-size: 0.56rem; line-height: 21px; text-align: center; }
.outfit-journey__progress strong { overflow: hidden; font-family: var(--studio-display); font-size: 1rem; font-weight: 400; text-overflow: ellipsis; white-space: nowrap; }
.outfit-journey__progress li.is-current { color: var(--outfit-rust); }
.outfit-journey__progress li.is-current span { background: var(--outfit-rust); color: var(--outfit-paper); }
.outfit-journey__progress li.is-done { color: var(--outfit-green); }
.outfit-journey__progress li.is-done span { background: var(--outfit-green); color: var(--outfit-paper); }

.outfit-walk-scene { --scene-edge: #56685f; --scene-paper: #eee4d1; position: relative; min-height: clamp(440px, 55vh, 650px); overflow: hidden; border-block: 1px solid var(--outfit-rule); background: #d7d0c2; isolation: isolate; }
.outfit-walk-scene::before { position: absolute; z-index: 10; inset: 10px; border: 1px solid rgb(245 240 231 / 0.62); box-shadow: inset 0 0 0 1px rgb(27 38 33 / 0.14); content: ""; pointer-events: none; }
.outfit-set { position: absolute; z-index: 0; inset: 0; overflow: hidden; color: var(--outfit-ink); }
.outfit-set--weather { --scene-edge: #53666b; --scene-paper: #d9e0df; }
.outfit-set--interior { --scene-edge: #665846; --scene-paper: #e7dcc6; }
.outfit-set--water { --scene-edge: #334f5c; --scene-paper: #d4dde0; }
.outfit-set--street { --scene-edge: #685b4c; --scene-paper: #e3d7c5; }
.outfit-set--garden { --scene-edge: #43543d; --scene-paper: #dce0c7; }
.outfit-set--ceremony { --scene-edge: #68483f; --scene-paper: #e6d8c7; }
.outfit-set--night { --scene-edge: #222a31; --scene-paper: #d2c5ad; }
.outfit-set__backdrop { position: absolute; z-index: 0; top: -3%; left: -3%; display: block; width: 106%; height: 106%; object-fit: cover; object-position: var(--scene-x) var(--scene-y); filter: saturate(0.9) contrast(1.03); transform: scale(1.04) translate3d(-1.2%, 0, 0); animation: outfit-backdrop-pan 3.9s cubic-bezier(0.18, 0.65, 0.22, 1) both; }
.outfit-set[data-scene="snow"] .outfit-set__backdrop { filter: saturate(0.48) brightness(1.12) contrast(0.94); }
.outfit-set[data-scene="portrait"] .outfit-set__backdrop { filter: saturate(0.62) contrast(1.1); }
.outfit-set[data-scene="karaoke"] .outfit-set__backdrop { filter: saturate(1.08) brightness(0.88); }
.outfit-set__wash { position: absolute; z-index: 1; inset: 0; background: linear-gradient(90deg, rgb(239 229 210 / 0.2), transparent 28% 70%, rgb(28 37 33 / 0.13)), radial-gradient(ellipse at 52% 58%, transparent 25%, rgb(28 37 33 / 0.1) 100%); pointer-events: none; }
.outfit-set::after { position: absolute; z-index: 9; inset: 0; background: repeating-linear-gradient(4deg, transparent 0 7px, rgb(58 48 39 / 0.025) 8px); content: ""; mix-blend-mode: multiply; pointer-events: none; }
.outfit-set__sign { position: absolute; z-index: 8; top: 6%; left: 4%; padding: 10px 14px 9px; border: 1px solid var(--outfit-ink); background: rgb(245 240 231 / 0.96); box-shadow: 6px 7px 0 rgb(27 38 33 / 0.18); font-family: var(--studio-mono); font-size: clamp(0.58rem, 1vw, 0.74rem); letter-spacing: 0.09em; opacity: 0; text-transform: uppercase; transform: scale(0.72) rotate(-5deg); animation: outfit-sign-in 0.42s steps(3, end) 0.22s both, outfit-sign-away 0.28s steps(2, end) 1.96s forwards; }
.outfit-set__sign::before { position: absolute; top: -8px; left: 38%; width: 42px; height: 14px; background: rgb(219 204 174 / 0.82); content: ""; opacity: 0.82; transform: rotate(3deg); }
.outfit-set__cast { position: absolute; z-index: 3; inset: 0; pointer-events: none; }
.outfit-set__person { --cast-enter: 22px; --cast-tilt: 1deg; position: absolute; bottom: 9%; display: block; width: clamp(88px, 11vw, 144px); opacity: 0; filter: sepia(0.08) saturate(0.82) drop-shadow(7px 8px 5px rgb(27 38 33 / 0.2)); transform-origin: 50% 100%; animation: outfit-cast-life 3.9s steps(6, end) both; }
.outfit-set__person--left { --cast-tilt: -1.5deg; left: 2.5%; }
.outfit-set__person--right { right: 2.5%; }
.outfit-figure--cast { width: 100%; margin: 0; }
.outfit-figure--cast .outfit-figure__stand { display: none; }
.outfit-figure--cast .outfit-piece { filter: drop-shadow(0 4px 3px rgb(27 38 33 / 0.19)); }
.outfit-set__person .outfit-figure__arm--right { animation: outfit-cast-wave 0.72s steps(3, end) 1.75s 1; }
.outfit-set__particles { position: absolute; z-index: 4; inset: 0; overflow: hidden; pointer-events: none; }
.outfit-set__particles i { position: absolute; top: -14%; left: 8%; display: block; width: 5px; height: 42px; background: var(--scene-paper); box-shadow: 2px 2px 0 rgb(27 38 33 / 0.12); opacity: 0.48; animation: outfit-particle-fall 2.1s linear infinite; transform: rotate(13deg); }
.outfit-set__particles i:nth-child(2) { left: 18%; animation-delay: -0.8s; }
.outfit-set__particles i:nth-child(3) { left: 29%; animation-delay: -1.4s; }
.outfit-set__particles i:nth-child(4) { left: 39%; animation-delay: -0.3s; }
.outfit-set__particles i:nth-child(5) { left: 50%; animation-delay: -1.1s; }
.outfit-set__particles i:nth-child(6) { left: 61%; animation-delay: -0.5s; }
.outfit-set__particles i:nth-child(7) { left: 71%; animation-delay: -1.7s; }
.outfit-set__particles i:nth-child(8) { left: 80%; animation-delay: -0.2s; }
.outfit-set__particles i:nth-child(9) { left: 89%; animation-delay: -1.3s; }
.outfit-set__particles i:nth-child(10) { left: 96%; animation-delay: -0.65s; }
.outfit-set--water .outfit-set__particles i,
.outfit-set--street .outfit-set__particles i { top: 18%; width: 22px; height: 3px; border-radius: 50%; animation-name: outfit-particle-drift; animation-duration: 3.4s; }
.outfit-set--garden .outfit-set__particles i,
.outfit-set--ceremony .outfit-set__particles i { width: 9px; height: 9px; border-radius: 50% 10% 50% 10%; background: #c78978; animation-duration: 3s; }
.outfit-set--night .outfit-set__particles i { width: 7px; height: 12px; background: #d6b768; animation-duration: 2.7s; }
.outfit-set[data-scene="snow"] .outfit-set__particles i { width: 11px; height: 11px; border-radius: 50%; background: #f6f1e8; opacity: 0.92; animation-duration: 3.2s; transform: none; }
.outfit-set[data-scene="thesis"] .outfit-set__particles i,
.outfit-set[data-scene="ladder"] .outfit-set__particles i,
.outfit-set[data-scene="radio"] .outfit-set__particles i { width: 24px; height: 18px; border: 1px solid rgb(76 60 43 / 0.28); background: #eee4d1; animation-duration: 2.8s; }
.outfit-set[data-scene="umbrella"] .outfit-set__particles i,
.outfit-set[data-scene="portrait"] .outfit-set__particles i { top: 14%; left: -12%; width: 78px; height: 3px; animation-name: outfit-particle-wind; animation-duration: 1.5s; }
.outfit-set__foreground { position: absolute; z-index: 7; right: 0; bottom: -2%; left: 0; height: 15%; pointer-events: none; }
.outfit-set__foreground i { position: absolute; bottom: 0; display: block; width: 36%; height: 100%; background: var(--scene-edge); filter: drop-shadow(0 -5px 5px rgb(27 38 33 / 0.2)); opacity: 0.9; }
.outfit-set__foreground i:first-child { left: -4%; clip-path: polygon(0 18%, 22% 5%, 47% 23%, 72% 9%, 100% 35%, 92% 100%, 0 100%); }
.outfit-set__foreground i:last-child { right: -4%; clip-path: polygon(0 31%, 26% 8%, 53% 22%, 76% 4%, 100% 17%, 100% 100%, 8% 100%); }
.outfit-set--interior .outfit-set__foreground i,
.outfit-set--street .outfit-set__foreground i { opacity: 0.74; }
.outfit-set--garden .outfit-set__foreground i { background: #354b32; }
.outfit-set--ceremony .outfit-set__foreground i { background: #6b413b; }
.outfit-set--night .outfit-set__foreground i { background: #171d22; }

.outfit-walker { position: absolute; z-index: 6; bottom: 4%; left: 0; width: clamp(170px, 20vw, 245px); will-change: transform; animation: outfit-side-cross 3.65s cubic-bezier(0.2, 0.62, 0.24, 1) both; }
.outfit-walker::after { position: absolute; z-index: -1; bottom: 1%; left: 18%; width: 64%; height: 7%; border-radius: 50%; background: rgb(20 27 24 / 0.24); content: ""; filter: blur(3px); animation: outfit-walk-shadow 0.48s steps(2, end) infinite; }
.outfit-walker .outfit-figure--walking { width: 100%; margin: 0; }
.outfit-figure--walking .outfit-figure__stand { display: none; }
.outfit-figure--walking .outfit-figure__puppet { animation: outfit-puppet-bob 0.48s steps(2, end) infinite; }
.outfit-figure--walking .outfit-figure__arm--left { animation: outfit-arm-left 0.48s steps(2, end) infinite; }
.outfit-figure--walking .outfit-figure__arm--right { animation: outfit-arm-right 0.48s steps(2, end) infinite; }
.outfit-figure--walking .outfit-figure__leg--left { animation: outfit-leg-left 0.48s steps(2, end) infinite; }
.outfit-figure--walking .outfit-figure__leg--right { animation: outfit-leg-right 0.48s steps(2, end) infinite; }
.outfit-figure--walking .outfit-piece { animation: outfit-cloth-jiggle 0.64s steps(2, end) infinite; filter: drop-shadow(0 8px 6px rgb(20 27 24 / 0.3)); }
.outfit-walk-scene[data-band="ready"] .outfit-figure--walking .outfit-figure__puppet { animation: outfit-puppet-bob 0.48s steps(2, end) infinite, outfit-ready-hop 0.62s steps(3, end) 1.88s 1; }
.outfit-walk-scene[data-band="questionable"] .outfit-figure--walking .outfit-figure__puppet { animation: outfit-puppet-bob 0.48s steps(2, end) infinite, outfit-wobble 0.82s steps(4, end) 1.88s 1; }
.outfit-walk-scene[data-band="trouble"] .outfit-figure--walking .outfit-figure__puppet { animation: outfit-puppet-bob 0.48s steps(2, end) infinite, outfit-stumble 0.95s steps(5, end) 1.8s 1; }
.outfit-scene-reaction { position: absolute; z-index: 6; bottom: 19%; left: 57%; width: clamp(120px, 15vw, 190px); aspect-ratio: 1; pointer-events: none; }
.outfit-scene-reaction i { --rx: -62px; --ry: -65px; --rr: -28deg; position: absolute; top: 54%; left: 45%; display: block; width: 16px; height: 16px; border: 1px solid currentColor; background: var(--scene-paper); color: var(--outfit-green); opacity: 0; clip-path: polygon(50% 0, 64% 33%, 100% 36%, 72% 58%, 81% 100%, 50% 76%, 18% 100%, 28% 58%, 0 36%, 36% 33%); animation: outfit-paper-burst 0.84s steps(5, end) 1.95s both; }
.outfit-scene-reaction i:nth-child(2) { --rx: 4px; --ry: -92px; --rr: 35deg; }
.outfit-scene-reaction i:nth-child(3) { --rx: 68px; --ry: -62px; --rr: 72deg; }
.outfit-scene-reaction i:nth-child(4) { --rx: 82px; --ry: 3px; --rr: 118deg; }
.outfit-scene-reaction i:nth-child(5) { --rx: 45px; --ry: 63px; --rr: 164deg; }
.outfit-scene-reaction i:nth-child(6) { --rx: -45px; --ry: 59px; --rr: -146deg; }
.outfit-scene-reaction i:nth-child(7) { --rx: -84px; --ry: 4px; --rr: -92deg; }
.outfit-walk-scene[data-band="questionable"] .outfit-scene-reaction i { width: 20px; height: 13px; border-color: #80601a; background: #e5d4a5; color: #80601a; clip-path: polygon(0 8%, 100% 0, 94% 100%, 5% 88%); animation-name: outfit-paper-flutter; }
.outfit-walk-scene[data-band="trouble"] .outfit-scene-reaction i { width: 7px; height: 34px; border: 0; background: var(--outfit-rust); color: var(--outfit-rust); clip-path: polygon(0 0, 100% 8%, 62% 47%, 100% 100%, 0 91%, 36% 51%); animation-name: outfit-paper-rip; }
.outfit-walk-impact { position: absolute; z-index: 8; top: clamp(18px, 4vw, 48px); right: clamp(18px, 4vw, 54px); width: min(330px, calc(100% - 36px)); padding: 17px 19px 18px; border: 2px solid currentColor; background: rgb(245 240 231 / 0.97); color: var(--outfit-rust); box-shadow: 9px 10px 0 rgb(27 38 33 / 0.2); clip-path: polygon(2% 2%, 98% 0, 100% 94%, 4% 100%, 0 54%); opacity: 0; transform: scale(0.68) rotate(7deg); transform-origin: 80% 0; animation: outfit-impact-in 0.48s steps(4, end) 2.24s both; }
.outfit-walk-impact::before { position: absolute; top: -7px; right: 24%; width: 56px; height: 15px; background: rgb(214 196 161 / 0.84); content: ""; transform: rotate(-3deg); }
.outfit-walk-scene[data-band="ready"] .outfit-walk-impact { color: var(--outfit-green); }
.outfit-walk-scene[data-band="questionable"] .outfit-walk-impact { color: #80601a; }
.outfit-walk-impact > span { font-family: var(--studio-mono); font-size: 0.54rem; letter-spacing: 0.09em; text-transform: uppercase; }
.outfit-walk-impact > strong { display: block; margin-top: 2px; font-family: var(--studio-display); font-size: clamp(2.1rem, 3.5vw, 3.5rem); font-weight: 400; letter-spacing: -0.04em; line-height: 0.9; }
.outfit-walk-impact p { margin: 8px 0 0; color: var(--outfit-ink); font-size: 0.82rem; line-height: 1.38; }
.outfit-journey__footer { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px; align-items: center; padding: 17px clamp(18px, 3vw, 40px); }
.outfit-journey__evidence { display: grid; max-width: 78ch; gap: 5px; }
.outfit-journey__evidence span { color: var(--outfit-rust); font-family: var(--studio-mono); font-size: 0.56rem; letter-spacing: 0.08em; text-transform: uppercase; }
.outfit-journey__evidence p { margin: 0; color: var(--outfit-muted); font-size: 0.78rem; line-height: 1.48; }
.outfit-journey__actions { display: grid; min-width: 220px; gap: 7px; justify-items: end; }
.outfit-journey__actions > span { color: var(--outfit-muted); font-family: var(--studio-mono); font-size: 0.54rem; letter-spacing: 0.07em; text-transform: uppercase; }
.outfit-journey__actions .outfit-clear { min-height: 42px; }

@keyframes outfit-side-cross {
  0% { transform: translate3d(-115%, 5%, 0) rotate(-3deg); }
  13% { transform: translate3d(5vw, 0, 0) rotate(1deg); }
  56% { transform: translate3d(51vw, 0, 0) rotate(-1deg); }
  74% { transform: translate3d(54vw, 0, 0) rotate(0.5deg); }
  84% { transform: translate3d(57vw, 0, 0) rotate(-0.5deg); }
  100% { transform: translate3d(105vw, 1%, 0) rotate(2deg); }
}
@keyframes outfit-backdrop-pan { 0% { transform: scale(1.07) translate3d(-1.6%, 0, 0); } 48% { transform: scale(1.045) translate3d(0, -0.4%, 0); } 100% { transform: scale(1.06) translate3d(1.6%, 0, 0); } }
@keyframes outfit-sign-in { to { opacity: 1; transform: scale(1) rotate(-1.5deg); } }
@keyframes outfit-sign-away { to { opacity: 0; transform: translateY(-18px) rotate(2deg); } }
@keyframes outfit-cast-life { 0% { opacity: 0; transform: translateY(var(--cast-enter)) rotate(var(--cast-tilt)); } 14%, 46% { opacity: 0.88; transform: translateY(0) rotate(var(--cast-tilt)); } 55% { opacity: 0.94; transform: translateY(-7px) rotate(calc(var(--cast-tilt) + 2deg)); } 68%, 100% { opacity: 0.88; transform: translateY(0) rotate(var(--cast-tilt)); } }
@keyframes outfit-cast-wave { 0%, 100% { transform: rotate(-7deg); } 45% { transform: rotate(-44deg); } 70% { transform: rotate(-16deg); } }
@keyframes outfit-puppet-bob { 0%, 100% { transform: translateY(0) rotate(-1deg) scaleY(1); } 50% { transform: translateY(-8px) rotate(1deg) scaleY(0.985); } }
@keyframes outfit-arm-left { 0%, 100% { transform: rotate(14deg); } 50% { transform: rotate(-9deg); } }
@keyframes outfit-arm-right { 0%, 100% { transform: rotate(-14deg); } 50% { transform: rotate(9deg); } }
@keyframes outfit-leg-left { 0%, 100% { transform: rotate(8deg); } 50% { transform: rotate(-7deg); } }
@keyframes outfit-leg-right { 0%, 100% { transform: rotate(-8deg); } 50% { transform: rotate(7deg); } }
@keyframes outfit-cloth-jiggle { 0%, 100% { transform: translateX(-50%) translateY(0) rotate(var(--piece-rotate)); } 50% { transform: translateX(-50%) translateY(-3px) rotate(calc(var(--piece-rotate) + 0.8deg)); } }
@keyframes outfit-ready-hop { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-24px) rotate(-2deg); } }
@keyframes outfit-wobble { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-6deg); } 65% { transform: rotate(7deg); } }
@keyframes outfit-stumble { 0%, 100% { transform: translateY(0) rotate(0); } 35% { transform: translateY(10px) rotate(11deg); } 68% { transform: translateY(-3px) rotate(-8deg); } }
@keyframes outfit-walk-shadow { 50% { opacity: 0.56; transform: scaleX(0.8); } }
@keyframes outfit-impact-in { to { opacity: 1; transform: scale(1) rotate(-1deg); } }
@keyframes outfit-paper-burst { 0% { opacity: 0; transform: translate(0, 0) scale(0.2) rotate(0); } 24% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--rx), var(--ry)) scale(1.1) rotate(var(--rr)); } }
@keyframes outfit-paper-flutter { 0% { opacity: 0; transform: translate(0, 0) scale(0.2) rotate(0); } 28%, 62% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--rx), var(--ry)) scale(1) rotate(var(--rr)); } }
@keyframes outfit-paper-rip { 0% { opacity: 0; transform: translate(0, 0) scaleY(0.2) rotate(0); } 22%, 70% { opacity: 0.9; } 100% { opacity: 0; transform: translate(var(--rx), var(--ry)) scaleY(1.2) rotate(var(--rr)); } }
@keyframes outfit-particle-fall { to { transform: translate3d(-55px, 720px, 0) rotate(48deg); } }
@keyframes outfit-particle-drift { to { transform: translate3d(115vw, 65px, 0) rotate(8deg); } }
@keyframes outfit-particle-wind { to { transform: translate3d(120vw, 120px, 0); } }

.outfit-results { display: grid; width: min(1480px, 100%); grid-template-columns: minmax(310px, 0.46fr) minmax(0, 1.54fr); margin-inline: auto; border: 1px solid var(--outfit-rule); background: var(--outfit-paper); box-shadow: 0 28px 80px rgb(32 43 37 / 0.16); }
.outfit-results__summary { display: flex; min-width: 0; flex-direction: column; align-items: center; padding: clamp(24px, 3vw, 44px); border-right: 1px solid var(--outfit-rule); background: #e0e1d8; text-align: center; }
.outfit-results__day { display: grid; width: 100%; gap: 3px; padding-bottom: 12px; border-bottom: 1px solid var(--outfit-rule); text-align: left; }
.outfit-results__day span,
.outfit-results__count,
.outfit-style-title span { color: var(--outfit-muted); font-family: var(--studio-mono); font-size: 0.59rem; letter-spacing: 0.09em; text-transform: uppercase; }
.outfit-results__day strong { font-family: var(--studio-display); font-size: 1.2rem; font-weight: 400; }
.outfit-figure--compact { width: min(76%, 250px); margin-top: 8px; }
.outfit-results__count { margin: 4px 0 10px; padding: 7px 10px; border: 1px solid var(--outfit-green); color: var(--outfit-green); transform: rotate(-1.5deg); }
.outfit-results__summary h2 { max-width: 11ch; margin: 0; font-family: var(--studio-display); font-size: clamp(2.2rem, 3.5vw, 4rem); font-weight: 400; letter-spacing: -0.055em; line-height: 0.92; }
.outfit-results__verdict { max-width: 33ch; margin: 13px 0 0; color: var(--outfit-muted); line-height: 1.45; }
.outfit-style-title { display: grid; gap: 4px; width: 100%; margin: 24px 0 0; padding: 14px 0; border-block: 1px solid var(--outfit-rule); }
.outfit-style-title strong { font-family: var(--studio-display); font-size: 1.3rem; font-weight: 400; }
.outfit-results__actions { display: grid; width: 100%; grid-template-columns: 1fr; gap: 8px; margin-top: 16px; }
.outfit-results__details { min-width: 0; align-self: start; background: #f5f0e7; }
.outfit-results__details > summary { padding: clamp(24px, 3vw, 42px); border-bottom: 1px solid transparent; cursor: pointer; font-family: var(--studio-display); font-size: clamp(1.8rem, 3vw, 3.2rem); letter-spacing: -0.04em; }
.outfit-results__details[open] > summary { border-bottom-color: var(--outfit-rule); }
.outfit-results__details > summary:focus-visible { outline: 3px solid var(--outfit-green); outline-offset: -6px; }
.outfit-postcards { display: grid; min-width: 0; grid-template-columns: repeat(3, minmax(0, 1fr)); align-content: start; }
.outfit-postcard { position: relative; min-width: 0; padding: clamp(20px, 2.4vw, 34px); border-right: 1px solid var(--outfit-rule); border-bottom: 1px solid var(--outfit-rule); background: #f5f0e7; }
.outfit-postcard:nth-child(3) { border-right: 0; }
.outfit-postcard header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.outfit-postcard header span { color: var(--outfit-muted); font-family: var(--studio-mono); font-size: 0.58rem; letter-spacing: 0.08em; text-transform: uppercase; }
.outfit-postcard header strong { padding: 6px 8px; border: 2px solid currentColor; color: var(--outfit-rust); font-family: var(--studio-mono); font-size: 0.59rem; letter-spacing: 0.08em; text-transform: uppercase; transform: rotate(2deg); }
.outfit-postcard[data-band="ready"] header strong { color: var(--outfit-green); transform: rotate(-2deg); }
.outfit-postcard[data-band="questionable"] header strong { color: #8a681c; }
.outfit-postcard__trace { position: relative; height: 34px; margin: 22px 0 18px; border-bottom: 1px solid var(--outfit-rule); }
.outfit-postcard__trace::before { position: absolute; bottom: -5px; left: 0; width: 9px; height: 9px; border: 2px solid currentColor; border-radius: 50%; background: var(--outfit-paper); content: ""; }
.outfit-postcard__trace::after { position: absolute; right: 0; bottom: -3px; width: 7px; height: 7px; background: currentColor; content: ""; transform: rotate(45deg); }
.outfit-postcard__trace span { color: var(--outfit-muted); font-family: var(--studio-mono); font-size: 0.55rem; letter-spacing: 0.07em; text-transform: uppercase; }
.outfit-postcard h3 { margin: 0; font-family: var(--studio-display); font-size: clamp(1.7rem, 2.4vw, 2.7rem); font-weight: 400; letter-spacing: -0.04em; line-height: 0.95; }
.outfit-postcard > p { margin: 9px 0 0; color: var(--outfit-muted); font-size: 0.84rem; line-height: 1.45; }
.outfit-postcard .outfit-postcard__evidence { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--outfit-rule); color: var(--outfit-ink); }
.outfit-object-record { display: grid; grid-column: 1 / -1; grid-template-columns: minmax(230px, 0.55fr) minmax(0, 1.45fr); gap: 30px; padding: clamp(24px, 3vw, 42px); }
.outfit-object-record h2 { margin: 7px 0 0; font-family: var(--studio-display); font-size: clamp(1.9rem, 3vw, 3.3rem); font-weight: 400; letter-spacing: -0.045em; line-height: 0.95; }
.outfit-object-record ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; margin: 0; padding: 0; border-top: 1px solid var(--outfit-rule); list-style: none; }
.outfit-object-record li { min-width: 0; border-bottom: 1px solid var(--outfit-rule); }
.outfit-object-record li:nth-child(odd) { border-right: 1px solid var(--outfit-rule); }
.outfit-object-record a { display: grid; gap: 3px; padding: 11px 13px; text-decoration: none; }
.outfit-object-record a:hover,
.outfit-object-record a:focus-visible { background: #dce6dc; }
.outfit-object-record strong { overflow: hidden; font-family: var(--studio-display); font-size: 0.98rem; font-weight: 400; text-overflow: ellipsis; white-space: nowrap; }
.outfit-object-record span { color: var(--outfit-muted); font-family: var(--studio-mono); font-size: 0.52rem; text-transform: uppercase; }

@media (max-width: 1180px) {
  .outfit-workspace { grid-template-columns: minmax(300px, 0.78fr) minmax(440px, 1.22fr); }
  .outfit-brief { display: grid; grid-column: 1 / -1; grid-template-columns: 0.7fr 0.85fr 1.45fr; gap: 24px; align-items: start; border-right: 0; border-bottom: 1px solid var(--outfit-rule); }
  .outfit-brief > .game-eyebrow { display: none; }
  .outfit-day-picker { margin: 0; }
  .outfit-day-copy h2 { font-size: clamp(2rem, 4vw, 3.4rem); }
  .outfit-stops { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 0; border-top: 0; }
  .outfit-stops li { padding: 0 12px; border-right: 1px solid var(--outfit-rule); border-bottom: 0; }
  .outfit-stops li:last-child { border-right: 0; }
  .outfit-stage { border-right: 1px solid var(--outfit-rule); }
  .outfit-journey__header { grid-template-columns: minmax(0, 0.75fr) minmax(440px, 1.25fr); }
}

@media (max-width: 780px) {
  .outfit-day-gate { padding: 82px 16px 24px; }
  .outfit-day-gate h1 { margin-bottom: 30px; font-size: clamp(3.6rem, 15vw, 5.8rem); }
  .outfit-day-gate__choices { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .outfit-day-gate__choices button { min-height: 70px; padding-inline: 10px; }
  .outfit-day-gate__choices button:hover,
  .outfit-day-gate__choices button:focus-visible { padding-left: 16px; }
  .outfit-experience { padding: 78px 10px 24px; }
  .outfit-assembly-header { grid-template-columns: 1fr; gap: 18px; margin-bottom: 18px; }
  .outfit-assembly-header h1 { font-size: clamp(3.2rem, 13vw, 5rem); }
  .outfit-assembly-header button { width: min(320px, 100%); }
  .outfit-header { grid-template-columns: 1fr; gap: 14px; }
  .outfit-header h1 { font-size: clamp(3.2rem, 14vw, 5.2rem); }
  .outfit-header > p { max-width: 58ch; }
  .outfit-workspace { grid-template-columns: 1fr; }
  .outfit-brief { display: block; grid-column: auto; padding: 20px; }
  .outfit-brief > .game-eyebrow { display: block; }
  .outfit-day-picker { margin: 14px 0 24px; }
  .outfit-stops { display: grid; grid-template-columns: 1fr; margin-top: 24px; border-top: 1px solid var(--outfit-rule); }
  .outfit-stops li { padding: 13px 0; border-right: 0; border-bottom: 1px solid var(--outfit-rule); }
  .outfit-stage { min-height: 690px; border-right: 0; border-bottom: 1px solid var(--outfit-rule); }
  .outfit-figure { width: min(90%, 330px); }
  .outfit-rack { grid-auto-columns: minmax(145px, 44%); grid-template-columns: none; grid-auto-flow: column; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x mandatory; }
  .outfit-garment { min-height: 262px; scroll-snap-align: start; }
  .outfit-garment__image { min-height: 155px; }
  .outfit-garment__image img { height: 150px; }
  .outfit-layer-panel__actions button { min-height: 32px; }
  .outfit-journey__header { grid-template-columns: 1fr; gap: 24px; }
  .outfit-journey__progress { margin-top: 4px; }
  .outfit-journey__footer { grid-template-columns: 1fr; }
  .outfit-journey__actions { min-width: 0; justify-items: stretch; }
  .outfit-walk-scene { min-height: 520px; }
  .outfit-walker { width: clamp(165px, 35vw, 210px); bottom: 8%; }
  .outfit-set__person { width: clamp(78px, 17vw, 112px); }
  .outfit-set__foreground { height: 12%; }
  .outfit-scene-reaction { left: 54%; }
  .outfit-results { grid-template-columns: 1fr; }
  .outfit-results__summary { border-right: 0; border-bottom: 1px solid var(--outfit-rule); }
  .outfit-figure--compact { width: min(68%, 230px); }
  .outfit-postcards { grid-template-columns: 1fr; }
  .outfit-postcard { border-right: 0; }
  .outfit-object-record { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .outfit-day-gate h1 { font-size: clamp(3.35rem, 17vw, 4.8rem); }
  .outfit-day-gate__choices button { min-height: 66px; font-size: 1rem; }
  .outfit-header h1 { font-size: clamp(3rem, 17vw, 4.4rem); }
  .outfit-day-picker { grid-auto-columns: minmax(150px, 58%); grid-template-columns: none; grid-auto-flow: column; overflow-x: auto; padding-bottom: 7px; scroll-snap-type: x mandatory; }
  .outfit-day-picker button { scroll-snap-align: start; }
  .outfit-stage { min-height: 650px; padding-inline: 14px; }
  .outfit-figure { width: min(100%, 300px); }
  .outfit-layer-panel li { grid-template-columns: 20px minmax(0, 1fr) auto; gap: 5px; }
  .outfit-layer-panel__actions button { min-height: 34px; padding-inline: 6px; }
  .outfit-rack-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .outfit-rack-tabs button { min-height: 40px; }
  .outfit-journey__header { padding: 18px 16px; }
  .outfit-journey__header h2 { font-size: clamp(2.5rem, 13vw, 4rem); }
  .outfit-journey__progress li { padding-inline: 7px; }
  .outfit-journey__progress strong { font-size: 0.78rem; }
  .outfit-walk-scene { min-height: 480px; }
  .outfit-walker { width: 168px; bottom: 12%; }
  .outfit-set__sign { top: 5%; left: 3%; }
  .outfit-set__person { bottom: 9%; width: 76px; }
  .outfit-set__person--left { left: 1%; }
  .outfit-set__person--right { right: 1%; }
  .outfit-set__foreground { height: 11%; }
  .outfit-scene-reaction { bottom: 28%; left: 54%; width: 130px; }
  .outfit-walk-impact { top: 5%; right: 10px; bottom: auto; left: auto; width: min(270px, calc(100% - 20px)); padding: 14px 16px; }
  .outfit-walk-impact > strong { font-size: 2.45rem; }
  .outfit-journey__actions { grid-template-columns: 1fr; }
  .outfit-stage__actions,
  .outfit-results__actions { grid-template-columns: 1fr; }
  .outfit-face-prompt__card > div { grid-template-columns: 1fr; }
  .outfit-object-record ul { grid-template-columns: 1fr; }
  .outfit-object-record li:nth-child(odd) { border-right: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .outfit-day-gate__preview { transition: none; }
  .outfit-day-gate__choices button { transition: none; }
  .outfit-face-prompt__card { animation: none; }
  .outfit-results [data-outfit-replay] { display: none; }
  .outfit-set__backdrop,
  .outfit-set__sign,
  .outfit-set__person,
  .outfit-set__person .outfit-figure__arm--right,
  .outfit-set__particles i,
  .outfit-walker,
  .outfit-walker::after,
  .outfit-figure--walking .outfit-figure__puppet,
  .outfit-figure--walking .outfit-figure__arm--left,
  .outfit-figure--walking .outfit-figure__arm--right,
  .outfit-figure--walking .outfit-figure__leg--left,
  .outfit-figure--walking .outfit-figure__leg--right,
  .outfit-figure--walking .outfit-piece,
  .outfit-scene-reaction i,
  .outfit-walk-impact { animation: none !important; }
  .outfit-set__backdrop { transform: scale(1.04); }
  .outfit-set__sign,
  .outfit-set__person,
  .outfit-walk-impact { opacity: 1; transform: none; }
  .outfit-walker { left: 38%; transform: none; }
  .outfit-scene-reaction { display: none; }
}

/* Open Plan ------------------------------------------------------------- */

.openplan {
  --openplan-ink: #f4ecff;
  --openplan-void: #150d24;
  --openplan-hot: #ff2f6d;
  --openplan-cool: #2ff0d6;
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: var(--openplan-void);
  color: var(--openplan-ink);
  font-family: var(--studio-sans, system-ui, sans-serif);
}

.openplan__canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  touch-action: none;
}
.openplan__canvas:focus-visible { outline: 3px solid var(--openplan-cool); outline-offset: -6px; }

.openplan [hidden] { display: none; }

.openplan__veil,
.openplan__ending,
.openplan__pause {
  position: absolute;
  z-index: 3;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 32px 24px;
  background: radial-gradient(120% 90% at 50% 40%, #35204f 0%, #150d24 70%);
}
.openplan__ending,
.openplan__pause { background: rgb(21 13 36 / 0.86); backdrop-filter: blur(6px); }

.openplan__application {
  position: absolute;
  z-index: 4;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgb(9 5 17 / 0.38);
}
.openplan__application-stage { width: min(560px, 92vw); text-align: center; }
.openplan__application-stage > .openplan__eyebrow { color: #fff2a8; }
.openplan__application-paper {
  position: relative;
  width: min(500px, 86vw);
  min-height: 290px;
  margin: 0 auto 20px;
  padding: 34px 42px;
  overflow: hidden;
  border: 2px solid #7b633d;
  background: #f3e9c9;
  box-shadow: 0 18px 70px rgb(0 0 0 / 0.55);
  color: #312438;
  text-align: left;
  transform: rotate(-1.5deg);
  transition: scale 420ms ease, rotate 420ms ease, opacity 420ms ease;
}
.openplan__application-paper::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.18;
  background: repeating-linear-gradient(0deg, transparent 0 9px, #6f5e3c 10px);
}
.openplan__application-paper.is-manager {
  width: min(380px, 82vw);
  min-height: 0;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.openplan__application-paper.is-manager::before { display: none; }
.openplan__manager-meal {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}
.openplan__manager-meal img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
  filter: drop-shadow(0 18px 28px rgb(0 0 0 / 0.58));
}
.openplan__application-paper > p { position: relative; margin: 12px 0; font: 700 0.78rem/1.4 var(--studio-mono, ui-monospace, monospace); }
.openplan__application-paper .openplan__application-stamp {
  width: max-content;
  margin: 6px auto 36px;
  padding: 10px 18px;
  border: 8px double #bd2844;
  color: #bd2844;
  font-size: clamp(1.65rem, 7vw, 3rem);
  line-height: 0.86;
  letter-spacing: -0.05em;
  text-align: center;
  transform: rotate(-6deg);
  white-space: pre-line;
}
.openplan__eat-prompt {
  margin: 0 0 16px;
  color: #fff7bc;
  font: 900 clamp(2.2rem, 9vw, 5.4rem)/0.9 var(--studio-mono, ui-monospace, monospace);
  letter-spacing: -0.08em;
  text-shadow: -5px 0 #ff2f6d, 5px 0 #2ff0d6;
  animation: openplan-eat 480ms steps(2, end) infinite;
}
.openplan__bite {
  position: absolute;
  z-index: 2;
  inset: 0;
  background: #130a20;
  opacity: 0;
  scale: 0.92;
  transition: opacity 80ms linear, scale 160ms steps(2, end);
}
.openplan__bite.is-visible { opacity: 1; scale: 1; }
.openplan__bite--1 { clip-path: polygon(0 0, 100% 0, 100% 22%, 88% 27%, 74% 20%, 58% 28%, 43% 21%, 29% 27%, 14% 20%, 0 25%); }
.openplan__bite--2 { clip-path: polygon(0 16%, 14% 17%, 29% 15%, 43% 17%, 58% 16%, 74% 15%, 88% 17%, 100% 16%, 100% 44%, 88% 49%, 72% 42%, 57% 51%, 41% 43%, 27% 50%, 13% 42%, 0 48%); }
.openplan__bite--3 { clip-path: polygon(0 38%, 13% 39%, 27% 37%, 41% 40%, 57% 38%, 72% 39%, 88% 37%, 100% 40%, 100% 66%, 86% 72%, 70% 65%, 55% 73%, 39% 66%, 24% 72%, 11% 64%, 0 69%); }
.openplan__bite--4 { clip-path: polygon(0 60%, 11% 61%, 24% 59%, 39% 62%, 55% 60%, 70% 61%, 86% 59%, 100% 62%, 100% 85%, 87% 90%, 73% 83%, 58% 91%, 42% 84%, 27% 90%, 13% 83%, 0 88%); }
.openplan__bite--5 { clip-path: polygon(0 79%, 13% 80%, 27% 78%, 42% 81%, 58% 79%, 73% 80%, 87% 78%, 100% 81%, 100% 100%, 0 100%); }
.openplan__application.is-finished .openplan__application-paper { scale: 0.08; rotate: 28deg; opacity: 0; }

@keyframes openplan-eat {
  0% { translate: -4px 0; filter: hue-rotate(0deg); }
  50% { translate: 5px -2px; filter: hue-rotate(80deg); }
}

.openplan__intro,
.openplan__ending-card { max-width: 34rem; text-align: left; }
.openplan__ending-card { text-align: center; }

.openplan__eyebrow {
  margin: 0 0 10px;
  font-family: var(--studio-mono, ui-monospace, monospace);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--openplan-cool);
}

.openplan__intro h1,
.openplan__ending-card h2 {
  margin: 0 0 14px;
  font-size: clamp(2.1rem, 7vw, 3.4rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.02em;
}
.openplan__intro h1 i { color: var(--openplan-hot); font-style: italic; }

.openplan__lead,
.openplan__ending-card p {
  max-width: 34ch;
  margin: 0 0 22px;
  color: #cbb9e4;
  font-size: 1.02rem;
  line-height: 1.55;
}
.openplan__ending-card p { max-width: none; }

.openplan__keys {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
  color: #b9a4d6;
  font-size: 0.84rem;
}
.openplan__keys span {
  display: inline-block;
  margin-right: 6px;
  padding: 2px 7px;
  border: 1px solid rgb(47 240 214 / 0.4);
  border-radius: 5px;
  font-family: var(--studio-mono, ui-monospace, monospace);
  font-size: 0.74rem;
  color: var(--openplan-cool);
}

.openplan__begin {
  padding: 13px 26px;
  border: 0;
  border-radius: 999px;
  background: var(--openplan-hot);
  color: #fff;
  font: inherit;
  font-weight: 650;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 140ms ease, background 140ms ease;
}
.openplan__begin:hover:not(:disabled) { transform: translateY(-1px); background: #ff5486; }
.openplan__begin:disabled { cursor: progress; opacity: 0.5; }

.openplan__note { margin: 16px 0 0; color: #8f7bad; font-size: 0.79rem; line-height: 1.5; }

.openplan__hud { position: absolute; z-index: 2; inset: 0; pointer-events: none; }
.openplan__hud > *:not(.openplan__crosshair):not(.openplan__hint):not(.openplan__caption) { pointer-events: auto; }

.openplan__crosshair {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 22px;
  height: 22px;
  translate: -50% -50%;
  mix-blend-mode: difference;
}
.openplan__crosshair span {
  position: absolute;
  background: #fff;
}
.openplan__crosshair span:first-child { top: 50%; left: 0; width: 100%; height: 2px; translate: 0 -50%; }
.openplan__crosshair span:last-child { top: 0; left: 50%; width: 2px; height: 100%; translate: -50% 0; }

.openplan__blame {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 260px;
  height: 260px;
  translate: -50% -50%;
  border-radius: 50%;
  opacity: 0;
  /* A wedge at the top of the ring; the whole ring rotates to aim it. */
  background: conic-gradient(from -20deg, rgb(255 47 109 / 0.85), rgb(255 47 109 / 0) 40deg);
  mask: radial-gradient(circle, transparent 62%, #000 72%, #000 100%);
}
.openplan__blame.is-lit { animation: openplan-blame 900ms ease-out forwards; }

@keyframes openplan-blame {
  0% { opacity: 0.95; scale: 0.94; }
  100% { opacity: 0; scale: 1.06; }
}

.openplan__chip {
  position: absolute;
  top: 18px;
  padding: 7px 14px;
  border: 1px solid rgb(244 236 255 / 0.22);
  border-radius: 999px;
  background: rgb(21 13 36 / 0.6);
  color: var(--openplan-ink);
  font: inherit;
  font-size: 0.76rem;
  cursor: pointer;
}
.openplan__chip--left { left: 18px; }
.openplan__chip--pause { left: 108px; }
.openplan__chip--right { right: 18px; }
.openplan__chip:hover { background: rgb(53 32 79 / 0.8); }

.openplan__hint {
  position: absolute;
  top: 62px;
  left: 50%;
  translate: -50% 0;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgb(21 13 36 / 0.56);
  color: #cbb9e4;
  font-size: 0.78rem;
  text-align: center;
  transition: opacity 500ms ease, visibility 500ms ease;
}
.openplan__hint p { margin: 0; }
.openplan__hint span { color: var(--openplan-cool); font-family: var(--studio-mono, ui-monospace, monospace); font-size: 0.72rem; }
.openplan__hint-touch { display: none; }
.openplan__hint.is-faded { visibility: hidden; opacity: 0; }

.openplan__caption {
  position: absolute;
  bottom: 108px;
  left: 50%;
  margin: 0;
  translate: -50% 6px;
  padding: 7px 16px;
  border-radius: 999px;
  background: rgb(255 47 109 / 0.2);
  color: var(--openplan-ink);
  font-size: 0.82rem;
  opacity: 0;
  transition: opacity 220ms ease, translate 220ms ease;
}
.openplan__caption.is-visible { opacity: 1; translate: -50% 0; }

.openplan__bar {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 18px;
  align-items: end;
  padding: 14px 22px 16px;
  background: linear-gradient(to top, rgb(21 13 36 / 0.88), transparent);
}
.openplan__stat { display: grid; gap: 3px; }
.openplan__stat--mid { text-align: center; }
.openplan__bar .openplan__stat:last-child { text-align: right; }

.openplan__label {
  font-family: var(--studio-mono, ui-monospace, monospace);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #9a85ba;
}
.openplan__stat strong {
  font-size: clamp(1.3rem, 4vw, 1.9rem);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.openplan__stat strong.is-empty { color: var(--openplan-hot); }
.is-critical .openplan__stat:first-child strong { color: var(--openplan-hot); }

.openplan__gauge {
  width: min(220px, 34vw);
  height: 5px;
  margin-top: 3px;
  border-radius: 999px;
  background: rgb(244 236 255 / 0.16);
  overflow: hidden;
}
.openplan__gauge i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--openplan-cool);
  transition: width 180ms ease, background 180ms ease;
}
.is-critical .openplan__gauge i { background: var(--openplan-hot); }

.openplan__fire,
.openplan__jump {
  position: absolute;
  right: 22px;
  bottom: 96px;
  width: 92px;
  height: 92px;
  border: 2px solid rgb(255 47 109 / 0.6);
  border-radius: 50%;
  background: rgb(255 47 109 / 0.24);
  color: var(--openplan-ink);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 650;
  cursor: pointer;
}
.openplan__fire:active { background: rgb(255 47 109 / 0.5); }
.openplan__jump {
  right: 124px;
  bottom: 112px;
  width: 72px;
  height: 72px;
  border-color: rgb(47 240 214 / 0.62);
  background: rgb(47 240 214 / 0.2);
}
.openplan__jump:active { background: rgb(47 240 214 / 0.44); }

.openplan__stick {
  position: absolute;
  width: 116px;
  height: 116px;
  translate: -50% -50%;
  border: 2px solid rgb(244 236 255 / 0.22);
  border-radius: 50%;
}
.openplan__stick span {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgb(244 236 255 / 0.3);
}

/* Floor name, top centre, under the dialog chrome. */
.openplan__floor {
  position: absolute;
  top: 20px;
  left: 50%;
  margin: 0;
  translate: -50% 0;
  font-family: var(--studio-mono, ui-monospace, monospace);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #b9a4d6;
  text-shadow: 0 1px 3px rgb(21 13 36 / 0.9);
}

/* The boss bar only exists while something is actually fighting you. */
.openplan__boss {
  position: absolute;
  top: 52px;
  left: 50%;
  width: min(420px, 62vw);
  translate: -50% 0;
  text-align: center;
}
.openplan__boss-name {
  margin: 0 0 5px;
  font-size: 0.82rem;
  font-weight: 650;
  color: var(--openplan-ink);
  text-shadow: 0 1px 3px rgb(21 13 36 / 0.9);
}
.openplan__boss-name i {
  margin-left: 8px;
  font-family: var(--studio-mono, ui-monospace, monospace);
  font-size: 0.68rem;
  font-style: normal;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--openplan-cool);
}
.openplan__boss-bar {
  height: 7px;
  border: 1px solid rgb(244 236 255 / 0.28);
  border-radius: 999px;
  background: rgb(21 13 36 / 0.6);
  overflow: hidden;
}
.openplan__boss-bar i {
  display: block;
  height: 100%;
  background: var(--openplan-hot);
  transition: width 160ms ease;
}
/* Guarded reads as "your shots are doing nothing", not "it is nearly dead". */
.openplan__boss.is-guarded .openplan__boss-bar { border-style: dashed; }
.openplan__boss.is-guarded .openplan__boss-bar i { background: #6f6a86; }

/* Which weapons you are carrying, and which one is up. */
.openplan__stat--arms { text-align: right; }
.openplan__arms {
  display: flex;
  justify-content: flex-end;
  gap: 5px;
  margin-top: 5px;
}
.openplan__arm {
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid rgb(244 236 255 / 0.22);
  border-radius: 6px;
  background: rgb(21 13 36 / 0.55);
  color: #9a85ba;
  font: inherit;
  font-family: var(--studio-mono, ui-monospace, monospace);
  font-size: 0.68rem;
  line-height: 1;
  cursor: pointer;
}
.openplan__arm.is-current {
  border-color: var(--openplan-cool);
  background: rgb(47 240 214 / 0.16);
  color: var(--openplan-ink);
}

/* Perks currently running, above the status bar. */
.openplan__perks {
  position: absolute;
  right: 22px;
  bottom: 104px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}
.openplan__perk {
  padding: 3px 9px;
  border-radius: 999px;
  background: rgb(21 13 36 / 0.66);
  font-family: var(--studio-mono, ui-monospace, monospace);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.openplan__perk--haste { color: #ff5c8a; }
.openplan__perk--shield { color: #9fd8ec; }
.openplan__perk--unseen { color: #d8c48a; }
.openplan__perk--focus { color: #ffcc2f; }

.openplan__card-unlock {
  margin: 0 0 14px;
  padding: 8px 14px;
  border: 1px solid rgb(47 240 214 / 0.4);
  border-radius: 10px;
  color: var(--openplan-cool);
  font-size: 0.86rem;
}

.openplan__ending-stat {
  font-family: var(--studio-mono, ui-monospace, monospace);
  font-size: 0.78rem;
  color: #9a85ba;
}
.openplan__ending-actions { display: flex; justify-content: center; gap: 12px; margin-top: 8px; }

.openplan--failed { display: grid; place-items: center; padding: 32px 24px; }

@media (pointer: coarse) {
  .openplan__arm { width: 34px; height: 34px; font-size: 0.8rem; }
  .openplan__perks { bottom: 200px; }
  .openplan__hint-touch { display: block; }
  .openplan__hint p:not(.openplan__hint-touch) { display: none; }
  .openplan__caption { bottom: 200px; }
}

@media (max-width: 640px) {
  .openplan__chip { top: 72px; }
  .openplan__floor { top: 112px; max-width: 72vw; font-size: 0.64rem; }
  .openplan__hint { top: 145px; width: calc(100% - 32px); padding: 7px 10px; }
  .openplan__boss { top: 182px; width: min(320px, 78vw); }
  .openplan__bar { grid-template-columns: 1fr auto; row-gap: 10px; padding: 12px 16px 14px; }
  .openplan__bar .openplan__stat:last-child { grid-column: 2; }
  .openplan__gauge { width: min(160px, 46vw); }
  .openplan__fire { right: 16px; bottom: 146px; width: 86px; height: 86px; }
  .openplan__jump { right: 110px; bottom: 154px; width: 68px; height: 68px; }
  .openplan__application-paper { min-height: 260px; padding: 26px 28px; }
}

@media (prefers-reduced-motion: reduce) {
  .openplan__begin,
  .openplan__caption,
  .openplan__gauge i,
  .openplan__boss-bar i,
  .openplan__hint { transition: none; }
  .openplan__application-paper,
  .openplan__bite { transition: none; }
  .openplan__eat-prompt { animation: none; }
  /* The wedge still appears and still clears itself; it just does not swell. */
  .openplan__blame.is-lit { animation: openplan-blame-still 900ms linear forwards; }
}

@keyframes openplan-blame-still {
  0%, 70% { opacity: 0.8; }
  100% { opacity: 0; }
}

/* Siege the Castle, cutout theatre */
.game-dialog[data-game="castle"] { background: #19393d; }
.game-dialog[data-game="castle"] .game-dialog__chrome { padding-right: 5px; }
.game-dialog[data-game="castle"] .game-dialog__count { display: none; }
.castle-game {
  --castle-ink: #222821;
  --castle-muted: #59615a;
  --castle-paper: #eee5cf;
  --castle-paper-deep: #d9c9a9;
  --castle-rule: rgb(34 40 33 / 0.24);
  --castle-green: #214b48;
  --castle-blue: #7199a0;
  --castle-rust: #a7432f;
  min-height: 100%;
  padding: 92px max(14px, calc((100vw - 1460px) / 2)) 48px;
  color: var(--castle-ink);
  background:
    radial-gradient(circle at 12% 8%, rgb(198 74 45 / 0.43), transparent 24%),
    radial-gradient(circle at 91% 7%, rgb(111 160 165 / 0.6), transparent 31%),
    linear-gradient(142deg, #d9c7a7 0 34%, #88a7a4 67%, #214248);
}
.castle-header {
  display: grid;
  width: min(1460px, 100%);
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.34fr);
  gap: 40px;
  align-items: end;
  margin: 0 auto 24px;
}
.castle-header h1 {
  margin: 4px 0 0;
  font-family: var(--studio-display);
  font-size: clamp(4rem, 7.2vw, 8rem);
  font-weight: 400;
  letter-spacing: -0.075em;
  line-height: 0.8;
}
.castle-dev-level {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 7px 9px;
  border: 1px solid rgb(66 48 35 / 0.32);
  background: #f0dfb9;
  box-shadow: 4px 5px 0 rgb(40 32 26 / 0.14);
  color: #49372c;
  font: 0.53rem var(--studio-mono);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transform: rotate(-0.4deg);
}
.castle-dev-level select {
  max-width: 210px;
  border: 1px solid currentColor;
  border-radius: 0;
  background: #f8edcf;
  color: inherit;
  font: inherit;
}
.castle-header > p { max-width: 35ch; margin: 0; color: #374b49; line-height: 1.52; }
.castle-header__brief { display: grid; gap: 13px; }
.castle-header__brief > p { max-width: 39ch; margin: 0; color: #374b49; line-height: 1.52; }
.castle-element-key {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.castle-element-key span {
  padding: 5px 7px;
  border: 1px solid rgb(78 38 25 / 0.26);
  background: rgb(239 220 180 / 0.68);
  font-family: var(--studio-mono);
  font-size: 0.44rem;
  letter-spacing: 0.025em;
  text-transform: uppercase;
  transform: rotate(-0.5deg);
}
.castle-element-key span:nth-child(even) { transform: rotate(0.8deg); }
.castle-element-key b { color: #9d3421; font-weight: 700; }
.castle-game--level-2 {
  --castle-green: #5b211a;
  --castle-rust: #d75228;
  background:
    radial-gradient(circle at 10% 7%, rgb(255 134 34 / 0.64), transparent 27%),
    radial-gradient(circle at 92% 12%, rgb(72 25 20 / 0.74), transparent 34%),
    linear-gradient(142deg, #c77d42 0 31%, #6c3025 66%, #211d20);
}
.castle-game--level-2 .castle-header > div:first-child,
.castle-game--level-2 .castle-header__brief > p { color: #f3e3c8; }
.castle-game--level-2 .castle-header__brief {
  padding: 15px 18px;
  background: rgb(42 20 18 / 0.28);
  clip-path: polygon(1% 4%, 98% 0, 100% 91%, 3% 100%);
}
.castle-game--level-3 {
  --castle-green: #294d57;
  --castle-blue: #8bb7c7;
  --castle-rust: #466f80;
  background:
    radial-gradient(circle at 11% 7%, rgb(231 242 239 / 0.82), transparent 25%),
    radial-gradient(circle at 91% 10%, rgb(66 104 122 / 0.72), transparent 34%),
    linear-gradient(142deg, #d9e3df 0 31%, #8da9b1 65%, #314c58);
}
.castle-game--level-3 .castle-header__brief {
  padding: 15px 18px;
  background: rgb(232 241 236 / 0.54);
  clip-path: polygon(1% 4%, 98% 0, 100% 91%, 3% 100%);
}
.castle-game--level-4 {
  --castle-green: #173f4d;
  --castle-blue: #80aec0;
  --castle-rust: #315f78;
  background:
    radial-gradient(circle at 10% 7%, rgb(192 216 220 / 0.42), transparent 25%),
    radial-gradient(circle at 92% 10%, rgb(19 50 65 / 0.86), transparent 36%),
    linear-gradient(142deg, #8e9fa5 0 30%, #385768 64%, #172d38);
}
.castle-game--level-4 .castle-header > div:first-child,
.castle-game--level-4 .castle-header__brief > p { color: #edf0e8; }
.castle-game--level-4 .castle-header__brief {
  padding: 15px 18px;
  background: rgb(14 42 54 / 0.46);
  clip-path: polygon(1% 4%, 98% 0, 100% 91%, 3% 100%);
}
.castle-game--level-5 {
  --castle-green: #211d20;
  --castle-blue: #7089a6;
  --castle-rust: #c46e2e;
  background:
    radial-gradient(circle at 10% 7%, rgb(246 201 106 / 0.42), transparent 24%),
    radial-gradient(circle at 91% 9%, rgb(28 35 61 / 0.92), transparent 36%),
    linear-gradient(142deg, #72604c 0 28%, #282a3b 61%, #11131d);
}
.castle-game--level-5 .castle-header > div:first-child,
.castle-game--level-5 .castle-header__brief > p { color: #f4ead3; }
.castle-game--level-5 .castle-header__brief {
  padding: 15px 18px;
  background: rgb(10 12 23 / 0.54);
  clip-path: polygon(1% 4%, 98% 0, 100% 91%, 3% 100%);
}
.castle-game--level-5 .castle-element-key span { border-color: rgb(224 180 86 / 0.34); background: rgb(34 31 36 / 0.72); color: #f1e4c7; }
.castle-game--level-5 .castle-element-key b { color: #efad49; }
.castle-workspace,
.castle-battle-shell {
  width: min(1460px, 100%);
  margin-inline: auto;
  border: 1px solid var(--castle-rule);
  background: var(--castle-paper);
  box-shadow: 0 32px 90px rgb(24 45 43 / 0.26);
}
.castle-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(270px, 0.31fr);
  grid-template-areas:
    "stage roster"
    "tray tray"
    "actions actions";
}
@media (min-width: 1101px) {
  .castle-workspace > .castle-roster {
    height: clamp(560px, 47vw, 690px);
    overflow-y: auto;
    scrollbar-gutter: stable;
  }
}
.castle-stage {
  position: relative;
  grid-area: stage;
  min-height: clamp(560px, 47vw, 690px);
  overflow: hidden;
  background: #94b3b4;
  isolation: isolate;
}
.castle-battle-shell .castle-stage { min-height: clamp(600px, 52vw, 730px); }
.castle-stage::after {
  position: absolute;
  z-index: 40;
  inset: 0;
  border: 9px solid rgb(245 233 204 / 0.34);
  box-shadow: inset 0 0 105px rgb(20 48 49 / 0.24);
  content: "";
  pointer-events: none;
}
.castle-landscape {
  position: absolute;
  z-index: 0;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 53%;
  filter: saturate(0.72) contrast(0.9) brightness(1.08);
  transform: scale(1.015);
  user-select: none;
}
.castle-stage--level-2 { background: #321e1b; }
.castle-stage--level-2 .castle-landscape {
  object-position: 52% 50%;
  filter: saturate(1.02) contrast(0.98) brightness(0.94);
  transform: scale(1.025);
}
.castle-stage--level-2 .castle-backdrop-wash {
  background:
    radial-gradient(ellipse at 58% 57%, rgb(245 173 92 / 0.23), transparent 47%),
    linear-gradient(90deg, rgb(58 21 18 / 0.18), transparent 45%, rgb(255 105 24 / 0.08)),
    linear-gradient(180deg, rgb(39 18 19 / 0.08), transparent 44%, rgb(255 83 20 / 0.2));
  mix-blend-mode: soft-light;
}
.castle-stage--level-2 .castle-road {
  right: 35%;
  bottom: -5%;
  width: 74%;
  height: 25%;
  background: linear-gradient(97deg, rgb(44 31 29 / 0.84), rgb(113 48 28 / 0.68) 58%, rgb(247 127 48 / 0.72));
  mix-blend-mode: screen;
}
.castle-backdrop-wash {
  position: absolute;
  z-index: 1;
  inset: 0;
  background:
    linear-gradient(90deg, rgb(224 211 173 / 0.18), transparent 45%, rgb(45 80 76 / 0.12)),
    linear-gradient(180deg, rgb(124 157 159 / 0.17), transparent 48%, rgb(62 68 47 / 0.22));
  mix-blend-mode: soft-light;
  pointer-events: none;
}
.castle-road {
  position: absolute;
  z-index: 4;
  right: -4%;
  bottom: -8%;
  width: 90%;
  height: 29%;
  background: linear-gradient(97deg, rgb(207 179 123 / 0.54), rgb(229 211 170 / 0.76) 63%, rgb(158 127 85 / 0.48));
  clip-path: polygon(0 78%, 14% 63%, 33% 52%, 55% 36%, 76% 22%, 100% 4%, 100% 100%, 0 100%);
  mix-blend-mode: screen;
}
.castle-fortress-cutout {
  position: absolute;
  z-index: 8;
  right: -2%;
  bottom: 4%;
  display: block;
  width: 78%;
  height: 74%;
  overflow: hidden;
  background: transparent;
  clip-path: polygon(1% 92%, 1% 80%, 4% 80%, 4% 34%, 7% 31%, 8% 16%, 11% 1%, 15% 16%, 17% 31%, 18% 39%, 67% 39%, 72% 32%, 76% 29%, 77% 15%, 81% 1%, 85% 15%, 88% 29%, 95% 31%, 98% 91%);
  filter: drop-shadow(14px 18px 3px rgb(28 34 27 / 0.32));
  mix-blend-mode: multiply;
  pointer-events: none;
  user-select: none;
}
.castle-cutout {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
  filter: sepia(0.18) contrast(1.26) brightness(0.94);
  mix-blend-mode: multiply;
}
.castle-stage--level-2 .castle-fortress-cutout {
  right: auto;
  bottom: 1%;
  left: 9%;
  width: 92%;
  height: 91%;
  padding: 0;
  background: transparent;
  clip-path: polygon(1% 8%, 19% 3%, 42% 0, 64% 4%, 83% 2%, 100% 10%, 99% 98%, 78% 100%, 55% 97%, 29% 100%, 0 96%);
  filter: drop-shadow(10px 14px 4px rgb(29 17 17 / 0.42));
  mix-blend-mode: normal;
  opacity: 0.94;
}
.castle-stage--level-2 .castle-cutout {
  object-fit: fill;
  object-position: center;
  filter: sepia(0.18) saturate(0.76) contrast(1.14) brightness(0.86);
  mix-blend-mode: normal;
  transform: none;
}
.castle-stage--level-2 .castle-cast-shadow { right: 0; bottom: 2%; width: 86%; background: rgb(12 8 8 / 0.46); }
.castle-stage--level-2 .castle-foreground-grass { background: #1c1a19; opacity: 0.95; }
.castle-stage--level-2 .castle-location { border-color: #6c301e; background: #e7c791; color: #54271b; }
.castle-stage--level-2 .castle-breach-tear { top: 67%; left: 56%; }
.castle-stage--level-3 { background: #a8bac0; }
.castle-stage--level-3 .castle-landscape {
  object-position: 44% 50%;
  filter: saturate(0.5) contrast(1.06) brightness(0.92) hue-rotate(165deg);
  transform: scale(1.015);
}
.castle-stage--level-3 .castle-backdrop-wash {
  background:
    linear-gradient(90deg, rgb(224 237 238 / 0.16), transparent 45%, rgb(43 78 92 / 0.23)),
    linear-gradient(180deg, rgb(227 241 243 / 0.22), transparent 48%, rgb(75 103 110 / 0.24));
  mix-blend-mode: screen;
}
.castle-stage--level-3 .castle-road {
  right: 26%;
  bottom: -7%;
  width: 88%;
  height: 27%;
  background: linear-gradient(96deg, rgb(220 231 228 / 0.8), rgb(180 207 214 / 0.72) 62%, rgb(111 151 164 / 0.6));
  mix-blend-mode: screen;
}
.castle-stage--level-3 .castle-fortress-cutout {
  right: -1%;
  bottom: 2%;
  width: 65%;
  height: 82%;
  overflow: visible;
  clip-path: none;
  filter: drop-shadow(13px 17px 3px rgb(25 45 52 / 0.42));
  mix-blend-mode: normal;
  opacity: 0.97;
}
.castle-stage--level-3 .castle-cutout {
  object-fit: contain;
  object-position: center bottom;
  filter: saturate(0.84) contrast(1.08) brightness(0.95);
  mix-blend-mode: normal;
}
.castle-stage--level-3 .castle-cast-shadow { right: -1%; bottom: 2%; width: 63%; background: rgb(27 48 56 / 0.36); }
.castle-stage--level-3 .castle-foreground-grass { background: #d8e2df; opacity: 0.92; }
.castle-stage--level-3 .castle-location { border-color: #557985; background: #e6ece4; color: #284653; }
.castle-stage--level-3 .castle-breach-tear { top: 71%; left: 70%; background: #86aebc; }
.castle-stage--level-4 { background: #273f4b; }
.castle-stage--level-4 .castle-landscape {
  object-position: 52% 52%;
  filter: saturate(0.62) contrast(1.12) brightness(0.78) hue-rotate(176deg);
  transform: scale(1.02);
}
.castle-stage--level-4 .castle-backdrop-wash {
  background:
    radial-gradient(ellipse at 67% 48%, rgb(214 229 228 / 0.19), transparent 38%),
    linear-gradient(90deg, rgb(17 45 57 / 0.18), transparent 42%, rgb(202 221 220 / 0.12)),
    linear-gradient(180deg, rgb(13 34 45 / 0.13), transparent 48%, rgb(25 60 72 / 0.32));
  mix-blend-mode: screen;
}
.castle-stage--level-4 .castle-road {
  right: 25%;
  bottom: -8%;
  width: 92%;
  height: 27%;
  background: linear-gradient(96deg, rgb(89 124 136 / 0.72), rgb(158 184 184 / 0.68) 61%, rgb(63 105 122 / 0.66));
  mix-blend-mode: screen;
}
.castle-stage--level-4 .castle-fortress-cutout {
  right: -1%;
  bottom: 2%;
  width: 72%;
  height: 83%;
  overflow: visible;
  clip-path: none;
  filter: drop-shadow(14px 18px 4px rgb(7 25 34 / 0.58));
  mix-blend-mode: normal;
  opacity: 0.99;
}
.castle-stage--level-4 .castle-cutout {
  object-fit: contain;
  object-position: center bottom;
  filter: saturate(0.78) contrast(1.12) brightness(1.03);
  mix-blend-mode: normal;
}
.castle-stage--level-4 .castle-cast-shadow { right: -1%; bottom: 2%; width: 69%; background: rgb(9 30 39 / 0.54); }
.castle-stage--level-4 .castle-foreground-grass { background: #173441; opacity: 0.96; }
.castle-stage--level-4 .castle-location { border-color: #436d7b; background: #dbe5df; color: #183d4b; }
.castle-stage--level-4 .castle-breach-tear { top: 72%; left: 64%; background: #4b879c; }
.castle-stage--level-5 { background: #111725; }
.castle-stage--level-5 .castle-landscape {
  object-position: 47% 52%;
  filter: saturate(0.74) contrast(1.1) brightness(0.72);
  transform: scale(1.018);
}
.castle-stage--level-5 .castle-backdrop-wash {
  background:
    radial-gradient(ellipse at 70% 58%, rgb(230 188 91 / 0.12), transparent 32%),
    linear-gradient(90deg, rgb(5 8 16 / 0.08), transparent 43%, rgb(7 9 15 / 0.36)),
    linear-gradient(180deg, rgb(9 14 30 / 0.12), transparent 48%, rgb(7 9 15 / 0.42));
  mix-blend-mode: multiply;
}
.castle-stage--level-5 .castle-road { display: none; }
.castle-stage--level-5 .castle-fortress-cutout {
  right: -2%;
  bottom: 1%;
  width: 74%;
  height: 83%;
  overflow: visible;
  background: rgb(242 236 221 / 0.92);
  clip-path: polygon(1% 7%, 19% 5%, 29% 1%, 50% 3%, 69% 0, 82% 5%, 99% 7%, 98% 98%, 76% 100%, 52% 98%, 27% 100%, 1% 97%);
  filter: drop-shadow(14px 19px 4px rgb(3 5 10 / 0.72));
  mix-blend-mode: normal;
  opacity: 0.99;
}
.castle-stage--level-5 .castle-cutout {
  object-fit: contain;
  object-position: center bottom;
  filter: saturate(0.88) contrast(1.14) brightness(0.91);
  mix-blend-mode: multiply;
}
.castle-stage--level-5 .castle-cast-shadow { right: -1%; bottom: 1%; width: 72%; background: rgb(2 3 8 / 0.68); }
.castle-stage--level-5 .castle-foreground-grass { background: #0e1119; opacity: 0.98; }
.castle-stage--level-5 .castle-location { border-color: #97743d; background: #eee1c4; color: #28232a; }
.castle-stage--level-5 .castle-breach-tear { top: 72%; left: 64%; background: #c36a2d; }
.castle-embers {
  position: absolute;
  z-index: 6;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.castle-embers i {
  position: absolute;
  bottom: 6%;
  left: calc(var(--ember-index, 0) * 13% + 2%);
  width: 8px;
  height: 14px;
  background: #ef7429;
  clip-path: polygon(50% 0, 100% 38%, 76% 100%, 12% 82%, 0 29%);
  filter: drop-shadow(0 0 4px #ff9d31);
  opacity: 0.68;
  animation: castle-ember-rise 3200ms calc(var(--ember-index, 0) * -370ms) steps(7, end) infinite;
}
.castle-embers i:nth-child(1) { --ember-index: 0; }
.castle-embers i:nth-child(2) { --ember-index: 1; }
.castle-embers i:nth-child(3) { --ember-index: 2; }
.castle-embers i:nth-child(4) { --ember-index: 3; }
.castle-embers i:nth-child(5) { --ember-index: 4; }
.castle-embers i:nth-child(6) { --ember-index: 5; }
.castle-embers i:nth-child(7) { --ember-index: 6; }
.castle-embers i:nth-child(8) { --ember-index: 7; }
.castle-snowfall {
  position: absolute;
  z-index: 6;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.castle-snowfall i {
  position: absolute;
  top: -5%;
  left: calc(var(--snow-index, 0) * 8.8% + 1%);
  width: calc(5px + var(--snow-index, 0) * 0.35px);
  aspect-ratio: 1;
  border: 1px solid rgb(112 146 157 / 0.34);
  border-radius: 52% 48% 44% 56%;
  background: #f2f2e8;
  box-shadow: 2px 2px 0 rgb(55 84 94 / 0.16);
  opacity: 0.78;
  animation: castle-snow-fall 4700ms calc(var(--snow-index, 0) * -410ms) steps(9, end) infinite;
}
.castle-snowfall i:nth-child(1) { --snow-index: 0; }
.castle-snowfall i:nth-child(2) { --snow-index: 1; }
.castle-snowfall i:nth-child(3) { --snow-index: 2; }
.castle-snowfall i:nth-child(4) { --snow-index: 3; }
.castle-snowfall i:nth-child(5) { --snow-index: 4; }
.castle-snowfall i:nth-child(6) { --snow-index: 5; }
.castle-snowfall i:nth-child(7) { --snow-index: 6; }
.castle-snowfall i:nth-child(8) { --snow-index: 7; }
.castle-snowfall i:nth-child(9) { --snow-index: 8; }
.castle-snowfall i:nth-child(10) { --snow-index: 9; }
.castle-snowfall i:nth-child(11) { --snow-index: 10; }
.castle-snowfall i:nth-child(12) { --snow-index: 11; }
.castle-rainfall {
  position: absolute;
  z-index: 6;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.castle-rainfall i {
  position: absolute;
  top: -12%;
  left: calc(var(--rain-index, 0) * 7.4% - 1%);
  width: 4px;
  height: calc(38px + var(--rain-index, 0) * 1.7px);
  border: 1px solid rgb(216 232 232 / 0.62);
  background: linear-gradient(180deg, rgb(238 241 231 / 0), rgb(181 213 221 / 0.82));
  box-shadow: 3px 3px 0 rgb(17 48 62 / 0.17);
  clip-path: polygon(36% 0, 100% 4%, 65% 100%, 0 94%);
  opacity: 0.58;
  transform: rotate(13deg);
  animation: castle-rain-fall 2600ms calc(var(--rain-index, 0) * -190ms) steps(8, end) infinite;
}
.castle-rainfall i:nth-child(1) { --rain-index: 0; }
.castle-rainfall i:nth-child(2) { --rain-index: 1; }
.castle-rainfall i:nth-child(3) { --rain-index: 2; }
.castle-rainfall i:nth-child(4) { --rain-index: 3; }
.castle-rainfall i:nth-child(5) { --rain-index: 4; }
.castle-rainfall i:nth-child(6) { --rain-index: 5; }
.castle-rainfall i:nth-child(7) { --rain-index: 6; }
.castle-rainfall i:nth-child(8) { --rain-index: 7; }
.castle-rainfall i:nth-child(9) { --rain-index: 8; }
.castle-rainfall i:nth-child(10) { --rain-index: 9; }
.castle-rainfall i:nth-child(11) { --rain-index: 10; }
.castle-rainfall i:nth-child(12) { --rain-index: 11; }
.castle-rainfall i:nth-child(13) { --rain-index: 12; }
.castle-rainfall i:nth-child(14) { --rain-index: 13; }
.castle-cast-shadow {
  position: absolute;
  z-index: 7;
  right: -2%;
  bottom: 5%;
  width: 66%;
  height: 8%;
  border-radius: 50%;
  background: rgb(35 39 30 / 0.22);
  filter: blur(6px);
  transform: skewX(-17deg);
}
.castle-paper-grain {
  position: absolute;
  z-index: 30;
  inset: 0;
  background:
    repeating-linear-gradient(101deg, transparent 0 5px, rgb(255 255 255 / 0.035) 5px 7px),
    repeating-linear-gradient(7deg, rgb(42 43 28 / 0.018) 0 1px, transparent 1px 6px);
  mix-blend-mode: soft-light;
  pointer-events: none;
}
.castle-foreground-grass {
  position: absolute;
  z-index: 22;
  right: -2%;
  bottom: -1%;
  left: -2%;
  height: 8%;
  background: #244a42;
  clip-path: polygon(0 43%, 4% 16%, 7% 48%, 11% 5%, 14% 49%, 19% 23%, 25% 54%, 31% 8%, 37% 45%, 43% 16%, 50% 52%, 58% 4%, 64% 45%, 71% 14%, 77% 51%, 83% 7%, 89% 43%, 94% 17%, 100% 48%, 100% 100%, 0 100%);
  opacity: 0.86;
  pointer-events: none;
}
.castle-location {
  position: absolute;
  z-index: 34;
  top: 18px;
  left: 20px;
  padding: 8px 10px;
  border: 1px solid rgb(32 36 29 / 0.28);
  background: #eee3ca;
  color: #30352c;
  box-shadow: 4px 5px 0 rgb(32 36 29 / 0.14);
  font-family: var(--studio-mono);
  font-size: 0.6rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  transform: rotate(-1.5deg);
}
.castle-enemy-preview {
  position: absolute;
  z-index: 11;
  bottom: 10%;
  left: 2%;
  display: block;
  width: clamp(300px, 34vw, 430px);
  height: clamp(104px, 13vw, 158px);
  filter: drop-shadow(7px 9px 2px rgb(32 39 32 / 0.25));
  transform: rotate(-1.5deg);
}
.castle-enemy-preview__line {
  position: absolute;
  inset: 0 0 20px;
  display: flex;
  align-items: end;
  justify-content: space-between;
}
.castle-enemy-preview__unit {
  position: relative;
  display: block;
  width: 44px;
  height: 92px;
  overflow: hidden;
  padding: 3px;
  border: 0;
  background: #eee6d5;
  color: var(--castle-ink);
  clip-path: polygon(8% 2%, 94% 5%, 100% 88%, 79% 100%, 4% 93%, 0 20%);
  cursor: pointer;
  transition: filter 160ms, transform 160ms;
}
.castle-enemy-preview__unit:hover,
.castle-enemy-preview__unit:focus-visible,
.castle-enemy-preview__unit.is-selected {
  filter: drop-shadow(0 0 5px #fff1c9) drop-shadow(0 0 2px #214b48);
  outline: none;
  transform: translateY(-5px) rotate(2deg);
}
.castle-enemy-preview__unit--gatebreakers { width: 74px; height: 86px; }
.castle-enemy-preview__unit--ram { width: 82px; height: 70px; }
.castle-stage--level-3 .castle-enemy-preview { width: clamp(360px, 40vw, 510px); }
.castle-stage--level-3 .castle-enemy-preview__unit { width: 34px; height: 78px; }
.castle-stage--level-3 .castle-enemy-preview__unit--gatebreakers { width: 56px; height: 72px; }
.castle-stage--level-3 .castle-enemy-preview__unit--ram { width: 64px; height: 56px; }
.castle-stage--level-4 .castle-enemy-preview { bottom: 7%; width: clamp(430px, 45vw, 580px); height: clamp(118px, 13vw, 160px); }
.castle-stage--level-4 .castle-enemy-preview__unit { width: 32px; height: 72px; }
.castle-stage--level-4 .castle-enemy-preview__unit--gatebreakers { width: 51px; height: 67px; }
.castle-stage--level-4 .castle-enemy-preview__unit--ram { width: 60px; height: 52px; }
.castle-stage--level-5 .castle-enemy-preview { bottom: 6%; width: clamp(470px, 49vw, 650px); height: clamp(122px, 14vw, 170px); }
.castle-stage--level-5 .castle-enemy-preview__unit { width: 30px; height: 68px; }
.castle-stage--level-5 .castle-enemy-preview__unit--gatebreakers { width: 48px; height: 64px; }
.castle-stage--level-5 .castle-enemy-preview__unit--ram { width: 56px; height: 50px; }
.castle-stage--level-5 .castle-enemy-preview__unit--art-commander { width: 55px; height: 52px; }
.castle-stage--level-5 .castle-enemy-preview__unit--art-siege-tower { width: 46px; height: 76px; }
.castle-enemy-preview__unit img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: saturate(0.82) contrast(1.15);
  mix-blend-mode: multiply;
}
.castle-enemy-preview__unit--gatebreakers img { object-fit: cover; object-position: 50% 4%; }
.castle-enemy-preview__unit--infantry img { object-fit: cover; object-position: 50% 18%; }
.castle-enemy-preview__unit--ram img { object-fit: cover; object-position: 69% center; transform: scale(1.18); }
.castle-enemy-preview i {
  position: absolute;
  left: 7px;
  bottom: 0;
  padding: 5px 7px;
  background: #f2e6ca;
  color: var(--castle-ink);
  font-family: var(--studio-mono);
  font-size: 0.52rem;
  font-style: normal;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transform: rotate(1deg);
}

.castle-slot {
  position: absolute;
  z-index: 16;
  top: var(--slot-y);
  left: var(--slot-x);
  display: grid;
  width: clamp(74px, 7.5vw, 106px);
  height: clamp(74px, 7.5vw, 106px);
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--castle-ink);
  box-shadow: none;
  cursor: pointer;
  transform: translate(-50%, -50%);
  touch-action: manipulation;
}
.castle-slot:hover,
.castle-slot:focus-visible { background: transparent; outline: 2px solid #fff2ca; outline-offset: 5px; }
.castle-slot.is-filled,
.castle-slot.is-filled:hover,
.castle-slot.is-filled:focus-visible {
  border: 0;
  background: transparent;
  box-shadow: none;
  outline: none;
}
.castle-slot.is-filled:hover .castle-piece,
.castle-slot.is-filled:focus-visible .castle-piece { outline: 2px solid #fff2ca; outline-offset: 4px; }
.castle-slot:nth-of-type(even) { transform: translate(-50%, -50%); }
.castle-slot__pin {
  position: absolute;
  z-index: 5;
  top: -4px;
  left: -4px;
  display: grid;
  width: 22px;
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid rgb(28 38 32 / 0.45);
  border-radius: 50%;
  background: #e9d7b4;
  font-family: var(--studio-mono);
  font-size: 0.52rem;
  box-shadow: 2px 3px 0 rgb(32 40 32 / 0.18);
}
.castle-slot__empty {
  display: grid;
  width: 46px;
  aspect-ratio: 1;
  place-items: center;
  border: 2px dashed rgb(32 42 34 / 0.62);
  border-radius: 50%;
  background: rgb(237 224 193 / 0.74);
  font-family: var(--studio-display);
  font-size: 1.6rem;
  line-height: 1;
}
.castle-slot__label {
  position: absolute;
  top: calc(100% - 5px);
  left: 50%;
  display: grid;
  min-width: max-content;
  gap: 1px;
  padding: 5px 7px;
  border: 1px solid rgb(36 44 35 / 0.22);
  background: rgb(242 232 207 / 0.92);
  text-align: center;
  transform: translateX(-50%) rotate(-1deg);
}
.castle-slot__label strong {
  font-family: var(--studio-display);
  font-size: 0.7rem;
  font-weight: 400;
  line-height: 1;
}
.castle-slot__label small {
  color: var(--castle-muted);
  font-family: var(--studio-mono);
  font-size: 0.42rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.castle-slot.is-compatible .castle-slot__empty,
.castle-slot.is-compatible .castle-piece {
  outline: 4px solid #f1d875;
  outline-offset: 4px;
  filter: drop-shadow(0 0 11px rgb(245 220 109 / 0.8));
}
.castle-slot.is-inspected .castle-slot__empty,
.castle-slot.is-inspected .castle-piece {
  outline: 3px solid #fff1c9;
  outline-offset: 5px;
  filter: drop-shadow(0 0 8px rgb(33 75 72 / 0.72));
}
.castle-slot.is-incompatible { cursor: not-allowed; opacity: 0.34; filter: grayscale(1); }
.castle-slot--battle {
  z-index: 17;
  width: clamp(82px, 8.5vw, 124px);
  height: clamp(82px, 8.5vw, 124px);
  cursor: default;
  pointer-events: none;
}
.castle-slot.castle-slot--battle {
  width: clamp(82px, 8.5vw, 124px);
  min-height: 0;
  height: clamp(82px, 8.5vw, 124px);
}
.castle-slot--battle.is-armed .castle-piece { filter: drop-shadow(0 0 12px rgb(242 215 111 / 0.85)); transform: translateY(-4px) scale(1.05); }
.castle-slot--battle.is-spent .castle-piece { opacity: 0.74; }
.castle-slot__battle-label {
  position: absolute;
  top: 89%;
  left: 50%;
  min-width: max-content;
  padding: 4px 6px;
  border: 1px solid rgb(35 40 32 / 0.22);
  background: rgb(238 226 198 / 0.9);
  font-family: var(--studio-mono);
  font-size: 0.42rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transform: translateX(-50%) rotate(-1deg);
}

.castle-objectives {
  position: absolute;
  z-index: 35;
  top: 18px;
  right: 20px;
  display: grid;
  width: min(170px, 24%);
  grid-template-columns: 1fr;
  border: 1px solid rgb(32 38 30 / 0.31);
  background: rgb(239 229 205 / 0.95);
  box-shadow: 6px 7px 0 rgb(34 38 30 / 0.15);
  transform: rotate(0.7deg);
}
.castle-objectives > span {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 7px;
  padding: 8px 9px;
  border-right: 1px solid var(--castle-rule);
}
.castle-objectives > span:last-child { border-right: 0; }
.castle-objectives strong { font-family: var(--studio-display); font-size: 0.72rem; font-weight: 400; }
.castle-objectives small { color: var(--castle-muted); font-family: var(--studio-mono); font-size: 0.43rem; }
.castle-objectives i {
  grid-column: 1 / -1;
  height: 6px;
  overflow: hidden;
  background: #b8ad91;
  clip-path: polygon(0 0, 100% 0, 97% 100%, 2% 85%);
}
.castle-objectives i b {
  display: block;
  width: calc(var(--integrity) * 100%);
  height: 100%;
  background: var(--castle-green);
  transition: width 460ms steps(4, end);
}
.castle-objectives .is-breached { background: rgb(154 62 43 / 0.17); }
.castle-objectives .is-breached i b { background: var(--castle-rust); }
.castle-breach-tear {
  position: absolute;
  z-index: 10;
  top: 58%;
  left: 73%;
  width: clamp(42px, 5vw, 70px);
  height: clamp(70px, 8vw, 110px);
  background: #171d19;
  clip-path: polygon(20% 1%, 82% 8%, 67% 24%, 96% 37%, 74% 51%, 91% 70%, 59% 78%, 70% 100%, 24% 90%, 31% 67%, 3% 53%, 27% 35%, 8% 18%);
  opacity: 0;
  pointer-events: none;
  transform: scale(0.6) rotate(-5deg);
  transition: opacity 420ms steps(3, end), transform 420ms steps(3, end);
}
.castle-stage.is-gate-breached .castle-breach-tear { opacity: 0.92; transform: scale(1) rotate(-2deg); }
.castle-stage.is-courtyard-breached .castle-breach-tear { background: var(--castle-rust); opacity: 1; transform: scale(1.32) rotate(5deg); }
.castle-stage.is-under-attack .castle-fortress-cutout { animation: castle-fortress-hit 760ms steps(4, end); }

.castle-piece {
  position: relative;
  display: block;
  width: 84px;
  height: 80px;
  overflow: visible;
  filter: drop-shadow(5px 7px 2px rgb(31 35 27 / 0.3));
  transition: transform 220ms steps(2, end), opacity 220ms;
  pointer-events: none;
}
.castle-piece--archers,
.castle-piece--oil,
.castle-piece--ballista,
.castle-piece--crossbow,
.castle-piece--siege-engine,
.castle-piece--beehive { mix-blend-mode: multiply; }
.castle-piece img {
  position: absolute;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: sepia(0.12) saturate(0.86) contrast(1.2);
  mix-blend-mode: multiply;
  user-select: none;
}
.castle-piece--photo {
  overflow: visible;
  background: transparent;
  filter: drop-shadow(5px 7px 2px rgb(20 22 18 / 0.34));
  mix-blend-mode: normal;
}
.castle-piece--photo .castle-piece__photo {
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #f5efe2;
  clip-path: polygon(3% 7%, 31% 2%, 68% 4%, 96% 1%, 100% 84%, 78% 100%, 38% 96%, 2% 92%);
  filter: saturate(0.92) contrast(1.08);
  mix-blend-mode: multiply;
}
.castle-piece--wall-spring-scorpion .castle-piece__photo,
.castle-piece--wall-collapsing-hoarding .castle-piece__photo,
.castle-piece--gate-drawbridge-collapse .castle-piece__photo { transform: scale(1.06); }
.castle-piece--tower-stone-droppers .castle-piece__photo,
.castle-piece--courtyard-royal-guard .castle-piece__photo { transform: scale(1.08); }
.castle-raster-effect {
  position: absolute;
  z-index: 5;
  top: 15%;
  left: -2%;
  display: block;
  width: 96px;
  height: 70px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  mix-blend-mode: multiply;
}
.castle-raster-effect img {
  position: absolute;
  max-width: none;
  filter: saturate(1.08) contrast(1.12);
  mix-blend-mode: multiply;
}
.castle-raster-effect--powder-shot img,
.castle-raster-effect--powder-keg img,
.castle-raster-effect--powder-blast img { width: 300%; height: 200%; }
.castle-raster-effect--powder-shot img { top: 0; left: 0; }
.castle-raster-effect--powder-keg img { top: -100%; left: -100%; }
.castle-raster-effect--powder-blast img { top: 0; left: -200%; }
.castle-raster-effect--greek-fire img { top: 0; left: 0; width: 200%; height: 200%; }
.castle-slot--battle.is-triggered .castle-raster-effect--powder-shot { animation: castle-raster-shell-flight 1250ms steps(6, end); }
.castle-slot--battle.is-triggered .castle-raster-effect--powder-keg { animation: castle-raster-keg-drop 1180ms steps(5, end); }
.castle-slot--battle.is-triggered .castle-raster-effect--powder-blast { animation: castle-raster-blast 980ms steps(5, end); }
.castle-slot--battle.is-triggered .castle-raster-effect--greek-fire { animation: castle-raster-fire-flight 1200ms steps(6, end); }
.castle-slot--battle.is-triggered .castle-piece--tower-powder-mortar .castle-piece__photo,
.castle-slot--battle.is-triggered .castle-piece--wall-spring-scorpion .castle-piece__photo { animation: castle-photo-recoil 720ms steps(4, end); }
.castle-slot--battle.is-triggered .castle-piece--tower-greek-fire-siphon .castle-piece__photo { animation: castle-photo-tip 1050ms steps(5, end); }
.castle-slot--battle.is-triggered .castle-piece--wall-powder-keg-drop .castle-piece__photo { animation: castle-photo-keg-release 920ms steps(4, end); }
.castle-slot--battle.is-triggered .castle-piece--wall-collapsing-hoarding .castle-piece__photo,
.castle-slot--battle.is-triggered .castle-piece--gate-drawbridge-collapse .castle-piece__photo { animation: castle-photo-collapse 1050ms steps(5, end); }
.castle-slot--battle.is-triggered .castle-piece--gate-fuse-mine .castle-piece__photo { animation: castle-photo-fuse 820ms steps(4, end); }
.castle-slot--battle.is-triggered .castle-piece--courtyard-royal-guard .castle-piece__photo { animation: castle-photo-guard 760ms steps(4, end); }
.castle-piece--archers img {
  inset: -6% 2% 0;
  width: 96%;
  height: 110%;
  object-fit: cover;
  object-position: 50% 48%;
  clip-path: polygon(29% 4%, 73% 0, 91% 27%, 83% 89%, 62% 100%, 22% 91%, 8% 48%);
}
.castle-piece--fire-archers img,
.castle-piece--longbow img {
  inset: 3%;
  width: 94%;
  height: 94%;
  object-fit: cover;
  clip-path: polygon(2% 8%, 96% 0, 100% 84%, 72% 100%, 5% 92%);
}
.castle-piece--crossbow img {
  inset: -8% 8% 0;
  width: 84%;
  height: 108%;
  object-fit: cover;
  object-position: 50% 35%;
  clip-path: polygon(16% 2%, 84% 0, 96% 91%, 70% 100%, 7% 92%, 1% 18%);
}
.castle-piece--siege-engine img,
.castle-piece--beehive img {
  inset: 3%;
  width: 94%;
  height: 94%;
  object-fit: contain;
  clip-path: polygon(3% 7%, 95% 0, 100% 87%, 76% 100%, 1% 91%);
}
.castle-piece--oil img {
  top: 4%;
  left: 6%;
  width: 88%;
  height: 70%;
  object-fit: cover;
  clip-path: polygon(5% 21%, 29% 6%, 74% 0, 97% 20%, 91% 80%, 66% 98%, 23% 90%, 0 63%);
  transform: rotate(-7deg);
  transform-origin: 22% 73%;
}
.castle-piece--ballista img {
  inset: 4%;
  width: 92%;
  height: 92%;
  object-fit: cover;
  object-position: 35% 30%;
  clip-path: polygon(2% 9%, 96% 0, 100% 82%, 75% 100%, 4% 91%);
  filter: sepia(0.34) contrast(1.35);
}
.castle-piece--net,
.castle-piece--spears,
.castle-piece--fire,
.castle-piece--frost-sling,
.castle-piece--icicles,
.castle-piece--frozen-moat { background: rgb(232 218 188 / 0.72); clip-path: polygon(3% 8%, 96% 0, 100% 89%, 75% 100%, 0 92%); }
.castle-sling-rack {
  position: absolute;
  inset: 10% 8%;
  border: 8px solid #c9ae77;
  border-width: 8px 3px 3px 8px;
  border-radius: 54% 42% 47% 38%;
  background: radial-gradient(circle at 42% 56%, #6e6652 0 9%, transparent 10%);
  transform: rotate(-16deg);
}
.castle-sling-rack i { position: absolute; width: 36px; height: 3px; background: #5d4329; transform-origin: left; }
.castle-sling-rack i:first-child { top: 20%; left: 46%; transform: rotate(48deg); }
.castle-sling-rack i:last-child { top: 69%; left: 45%; transform: rotate(-41deg); }
.castle-piece--frost-sling { background: rgb(216 231 230 / 0.84); }
.castle-piece--frost-sling .castle-sling-rack {
  border-color: #9ec1ca #557986 #557986 #9ec1ca;
  background: radial-gradient(circle at 42% 56%, #d9eef1 0 10%, transparent 11%);
}
.castle-piece--frost-sling .castle-sling-rack i { background: #416473; }
.castle-icicle-rack { position: absolute; inset: 7% 5%; }
.castle-icicle-rack i {
  position: absolute;
  top: 4%;
  left: calc(var(--ice-index, 0) * 15% + 3%);
  width: 17%;
  height: calc(54% + var(--ice-index, 0) * 4%);
  border: 2px solid #789eaa;
  background: linear-gradient(90deg, #eef5ee, #a9ced6 62%, #668d9c);
  clip-path: polygon(0 0, 100% 8%, 54% 100%);
  filter: drop-shadow(2px 3px 0 rgb(48 81 91 / 0.24));
  transform: rotate(calc(-7deg + var(--ice-index, 0) * 3deg));
}
.castle-icicle-rack i:nth-child(1) { --ice-index: 0; }
.castle-icicle-rack i:nth-child(2) { --ice-index: 1; }
.castle-icicle-rack i:nth-child(3) { --ice-index: 2; }
.castle-icicle-rack i:nth-child(4) { --ice-index: 3; }
.castle-icicle-rack i:nth-child(5) { --ice-index: 4; }
.castle-icicle-rack i:nth-child(6) { --ice-index: 5; }
.castle-ice-pool {
  position: absolute;
  inset: 24% 3% 14%;
  border: 3px solid #587e8a;
  background: linear-gradient(145deg, #d8eaeb, #83afba 54%, #edf3ea);
  clip-path: polygon(3% 28%, 26% 4%, 61% 0, 98% 25%, 89% 81%, 55% 100%, 14% 87%);
  box-shadow: inset 0 0 0 5px rgb(239 247 240 / 0.36);
}
.castle-ice-pool i {
  position: absolute;
  top: 16%;
  left: calc(var(--crack-index, 0) * 18% + 8%);
  width: 2px;
  height: 70%;
  background: #406875;
  transform: rotate(calc(-48deg + var(--crack-index, 0) * 21deg));
  transform-origin: center;
}
.castle-ice-pool i:nth-child(1) { --crack-index: 0; }
.castle-ice-pool i:nth-child(2) { --crack-index: 1; }
.castle-ice-pool i:nth-child(3) { --crack-index: 2; }
.castle-ice-pool i:nth-child(4) { --crack-index: 3; }
.castle-ice-pool i:nth-child(5) { --crack-index: 4; }
.castle-piece--storm-beacon,
.castle-piece--flood-sluice,
.castle-piece--fire-pots,
.castle-piece--rolling-logs,
.castle-piece--spike-pit,
.castle-piece--pavise-bows {
  background: rgb(222 225 212 / 0.86);
  clip-path: polygon(4% 7%, 94% 1%, 100% 86%, 78% 100%, 2% 92%);
}
.castle-beacon-mast {
  position: absolute;
  inset: 3% 12% 5%;
  border-bottom: 8px solid #57606a;
  background:
    linear-gradient(118deg, transparent 0 46%, #46515a 47% 51%, transparent 52%),
    linear-gradient(62deg, transparent 0 46%, #46515a 47% 51%, transparent 52%);
}
.castle-beacon-mast::before {
  position: absolute;
  top: 2%;
  bottom: 0;
  left: 48%;
  width: 7px;
  border: 2px solid #584126;
  background: linear-gradient(90deg, #70512d, #d1a45a 52%, #563b25);
  content: "";
}
.castle-beacon-mast::after {
  position: absolute;
  top: -1%;
  left: 40%;
  width: 22%;
  aspect-ratio: 1;
  border: 3px solid #32586a;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 35%, #eaf1e8 0 20%, #74a5b8 21% 57%, #264b5b 58%);
  box-shadow: 0 0 0 5px rgb(214 225 216 / 0.54);
  content: "";
}
.castle-beacon-mast i {
  position: absolute;
  top: calc(28% + var(--beacon-index, 0) * 17%);
  left: 20%;
  width: 60%;
  border-top: 3px solid #2f4955;
  transform: rotate(calc(-7deg + var(--beacon-index, 0) * 7deg));
}
.castle-beacon-mast i:nth-child(1) { --beacon-index: 0; }
.castle-beacon-mast i:nth-child(2) { --beacon-index: 1; }
.castle-beacon-mast i:nth-child(3) { --beacon-index: 2; }
.castle-sluice-frame {
  position: absolute;
  inset: 8% 8% 6%;
  border: 7px solid #544331;
  background: linear-gradient(180deg, #6f8790 0 18%, #b8d1d2 19% 76%, #426d7e 77%);
  box-shadow: inset 0 0 0 4px rgb(225 230 214 / 0.5);
  clip-path: polygon(2% 3%, 96% 0, 100% 91%, 73% 100%, 0 94%);
}
.castle-sluice-frame::before {
  position: absolute;
  top: 10%;
  right: 8%;
  left: 8%;
  height: 14%;
  border: 3px solid #443628;
  background: #b5854d;
  content: "";
}
.castle-sluice-frame i {
  position: absolute;
  top: 27%;
  bottom: 4%;
  left: calc(16% + var(--sluice-index, 0) * 29%);
  width: 10%;
  background: linear-gradient(#dce8e2, #6599a7 52%, #2d6174);
  clip-path: polygon(14% 0, 94% 7%, 72% 100%, 0 91%);
}
.castle-sluice-frame i:nth-child(1) { --sluice-index: 0; }
.castle-sluice-frame i:nth-child(2) { --sluice-index: 1; }
.castle-sluice-frame i:nth-child(3) { --sluice-index: 2; }
.castle-pot-rack {
  position: absolute;
  inset: 9% 4% 7%;
  border-bottom: 9px solid #70472d;
}
.castle-pot-rack::before,
.castle-pot-rack::after {
  position: absolute;
  bottom: -3px;
  width: 7px;
  height: 34%;
  background: #59402c;
  content: "";
}
.castle-pot-rack::before { left: 7%; transform: rotate(8deg); }
.castle-pot-rack::after { right: 7%; transform: rotate(-8deg); }
.castle-pot-rack i {
  position: absolute;
  bottom: 15%;
  left: calc(4% + var(--pot-index, 0) * 32%);
  width: 29%;
  height: calc(42% + var(--pot-index, 0) * 5%);
  border: 4px solid #783a24;
  border-radius: 42% 43% 54% 50%;
  background: linear-gradient(130deg, #ef9b42, #a63b27 58%, #4c2922);
  box-shadow: inset 5px 4px 0 rgb(255 203 101 / 0.28);
  transform: rotate(calc(-8deg + var(--pot-index, 0) * 7deg));
}
.castle-pot-rack i::before {
  position: absolute;
  top: -12px;
  right: 7%;
  left: 7%;
  height: 8px;
  border: 3px solid #653320;
  border-radius: 50%;
  background: #321f1c;
  content: "";
}
.castle-pot-rack i:nth-child(1) { --pot-index: 0; }
.castle-pot-rack i:nth-child(2) { --pot-index: 1; }
.castle-pot-rack i:nth-child(3) { --pot-index: 2; }
.castle-log-rack {
  position: absolute;
  inset: 8% 4%;
  transform: rotate(-8deg);
}
.castle-log-rack i {
  position: absolute;
  top: calc(7% + var(--log-index, 0) * 21%);
  left: calc(2% + var(--log-index, 0) * 3%);
  width: 88%;
  height: 15%;
  border: 3px solid #513522;
  border-radius: 48% 8% 13% 46%;
  background: repeating-linear-gradient(90deg, #8b5830 0 10px, #b9793e 10px 16px);
  box-shadow: inset 0 3px 0 rgb(235 180 105 / 0.24);
}
.castle-log-rack i:nth-child(1) { --log-index: 0; }
.castle-log-rack i:nth-child(2) { --log-index: 1; }
.castle-log-rack i:nth-child(3) { --log-index: 2; }
.castle-log-rack i:nth-child(4) { --log-index: 3; }
.castle-log-rush {
  position: absolute;
  z-index: -1;
  top: 54%;
  left: 9%;
  width: 90px;
  height: 150px;
  pointer-events: none;
}
.castle-log-rush i {
  position: absolute;
  top: calc(var(--rush-index, 0) * 20px);
  left: 0;
  width: 79px;
  height: 17px;
  border: 3px solid #e2cfaa;
  border-radius: 47% 8% 11% 46%;
  background: linear-gradient(90deg, #77482b, #bd8046 57%, #65402b);
  opacity: 0;
  transform: rotate(-16deg);
}
.castle-log-rush i:nth-child(1) { --rush-index: 0; }
.castle-log-rush i:nth-child(2) { --rush-index: 1; }
.castle-pit-hatch {
  position: absolute;
  inset: 18% 4% 7%;
  border: 4px solid #493328;
  background: repeating-linear-gradient(90deg, #765037 0 12px, #b37d4e 12px 17px);
  clip-path: polygon(2% 13%, 95% 0, 100% 84%, 68% 100%, 0 91%);
  transform-origin: 8% 90%;
}
.castle-pit-spikes {
  position: absolute;
  inset: 22% 7% 8%;
}
.castle-pit-spikes i {
  position: absolute;
  bottom: 3%;
  left: calc(3% + var(--spike-index, 0) * 16%);
  width: 15%;
  height: calc(48% + var(--spike-index, 0) * 4%);
  background: linear-gradient(90deg, #342e2b, #819097 55%, #2e383d);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  filter: drop-shadow(2px 3px 0 #d8c7a6);
}
.castle-pit-spikes i:nth-child(1) { --spike-index: 0; }
.castle-pit-spikes i:nth-child(2) { --spike-index: 1; }
.castle-pit-spikes i:nth-child(3) { --spike-index: 2; }
.castle-pit-spikes i:nth-child(4) { --spike-index: 3; }
.castle-pit-spikes i:nth-child(5) { --spike-index: 4; }
.castle-pit-spikes i:nth-child(6) { --spike-index: 5; }
.castle-pavise-shield {
  position: absolute;
  inset: 8% 34% 5% 5%;
  border: 4px solid #44352a;
  border-radius: 48% 48% 8% 8% / 22% 22% 8% 8%;
  background:
    linear-gradient(90deg, transparent 46%, #d5c49e 47% 54%, transparent 55%),
    linear-gradient(#547489 0 33%, #e1d4b3 34% 66%, #9d4d37 67%);
  box-shadow: inset 0 0 0 4px rgb(236 226 203 / 0.45);
  transform: rotate(-5deg);
}
.castle-pavise-crossbow {
  position: absolute;
  top: 24%;
  right: 2%;
  width: 66%;
  height: 53%;
  border-top: 6px solid #5f4029;
  transform: rotate(-9deg);
}
.castle-pavise-crossbow::before {
  position: absolute;
  top: -25px;
  right: 4%;
  width: 72%;
  height: 45px;
  border: 5px solid #513826;
  border-block-color: transparent;
  border-radius: 50%;
  content: "";
}
.castle-piece--pavise-bows .castle-ballista-bolt { top: 31%; left: 30%; width: 96px; }
.castle-net-grid {
  position: absolute;
  inset: 7%;
  border: 4px solid #5c4932;
  background:
    repeating-linear-gradient(42deg, transparent 0 10px, #70583b 10px 13px),
    repeating-linear-gradient(132deg, transparent 0 10px, #70583b 10px 13px);
  clip-path: polygon(4% 0, 100% 7%, 93% 96%, 8% 100%);
}
.castle-spear-rack { position: absolute; inset: 4%; transform: rotate(-8deg); }
.castle-spear-rack i {
  position: absolute;
  bottom: 5%;
  width: 6px;
  height: 88%;
  background: linear-gradient(90deg, #6b452c, #b67a43, #593a28);
  transform-origin: 50% 88%;
}
.castle-spear-rack i::before {
  position: absolute;
  top: -12px;
  left: -5px;
  border: 8px solid transparent;
  border-bottom: 16px solid #34403b;
  content: "";
}
.castle-spear-rack i:nth-child(1) { left: 15%; transform: rotate(-10deg); }
.castle-spear-rack i:nth-child(2) { left: 38%; transform: rotate(4deg); }
.castle-spear-rack i:nth-child(3) { left: 61%; transform: rotate(-4deg); }
.castle-spear-rack i:nth-child(4) { left: 82%; transform: rotate(11deg); }
.castle-fire-trench { position: absolute; inset: 9% 3%; }
.castle-fire-trench i {
  position: absolute;
  bottom: 0;
  width: 22%;
  height: 78%;
  background: linear-gradient(#e3a13b, #b84728 65%, #653320);
  clip-path: polygon(50% 0, 72% 31%, 100% 20%, 84% 72%, 55% 100%, 18% 82%, 0 44%, 33% 51%);
}
.castle-fire-trench i:nth-child(1) { left: 0; height: 55%; }
.castle-fire-trench i:nth-child(2) { left: 17%; }
.castle-fire-trench i:nth-child(3) { left: 34%; height: 64%; }
.castle-fire-trench i:nth-child(4) { left: 51%; height: 88%; }
.castle-fire-trench i:nth-child(5) { left: 68%; height: 58%; }
.castle-fire-trench i:nth-child(6) { left: 82%; height: 72%; }
.castle-portcullis-grid {
  position: absolute;
  inset: 5% 16% 2%;
  display: block;
  background:
    repeating-linear-gradient(90deg, transparent 0 13px, #343329 13px 18px),
    repeating-linear-gradient(0deg, transparent 0 12px, #343329 12px 16px),
    #d6c29b;
  clip-path: polygon(2% 0, 97% 3%, 100% 84%, 88% 100%, 76% 84%, 62% 100%, 49% 84%, 35% 100%, 22% 84%, 8% 100%, 0 83%);
  box-shadow: inset 0 0 0 4px #292d27;
}
.castle-portcullis-grid i {
  position: absolute;
  top: -7px;
  width: 9px;
  height: 13px;
  border-radius: 50%;
  background: #b1854c;
}
.castle-portcullis-grid i:nth-child(1) { left: 8%; }
.castle-portcullis-grid i:nth-child(2) { left: 34%; }
.castle-portcullis-grid i:nth-child(3) { left: 61%; }
.castle-portcullis-grid i:nth-child(4) { left: 87%; }
.castle-rock-basket {
  position: absolute;
  inset: 28% 7% 9%;
  border: 4px solid #6b482e;
  background: repeating-linear-gradient(35deg, #9b6b3e 0 7px, #c09258 7px 11px);
  clip-path: polygon(5% 6%, 96% 0, 86% 100%, 15% 94%);
}
.castle-rock-basket i,
.castle-falling-rocks i {
  position: absolute;
  border-radius: 46% 54% 35% 65%;
  background: #5e6559;
  box-shadow: inset 3px 2px 0 rgb(255 255 255 / 0.16);
}
.castle-rock-basket i:nth-child(1) { top: -24px; left: 4px; width: 28px; height: 25px; }
.castle-rock-basket i:nth-child(2) { top: -31px; left: 26px; width: 32px; height: 30px; }
.castle-rock-basket i:nth-child(3) { top: -22px; left: 51px; width: 27px; height: 22px; }
.castle-rock-basket i:nth-child(4) { top: -9px; left: 16px; width: 30px; height: 24px; }
.castle-rock-basket i:nth-child(5) { top: -8px; left: 43px; width: 28px; height: 25px; }
.castle-falling-rocks { position: absolute; top: 58%; left: 18%; width: 84px; height: 280px; pointer-events: none; }
.castle-falling-rocks i { top: 0; opacity: 0; }
.castle-falling-rocks i:nth-child(1) { left: 3px; width: 19px; height: 17px; }
.castle-falling-rocks i:nth-child(2) { left: 24px; width: 25px; height: 21px; }
.castle-falling-rocks i:nth-child(3) { left: 48px; width: 18px; height: 22px; }
.castle-falling-rocks i:nth-child(4) { left: 67px; width: 15px; height: 14px; }
.castle-caltrop-cluster { position: absolute; inset: 22% 3% 9%; }
.castle-caltrop-cluster i {
  position: absolute;
  width: 27px;
  height: 27px;
  transform: rotate(24deg);
}
.castle-caltrop-cluster i::before,
.castle-caltrop-cluster i::after {
  position: absolute;
  top: 11px;
  left: 0;
  width: 27px;
  height: 5px;
  background: #2c3936;
  clip-path: polygon(0 50%, 19% 0, 82% 0, 100% 50%, 82% 100%, 19% 100%);
  content: "";
}
.castle-caltrop-cluster i::after { transform: rotate(90deg); }
.castle-caltrop-cluster i:nth-child(1) { top: 1%; left: 4%; }
.castle-caltrop-cluster i:nth-child(2) { top: 22%; left: 31%; transform: rotate(8deg); }
.castle-caltrop-cluster i:nth-child(3) { top: 3%; left: 61%; transform: rotate(39deg); }
.castle-caltrop-cluster i:nth-child(4) { top: 51%; left: 12%; transform: rotate(65deg); }
.castle-caltrop-cluster i:nth-child(5) { top: 52%; left: 58%; transform: rotate(81deg); }
.castle-timber { position: absolute; inset: 7% 1%; }
.castle-timber i {
  position: absolute;
  left: 5%;
  width: 90%;
  height: 17px;
  border: 2px solid #4e3426;
  border-radius: 50% 8% 12% 45%;
  background: linear-gradient(90deg, #7b4b2d, #c48448 52%, #795039);
  box-shadow: inset 0 3px 0 rgb(244 196 123 / 0.28);
}
.castle-timber i:nth-child(1) { top: 11%; transform: rotate(31deg); }
.castle-timber i:nth-child(2) { top: 37%; transform: rotate(-27deg); }
.castle-timber i:nth-child(3) { top: 56%; transform: rotate(7deg); }
.castle-timber i:nth-child(4) { top: 72%; transform: rotate(-4deg); }
.castle-oil-pour {
  position: absolute;
  z-index: -1;
  top: 48%;
  left: 6%;
  width: 72px;
  height: min(43vh, 330px);
  opacity: 0;
  transform: rotate(4deg);
  pointer-events: none;
}
.castle-oil-pour::before {
  position: absolute;
  top: 0;
  left: 25px;
  width: 20px;
  height: 88%;
  background: linear-gradient(#8f3b1f, #d76b32 54%, #8b2d1c);
  clip-path: polygon(21% 0, 77% 2%, 100% 31%, 69% 61%, 88% 100%, 29% 95%, 0 69%, 25% 39%);
  content: "";
}
.castle-oil-pour i {
  position: absolute;
  top: 9%;
  width: 14px;
  aspect-ratio: 0.72;
  border-radius: 56% 44% 68% 32%;
  background: #c3542b;
  opacity: 0;
}
.castle-oil-pour i:nth-child(1) { left: 2px; }
.castle-oil-pour i:nth-child(2) { left: 19px; }
.castle-oil-pour i:nth-child(3) { left: 42px; }
.castle-oil-pour i:nth-child(4) { left: 58px; }
.castle-oil-pour i:nth-child(5) { left: 31px; }
.castle-oil-pour i:nth-child(6) { left: 8px; }
.castle-arrow {
  position: absolute;
  z-index: -1;
  top: 47%;
  left: 28%;
  width: 76px;
  border-top: 2px solid #402f24;
  opacity: 0;
  transform: rotate(158deg);
}
.castle-arrow::after {
  position: absolute;
  top: -5px;
  right: -2px;
  border: 4px solid transparent;
  border-left-color: #402f24;
  content: "";
}
.castle-arrow--two { top: 39%; transform: rotate(164deg); }
.castle-arrow--three { top: 52%; transform: rotate(151deg); }
.castle-arrow--four { top: 34%; transform: rotate(170deg); }
.castle-ballista-bolt {
  position: absolute;
  z-index: -1;
  top: 48%;
  left: 3%;
  width: 110px;
  border-top: 5px solid #433225;
  opacity: 0;
  transform: rotate(171deg);
}
.castle-ballista-bolt::after {
  position: absolute;
  top: -8px;
  right: -4px;
  border: 6px solid transparent;
  border-left-color: #433225;
  content: "";
}

.castle-arrow-volley,
.castle-javelin-volley,
.castle-thrown-rocks,
.castle-lava-splash,
.castle-fire-burst,
.castle-swarm-burst,
.castle-dust-burst,
.castle-frost-volley,
.castle-frost-fall {
  position: absolute;
  z-index: -1;
  top: 40%;
  left: 18%;
  width: 88px;
  height: 54px;
  pointer-events: none;
}
.castle-arrow-volley i {
  position: absolute;
  top: calc(var(--arrow-index, 0) * 10px);
  left: 0;
  width: 74px;
  height: 11px;
  background: #ead9b7;
  clip-path: polygon(0 34%, 72% 28%, 82% 0, 100% 50%, 82% 100%, 72% 69%, 0 66%);
  filter: drop-shadow(2px 3px 0 rgb(30 24 20 / 0.3));
  opacity: 0;
  transform: rotate(158deg);
}
.castle-arrow-volley i::before {
  position: absolute;
  top: 4px;
  left: 7px;
  width: 61px;
  border-top: 2px solid #402f24;
  content: "";
}
.castle-arrow-volley i::after {
  position: absolute;
  top: 1px;
  right: 4px;
  border: 4px solid transparent;
  border-left-color: #402f24;
  content: "";
}
.castle-piece--fire-archers .castle-arrow-volley i { background: #efb04a; filter: drop-shadow(2px 3px 0 rgb(64 26 19 / 0.4)); }
.castle-piece--fire-archers .castle-arrow-volley i::after { border-left-color: #b63b22; }
.castle-arrow-volley i:nth-child(1) { --arrow-index: 0; }
.castle-arrow-volley i:nth-child(2) { --arrow-index: 1; transform: rotate(164deg); }
.castle-arrow-volley i:nth-child(3) { --arrow-index: 2; transform: rotate(151deg); }
.castle-arrow-volley i:nth-child(4) { --arrow-index: 3; transform: rotate(170deg); }
.castle-fire-burst,
.castle-lava-splash,
.castle-swarm-burst,
.castle-dust-burst { top: 58%; left: -14%; width: 108px; height: 190px; }
.castle-fire-burst i,
.castle-lava-splash i,
.castle-swarm-burst i,
.castle-dust-burst i {
  position: absolute;
  top: 0;
  left: calc(var(--burst-index, 0) * 16px);
  width: 16px;
  height: 24px;
  background: #c1542b;
  clip-path: polygon(50% 0, 83% 36%, 100% 72%, 63% 100%, 19% 88%, 0 48%);
  opacity: 0;
}
.castle-fire-burst i { filter: drop-shadow(2px 3px 0 #f4d7a2) drop-shadow(0 0 3px #e34d24); }
.castle-lava-splash i {
  width: 25px;
  height: 34px;
  background: linear-gradient(#ffd465, #ef5a22 58%, #742619);
  clip-path: polygon(48% 0, 74% 22%, 100% 48%, 79% 100%, 23% 91%, 0 46%, 29% 24%);
  filter: drop-shadow(3px 4px 0 #3c201d);
}
.castle-swarm-burst i { width: 9px; height: 9px; border-radius: 50%; background: #6c4b24; clip-path: none; }
.castle-dust-burst i { width: 20px; height: 20px; border-radius: 50%; background: #d5cda8; clip-path: none; filter: blur(1px); }
.castle-fire-burst i:nth-child(1), .castle-swarm-burst i:nth-child(1), .castle-dust-burst i:nth-child(1) { --burst-index: 0; }
.castle-fire-burst i:nth-child(2), .castle-swarm-burst i:nth-child(2), .castle-dust-burst i:nth-child(2) { --burst-index: 1; }
.castle-fire-burst i:nth-child(3), .castle-swarm-burst i:nth-child(3), .castle-dust-burst i:nth-child(3) { --burst-index: 2; }
.castle-fire-burst i:nth-child(4), .castle-swarm-burst i:nth-child(4), .castle-dust-burst i:nth-child(4) { --burst-index: 3; }
.castle-fire-burst i:nth-child(5), .castle-swarm-burst i:nth-child(5), .castle-dust-burst i:nth-child(5) { --burst-index: 4; }
.castle-swarm-burst i:nth-child(6), .castle-dust-burst i:nth-child(6) { --burst-index: 5; }
.castle-swarm-burst i:nth-child(7) { --burst-index: 6; }
.castle-lava-splash i:nth-child(1) { --burst-index: 0; }
.castle-lava-splash i:nth-child(2) { --burst-index: 1; }
.castle-lava-splash i:nth-child(3) { --burst-index: 2; }
.castle-lava-splash i:nth-child(4) { --burst-index: 3; }
.castle-lava-splash i:nth-child(5) { --burst-index: 4; }

.castle-frost-volley,
.castle-frost-fall { top: 39%; left: 4%; width: 112px; height: 170px; }
.castle-frost-volley i,
.castle-frost-fall i {
  position: absolute;
  top: calc(var(--frost-index, 0) * 8px);
  left: calc(var(--frost-index, 0) * 10px);
  width: 25px;
  height: 19px;
  border: 2px solid #dcebec;
  background: linear-gradient(145deg, #eff6ef, #75a9b8);
  clip-path: polygon(50% 0, 100% 31%, 82% 100%, 13% 84%, 0 22%);
  filter: drop-shadow(2px 3px 0 rgb(43 76 87 / 0.36));
  opacity: 0;
}
.castle-frost-volley i:nth-child(1), .castle-frost-fall i:nth-child(1) { --frost-index: 0; }
.castle-frost-volley i:nth-child(2), .castle-frost-fall i:nth-child(2) { --frost-index: 1; }
.castle-frost-volley i:nth-child(3), .castle-frost-fall i:nth-child(3) { --frost-index: 2; }
.castle-frost-volley i:nth-child(4), .castle-frost-fall i:nth-child(4) { --frost-index: 3; }
.castle-frost-volley i:nth-child(5), .castle-frost-fall i:nth-child(5) { --frost-index: 4; }
.castle-frost-volley i:nth-child(6), .castle-frost-fall i:nth-child(6) { --frost-index: 5; }

.castle-javelin-volley { top: 32%; left: 6%; width: 120px; height: 70px; }
.castle-javelin-volley i {
  position: absolute;
  top: calc(var(--javelin-index, 0) * 21px);
  left: 0;
  width: 112px;
  height: 13px;
  background: #ead9b7;
  clip-path: polygon(0 35%, 76% 30%, 85% 0, 100% 50%, 85% 100%, 76% 68%, 0 65%);
  filter: drop-shadow(2px 3px 0 rgb(34 27 21 / 0.38));
  opacity: 0;
  transform: rotate(164deg);
}
.castle-javelin-volley i::before { position: absolute; top: 5px; left: 8px; width: 86px; border-top: 3px solid #6b452c; content: ""; }
.castle-javelin-volley i:nth-child(1) { --javelin-index: 0; }
.castle-javelin-volley i:nth-child(2) { --javelin-index: 1; transform: rotate(157deg); }

.castle-thrown-rocks { top: 35%; left: 12%; width: 90px; height: 70px; }
.castle-thrown-rocks i {
  position: absolute;
  top: calc(var(--rock-index, 0) * 13px);
  left: calc(var(--rock-index, 0) * 9px);
  width: 22px;
  height: 19px;
  border: 3px solid #d9c9a9;
  border-radius: 46% 54% 35% 65%;
  background: #5e6559;
  filter: drop-shadow(2px 3px 0 rgb(30 27 24 / 0.42));
  opacity: 0;
}
.castle-thrown-rocks i:nth-child(1) { --rock-index: 0; }
.castle-thrown-rocks i:nth-child(2) { --rock-index: 1; }
.castle-thrown-rocks i:nth-child(3) { --rock-index: 2; }
.castle-thrown-rocks i:nth-child(4) { --rock-index: 3; }

.castle-lightning-chain,
.castle-water-burst {
  position: absolute;
  z-index: -1;
  top: 45%;
  left: 4%;
  width: 112px;
  height: 190px;
  pointer-events: none;
}
.castle-lightning-chain i {
  position: absolute;
  top: calc(var(--lightning-index, 0) * 18px);
  left: calc(var(--lightning-index, 0) * 7px);
  width: 108px;
  height: 21px;
  border: 2px solid #e7ede1;
  background: #8fd0e1;
  box-shadow: 3px 4px 0 rgb(18 56 74 / 0.38), 0 0 7px rgb(214 240 238 / 0.82);
  clip-path: polygon(0 41%, 24% 26%, 31% 0, 48% 34%, 70% 20%, 77% 55%, 100% 69%, 74% 80%, 64% 100%, 45% 68%, 23% 83%);
  opacity: 0;
  transform: rotate(calc(162deg + var(--lightning-index, 0) * 5deg));
}
.castle-lightning-chain i:nth-child(1) { --lightning-index: 0; }
.castle-lightning-chain i:nth-child(2) { --lightning-index: 1; }
.castle-lightning-chain i:nth-child(3) { --lightning-index: 2; }
.castle-water-burst { top: 54%; left: 1%; width: 100px; height: 230px; }
.castle-water-burst i {
  position: absolute;
  top: 0;
  left: calc(2% + var(--water-index, 0) * 15%);
  width: 16%;
  height: calc(54px + var(--water-index, 0) * 6px);
  border: 2px solid #dce9e4;
  background: linear-gradient(180deg, #d7e9e5, #68a9ba 62%, #2d677b);
  box-shadow: 2px 3px 0 rgb(24 61 74 / 0.36);
  clip-path: polygon(32% 0, 93% 5%, 100% 43%, 65% 100%, 7% 91%, 0 36%);
  opacity: 0;
  transform: rotate(calc(-7deg + var(--water-index, 0) * 3deg));
}
.castle-water-burst i:nth-child(1) { --water-index: 0; }
.castle-water-burst i:nth-child(2) { --water-index: 1; }
.castle-water-burst i:nth-child(3) { --water-index: 2; }
.castle-water-burst i:nth-child(4) { --water-index: 3; }
.castle-water-burst i:nth-child(5) { --water-index: 4; }
.castle-water-burst i:nth-child(6) { --water-index: 5; }

.castle-slot--battle.is-triggered .castle-piece--oil img { animation: castle-cauldron-tip 1400ms steps(5, end); }
.castle-slot--battle.is-triggered .castle-oil-pour { animation: castle-oil-sheet 1500ms steps(5, end); }
.castle-slot--battle.is-triggered .castle-oil-pour i { animation: castle-oil-drop 980ms steps(4, end); }
.castle-slot--battle.is-triggered .castle-oil-pour i:nth-child(2) { animation-delay: 120ms; }
.castle-slot--battle.is-triggered .castle-oil-pour i:nth-child(3) { animation-delay: 230ms; }
.castle-slot--battle.is-triggered .castle-oil-pour i:nth-child(4) { animation-delay: 340ms; }
.castle-slot--battle.is-triggered .castle-oil-pour i:nth-child(5) { animation-delay: 470ms; }
.castle-slot--battle.is-triggered .castle-oil-pour i:nth-child(6) { animation-delay: 590ms; }
.castle-slot--battle.is-triggered .castle-arrow { animation: castle-arrow-flight 850ms steps(4, end); }
.castle-slot--battle.is-triggered .castle-arrow--two { animation-delay: 120ms; }
.castle-slot--battle.is-triggered .castle-arrow--three { animation-delay: 240ms; }
.castle-slot--battle.is-triggered .castle-arrow--four { animation-delay: 360ms; }
.castle-slot--battle.is-triggered .castle-falling-rocks i { animation: castle-rock-drop 950ms steps(4, end); }
.castle-slot--battle.is-triggered .castle-falling-rocks i:nth-child(2) { animation-delay: 120ms; }
.castle-slot--battle.is-triggered .castle-falling-rocks i:nth-child(3) { animation-delay: 250ms; }
.castle-slot--battle.is-triggered .castle-falling-rocks i:nth-child(4) { animation-delay: 390ms; }
.castle-slot--battle.is-triggered .castle-ballista-bolt { animation: castle-bolt-flight 880ms steps(5, end); }
.castle-slot--battle.is-triggered .castle-portcullis-grid { animation: castle-gate-drop 900ms steps(5, end); }
.castle-slot--battle.is-triggered .castle-piece--caltrops { animation: castle-caltrop-snap 620ms steps(3, end); }
.castle-slot--battle.is-triggered .castle-piece--barricade { animation: castle-timber-hit 850ms steps(4, end); }
.castle-slot--battle.is-triggered .castle-arrow-volley i { animation: castle-arrow-flight 850ms steps(4, end); }
.castle-slot--battle.is-triggered .castle-arrow-volley i:nth-child(2) { animation-delay: 100ms; }
.castle-slot--battle.is-triggered .castle-arrow-volley i:nth-child(3) { animation-delay: 200ms; }
.castle-slot--battle.is-triggered .castle-arrow-volley i:nth-child(4) { animation-delay: 300ms; }
.castle-slot--battle.is-triggered .castle-javelin-volley i { animation: castle-javelin-flight 920ms steps(5, end); }
.castle-slot--battle.is-triggered .castle-javelin-volley i:nth-child(2) { animation-delay: 180ms; }
.castle-slot--battle.is-triggered .castle-thrown-rocks i { animation: castle-rock-flight 980ms steps(5, end); }
.castle-slot--battle.is-triggered .castle-thrown-rocks i:nth-child(2) { animation-delay: 110ms; }
.castle-slot--battle.is-triggered .castle-thrown-rocks i:nth-child(3) { animation-delay: 220ms; }
.castle-slot--battle.is-triggered .castle-thrown-rocks i:nth-child(4) { animation-delay: 330ms; }
.castle-slot--battle.is-triggered .castle-fire-burst i { animation: castle-effect-burst 980ms steps(5, end); }
.castle-slot--battle.is-triggered .castle-lava-splash i { animation: castle-lava-flight 1050ms steps(5, end); }
.castle-slot--battle.is-triggered .castle-swarm-burst i { animation: castle-swarm-fall 1200ms steps(6, end); }
.castle-slot--battle.is-triggered .castle-dust-burst i { animation: castle-dust-fall 1150ms steps(5, end); }
.castle-slot--battle.is-triggered .castle-frost-volley i { animation: castle-frost-flight 1050ms steps(5, end); }
.castle-slot--battle.is-triggered .castle-frost-fall i { animation: castle-frost-drop 1100ms steps(5, end); }
.castle-slot--battle.is-triggered .castle-net-grid { animation: castle-net-drop 900ms steps(5, end); }
.castle-slot--battle.is-triggered .castle-spear-rack { animation: castle-spear-thrust 720ms steps(4, end); }
.castle-slot--battle.is-triggered .castle-fire-trench { animation: castle-fire-snap 920ms steps(5, end); }
.castle-slot--battle.is-triggered .castle-beacon-mast { animation: castle-beacon-strike 950ms steps(4, end); }
.castle-slot--battle.is-triggered .castle-lightning-chain i { animation: castle-lightning-flight 900ms steps(5, end); }
.castle-slot--battle.is-triggered .castle-lightning-chain i:nth-child(2) { animation-delay: 110ms; }
.castle-slot--battle.is-triggered .castle-lightning-chain i:nth-child(3) { animation-delay: 220ms; }
.castle-slot--battle.is-triggered .castle-sluice-frame { animation: castle-sluice-open 1050ms steps(5, end); }
.castle-slot--battle.is-triggered .castle-water-burst i { animation: castle-water-fall 1150ms steps(6, end); }
.castle-slot--battle.is-triggered .castle-water-burst i:nth-child(2) { animation-delay: 80ms; }
.castle-slot--battle.is-triggered .castle-water-burst i:nth-child(3) { animation-delay: 160ms; }
.castle-slot--battle.is-triggered .castle-water-burst i:nth-child(4) { animation-delay: 240ms; }
.castle-slot--battle.is-triggered .castle-water-burst i:nth-child(5) { animation-delay: 320ms; }
.castle-slot--battle.is-triggered .castle-water-burst i:nth-child(6) { animation-delay: 400ms; }
.castle-slot--battle.is-triggered .castle-pot-rack i { animation: castle-pot-tip 920ms steps(4, end); }
.castle-slot--battle.is-triggered .castle-pot-rack i:nth-child(2) { animation-delay: 90ms; }
.castle-slot--battle.is-triggered .castle-pot-rack i:nth-child(3) { animation-delay: 180ms; }
.castle-slot--battle.is-triggered .castle-log-rush i { animation: castle-log-release 1050ms steps(5, end); }
.castle-slot--battle.is-triggered .castle-log-rush i:nth-child(2) { animation-delay: 150ms; }
.castle-slot--battle.is-triggered .castle-pit-hatch { animation: castle-pit-open 900ms steps(4, end); }
.castle-slot--battle.is-triggered .castle-pit-spikes { animation: castle-spikes-rise 900ms steps(4, end); }
.castle-slot--battle.is-triggered .castle-pavise-crossbow { animation: castle-crossbow-recoil 720ms steps(4, end); }

.castle-roster {
  display: grid;
  grid-area: roster;
  grid-template-rows: auto 1fr;
  border-left: 1px solid var(--castle-rule);
  background: #d7c9aa;
}
.castle-roster header { padding: 25px 23px 19px; border-bottom: 1px solid var(--castle-rule); }
.castle-roster header > span,
.castle-tray header span,
.castle-report header > span {
  color: var(--castle-muted);
  font-family: var(--studio-mono);
  font-size: 0.57rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
.castle-roster h2 {
  margin: 6px 0 7px;
  font-family: var(--studio-display);
  font-size: clamp(1.8rem, 2.7vw, 3rem);
  font-weight: 400;
  letter-spacing: -0.045em;
  line-height: 0.92;
}
.castle-roster header p { margin: 0; color: var(--castle-muted); font-size: 0.74rem; line-height: 1.42; }
.castle-roster ol { display: grid; margin: 0; padding: 0; list-style: none; }
.castle-roster li {
  display: grid;
  min-height: 74px;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 7px 17px;
  border-bottom: 1px solid var(--castle-rule);
}
.castle-roster li:last-child { border-bottom: 0; }
.castle-roster li > span:nth-child(2) { display: grid; gap: 3px; }
.castle-roster li strong { font-family: var(--studio-display); font-size: 0.98rem; font-weight: 400; }
.castle-roster li small { color: var(--castle-muted); font-size: 0.63rem; }
.castle-roster li > i {
  grid-column: 2;
  display: block;
  width: min(calc(var(--roster-hp) * 7px), 100%);
  height: 4px;
  margin-top: -12px;
  background: var(--castle-rust);
  clip-path: polygon(0 0, 100% 0, 96% 100%, 2% 83%);
}
.castle-roster__cutout {
  position: relative;
  display: block;
  width: 50px;
  height: 58px;
  overflow: hidden;
  background: #eadfc7;
  clip-path: polygon(8% 2%, 93% 6%, 100% 88%, 78% 100%, 3% 91%, 0 22%);
  filter: drop-shadow(3px 4px 1px rgb(35 41 33 / 0.25));
}
.castle-roster__cutout img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: saturate(0.82) contrast(1.15);
  mix-blend-mode: multiply;
}
.castle-roster__cutout--gatebreakers { width: 58px; }
.castle-roster__cutout--gatebreakers img { object-fit: cover; object-position: 50% 4%; }
.castle-roster__cutout--infantry img { object-fit: cover; object-position: 50% 18%; }
.castle-roster__cutout--ram { width: 62px; }
.castle-roster__cutout--ram img { object-fit: cover; object-position: 69% center; transform: scale(1.18); }

.castle-inspector { align-content: start; }
.castle-enemy-detail {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 18px;
  border-bottom: 1px solid var(--castle-rule);
  background: #ded2b8;
}
.castle-enemy-detail__cutout {
  width: 90px;
  height: 122px;
  transform: rotate(-2deg);
}
.castle-enemy-detail dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-column: 2;
  gap: 5px;
  margin: 0;
}
.castle-enemy-detail dl div { min-width: 0; }
.castle-enemy-detail dt {
  color: var(--castle-muted);
  font-family: var(--studio-mono);
  font-size: 0.43rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.castle-enemy-detail dd {
  margin: 3px 0 0;
  font-family: var(--studio-display);
  font-size: 1.45rem;
}
.castle-enemy-detail > p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--castle-muted);
  font-size: 0.68rem;
  line-height: 1.42;
}
.castle-enemy-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 10px;
}
.castle-enemy-picker button {
  display: grid;
  min-width: 0;
  min-height: 92px;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 2px 8px;
  align-items: center;
  padding: 8px;
  border: 0;
  border-right: 1px solid var(--castle-rule);
  border-bottom: 1px solid var(--castle-rule);
  background: #e7ddc7;
  color: var(--castle-ink);
  cursor: pointer;
  text-align: left;
}
.castle-enemy-picker button:nth-child(4n + 2),
.castle-enemy-picker button:nth-child(4n + 3) { background: #ddd2b9; }
.castle-enemy-picker button:hover,
.castle-enemy-picker button:focus-visible,
.castle-enemy-picker button[aria-pressed="true"] { z-index: 1; outline: 2px solid var(--castle-green); outline-offset: -2px; }
.castle-enemy-picker .castle-roster__cutout { grid-row: span 2; width: 46px; height: 60px; }
.castle-enemy-picker strong { align-self: end; overflow: hidden; font-family: var(--studio-display); font-size: 0.82rem; font-weight: 400; text-overflow: ellipsis; white-space: nowrap; }
.castle-enemy-picker small { align-self: start; color: var(--castle-muted); font-size: 0.54rem; }

.castle-slot-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 10px;
}
.castle-slot-option {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 126px;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  overflow: hidden;
  padding: 22px 8px 8px;
  border: 0;
  border-right: 1px solid var(--castle-rule);
  border-bottom: 1px solid var(--castle-rule);
  background: #e7dec9;
  color: var(--castle-ink);
  cursor: pointer;
  text-align: left;
}
.castle-slot-option:nth-child(4n + 2),
.castle-slot-option:nth-child(4n + 3) { background: #ddd3bd; }
.castle-slot-option:hover,
.castle-slot-option:focus-visible,
.castle-slot-option.is-current { z-index: 1; outline: 3px solid var(--castle-green); outline-offset: -3px; }
.castle-slot-option .castle-piece { width: 46px; height: 50px; }
.castle-slot-option > span:not(.castle-piece) { display: grid; min-width: 0; gap: 3px; }
.castle-slot-option strong,
.castle-slot-option small,
.castle-slot-option em { min-width: 0; overflow-wrap: anywhere; }
.castle-slot-option strong { font-family: var(--studio-display); font-size: 0.82rem; font-weight: 400; line-height: 1.05; }
.castle-slot-option small { color: var(--castle-rust); font-family: var(--studio-mono); font-size: 0.45rem; line-height: 1.3; text-transform: uppercase; }
.castle-slot-option em { color: var(--castle-muted); font-size: 0.48rem; font-style: normal; line-height: 1.25; }
.castle-slot-option > b {
  position: absolute;
  top: 6px;
  right: 7px;
  color: var(--castle-green);
  font-family: var(--studio-mono);
  font-size: 0.43rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.castle-slot-option.is-locked {
  background: #cfc7b5;
  cursor: not-allowed;
  filter: grayscale(0.7);
  opacity: 0.58;
}
.castle-slot-option.is-locked > b { color: var(--castle-rust); }

.castle-tray { grid-area: tray; padding: clamp(20px, 2.5vw, 34px); border-top: 1px solid var(--castle-rule); }
.castle-tray header { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 17px; }
.castle-tray h2 {
  margin: 4px 0 0;
  font-family: var(--studio-display);
  font-size: clamp(1.7rem, 2.7vw, 3rem);
  font-weight: 400;
  letter-spacing: -0.045em;
}
.castle-armoury-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0 0 14px;
}
.castle-armoury-filters button {
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid var(--castle-rule);
  background: #ded6c2;
  color: var(--castle-ink);
  cursor: pointer;
  font-family: var(--studio-mono);
  font-size: 0.55rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.castle-armoury-filters button[aria-pressed="true"] { background: var(--castle-green); color: #f4eddb; }
.castle-armoury-filters b { margin-left: 4px; font-weight: 400; opacity: 0.72; }
.castle-tray header button,
.castle-actions button,
.castle-build-actions button,
.castle-battle-controls button,
.castle-start-prompt button {
  min-height: 46px;
  padding: 9px 14px;
  border: 1px solid var(--castle-ink);
  background: transparent;
  color: var(--castle-ink);
  cursor: pointer;
}
.castle-tray header button:disabled,
.castle-build-actions button:disabled { cursor: not-allowed; opacity: 0.34; }
.castle-tray__cards {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border-top: 1px solid var(--castle-rule);
  border-left: 1px solid var(--castle-rule);
}
.castle-defense-card {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 148px;
  grid-template-columns: 80px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 17px 13px 13px;
  border: 0;
  border-right: 1px solid var(--castle-rule);
  border-bottom: 1px solid var(--castle-rule);
  background: #e8e1d0;
  color: var(--castle-ink);
  cursor: grab;
  text-align: left;
  touch-action: none;
}
.castle-defense-card:nth-child(odd) { background: #e1dccb; }
.castle-defense-card:hover,
.castle-defense-card:focus-visible,
.castle-defense-card.is-selected { z-index: 2; background: #d4ddcf; }
.castle-defense-card.is-selected { box-shadow: inset 0 0 0 3px var(--castle-green); }
.castle-defense-card:active { cursor: grabbing; transform: translateY(1px); }
.castle-defense-card .castle-piece { width: 72px; height: 70px; }
.castle-defense-card > span:not(.castle-piece) { display: grid; gap: 4px; }
.castle-defense-card strong { font-family: var(--studio-display); font-size: 1.06rem; font-weight: 400; }
.castle-defense-card small { color: var(--castle-muted); font-size: 0.68rem; line-height: 1.35; }
.castle-defense-card em {
  color: var(--castle-green);
  font-family: var(--studio-mono);
  font-size: 0.49rem;
  font-style: normal;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}
.castle-defense-card mark {
  width: max-content;
  max-width: 100%;
  padding: 3px 5px;
  background: #d1c39f;
  color: #4d554d;
  font-family: var(--studio-mono);
  font-size: 0.46rem;
  line-height: 1.25;
  text-transform: uppercase;
}
.castle-defense-card > b {
  position: absolute;
  top: 7px;
  right: 8px;
  color: var(--castle-muted);
  font-family: var(--studio-mono);
  font-size: 0.48rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.castle-defense-card.is-placed > b { color: var(--castle-green); }
.castle-defense-card.is-locked {
  cursor: not-allowed;
  filter: grayscale(0.72);
  opacity: 0.58;
  touch-action: pan-y;
}
.castle-defense-card.is-locked:hover,
.castle-defense-card.is-locked:focus-visible { z-index: auto; background: #d6d0c0; }
.castle-defense-card.is-locked > b { color: var(--castle-rust); }
.castle-drag-ghost {
  position: fixed;
  z-index: 100;
  width: 270px;
  min-height: 118px;
  pointer-events: none;
  opacity: 0.95;
  transform: translate(-50%, -50%) rotate(-2deg);
  box-shadow: 0 20px 45px rgb(28 33 25 / 0.3);
}
.castle-build-actions {
  display: flex;
  grid-area: actions;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px clamp(20px, 2.5vw, 34px);
  border-top: 1px solid var(--castle-rule);
}
.castle-build-actions p { margin: 0; color: var(--castle-muted); font-size: 0.82rem; }
.castle-build-actions button { min-width: 210px; background: var(--castle-green); color: #f4eddb; font-weight: 700; }
.castle-build-actions button:not(:disabled):hover,
.castle-build-actions button:not(:disabled):focus-visible { background: #173b38; }

.castle-start-prompt {
  position: fixed;
  z-index: 120;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgb(19 38 37 / 0.7);
  backdrop-filter: blur(5px);
}
.castle-start-prompt > div {
  width: min(520px, 100%);
  padding: clamp(25px, 4vw, 46px);
  border: 1px solid rgb(35 40 32 / 0.42);
  background: #eee2c8;
  box-shadow: 15px 18px 0 rgb(25 33 28 / 0.3);
  transform: rotate(-1deg);
  animation: castle-card-in 420ms steps(4, end);
}
.castle-start-prompt span { color: var(--castle-muted); font-family: var(--studio-mono); font-size: 0.58rem; letter-spacing: 0.08em; text-transform: uppercase; }
.castle-start-prompt h2 { margin: 9px 0 12px; font-family: var(--studio-display); font-size: clamp(2.7rem, 6vw, 4.6rem); font-weight: 400; letter-spacing: -0.06em; line-height: 0.9; }
.castle-start-prompt p { max-width: 43ch; margin: 0; color: var(--castle-muted); line-height: 1.5; }
.castle-start-prompt > div > div { display: flex; gap: 9px; margin-top: 24px; }
.castle-start-prompt [data-castle-confirm-start] { background: var(--castle-green); color: #f4eddb; font-weight: 700; }

.castle-unit {
  position: absolute;
  z-index: calc(26 - var(--unit-index));
  bottom: 8%;
  left: var(--unit-x);
  display: block;
  width: clamp(66px, 5vw, 80px);
  height: clamp(108px, 9vw, 132px);
  filter: drop-shadow(6px 8px 2px rgb(28 31 24 / 0.38));
  transform: translateX(var(--unit-offset));
  transition: left 1250ms steps(6, end);
}
.castle-unit--gatebreakers { width: clamp(112px, 8.5vw, 134px); height: clamp(102px, 8vw, 124px); }
.castle-unit--ram { width: clamp(132px, 10.5vw, 158px); height: clamp(86px, 7.7vw, 112px); }
.castle-stage--level-3 .castle-unit { width: clamp(54px, 4.2vw, 68px); height: clamp(92px, 7.6vw, 112px); }
.castle-stage--level-3 .castle-unit--gatebreakers { width: clamp(84px, 6.8vw, 104px); height: clamp(82px, 6.7vw, 100px); }
.castle-stage--level-3 .castle-unit--ram { width: clamp(102px, 8.1vw, 124px); height: clamp(68px, 6.3vw, 88px); }
.castle-stage--level-4 .castle-unit { bottom: calc(5% + var(--unit-row) * 74px); width: clamp(50px, 3.8vw, 62px); height: clamp(86px, 7vw, 104px); }
.castle-stage--level-4 .castle-unit--gatebreakers { width: clamp(78px, 6vw, 96px); height: clamp(76px, 6vw, 92px); }
.castle-stage--level-4 .castle-unit--ram { width: clamp(94px, 7.4vw, 116px); height: clamp(64px, 5.7vw, 80px); }
.castle-stage--level-4 .castle-unit:nth-child(3n + 2) .castle-unit__health { bottom: calc(100% + 21px); }
.castle-stage--level-4 .castle-unit:nth-child(3n) .castle-unit__health { bottom: calc(100% + 37px); }
.castle-stage--level-5 .castle-unit { bottom: calc(4% + var(--unit-row) * 76px); width: clamp(48px, 3.6vw, 60px); height: clamp(84px, 6.8vw, 102px); }
.castle-stage--level-5 .castle-unit--gatebreakers { width: clamp(76px, 5.8vw, 94px); height: clamp(74px, 5.8vw, 90px); }
.castle-stage--level-5 .castle-unit--ram { width: clamp(90px, 7vw, 110px); height: clamp(62px, 5.5vw, 78px); }
.castle-stage--level-5 .castle-unit--art-commander { width: clamp(84px, 6.5vw, 104px); height: clamp(72px, 5.8vw, 92px); }
.castle-stage--level-5 .castle-unit--art-siege-tower { width: clamp(72px, 5.6vw, 90px); height: clamp(106px, 8.4vw, 132px); }
.castle-stage--level-5 .castle-unit:nth-child(3n + 2) .castle-unit__health { bottom: calc(100% + 19px); }
.castle-stage--level-5 .castle-unit:nth-child(3n) .castle-unit__health { bottom: calc(100% + 35px); }
.castle-unit__health {
  position: absolute;
  z-index: 6;
  bottom: calc(100% + 7px);
  left: 50%;
  display: grid;
  width: 112px;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 7px;
  padding: 5px 6px;
  border: 1px solid rgb(32 38 30 / 0.31);
  background: rgb(241 231 207 / 0.94);
  box-shadow: 3px 4px 0 rgb(34 39 31 / 0.14);
  transform: translateX(-50%) rotate(-1deg);
  transition: opacity 260ms;
}
.castle-unit:nth-of-type(even) .castle-unit__health { transform: translateX(-50%) rotate(1deg); }
.castle-unit__health strong {
  overflow: hidden;
  font-family: var(--studio-display);
  font-size: 0.68rem;
  font-weight: 400;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.castle-unit__health small { color: var(--castle-muted); font-family: var(--studio-mono); font-size: 0.45rem; }
.castle-unit__health > i {
  display: block;
  grid-column: 1 / -1;
  height: 6px;
  overflow: hidden;
  background: #b8ad91;
  clip-path: polygon(0 0, 100% 0, 97% 100%, 2% 85%);
}
.castle-unit__health > i b {
  display: block;
  width: calc(var(--hp-ratio) * 100%);
  height: 100%;
  background: linear-gradient(90deg, #9d3a2b, #c6643d);
  transition: width 460ms steps(4, end);
}
.castle-unit__shadow {
  position: absolute;
  bottom: -5px;
  left: 9%;
  width: 85%;
  height: 10px;
  border-radius: 50%;
  background: rgb(31 34 27 / 0.24);
}
.castle-unit__puppet {
  position: absolute;
  inset: 0;
  transform-origin: 50% 88%;
  animation: castle-cutout-march 520ms steps(2, end) infinite;
}
.castle-unit__art {
  position: absolute;
  inset: 0;
  display: block;
  overflow: hidden;
  padding: 4px;
  background: #eee5d2;
  clip-path: polygon(8% 1%, 93% 5%, 100% 86%, 80% 100%, 3% 93%, 0 20%);
}
.castle-unit__art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: saturate(0.84) contrast(1.14);
  mix-blend-mode: multiply;
}
.castle-unit--gatebreakers .castle-unit__art img { object-fit: cover; object-position: 50% 4%; }
.castle-unit--infantry .castle-unit__art img { object-fit: cover; object-position: 50% 18%; }
.castle-unit--ram .castle-unit__art img { object-fit: cover; object-position: 69% center; transform: scale(1.18); }
.castle-unit--art-powder-sappers .castle-unit__art img,
.castle-unit--art-commander .castle-unit__art img,
.castle-unit--art-siege-tower .castle-unit__art img { object-fit: contain; object-position: center; transform: none; }
.castle-unit__status {
  position: absolute;
  z-index: 7;
  right: -8px;
  bottom: 8%;
  min-width: 54px;
  padding: 4px 6px;
  background: #e4cf9e;
  color: #4f2b20;
  filter: drop-shadow(3px 4px 0 rgb(28 24 20 / 0.34));
  font-family: var(--studio-mono);
  font-size: 0.43rem;
  letter-spacing: 0.04em;
  opacity: 0;
  text-align: center;
  text-transform: uppercase;
  transform: rotate(3deg);
  transition: opacity 180ms steps(2, end);
}
.castle-unit.is-burning .castle-unit__status,
.castle-unit.is-oiled .castle-unit__status,
.castle-unit.is-chilled .castle-unit__status,
.castle-unit.is-wet .castle-unit__status,
.castle-unit.is-powdered .castle-unit__status,
.castle-unit.is-powder-blasted .castle-unit__status,
.castle-unit.is-steamed .castle-unit__status { opacity: 1; }
.castle-unit.is-burning .castle-unit__status {
  background: #ef8e36;
  color: #3b1c18;
  clip-path: polygon(5% 18%, 19% 0, 33% 18%, 49% 1%, 62% 19%, 83% 0, 100% 28%, 93% 100%, 4% 91%);
  animation: castle-status-flame 680ms steps(3, end) infinite;
}
.castle-unit.is-burning .castle-unit__art { filter: drop-shadow(0 0 7px #ef5a24); }
.castle-unit.is-oiled .castle-unit__status {
  background: #593629;
  color: #f0d9ae;
  clip-path: polygon(2% 21%, 18% 3%, 47% 9%, 69% 0, 96% 19%, 88% 91%, 61% 100%, 25% 89%);
}
.castle-unit.is-oiled .castle-unit__art::after {
  position: absolute;
  inset: 23% 12% 8%;
  background: rgb(71 38 26 / 0.46);
  clip-path: polygon(13% 0, 78% 8%, 100% 46%, 82% 91%, 34% 100%, 0 63%);
  content: "";
  mix-blend-mode: multiply;
}
.castle-unit.is-chilled .castle-unit__status {
  background: #cce2e3;
  color: #294f5d;
  clip-path: polygon(0 12%, 16% 3%, 42% 10%, 65% 0, 100% 17%, 91% 91%, 57% 100%, 22% 89%);
}
.castle-unit.is-chilled .castle-unit__art {
  filter: drop-shadow(0 0 6px #a9d7df) saturate(0.72);
}
.castle-unit.is-chilled .castle-unit__puppet { animation-duration: 820ms; }
.castle-unit.is-wet .castle-unit__status {
  background: #75aebb;
  color: #173c4b;
  clip-path: polygon(4% 8%, 22% 0, 47% 13%, 70% 2%, 96% 18%, 100% 78%, 78% 100%, 51% 88%, 25% 98%, 0 74%);
}
.castle-unit.is-wet .castle-unit__art {
  filter: drop-shadow(0 0 5px #87c5d3) saturate(0.7) contrast(1.08);
}
.castle-unit.is-powdered .castle-unit__status {
  background: #4b4742;
  color: #f4e1ba;
  clip-path: polygon(0 16%, 18% 3%, 43% 11%, 65% 0, 98% 19%, 91% 93%, 57% 100%, 19% 88%);
}
.castle-unit.is-powdered .castle-unit__art {
  filter: drop-shadow(0 0 5px #d69c55) saturate(0.64) contrast(1.2);
}
.castle-unit.is-powdered .castle-unit__art::after {
  position: absolute;
  inset: 13% 8% 9%;
  background: repeating-radial-gradient(circle at 30% 35%, rgb(43 40 38 / 0.7) 0 3px, transparent 4px 15px);
  clip-path: polygon(4% 12%, 92% 0, 100% 81%, 67% 100%, 0 88%);
  content: "";
  mix-blend-mode: multiply;
  opacity: 0.62;
}
.castle-unit.is-steamed .castle-unit__status {
  background: #edf1e9;
  color: #3f6571;
  clip-path: polygon(2% 15%, 21% 2%, 48% 10%, 73% 0, 100% 21%, 91% 92%, 54% 100%, 18% 88%);
}
.castle-steam-burst {
  position: absolute;
  z-index: 9;
  top: 14%;
  left: 42%;
  width: 80px;
  height: 85px;
  pointer-events: none;
}
.castle-steam-burst i {
  position: absolute;
  top: 45%;
  left: 35%;
  width: calc(18px + var(--steam-index, 0) * 2px);
  aspect-ratio: 1;
  border: 2px solid #769eaa;
  border-radius: 48% 52% 45% 55%;
  background: #edf2ea;
  box-shadow: 3px 4px 0 rgb(42 72 82 / 0.22);
  opacity: 0;
}
.castle-steam-burst i:nth-child(1) { --steam-index: 0; --steam-x: -38px; }
.castle-steam-burst i:nth-child(2) { --steam-index: 1; --steam-x: -15px; }
.castle-steam-burst i:nth-child(3) { --steam-index: 2; --steam-x: 14px; }
.castle-steam-burst i:nth-child(4) { --steam-index: 3; --steam-x: 38px; }
.castle-steam-burst i:nth-child(5) { --steam-index: 4; --steam-x: -26px; }
.castle-steam-burst i:nth-child(6) { --steam-index: 5; --steam-x: 29px; }
.castle-unit.is-steamed .castle-steam-burst i { animation: castle-steam-rise 980ms steps(5, end); }
.castle-lightning-hit,
.castle-water-hit {
  position: absolute;
  z-index: 9;
  inset: -9% -18%;
  pointer-events: none;
}
.castle-lightning-hit i {
  position: absolute;
  top: calc(var(--hit-index, 0) * 28%);
  left: calc(8% + var(--hit-index, 0) * 23%);
  width: 52%;
  height: 32%;
  border: 2px solid #edf3e9;
  background: #87cfe1;
  box-shadow: 0 0 8px #eaf7f1;
  clip-path: polygon(0 38%, 31% 25%, 42% 0, 58% 37%, 100% 51%, 66% 67%, 54% 100%, 37% 62%);
  opacity: 0;
  transform: rotate(calc(-18deg + var(--hit-index, 0) * 23deg));
}
.castle-lightning-hit i:nth-child(1),
.castle-water-hit i:nth-child(1) { --hit-index: 0; }
.castle-lightning-hit i:nth-child(2),
.castle-water-hit i:nth-child(2) { --hit-index: 1; }
.castle-lightning-hit i:nth-child(3),
.castle-water-hit i:nth-child(3) { --hit-index: 2; }
.castle-water-hit i:nth-child(4) { --hit-index: 3; }
.castle-water-hit i:nth-child(5) { --hit-index: 4; }
.castle-unit.is-electrified .castle-lightning-hit i { animation: castle-lightning-hit 920ms steps(5, end); }
.castle-unit.is-electrified .castle-lightning-hit i:nth-child(2) { animation-delay: 80ms; }
.castle-unit.is-electrified .castle-lightning-hit i:nth-child(3) { animation-delay: 160ms; }
.castle-water-hit i {
  position: absolute;
  top: -5%;
  left: calc(var(--hit-index, 0) * 20%);
  width: 17%;
  height: 52%;
  border: 2px solid #dcece7;
  background: linear-gradient(#d8ebe6, #5c9dae);
  clip-path: polygon(43% 0, 100% 62%, 73% 100%, 21% 92%, 0 57%);
  opacity: 0;
}
.castle-unit.is-wetted .castle-water-hit i { animation: castle-water-hit 940ms steps(5, end); }
.castle-powder-blast-hit {
  position: absolute;
  z-index: 11;
  top: -18%;
  left: -55%;
  display: block;
  width: 170%;
  height: 125%;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  mix-blend-mode: multiply;
}
.castle-powder-blast-hit img {
  position: absolute;
  top: 0;
  left: -200%;
  width: 300%;
  max-width: none;
  height: 200%;
  filter: saturate(1.12) contrast(1.16);
}
.castle-unit.is-powder-blasted .castle-powder-blast-hit { animation: castle-powder-hit 1080ms steps(6, end); }
.castle-damage-pop {
  position: absolute;
  z-index: 8;
  top: 18%;
  left: 55%;
  min-width: 28px;
  padding: 4px 6px;
  background: #a13e2e;
  color: #fff0d4;
  font-family: var(--studio-mono);
  font-size: 0.62rem;
  font-weight: 700;
  opacity: 0;
  transform: translate(-50%, 0) rotate(-4deg);
}
.castle-unit.is-hit .castle-unit__puppet { animation: castle-cutout-hit 760ms steps(4, end); }
.castle-unit.is-attacking .castle-unit__puppet { animation: castle-unit-attack 680ms steps(4, end) infinite; }
.castle-unit.is-hit .castle-damage-pop { animation: castle-damage-pop 780ms steps(4, end); }
.castle-unit.is-stopped { z-index: 13; pointer-events: none; }
.castle-unit.is-stopped .castle-unit__puppet { animation: castle-unit-fall 1450ms steps(6, end) forwards; }
.castle-unit.is-stopped .castle-unit__health { animation: castle-health-vanish 1050ms 260ms steps(4, end) forwards; }
.castle-unit.is-stopped .castle-unit__shadow { animation: castle-shadow-vanish 1300ms steps(5, end) forwards; }
.castle-battle-note {
  position: absolute;
  z-index: 35;
  top: 27%;
  bottom: auto;
  left: 3%;
  max-width: 31ch;
  margin: 0;
  padding: 13px 16px;
  border: 1px solid rgb(33 37 29 / 0.29);
  background: rgb(239 229 205 / 0.95);
  box-shadow: 7px 8px 0 rgb(34 38 30 / 0.15);
  color: #31362d;
  font-family: var(--studio-display);
  font-size: clamp(1.05rem, 1.7vw, 1.45rem);
  line-height: 1.15;
  transform: rotate(-1deg);
}
.castle-battle-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 15px 20px;
  border-top: 1px solid var(--castle-rule);
}
.castle-battle-controls > div {
  display: grid;
  min-width: 0;
  flex: 1;
  grid-template-columns: minmax(180px, 0.45fr) minmax(180px, 1fr) auto;
  gap: 12px;
  align-items: center;
}
.castle-battle-controls span { overflow: hidden; color: var(--castle-muted); font-size: 0.76rem; text-overflow: ellipsis; white-space: nowrap; }
.castle-battle-controls > div > i { display: block; height: 6px; overflow: hidden; background: #c5b99e; }
.castle-battle-controls > div > i b { display: block; width: 0; height: 100%; background: var(--castle-rust); transition: width 500ms steps(4, end); }
.castle-battle-controls small { color: var(--castle-muted); font-family: var(--studio-mono); font-size: 0.52rem; text-transform: uppercase; }
.castle-verdict-card {
  position: absolute;
  z-index: 36;
  top: 24%;
  left: 3%;
  width: min(350px, 32vw);
  padding: clamp(19px, 2.2vw, 30px);
  border: 1px solid rgb(39 42 34 / 0.35);
  background: #eee2c8;
  box-shadow: 12px 14px 0 rgb(39 42 34 / 0.18);
  transform: rotate(-1.5deg);
  animation: castle-card-in 520ms steps(4, end);
}
.castle-verdict-card > span { color: var(--castle-muted); font-family: var(--studio-mono); font-size: 0.56rem; letter-spacing: 0.08em; text-transform: uppercase; }
.castle-verdict-card strong { display: block; margin-top: 8px; font-family: var(--studio-display); font-size: clamp(2.1rem, 3.3vw, 4rem); font-weight: 400; letter-spacing: -0.055em; line-height: 0.9; }
.castle-verdict-card p { margin: 12px 0 0; color: var(--castle-muted); font-size: 0.84rem; line-height: 1.45; }
.castle-report { display: grid; grid-template-columns: minmax(260px, 0.5fr) minmax(0, 1.5fr); }
.castle-report > header { grid-row: span 3; padding: clamp(26px, 3vw, 43px); border-right: 1px solid var(--castle-rule); background: #d4d0bb; }
.castle-report header h2 { max-width: 10ch; margin: 10px 0; font-family: var(--studio-display); font-size: clamp(2.5rem, 4.2vw, 4.9rem); font-weight: 400; letter-spacing: -0.06em; line-height: 0.88; }
.castle-report header p { max-width: 36ch; margin: 0; color: var(--castle-muted); line-height: 1.5; }
.castle-report dl { display: grid; grid-column: 2; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; border-bottom: 1px solid var(--castle-rule); }
.castle-report dl > div { min-width: 0; padding: 19px; border-right: 1px solid var(--castle-rule); }
.castle-report dl > div:last-child { border-right: 0; }
.castle-report dt { color: var(--castle-muted); font-family: var(--studio-mono); font-size: 0.54rem; letter-spacing: 0.06em; text-transform: uppercase; }
.castle-report dd { margin: 8px 0 0; font-family: var(--studio-display); font-size: clamp(1.2rem, 2vw, 2rem); line-height: 0.96; }
.castle-report ol { grid-column: 2; margin: 0; padding: 0; list-style: none; }
.castle-report li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 19px; border-bottom: 1px solid var(--castle-rule); }
.castle-report li > span { color: var(--castle-muted); font-family: var(--studio-mono); font-size: 0.58rem; }
.castle-report li strong { font-family: var(--studio-display); font-size: 0.98rem; font-weight: 400; }
.castle-report li p { margin: 2px 0 0; color: var(--castle-muted); font-size: 0.71rem; }
.castle-report li b { color: var(--castle-green); font-family: var(--studio-mono); font-size: 0.52rem; font-weight: 400; text-transform: uppercase; }
.castle-actions { display: flex; grid-column: 2; gap: 9px; padding: 16px 19px; }
.castle-actions button:first-child { background: var(--castle-green); color: #f0efe4; }
.castle-actions [data-castle-advance] { margin-left: auto; background: #a83b22; color: #fff0d7; font-weight: 700; }

.castle-finale {
  position: relative;
  min-height: clamp(620px, 54vw, 760px);
  overflow: hidden;
  background: #101625;
  isolation: isolate;
}
.castle-finale::after {
  position: absolute;
  z-index: 40;
  inset: 0;
  border: 10px solid rgb(242 230 201 / 0.38);
  box-shadow: inset 0 0 130px rgb(4 6 12 / 0.55);
  content: "";
  pointer-events: none;
}
.castle-finale__backdrop {
  position: absolute;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 48% 52%;
  filter: saturate(0.8) contrast(1.12) brightness(0.58);
}
.castle-finale__wash {
  position: absolute;
  z-index: 1;
  inset: 0;
  background: radial-gradient(circle at 54% 42%, rgb(231 173 69 / 0.22), transparent 31%), linear-gradient(180deg, rgb(4 6 14 / 0.08), rgb(4 5 11 / 0.58));
}
.castle-finale__fortress {
  position: absolute;
  z-index: 5;
  right: 4%;
  bottom: 2%;
  width: 75%;
  height: 67%;
  overflow: hidden;
  background: #efe8d8;
  clip-path: polygon(1% 7%, 22% 2%, 48% 4%, 71% 0, 99% 6%, 98% 97%, 72% 100%, 46% 97%, 19% 100%, 1% 95%);
  filter: drop-shadow(15px 20px 4px rgb(0 0 0 / 0.72));
  transform: translateY(9%);
  animation: castle-finale-fortress 1050ms steps(5, end) forwards;
}
.castle-finale__fortress img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  filter: saturate(0.95) contrast(1.16) brightness(0.9);
  mix-blend-mode: multiply;
}
.castle-finale__fireworks { position: absolute; z-index: 8; inset: 0; pointer-events: none; }
.castle-finale__fireworks > i {
  --firework-size: clamp(110px, 13vw, 190px);
  position: absolute;
  top: 8%;
  left: 35%;
  display: block;
  width: var(--firework-size);
  height: var(--firework-size);
  overflow: hidden;
  opacity: 0;
  clip-path: polygon(50% 0, 59% 12%, 70% 3%, 73% 18%, 89% 9%, 86% 26%, 100% 29%, 88% 40%, 99% 50%, 86% 58%, 96% 72%, 79% 73%, 81% 90%, 65% 83%, 56% 100%, 48% 87%, 36% 99%, 30% 84%, 13% 91%, 17% 73%, 0 68%, 13% 56%, 2% 43%, 15% 35%, 4% 20%, 22% 20%, 24% 4%, 41% 14%);
  filter: drop-shadow(5px 7px 2px rgb(0 0 0 / 0.36));
  mix-blend-mode: multiply;
  transform: scale(0.2) rotate(-8deg);
  animation: castle-finale-firework 2400ms calc(420ms + var(--firework-index) * 360ms) steps(7, end) infinite;
}
.castle-finale__fireworks > i:nth-child(2) { top: 4%; left: 57%; --firework-size: clamp(90px, 11vw, 160px); }
.castle-finale__fireworks > i:nth-child(3) { top: 16%; left: 76%; --firework-size: clamp(100px, 12vw, 175px); }
.castle-finale__fireworks > i:nth-child(4) { top: 31%; left: 29%; --firework-size: clamp(84px, 9vw, 138px); }
.castle-finale__fireworks > i:nth-child(5) { top: 22%; left: 49%; --firework-size: clamp(92px, 10vw, 148px); }
.castle-finale__fireworks > i:nth-child(6) { top: 34%; left: 70%; --firework-size: clamp(96px, 11vw, 158px); }
.castle-finale__fireworks img {
  position: absolute;
  top: calc(var(--firework-row) * -100%);
  left: calc(var(--firework-column) * -100%);
  width: 300%;
  max-width: none;
  height: 200%;
  object-fit: fill;
  filter: saturate(1.24) contrast(1.18);
  mix-blend-mode: multiply;
}
.castle-finale__banner,
.castle-finale__garland,
.castle-finale__confetti {
  position: absolute;
  z-index: 12;
  display: block;
  overflow: hidden;
  filter: drop-shadow(4px 6px 2px rgb(0 0 0 / 0.34));
  mix-blend-mode: multiply;
  pointer-events: none;
}
.castle-finale__banner { top: 2%; width: clamp(180px, 22vw, 320px); height: clamp(44px, 5vw, 72px); }
.castle-finale__banner--left { left: 1%; transform: rotate(-3deg); }
.castle-finale__banner--right { right: 1%; transform: rotate(3deg); }
.castle-finale__banner img { width: 100%; height: auto; }
.castle-finale__banner--right img { transform: translateY(-25%); }
.castle-finale__garland { right: 17%; bottom: 4%; width: clamp(260px, 36vw, 500px); height: clamp(58px, 7vw, 96px); transform: rotate(-1deg); }
.castle-finale__garland img { width: 100%; height: auto; transform: translateY(-37%); }
.castle-finale__confetti { right: 5%; bottom: 2%; width: clamp(160px, 20vw, 280px); height: clamp(74px, 9vw, 130px); }
.castle-finale__confetti img { width: 100%; height: auto; transform: translate(-24%, -61%) scale(1.8); }
.castle-finale__defenders { position: absolute; z-index: 15; right: 8%; bottom: 2%; display: flex; align-items: end; gap: clamp(8px, 1.2vw, 18px); }
.castle-finale__defenders i { display: block; width: clamp(62px, 7vw, 106px); height: clamp(90px, 10vw, 150px); overflow: hidden; background: #f1e8d6; clip-path: polygon(6% 2%, 91% 6%, 100% 87%, 78% 100%, 2% 92%); filter: drop-shadow(6px 8px 2px rgb(0 0 0 / 0.42)); animation: castle-finale-cheer 880ms calc(var(--cheer-index, 0) * 170ms) steps(4, end) infinite; }
.castle-finale__defenders i:nth-child(1) { width: clamp(116px, 13vw, 190px); --cheer-index: 0; }
.castle-finale__defenders i:nth-child(2) { --cheer-index: 1; }
.castle-finale__defenders i:nth-child(3) { --cheer-index: 2; }
.castle-finale__defenders img { width: 100%; height: 100%; object-fit: contain; filter: saturate(0.98) contrast(1.1); mix-blend-mode: multiply; }
.castle-finale__card {
  position: absolute;
  z-index: 22;
  top: 18%;
  left: 3%;
  width: min(390px, 35vw);
  padding: clamp(22px, 2.7vw, 38px);
  border: 1px solid rgb(32 34 29 / 0.42);
  background: #eee1c5;
  box-shadow: 13px 16px 0 rgb(4 6 11 / 0.38);
  clip-path: polygon(2% 3%, 98% 0, 100% 93%, 72% 100%, 1% 96%);
  transform: rotate(-1.2deg);
  animation: castle-card-in 650ms steps(5, end);
}
.castle-finale__card > span { color: #6c5b4a; font-family: var(--studio-mono); font-size: 0.57rem; letter-spacing: 0.07em; text-transform: uppercase; }
.castle-finale__card h2 { max-width: 9ch; margin: 10px 0 14px; font-family: var(--studio-display); font-size: clamp(2.8rem, 5.3vw, 5.7rem); font-weight: 400; letter-spacing: -0.065em; line-height: 0.85; }
.castle-finale__card p { max-width: 39ch; margin: 0; color: #625e54; line-height: 1.5; }
.castle-finale__card button { margin-top: 21px; background: #222027; color: #f4e7ca; font-weight: 700; }

@keyframes castle-cutout-march { 0%, 100% { transform: rotate(-0.8deg); } 50% { transform: translateY(-5px) rotate(1.2deg); } }
@keyframes castle-cutout-hit { 30% { transform: translateY(-11px) rotate(-9deg); } 65% { transform: translateY(4px) rotate(6deg); } }
@keyframes castle-unit-attack { 0%, 100% { transform: translateX(0) rotate(-1deg); } 45% { transform: translateX(9px) rotate(5deg); } 70% { transform: translateX(2px) rotate(-3deg); } }
@keyframes castle-fortress-hit { 0%, 100% { transform: translateX(0); } 35% { transform: translateX(7px) rotate(0.4deg); } 62% { transform: translateX(-4px) rotate(-0.3deg); } }
@keyframes castle-damage-pop { 18% { opacity: 1; } 70% { opacity: 1; transform: translate(-50%, -35px) rotate(4deg); } 100% { opacity: 0; transform: translate(-50%, -48px) rotate(7deg); } }
@keyframes castle-unit-fall { 0% { opacity: 1; transform: rotate(0); } 42% { opacity: 1; transform: translateY(-7px) rotate(-8deg); } 78% { opacity: 1; transform: translateY(20px) rotate(-20deg); } 100% { opacity: 0; transform: translateY(48px) rotate(-29deg); } }
@keyframes castle-shadow-vanish { 45% { opacity: 0.18; transform: scaleX(1.25); } 100% { opacity: 0; transform: scaleX(0.5); } }
@keyframes castle-health-vanish { to { opacity: 0; transform: translate(-50%, -14px) rotate(4deg); } }
@keyframes castle-cauldron-tip { 0%, 100% { transform: rotate(-7deg); } 35%, 78% { transform: translate(-5px, 4px) rotate(-42deg); } }
@keyframes castle-oil-sheet { 0% { opacity: 0; transform: scaleY(0.05) rotate(4deg); transform-origin: top; } 25%, 74% { opacity: 0.95; transform: scaleY(1) rotate(4deg); transform-origin: top; } 100% { opacity: 0; transform: scaleY(1.05) rotate(4deg); transform-origin: top; } }
@keyframes castle-oil-drop { 0% { opacity: 0; transform: translateY(0) scale(0.6); } 24% { opacity: 1; } 100% { opacity: 0; transform: translateY(250px) scale(1.1); } }
@keyframes castle-arrow-flight { 0% { opacity: 0; transform: translate(0, 0) rotate(158deg); } 20% { opacity: 1; } 100% { opacity: 0; transform: translate(-430px, 225px) rotate(158deg); } }
@keyframes castle-javelin-flight { 0% { opacity: 0; transform: translate(0, 0) rotate(164deg); } 18% { opacity: 1; } 100% { opacity: 0; transform: translate(-620px, 230px) rotate(164deg); } }
@keyframes castle-rock-flight { 0% { opacity: 0; transform: translate(0, 0) rotate(0); } 18% { opacity: 1; } 58% { transform: translate(-230px, -58px) rotate(130deg); } 100% { opacity: 0; transform: translate(-470px, 170px) rotate(290deg); } }
@keyframes castle-rock-drop { 0% { opacity: 0; transform: translateY(0) rotate(0); } 18% { opacity: 1; } 100% { opacity: 0; transform: translateY(260px) rotate(210deg); } }
@keyframes castle-bolt-flight { 0% { opacity: 0; transform: translate(0, 0) rotate(171deg); } 20% { opacity: 1; } 100% { opacity: 0; transform: translate(-600px, 230px) rotate(171deg); } }
@keyframes castle-gate-drop { 0% { transform: translateY(-34px); } 65% { transform: translateY(74px); } 82% { transform: translateY(61px); } 100% { transform: translateY(69px); } }
@keyframes castle-caltrop-snap { 35% { transform: translateY(-8px) rotate(4deg); } 70% { transform: translateY(3px) rotate(-2deg); } }
@keyframes castle-timber-hit { 25% { transform: translateX(-8px) rotate(-5deg); } 55% { transform: translateX(7px) rotate(4deg); } 82% { transform: translateX(-3px) rotate(-2deg); } }
@keyframes castle-effect-burst { 0% { opacity: 0; transform: translate(0, 0) scale(0.5); } 24% { opacity: 1; } 100% { opacity: 0; transform: translate(-170px, 150px) scale(1.2) rotate(32deg); } }
@keyframes castle-lava-flight { 0% { opacity: 0; transform: translate(0, 0) scale(0.45); } 22% { opacity: 1; } 68% { transform: translate(-110px, 90px) scale(1.2) rotate(17deg); } 100% { opacity: 0; transform: translate(-190px, 170px) scale(0.7) rotate(43deg); } }
@keyframes castle-swarm-fall { 0% { opacity: 0; transform: translate(0, 0); } 18% { opacity: 1; } 100% { opacity: 0; transform: translate(-190px, 145px) rotate(220deg); } }
@keyframes castle-dust-fall { 0% { opacity: 0; transform: translate(0, 0) scale(0.4); } 24% { opacity: 0.78; } 100% { opacity: 0; transform: translate(-150px, 135px) scale(2.1); } }
@keyframes castle-net-drop { 0% { opacity: 1; transform: translate(0, 0) rotate(0); } 100% { opacity: 0; transform: translate(-170px, 175px) rotate(-22deg) scale(1.3); } }
@keyframes castle-spear-thrust { 0%, 100% { transform: translateX(0) rotate(-8deg); } 45% { transform: translateX(-42px) rotate(-17deg); } }
@keyframes castle-fire-snap { 0%, 100% { transform: scaleY(1); } 48% { transform: scaleY(1.35) translateY(-7px); filter: brightness(1.25); } }
@keyframes castle-card-in { from { opacity: 0; transform: translateY(-35px) scale(0.8) rotate(4deg); } to { opacity: 1; transform: rotate(-1.5deg); } }
@keyframes castle-ember-rise { 0% { opacity: 0; transform: translate(0, 20px) rotate(0); } 18%, 68% { opacity: 0.72; } 100% { opacity: 0; transform: translate(28px, -430px) rotate(210deg); } }
@keyframes castle-status-flame { 0%, 100% { transform: translateY(0) rotate(3deg); } 50% { transform: translateY(-4px) rotate(-2deg); } }
@keyframes castle-frost-flight { 0% { opacity: 0; transform: translate(0, 0) rotate(-13deg) scale(0.55); } 18% { opacity: 1; } 62% { opacity: 0.96; transform: translate(-250px, 70px) rotate(-33deg) scale(1); } 100% { opacity: 0; transform: translate(-520px, 235px) rotate(-57deg) scale(0.72); } }
@keyframes castle-frost-drop { 0% { opacity: 0; transform: translate(0, -24px) rotate(-5deg) scaleY(0.5); } 17% { opacity: 1; } 78% { opacity: 0.96; transform: translate(-105px, 168px) rotate(18deg) scaleY(1.1); } 100% { opacity: 0; transform: translate(-135px, 245px) rotate(29deg) scaleY(0.7); } }
@keyframes castle-snow-fall { 0% { opacity: 0; transform: translate(0, -28px) rotate(0); } 16%, 73% { opacity: 0.72; } 100% { opacity: 0; transform: translate(44px, 560px) rotate(235deg); } }
@keyframes castle-steam-rise { 0% { opacity: 0; transform: translate(0, 16px) scale(0.35); } 20%, 62% { opacity: 0.92; } 100% { opacity: 0; transform: translate(var(--steam-x), -86px) scale(1.35) rotate(31deg); } }
@keyframes castle-rain-fall { 0% { opacity: 0; transform: translate(-20px, -70px) rotate(13deg); } 15%, 78% { opacity: 0.58; } 100% { opacity: 0; transform: translate(84px, 760px) rotate(13deg); } }
@keyframes castle-beacon-strike { 0%, 100% { filter: none; transform: rotate(0); } 28%, 61% { filter: drop-shadow(0 0 11px #cfeef2) brightness(1.35); transform: rotate(-4deg); } 78% { transform: rotate(3deg); } }
@keyframes castle-lightning-flight { 0% { opacity: 0; transform: translate(0, 0) rotate(162deg) scaleX(0.25); } 18%, 64% { opacity: 1; } 100% { opacity: 0; transform: translate(-520px, 230px) rotate(162deg) scaleX(1.18); } }
@keyframes castle-sluice-open { 0%, 100% { filter: none; transform: scaleY(1); transform-origin: bottom; } 28%, 76% { filter: brightness(1.25); transform: scaleY(0.72); transform-origin: bottom; } }
@keyframes castle-water-fall { 0% { opacity: 0; transform: translate(0, -25px) scaleY(0.25); } 18%, 72% { opacity: 0.96; } 100% { opacity: 0; transform: translate(-120px, 250px) rotate(18deg) scaleY(1.2); } }
@keyframes castle-pot-tip { 0%, 100% { transform: rotate(var(--pot-rest, 0)); } 35%, 76% { transform: translate(-5px, 7px) rotate(-48deg); } }
@keyframes castle-log-release { 0% { opacity: 0; transform: translate(0, -20px) rotate(-16deg); } 18%, 73% { opacity: 1; } 100% { opacity: 0; transform: translate(-245px, 225px) rotate(-245deg); } }
@keyframes castle-pit-open { 0%, 100% { transform: perspective(120px) rotateX(0); } 35%, 78% { transform: perspective(120px) rotateX(78deg); } }
@keyframes castle-spikes-rise { 0%, 100% { transform: scaleY(1); transform-origin: bottom; } 28%, 72% { transform: translateY(-13px) scaleY(1.28); transform-origin: bottom; } }
@keyframes castle-crossbow-recoil { 0%, 100% { transform: translateX(0) rotate(-9deg); } 35% { transform: translateX(8px) rotate(-4deg); } 70% { transform: translateX(-3px) rotate(-11deg); } }
@keyframes castle-lightning-hit { 0% { opacity: 0; transform: scale(0.35) rotate(-18deg); } 17%, 68% { opacity: 1; } 100% { opacity: 0; transform: scale(1.18) rotate(34deg); } }
@keyframes castle-water-hit { 0% { opacity: 0; transform: translateY(-45px) scaleY(0.35); } 16%, 64% { opacity: 0.9; } 100% { opacity: 0; transform: translateY(108px) rotate(16deg); } }
@keyframes castle-raster-shell-flight { 0% { opacity: 0; transform: translate(0, 0) rotate(12deg) scale(0.55); } 18% { opacity: 1; } 58% { transform: translate(-210px, -65px) rotate(-18deg) scale(0.9); } 100% { opacity: 0; transform: translate(-480px, 170px) rotate(-42deg) scale(1.05); } }
@keyframes castle-raster-keg-drop { 0% { opacity: 0; transform: translate(0, -10px) rotate(0) scale(0.65); } 18% { opacity: 1; } 100% { opacity: 0; transform: translate(-115px, 245px) rotate(-170deg) scale(1.05); } }
@keyframes castle-raster-blast { 0% { opacity: 0; transform: scale(0.25) rotate(-5deg); } 23%, 68% { opacity: 1; } 100% { opacity: 0; transform: translate(-35px, 20px) scale(1.9) rotate(11deg); } }
@keyframes castle-raster-fire-flight { 0% { opacity: 0; transform: translate(0, 0) scaleX(0.25); } 16%, 70% { opacity: 1; } 100% { opacity: 0; transform: translate(-210px, 155px) rotate(18deg) scale(1.2); } }
@keyframes castle-photo-recoil { 0%, 100% { transform: translateX(0) rotate(0); } 32% { transform: translateX(8px) rotate(3deg); } 68% { transform: translateX(-3px) rotate(-2deg); } }
@keyframes castle-photo-tip { 0%, 100% { transform: rotate(0); } 36%, 76% { transform: translate(-4px, 5px) rotate(-13deg); } }
@keyframes castle-photo-keg-release { 0%, 100% { transform: translateY(0) rotate(0); } 42% { transform: translateY(14px) rotate(8deg); } 76% { transform: translateY(3px) rotate(-3deg); } }
@keyframes castle-photo-collapse { 0%, 100% { transform: rotate(0) translateY(0); } 38% { transform: rotate(7deg) translateY(8px); } 76% { transform: rotate(-4deg) translateY(15px); } }
@keyframes castle-photo-fuse { 0%, 100% { filter: saturate(0.92) contrast(1.08); transform: translateX(0); } 34%, 68% { filter: saturate(1.35) contrast(1.22) brightness(1.16); transform: translateX(4px) rotate(2deg); } }
@keyframes castle-photo-guard { 0%, 100% { transform: translateX(0) rotate(0); } 44% { transform: translateX(-12px) rotate(-4deg); } 72% { transform: translateX(4px) rotate(2deg); } }
@keyframes castle-powder-hit { 0% { opacity: 0; transform: scale(0.22) rotate(-7deg); } 17%, 68% { opacity: 1; } 100% { opacity: 0; transform: translateY(-12px) scale(1.34) rotate(8deg); } }
@keyframes castle-finale-fortress { from { opacity: 0; transform: translateY(22%); } to { opacity: 1; transform: translateY(9%); } }
@keyframes castle-finale-firework { 0%, 8% { opacity: 0; transform: scale(0.2) rotate(-8deg); } 24%, 63% { opacity: 1; transform: scale(1) rotate(2deg); } 82%, 100% { opacity: 0; transform: scale(1.14) rotate(6deg); } }
@keyframes castle-finale-cheer { 0%, 100% { transform: translateY(0) rotate(-1deg); } 42% { transform: translateY(-11px) rotate(3deg); } 72% { transform: translateY(-3px) rotate(-2deg); } }

@media (max-width: 1100px) {
  .castle-workspace {
    grid-template-columns: 1fr;
    grid-template-areas:
      "stage"
      "roster"
      "tray"
      "actions";
  }
  .castle-roster { border-top: 1px solid var(--castle-rule); border-left: 0; }
  .castle-roster header { display: grid; grid-template-columns: 0.5fr 1fr; gap: 4px 18px; align-content: center; }
  .castle-roster header p { grid-column: 2; }
  .castle-roster ol { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .castle-roster li { border-right: 1px solid var(--castle-rule); }
  .castle-slot-options,
  .castle-enemy-picker { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .castle-tray__cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .castle-defense-card { min-height: 132px; }
  .castle-report { grid-template-columns: 1fr; }
  .castle-report > header { grid-row: auto; border-right: 0; border-bottom: 1px solid var(--castle-rule); }
  .castle-report dl,
  .castle-report ol,
  .castle-actions { grid-column: 1; }
}

@media (max-width: 700px) {
  .castle-game { padding: 82px 10px 25px; }
  .castle-header { grid-template-columns: 1fr; gap: 13px; }
  .castle-header h1 { font-size: clamp(3.6rem, 17vw, 5.7rem); }
  .castle-header > p { max-width: 52ch; }
  .castle-stage,
  .castle-battle-shell .castle-stage { min-height: 540px; }
  .castle-landscape { object-position: 43% center; }
  .castle-location { top: 11px; left: 10px; }
  .castle-objectives { top: 52px; right: 10px; width: min(150px, calc(100% - 20px)); }
  .castle-fortress-cutout { right: -1%; bottom: 7%; width: 82%; height: 66%; }
  .castle-stage--level-3 .castle-fortress-cutout { right: -4%; bottom: 9%; width: 79%; height: 68%; }
  .castle-stage--level-4 .castle-fortress-cutout { right: -9%; bottom: 8%; width: 92%; height: 69%; }
  .castle-stage--level-5 .castle-fortress-cutout { right: -13%; bottom: 8%; width: 96%; height: 67%; }
  .castle-enemy-preview { bottom: 10%; left: 10px; width: calc(100% - 20px); height: 118px; }
  .castle-enemy-preview__unit { width: 36px; height: 78px; }
  .castle-enemy-preview__unit--gatebreakers { width: 60px; height: 72px; }
  .castle-enemy-preview__unit--ram { width: 70px; height: 58px; }
  .castle-stage--level-3 .castle-enemy-preview { bottom: 9%; left: 6px; width: calc(100% - 12px); height: 108px; }
  .castle-stage--level-3 .castle-enemy-preview__unit { width: 27px; height: 62px; }
  .castle-stage--level-3 .castle-enemy-preview__unit--gatebreakers { width: 43px; height: 58px; }
  .castle-stage--level-3 .castle-enemy-preview__unit--ram { width: 48px; height: 46px; }
  .castle-stage--level-4 .castle-enemy-preview { bottom: 7%; left: 4px; width: calc(100% - 8px); height: 132px; }
  .castle-stage--level-4 .castle-enemy-preview__unit { width: 24px; height: 54px; }
  .castle-stage--level-4 .castle-enemy-preview__unit--gatebreakers { width: 38px; height: 50px; }
  .castle-stage--level-4 .castle-enemy-preview__unit--ram { width: 43px; height: 40px; }
  .castle-stage--level-5 .castle-enemy-preview { bottom: 5%; left: 3px; width: calc(100% - 6px); height: 140px; }
  .castle-stage--level-5 .castle-enemy-preview__unit { width: 22px; height: 50px; }
  .castle-stage--level-5 .castle-enemy-preview__unit--gatebreakers { width: 35px; height: 47px; }
  .castle-stage--level-5 .castle-enemy-preview__unit--ram { width: 40px; height: 36px; }
  .castle-stage--level-5 .castle-enemy-preview__unit--art-commander { width: 39px; height: 38px; }
  .castle-stage--level-5 .castle-enemy-preview__unit--art-siege-tower { width: 33px; height: 56px; }
  .castle-stage--level-5 .castle-slot {
    top: var(--slot-narrow-y);
    left: var(--slot-narrow-x);
  }
  .castle-slot { width: 58px; height: 58px; }
  .castle-slot--battle,
  .castle-slot.castle-slot--battle { width: 64px; height: 64px; }
  .castle-slot__label { padding: 3px 4px; }
  .castle-slot[data-castle-slot="5"] .castle-slot__label { left: 0; }
  .castle-stage--level-5 .castle-slot[data-castle-slot="2"] .castle-slot__label { left: 25%; }
  .castle-stage--level-5 .castle-slot[data-castle-slot="5"] .castle-slot__label {
    top: 50%;
    bottom: auto;
    left: calc(100% - 3px);
    transform: translateY(-50%) rotate(-1deg);
  }
  .castle-stage--level-5 .castle-slot[data-castle-slot="5"] .castle-slot__pin { top: 8px; }
  .castle-slot[data-castle-slot="6"] .castle-slot__label { left: 43%; }
  .castle-slot__label strong { font-size: 0.56rem; }
  .castle-slot__label small { display: none; }
  .castle-slot__pin { width: 18px; font-size: 0.44rem; }
  .castle-piece { width: 58px; height: 56px; }
  .castle-slot__battle-label { display: none; }
  .castle-roster header { display: block; padding: 17px; }
  .castle-roster header p { margin-top: 5px; }
  .castle-roster ol { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .castle-roster li { min-height: 65px; grid-template-columns: 42px minmax(0, 1fr); padding: 6px 10px; }
  .castle-roster__cutout { width: 40px; height: 48px; }
  .castle-roster li strong { font-size: 0.82rem; }
  .castle-slot-options,
  .castle-enemy-picker { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .castle-enemy-detail { grid-template-columns: 76px minmax(0, 1fr); }
  .castle-enemy-detail__cutout { width: 72px; height: 98px; }
  .castle-tray { padding: 18px 10px; }
  .castle-tray header { align-items: start; }
  .castle-tray h2 { font-size: 1.65rem; }
  .castle-armoury-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .castle-armoury-filters button { width: 100%; }
  .castle-tray__cards { grid-template-columns: 1fr; }
  .castle-defense-card { min-height: 116px; grid-template-columns: 74px minmax(0, 1fr); }
  .castle-build-actions { align-items: stretch; flex-direction: column; }
  .castle-build-actions button { width: 100%; }
  .castle-unit { bottom: 8%; width: 42px; height: 76px; transform: translateX(var(--unit-mobile-offset)); }
  .castle-unit--gatebreakers { width: 66px; height: 72px; }
  .castle-unit--ram { width: 72px; height: 56px; }
  .castle-stage--level-3 .castle-unit { bottom: calc(5% + var(--unit-row) * 70px); width: 34px; height: 64px; transform: translateX(var(--unit-mobile-offset)); }
  .castle-stage--level-3 .castle-unit--gatebreakers { width: 52px; height: 59px; }
  .castle-stage--level-3 .castle-unit--ram { width: 58px; height: 46px; }
  .castle-stage--level-3 .castle-unit:nth-child(even) .castle-unit__health { bottom: calc(100% + 24px); }
  .castle-stage--level-4 .castle-unit { bottom: calc(4% + var(--unit-row) * 61px); width: 27px; height: 54px; transform: translateX(var(--unit-mobile-offset)); }
  .castle-stage--level-4 .castle-unit--gatebreakers { width: 42px; height: 50px; }
  .castle-stage--level-4 .castle-unit--ram { width: 48px; height: 39px; }
  .castle-stage--level-4 .castle-unit__health { width: 62px; }
  .castle-stage--level-4 .castle-unit:nth-child(n) .castle-unit__health { bottom: calc(100% + 5px); }
  .castle-stage--level-5 .castle-unit { bottom: calc(3% + var(--unit-row) * 61px); width: 25px; height: 51px; transform: translateX(var(--unit-mobile-offset)); }
  .castle-stage--level-5 .castle-unit--gatebreakers { width: 39px; height: 47px; }
  .castle-stage--level-5 .castle-unit--ram { width: 45px; height: 38px; }
  .castle-stage--level-5 .castle-unit--art-commander { width: 44px; height: 39px; }
  .castle-stage--level-5 .castle-unit--art-siege-tower { width: 36px; height: 58px; }
  .castle-stage--level-5 .castle-unit__health { left: 13px; width: 56px; }
  .castle-stage--level-5 .castle-unit:nth-child(n) .castle-unit__health { bottom: calc(100% + 4px); }
  .castle-unit__health { bottom: calc(100% + 5px); width: 68px; padding: 3px 4px; }
  .castle-unit--gatebreakers .castle-unit__health,
  .castle-unit--ram .castle-unit__health { left: 21px; }
  .castle-stage--level-4 .castle-unit .castle-unit__health { left: 14px; width: 58px; }
  .castle-unit__health strong { font-size: 0.51rem; }
  .castle-unit__health small { font-size: 0.37rem; }
  .castle-battle-note { top: 17%; right: 11px; bottom: auto; left: 11px; max-width: 28ch; font-size: 0.98rem; }
  .castle-battle-controls { align-items: stretch; flex-direction: column; }
  .castle-battle-controls > div { grid-template-columns: 1fr auto; }
  .castle-battle-controls > div > i { grid-column: 1 / -1; grid-row: 2; }
  .castle-battle-controls button { width: 100%; }
  .castle-verdict-card { top: 12%; left: 5%; width: min(290px, 78vw); }
  .castle-report dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .castle-report dl > div:nth-child(2) { border-right: 0; }
  .castle-report dl > div:nth-child(-n+2) { border-bottom: 1px solid var(--castle-rule); }
  .castle-report li { align-items: start; grid-template-columns: 23px minmax(0, 1fr); }
  .castle-report li b { grid-column: 2; }
  .castle-actions { flex-direction: column; }
  .castle-finale { min-height: 650px; }
  .castle-finale__backdrop { object-position: 42% center; }
  .castle-finale__fortress { right: -18%; bottom: 11%; width: 112%; height: 55%; }
  .castle-finale__fireworks > i { --firework-size: 92px; }
  .castle-finale__fireworks > i:nth-child(1) { top: 5%; left: 4%; }
  .castle-finale__fireworks > i:nth-child(2) { top: 8%; left: 37%; }
  .castle-finale__fireworks > i:nth-child(3) { top: 4%; left: 68%; }
  .castle-finale__fireworks > i:nth-child(n+4) { top: 42%; }
  .castle-finale__fireworks > i:nth-child(4) { left: 8%; }
  .castle-finale__fireworks > i:nth-child(5) { left: 39%; }
  .castle-finale__fireworks > i:nth-child(6) { left: 69%; }
  .castle-finale__banner { display: none; }
  .castle-finale__garland { right: -9%; bottom: 5%; width: 85%; }
  .castle-finale__confetti { right: -8%; bottom: 1%; width: 50%; }
  .castle-finale__defenders { right: 2%; bottom: 2%; gap: 4px; }
  .castle-finale__defenders i { width: 44px; height: 72px; }
  .castle-finale__defenders i:nth-child(1) { width: 82px; }
  .castle-finale__card { top: 14%; left: 5%; width: min(330px, 88vw); padding: 24px; }
  .castle-finale__card h2 { font-size: clamp(3rem, 15vw, 4.5rem); }
  .castle-finale__card button { width: 100%; }
  .castle-start-prompt > div > div { align-items: stretch; flex-direction: column; }
  .castle-start-prompt button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .castle-piece,
  .castle-unit,
  .castle-unit__puppet,
  .castle-unit__art,
  .castle-unit__health,
  .castle-damage-pop,
  .castle-oil-pour,
  .castle-arrow-volley i,
  .castle-javelin-volley i,
  .castle-thrown-rocks i,
  .castle-lava-splash i,
  .castle-fire-burst i,
  .castle-swarm-burst i,
  .castle-dust-burst i,
  .castle-frost-volley i,
  .castle-frost-fall i,
  .castle-net-grid,
  .castle-spear-rack,
  .castle-fire-trench,
  .castle-arrow,
  .castle-falling-rocks i,
  .castle-ballista-bolt,
  .castle-portcullis-grid,
  .castle-fortress-cutout,
  .castle-embers i,
  .castle-snowfall i,
  .castle-rainfall i,
  .castle-steam-burst i,
  .castle-lightning-chain i,
  .castle-water-burst i,
  .castle-raster-effect,
  .castle-piece__photo,
  .castle-powder-blast-hit,
  .castle-log-rush i,
  .castle-beacon-mast,
  .castle-sluice-frame,
  .castle-pot-rack i,
  .castle-pit-hatch,
  .castle-pit-spikes,
  .castle-pavise-crossbow,
  .castle-lightning-hit i,
  .castle-water-hit i,
  .castle-unit__status,
  .castle-start-prompt > div,
  .castle-verdict-card,
  .castle-finale__fortress,
  .castle-finale__fireworks > i,
  .castle-finale__defenders i,
  .castle-finale__card { transition: none !important; animation: none !important; }
  .castle-unit.is-stopped { opacity: 0; }
  .castle-finale__fortress { opacity: 1; transform: translateY(9%); }
  .castle-finale__fireworks > i { opacity: 0.9; transform: scale(1); }
}

/* Bake It Till You Make It — pantry, oven, and the judging tent ---------- */

.bake-experience {
  --bake-ink: #2a2118;
  --bake-muted: #6d6154;
  --bake-paper: #f6efe2;
  --bake-paper-deep: #e8ddc9;
  --bake-green: #4a6141;
  --bake-rust: #a4552f;
  --bake-amber: #b5811f;
  --bake-rule: rgb(42 33 24 / 0.2);
  min-height: 100%;
  padding: 86px clamp(14px, 2.4vw, 38px) 42px;
  color: var(--bake-ink);
  background:
    radial-gradient(circle at 84% 6%, rgb(181 129 31 / 0.16), transparent 30%),
    linear-gradient(148deg, #f3ece0, #e6dccb 62%, #d5cbb9);
}
.game-dialog[data-game="bake"] .game-dialog__count { display: none; }

.bake-header {
  display: grid;
  width: min(1480px, 100%);
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.36fr);
  gap: 28px;
  align-items: end;
  margin: 0 auto 26px;
}
.bake-header h1 {
  margin: 7px 0 0;
  font-family: var(--studio-display);
  font-size: clamp(3.2rem, 6vw, 6.4rem);
}
/* Stained Glass -------------------------------------------------------- */

.game-dialog[data-game="stained-glass"] { background: #171319; }
.game-dialog[data-game="stained-glass"] .game-dialog__chrome { padding-right: 5px; }
.game-dialog[data-game="stained-glass"] .game-dialog__count { display: none; }

.sg-game {
  --sg-ink: #251e19;
  --sg-paper: #efe4cc;
  --sg-lead: #1b1716;
  min-height: 100svh;
  overflow: clip;
  color: var(--sg-ink);
  background: #6f4931;
  font-family: var(--studio-sans);
}
.sg-game button, .sg-game input { font: inherit; }
.sg-game button:focus-visible, .sg-game input:focus-visible { outline: 3px solid #fff2a7; outline-offset: 3px; }
.sg-kicker {
  margin: 0;
  font-family: var(--studio-mono);
  font-size: 0.67rem;
  letter-spacing: 0.12em;
  line-height: 1.4;
  text-transform: uppercase;
}
.sg-primary {
  min-height: 50px;
  padding: 12px 17px;
  border: 1px solid #171413;
  background: #171413;
  color: #fff7df;
  cursor: pointer;
}
.sg-primary:disabled { cursor: not-allowed; opacity: 0.34; }
.sg-primary:not(:disabled):hover { background: #3a2821; }

.sg-workbench {
  min-height: 100svh;
  padding: 88px clamp(14px, 3vw, 42px) 38px;
  background:
    linear-gradient(90deg, rgb(47 25 15 / .15) 1px, transparent 1px) 0 0 / 38px 100%,
    radial-gradient(circle at 8% 12%, rgb(255 221 163 / .22), transparent 25%),
    linear-gradient(113deg, #9a6745, #6b422c 58%, #4f3125);
  isolation: isolate;
}
.sg-workbench::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  background: repeating-linear-gradient(3deg, transparent 0 13px, rgb(42 19 11 / .1) 14px, transparent 15px 27px);
  content: "";
  pointer-events: none;
}
.sg-workbench__header {
  display: grid;
  width: min(1480px, 100%);
  grid-template-columns: minmax(0, 1fr) minmax(240px, 34ch);
  gap: 30px;
  align-items: end;
  margin: 0 auto 22px;
  color: #fff1d1;
}
.sg-workbench__header h1 {
  margin: 3px 0 0;
  font-family: var(--studio-display);
  font-size: clamp(3rem, 6.4vw, 7rem);
  font-weight: 400;
  letter-spacing: -0.07em;
  line-height: 0.76;
}
.sg-workbench__header h1 i { color: #ffd46e; font-weight: 400; }
.sg-workbench__header > p { max-width: 32ch; margin: 0; color: rgb(255 239 209 / .76); font-size: 0.92rem; line-height: 1.55; }
.sg-workbench__bench {
  display: grid;
  width: min(1480px, 100%);
  min-height: min(760px, calc(100svh - 190px));
  grid-template-columns: minmax(0, 1fr) minmax(330px, 430px);
  margin: 0 auto;
  border: 1px solid rgb(35 18 11 / .62);
  background: #7c5137;
  box-shadow: 0 34px 90px rgb(27 12 7 / .34), inset 0 1px rgb(255 235 196 / .22);
}
.sg-workbench__drawing {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 650px;
  place-items: center;
  overflow: hidden;
  padding: 54px 32px 82px;
  background:
    linear-gradient(90deg, transparent 49.8%, rgb(55 33 24 / .25) 50%, transparent 50.2%),
    linear-gradient(0deg, transparent 49.8%, rgb(55 33 24 / .17) 50%, transparent 50.2%),
    radial-gradient(circle, #d8c69e 0 45%, #b99c71 76%, #846147 100%);
}
.sg-workbench__drawing::after {
  position: absolute;
  inset: 20px;
  border: 1px solid rgb(50 34 26 / .2);
  box-shadow: inset 0 0 80px rgb(69 35 17 / .19);
  content: "";
  pointer-events: none;
}
.sg-cartoon { position: absolute; top: 27px; left: 31px; color: rgb(60 45 33 / .58); font-family: var(--studio-mono); font-size: 0.63rem; letter-spacing: 0.1em; text-transform: uppercase; }
.sg-cartoon::after { display: block; width: 88px; height: 1px; margin-top: 7px; background: currentColor; content: ""; transform: rotate(-2deg); }
.sg-window-wrap {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(72%, 580px);
  height: min(68vh, 610px);
  min-height: 460px;
  place-items: center;
  filter: drop-shadow(0 24px 20px rgb(36 18 11 / .31));
}
.sg-window {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  user-select: none;
}
.sg-window__frame { fill: var(--sg-lead); }
.sg-window__pane { cursor: pointer; outline: none; }
.sg-window__pane-fill { transition: filter 260ms ease, opacity 260ms ease; }
.sg-window__pane.is-empty .sg-window__pane-fill { opacity: 0.42; }
.sg-window__pane.is-filled .sg-window__pane-fill { filter: saturate(1.02) brightness(1.08) drop-shadow(0 0 2px rgb(255 246 215 / .28)); }
.sg-window__pane:hover .sg-window__pane-fill,
.sg-window__pane:focus .sg-window__pane-fill,
.sg-window__pane.is-selected .sg-window__pane-fill { filter: brightness(1.25) saturate(1.2); }
.sg-window__pane:focus .sg-window__pane-fill { stroke: #fff7d5; stroke-width: 1.9px; }
.sg-window__cell-outline { fill: none; stroke: var(--sg-lead); stroke-linejoin: round; stroke-width: 2.25px; pointer-events: none; }
.sg-window__outer-lead { fill: none; stroke: #171313; stroke-width: 4.2px; pointer-events: none; }
.sg-window__pane.is-guided .sg-window__pane-fill { opacity: 1; animation: sg-guide 1.35s ease-in-out infinite; stroke: #a8dbff; stroke-width: 2.5px; }
@keyframes sg-guide { 50% { filter: brightness(1.55); } }
.sg-guidance {
  position: absolute;
  z-index: 2;
  right: 28px;
  bottom: 24px;
  left: 28px;
  display: flex;
  max-width: 62ch;
  align-items: center;
  gap: 9px;
  margin: 0 auto;
  color: rgb(52 38 29 / .74);
  font-size: 0.76rem;
  line-height: 1.4;
  text-align: center;
}
.sg-guidance span { flex: 0 0 8px; width: 8px; height: 8px; border-radius: 50%; background: #555044; box-shadow: 0 0 0 4px rgb(63 55 43 / .1); }
.sg-guidance.is-active { color: #241d18; font-weight: 700; }
.sg-guidance.is-active span { background: #2c74b7; box-shadow: 0 0 0 4px rgb(44 116 183 / .15), 0 0 18px #2c74b7; }

.sg-tools {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 0;
  background:
    linear-gradient(rgb(255 255 255 / .08), transparent 44%),
    repeating-linear-gradient(0deg, transparent 0 29px, rgb(75 57 36 / .055) 30px),
    var(--sg-paper);
  box-shadow: -16px 0 42px rgb(46 22 11 / .14);
}
.sg-tool-section { padding: 19px 22px; border-bottom: 1px solid rgb(65 48 31 / .18); }
.sg-tool-label { margin: 0 0 11px; color: #6c5a45; font-family: var(--studio-mono); font-size: 0.61rem; letter-spacing: 0.11em; text-transform: uppercase; }
.sg-tool-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.sg-tool-heading > span { overflow: hidden; color: #705b43; font-size: 0.68rem; text-overflow: ellipsis; white-space: nowrap; }
.sg-frame-picker { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.sg-frame-picker button,
.sg-assists button {
  min-height: 49px;
  border: 1px solid rgb(49 38 27 / .24);
  background: rgb(255 252 239 / .36);
  color: var(--sg-ink);
  cursor: pointer;
}
.sg-frame-picker button { display: grid; place-content: center; gap: 2px; padding: 7px 5px; }
.sg-frame-picker button strong { font-family: var(--studio-display); font-size: 1.02rem; font-weight: 400; }
.sg-frame-picker button span { color: #75634f; font-size: 0.52rem; line-height: 1.15; }
.sg-frame-picker button[aria-pressed="true"] { border-color: #251e19; background: #251e19; color: #fff5dc; }
.sg-frame-picker button[aria-pressed="true"] span { color: rgb(255 245 220 / .65); }
.sg-palette { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px; }
.sg-swatch { display: grid; min-width: 0; gap: 3px; padding: 3px; border: 1px solid transparent; background: transparent; color: #594a3b; cursor: pointer; }
.sg-swatch > span {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border: 2px solid rgb(29 21 18 / .78);
  background-color: hsl(var(--glass-h) var(--glass-s) var(--glass-l));
  box-shadow: inset 0 0 12px rgb(255 255 255 / .26), inset 0 -8px 12px rgb(24 13 10 / .13), 0 2px 4px rgb(37 20 10 / .18);
}
.sg-swatch > span::after { position: absolute; inset: 0; background: linear-gradient(135deg, rgb(255 255 255 / .3), transparent 38%, rgb(24 12 10 / .12) 78%, rgb(255 255 255 / .12)); content: ""; pointer-events: none; }
.sg-swatch--streaky > span { background-image: repeating-linear-gradient(79deg, transparent 0 8px, rgb(30 16 12 / .12) 9px, rgb(255 255 255 / .2) 10px, transparent 11px 17px); }
.sg-swatch--seedy > span { background-image: radial-gradient(circle at 25% 25%, transparent 0 2px, rgb(28 16 13 / .16) 2.4px, rgb(255 255 255 / .24) 2.9px, transparent 3.4px), radial-gradient(circle at 70% 68%, transparent 0 1px, rgb(28 16 13 / .14) 1.4px, rgb(255 255 255 / .23) 1.8px, transparent 2.3px); }
.sg-swatch--rippled > span { background-image: repeating-radial-gradient(ellipse at 20% 40%, transparent 0 7px, rgb(29 16 13 / .11) 8px, rgb(255 255 255 / .18) 9px, transparent 10px 15px); }
.sg-swatch small { overflow: hidden; font-size: 0.5rem; line-height: 1.1; text-overflow: ellipsis; white-space: nowrap; }
.sg-swatch[aria-pressed="true"] { border-color: #211b18; background: #fff8e9; }
.sg-swatch[aria-pressed="true"] > span { box-shadow: 0 0 0 2px #fff8e9, 0 0 0 4px #211b18; }
.sg-assists { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.sg-assists .sg-tool-label { grid-column: 1 / -1; }
.sg-assists button { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; align-content: center; padding: 8px 10px; text-align: left; }
.sg-assists button:first-of-type { grid-column: 1 / -1; }
.sg-assists button span { font-size: 0.73rem; }
.sg-assists button small { color: #745f49; font-family: var(--studio-mono); font-size: 0.5rem; }
.sg-assists button[aria-pressed="true"] small { color: #31694e; }
.sg-assists button:disabled { cursor: not-allowed; opacity: 0.42; }
.sg-preview { display: grid; grid-template-columns: 74px 1fr; gap: 13px; align-items: center; padding: 16px 22px; border-bottom: 1px solid rgb(65 48 31 / .18); background: #272833; color: #fff3d6; }
.sg-preview > div { display: grid; width: 70px; height: 76px; place-items: center; filter: drop-shadow(0 0 12px rgb(255 196 113 / .32)); }
.sg-preview .sg-window__frame { fill: #100f14; }
.sg-preview .sg-window__cell-outline, .sg-preview .sg-window__outer-lead { stroke: #111016; }
.sg-preview .sg-window__pane.is-filled .sg-window__pane-fill { filter: brightness(1.42) saturate(1.2); }
.sg-preview p { margin: 0; font-family: var(--studio-mono); font-size: 0.61rem; letter-spacing: 0.1em; text-transform: uppercase; }
.sg-preview p span { display: inline-block; width: 6px; height: 6px; margin-right: 7px; border-radius: 50%; background: #ffd678; box-shadow: 0 0 12px #ffd678; }
.sg-install { display: grid; gap: 10px; margin-top: auto; padding: 18px 22px 21px; }
.sg-install p { min-height: 2.4em; margin: 0; color: #675441; font-size: 0.68rem; line-height: 1.35; }
.sg-install .sg-primary { display: flex; align-items: center; justify-content: space-between; }
.sg-install .sg-primary span { font-family: var(--studio-mono); font-size: 0.63rem; }

.sg-loading, .sg-fallback {
  display: grid;
  min-height: 100svh;
  place-content: center;
  padding: 86px 24px 40px;
  background: radial-gradient(circle at 50% 34%, #5f5d64, #211c21 58%, #141116);
  color: #fff2d6;
  text-align: center;
}
.sg-loading > div { width: min(260px, 58vw); height: 360px; margin: 0 auto 24px; filter: drop-shadow(0 0 34px rgb(255 195 101 / .34)); }
.sg-loading .sg-window__frame, .sg-fallback .sg-window__frame { fill: #111014; }
.sg-loading .sg-window__cell-outline, .sg-loading .sg-window__outer-lead,
.sg-fallback .sg-window__cell-outline, .sg-fallback .sg-window__outer-lead { stroke: #111014; }
.sg-loading .sg-window__pane-fill, .sg-fallback .sg-window__pane-fill { filter: saturate(1.2) brightness(1.28); }
.sg-loading h1, .sg-fallback h1 { margin: 7px 0 8px; font-family: var(--studio-display); font-size: clamp(2.8rem, 8vw, 6.5rem); font-weight: 400; letter-spacing: -0.06em; }
.sg-loading > p:last-child, .sg-fallback__copy > p { color: rgb(255 242 214 / .7); }
.sg-fallback { grid-template-columns: minmax(190px, 360px) minmax(280px, 480px); gap: clamp(30px, 7vw, 90px); align-items: center; text-align: left; }
.sg-fallback__window { height: min(70svh, 650px); filter: drop-shadow(0 0 42px rgb(255 190 93 / .38)); }
.sg-fallback__copy .sg-primary { margin-top: 18px; }

.sg-chapel { position: relative; min-height: 100svh; overflow: hidden; background: #16141a; color: #fff5de; }
.sg-chapel canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; min-height: 100svh; cursor: grab; touch-action: none; }
.sg-chapel canvas.is-looking { cursor: grabbing; }
.sg-chapel canvas:focus-visible { outline: 3px solid #fff1a6; outline-offset: -8px; }
.sg-chapel__title { position: absolute; z-index: 2; top: 78px; left: clamp(16px, 3vw, 42px); pointer-events: none; text-shadow: 0 2px 18px #111; }
.sg-chapel__title h1 { margin: 2px 0 0; font-family: var(--studio-display); font-size: clamp(2.4rem, 5vw, 5.6rem); font-weight: 400; letter-spacing: -0.07em; line-height: 0.82; }
.sg-chapel__title h1 i { color: #ffd384; font-weight: 400; }
.sg-follow, .sg-quality {
  position: absolute;
  z-index: 3;
  top: 82px;
  right: clamp(14px, 3vw, 42px);
  min-height: 42px;
  border: 1px solid rgb(255 247 225 / .28);
  background: rgb(19 17 21 / .58);
  color: #fff5dc;
  backdrop-filter: blur(12px);
}
.sg-follow { padding: 8px 13px; cursor: pointer; }
.sg-quality { top: 132px; display: grid; min-height: 0; place-items: center; padding: 6px 9px; border-color: transparent; color: rgb(255 245 220 / .64); font-family: var(--studio-mono); font-size: 0.56rem; letter-spacing: 0.08em; text-transform: uppercase; }
.sg-timebar {
  position: absolute;
  z-index: 3;
  right: clamp(14px, 3vw, 42px);
  bottom: clamp(14px, 3vw, 34px);
  left: clamp(14px, 3vw, 42px);
  display: grid;
  grid-template-columns: 145px minmax(160px, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 13px 14px;
  border: 1px solid rgb(255 246 225 / .22);
  background: rgb(18 15 19 / .7);
  box-shadow: 0 12px 44px rgb(0 0 0 / .28);
  backdrop-filter: blur(16px);
}
.sg-timebar[hidden] { display: none; }
.sg-timebar > div { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: baseline; }
.sg-timebar span { font-family: var(--studio-display); font-size: 1.18rem; }
.sg-timebar output { color: #ffd18a; font-family: var(--studio-mono); font-size: 0.65rem; }
.sg-timebar input { width: 100%; accent-color: #e5a95f; cursor: ew-resize; }
.sg-timebar button { min-height: 42px; padding: 8px 12px; border: 1px solid rgb(255 245 222 / .26); background: transparent; color: #fff3d7; cursor: pointer; }
.sg-day-end {
  position: absolute;
  z-index: 5;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 86px 24px 30px;
  background: rgb(10 9 13 / .58);
  backdrop-filter: blur(7px);
}
.sg-day-end[hidden] { display: none; }
.sg-day-end > div { width: min(520px, 100%); padding: clamp(24px, 4vw, 46px); border: 1px solid rgb(255 232 194 / .26); background: rgb(28 22 25 / .9); box-shadow: 0 30px 90px #09070b; }
.sg-day-end h2 { margin: 9px 0 13px; font-family: var(--studio-display); font-size: clamp(2.5rem, 6vw, 5rem); font-weight: 400; letter-spacing: -0.055em; line-height: 0.9; }
.sg-day-end > div > p:not(.sg-kicker) { color: rgb(255 242 216 / .68); line-height: 1.55; }
.sg-day-end > div > div { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 24px; }
.sg-day-end button:not(.sg-primary), .sg-keepsake-note button { min-height: 50px; padding: 12px 17px; border: 1px solid rgb(255 242 214 / .28); background: transparent; color: #fff2d8; cursor: pointer; }
.sg-keepsake-note { position: absolute; z-index: 4; right: 22px; bottom: 22px; display: flex; align-items: center; gap: 13px; padding: 9px 10px 9px 14px; border: 1px solid rgb(255 239 203 / .26); background: rgb(18 15 19 / .72); backdrop-filter: blur(14px); }
.sg-keepsake-note[hidden] { display: none; }
.sg-keepsake-note p { margin: 0; font-family: var(--studio-mono); font-size: 0.59rem; letter-spacing: 0.08em; text-transform: uppercase; }
.sg-keepsake-note button { min-height: 38px; padding: 7px 10px; }
.sg-dissolve { position: absolute; z-index: 4; inset: 0; background: #f5d9af; opacity: 0; pointer-events: none; }
.sg-dissolve.is-changing { animation: sg-dissolve 680ms ease-in-out; }
@keyframes sg-dissolve { 50% { opacity: .25; } }

@media (max-width: 900px) {
  .sg-workbench__header { grid-template-columns: 1fr; gap: 12px; }
  .sg-workbench__header > p { display: none; }
  .sg-workbench__bench { grid-template-columns: 1fr; }
  .sg-workbench__drawing { min-height: 610px; }
  .sg-window-wrap { width: min(76%, 530px); height: 540px; min-height: 0; }
  .sg-tools { box-shadow: 0 -16px 42px rgb(46 22 11 / .14); }
  .sg-fallback { grid-template-columns: 1fr; text-align: center; }
  .sg-fallback__window { height: 42svh; }
}

@media (max-width: 520px) {
  .sg-workbench { padding: 76px 8px 18px; }
  .sg-workbench__header { padding-inline: 8px; margin-bottom: 14px; }
  .sg-workbench__header h1 { font-size: clamp(3.25rem, 17vw, 5.1rem); }
  .sg-workbench__bench { border-inline: 0; }
  .sg-workbench__drawing { min-height: 460px; padding: 46px 12px 74px; }
  .sg-workbench__drawing::after { inset: 9px; }
  .sg-cartoon { top: 18px; left: 18px; }
  .sg-window-wrap { width: min(88%, 350px); height: 360px; }
  .sg-window-wrap:has(.sg-window--lancet) { height: 390px; }
  .sg-guidance { right: 14px; bottom: 17px; left: 14px; font-size: 0.68rem; }
  .sg-tool-section { padding: 17px 14px; }
  .sg-frame-picker button { min-height: 54px; }
  .sg-palette { gap: 6px; }
  .sg-swatch { padding: 2px; }
  .sg-swatch small { font-size: 0.46rem; }
  .sg-assists { grid-template-columns: 1fr; }
  .sg-assists .sg-tool-label, .sg-assists button:first-of-type { grid-column: auto; }
  .sg-assists button { min-height: 48px; }
  .sg-preview { padding-inline: 14px; }
  .sg-install { padding-inline: 14px; }
  .sg-chapel__title { top: 72px; left: 12px; max-width: 210px; }
  .sg-chapel__title h1 { font-size: 2.25rem; }
  .sg-follow { top: 70px; right: 12px; min-height: 38px; padding: 6px 9px; font-size: 0.7rem; }
  .sg-quality { top: 113px; right: 12px; font-size: 0.48rem; }
  .sg-timebar { right: 9px; bottom: 9px; left: 9px; grid-template-columns: 1fr auto; gap: 8px 11px; padding: 10px; }
  .sg-timebar > div { grid-column: 1; }
  .sg-timebar input { grid-column: 1 / -1; grid-row: 2; min-height: 30px; }
  .sg-timebar button { grid-column: 2; grid-row: 1; min-height: 38px; padding: 6px 9px; font-size: 0.7rem; }
  .sg-day-end { padding-inline: 12px; }
  .sg-day-end > div { padding: 25px 21px; }
  .sg-day-end > div > div { flex-direction: column; }
  .sg-day-end button { width: 100%; }
  .sg-keepsake-note { right: 9px; bottom: 9px; left: 9px; justify-content: space-between; }
  .sg-loading > div { height: 300px; }
}

@media (max-height: 620px) and (min-width: 521px) {
  .sg-chapel__title { top: 70px; }
  .sg-chapel__title h1 { font-size: 3.2rem; }
  .sg-timebar { bottom: 10px; }
  .sg-follow { top: 70px; }
  .sg-quality { top: 118px; }
}

@media (prefers-reduced-motion: reduce) {
  .sg-window__pane.is-guided .sg-window__pane-fill { animation: none; filter: brightness(1.38); }
  .sg-dissolve.is-changing { animation-duration: 680ms !important; }
}

/* Bonsai — a full-bleed, season-lit living sculpture. -------------------- */

.game-dialog[data-game="bonsai"] { background: #bfc8b2; }
.game-dialog[data-game="bonsai"] .game-dialog__chrome {
  padding-right: 5px;
  border: 1px solid rgb(255 255 255 / 0.35);
  background: rgb(242 243 232 / 0.52);
  box-shadow: 0 8px 32px rgb(36 43 33 / 0.12);
  backdrop-filter: blur(18px) saturate(115%);
}
.game-dialog[data-game="bonsai"] .game-dialog__count { display: none; }

.bonsai {
  --bonsai-ink: #1f2922;
  --bonsai-paper: #f2f0e5;
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 100svh;
  overflow: hidden;
  background: #bfc8b2;
  color: var(--bonsai-ink);
  font-family: var(--studio-sans);
  isolation: isolate;
  user-select: none;
}
.bonsai [hidden] { display: none !important; }
.bonsai__canvas {
  position: absolute;
  display: block;
  width: 100%;
  height: 100%;
  inset: 0;
  cursor: grab;
  touch-action: none;
}
.bonsai__canvas:active { cursor: grabbing; }
.bonsai__canvas:focus-visible { outline: 3px solid rgb(251 248 224 / 0.9); outline-offset: -7px; }
.bonsai__vignette {
  position: absolute;
  z-index: 1;
  inset: 0;
  background: radial-gradient(ellipse at 50% 47%, transparent 44%, rgb(25 31 25 / 0.08) 72%, rgb(17 21 18 / 0.28) 115%);
  opacity: 0.48;
  pointer-events: none;
  transition: opacity 1800ms ease, background 1800ms ease;
}
.bonsai.is-ending .bonsai__vignette {
  background: radial-gradient(ellipse at 43% 45%, transparent 31%, rgb(32 27 24 / 0.16) 67%, rgb(18 16 15 / 0.58) 108%);
  opacity: 1;
}
.bonsai__flash {
  position: absolute;
  z-index: 6;
  inset: 0;
  background: #fffdf2;
  opacity: 0;
  pointer-events: none;
}
.bonsai.is-ending .bonsai__flash { animation: bonsai-shutter 1100ms 700ms ease both; }

.bonsai__loading {
  position: absolute;
  z-index: 5;
  display: grid;
  inset: 0;
  place-content: center;
  justify-items: center;
  gap: 16px;
  background: radial-gradient(circle, #d9dcc9, #a9b39f);
  color: #465345;
  font-family: var(--studio-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.bonsai__loading span {
  width: 26px;
  height: 26px;
  border: 1px solid currentColor;
  border-radius: 50% 0 50% 50%;
  transform: rotate(-28deg);
  animation: bonsai-wake 1600ms ease-in-out infinite alternate;
}
.bonsai__loading p { margin: 0; }

.bonsai__status {
  position: absolute;
  z-index: 3;
  top: 22px;
  left: 22px;
  display: flex;
  min-width: 218px;
  align-items: stretch;
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / 0.38);
  border-radius: 18px;
  background: rgb(240 240 226 / 0.54);
  box-shadow: inset 0 1px rgb(255 255 255 / 0.48), 0 16px 45px rgb(36 44 34 / 0.11);
  backdrop-filter: blur(18px) saturate(115%);
}
.bonsai__status > p { display: grid; gap: 3px; margin: 0; padding: 11px 15px; }
.bonsai__status > p + p { border-left: 1px solid rgb(34 45 35 / 0.13); }
.bonsai__status span { font-family: var(--studio-display); font-size: 1.2rem; letter-spacing: -0.025em; }
.bonsai__status small {
  color: rgb(31 41 34 / 0.58);
  font-family: var(--studio-mono);
  font-size: 0.56rem;
  letter-spacing: 0.07em;
  line-height: 1.2;
  text-transform: uppercase;
}
.bonsai__seed span { max-width: 9ch; overflow: hidden; font-family: var(--studio-mono); font-size: 0.68rem; text-overflow: ellipsis; white-space: nowrap; }

.bonsai__guidance,
.bonsai__orbit,
.bonsai__message {
  position: absolute;
  z-index: 3;
  margin: 0;
  border: 1px solid rgb(255 255 255 / 0.32);
  background: rgb(33 43 35 / 0.52);
  box-shadow: inset 0 1px rgb(255 255 255 / 0.11), 0 12px 34px rgb(27 34 28 / 0.12);
  color: #faf8ec;
  backdrop-filter: blur(16px) saturate(110%);
}
.bonsai__guidance {
  bottom: 24px;
  left: 22px;
  width: min(290px, calc(100% - 44px));
  padding: 12px 15px;
  border-radius: 15px;
  font-family: var(--studio-display);
  font-size: 0.96rem;
  line-height: 1.3;
}
.bonsai__orbit {
  right: 22px;
  bottom: 96px;
  padding: 9px 13px;
  border-radius: 13px;
  background: rgb(33 43 35 / 0.7);
  color: rgb(250 248 236 / 0.92);
  font-family: var(--studio-mono);
  font-size: 0.57rem;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}
.bonsai__message {
  top: 82px;
  left: 50%;
  max-width: min(420px, calc(100% - 36px));
  padding: 10px 16px;
  border-radius: 15px;
  font-size: 0.82rem;
  line-height: 1.35;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -8px);
  transition: opacity 300ms ease, transform 360ms cubic-bezier(0.22, 1, 0.36, 1);
}
.bonsai__message.is-visible { opacity: 1; transform: translate(-50%, 0); }

.bonsai__tools {
  position: absolute;
  z-index: 4;
  bottom: 18px;
  left: 50%;
  display: flex;
  gap: 5px;
  padding: 6px;
  border: 1px solid rgb(255 255 255 / 0.38);
  border-radius: 21px;
  background: rgb(239 240 226 / 0.62);
  box-shadow: inset 0 1px rgb(255 255 255 / 0.64), 0 18px 52px rgb(28 37 29 / 0.2);
  transform: translateX(-50%);
  backdrop-filter: blur(22px) saturate(120%);
}
.bonsai__tools button {
  display: grid;
  min-width: 96px;
  min-height: 58px;
  grid-template-columns: 22px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 15px;
  background: transparent;
  color: rgb(31 41 34 / 0.68);
  cursor: pointer;
  text-align: left;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}
.bonsai__tools button:hover:not(:disabled) { background: rgb(255 255 255 / 0.4); color: var(--bonsai-ink); }
.bonsai__tools button:active:not(:disabled) { transform: translateY(1px); }
.bonsai__tools button[aria-pressed="true"] { border-color: rgb(33 48 38 / 0.17); background: rgb(35 54 40 / 0.88); color: #f4f2e6; }
.bonsai__tools button:disabled { cursor: wait; opacity: 0.56; }
.bonsai__tools svg { width: 21px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.6; }
.bonsai__tools span { font-size: 0.78rem; }
.bonsai__tools kbd {
  color: currentColor;
  font-family: var(--studio-mono);
  font-size: 0.53rem;
  font-weight: 400;
  opacity: 0.54;
}
.bonsai__tools .bonsai__next {
  min-width: 142px;
  border-color: rgb(38 55 42 / 0.22);
  background: rgb(235 218 171 / 0.72);
  color: #28342a;
}
.bonsai__tools .bonsai__next:hover:not(:disabled) { background: #f0dda9; }

.bonsai__reflection {
  position: absolute;
  z-index: 5;
  display: grid;
  inset: 0;
  padding: 86px 24px 96px;
  background: rgb(31 37 31 / 0.22);
  place-items: center;
  backdrop-filter: blur(5px) saturate(90%);
}
.bonsai__reflection > div {
  width: min(610px, 100%);
  padding: clamp(25px, 4vw, 42px);
  border: 1px solid rgb(58 51 42 / 0.28);
  outline: 1px solid rgb(255 255 255 / 0.5);
  outline-offset: -8px;
  background: rgb(244 240 225 / 0.94);
  box-shadow: 0 30px 80px rgb(31 27 22 / 0.3), inset 0 1px rgb(255 255 255 / 0.8);
  color: #29261f;
  animation: bonsai-reflection-in 520ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
.bonsai__reflection h2 { max-width: 14ch; margin: 10px 0 12px; font-family: var(--studio-display); font-size: clamp(2rem, 4vw, 3.4rem); font-weight: 400; letter-spacing: -0.055em; line-height: 0.94; }
.bonsai__reflection > div > p:not(.bonsai__ending-label) { margin: 0; color: rgb(41 38 31 / 0.62); line-height: 1.45; }
.bonsai__reflection-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 25px; }
.bonsai__reflection-actions button {
  display: grid;
  min-height: 92px;
  gap: 6px;
  align-content: center;
  padding: 16px 18px;
  border: 1px solid rgb(43 48 40 / 0.22);
  background: rgb(255 253 242 / 0.52);
  color: #2b302a;
  cursor: pointer;
  text-align: left;
  transition: background 180ms ease, border-color 180ms ease, transform 180ms ease;
}
.bonsai__reflection-actions button:hover { border-color: rgb(43 48 40 / 0.5); background: #fffdf2; }
.bonsai__reflection-actions button:active { transform: translateY(1px); }
.bonsai__reflection-actions strong { font-family: var(--studio-display); font-size: 1.15rem; font-weight: 400; }
.bonsai__reflection-actions span { color: rgb(43 48 40 / 0.6); font-size: 0.72rem; }

.bonsai__snip {
  position: absolute;
  z-index: 5;
  width: 38px;
  height: 38px;
  margin: -19px;
  border: 2px solid rgb(255 244 202 / 0.92);
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgb(255 245 207 / 0.18), 0 0 24px rgb(255 236 169 / 0.72);
  pointer-events: none;
  animation: bonsai-snip 700ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
.bonsai__snip::before,
.bonsai__snip::after {
  position: absolute;
  top: 17px;
  left: 7px;
  width: 23px;
  height: 2px;
  border-radius: 2px;
  background: #fff5cf;
  content: "";
  transform: rotate(32deg);
}
.bonsai__snip::after { transform: rotate(-32deg); }

.bonsai__ending {
  position: absolute;
  z-index: 5;
  display: grid;
  inset: 0;
  align-items: center;
  justify-items: end;
  padding: 88px clamp(24px, 6vw, 92px) 36px;
  background: linear-gradient(90deg, transparent 22%, rgb(26 23 21 / 0.04) 48%, rgb(22 20 18 / 0.36));
  pointer-events: none;
}
.bonsai__keepsake {
  width: min(460px, 42vw);
  padding: clamp(27px, 4vw, 46px);
  border: 1px solid rgb(50 43 36 / 0.3);
  outline: 1px solid rgb(255 255 255 / 0.46);
  outline-offset: -8px;
  background: rgb(244 239 224 / 0.9);
  box-shadow: 0 38px 90px rgb(26 20 16 / 0.28), inset 0 1px rgb(255 255 255 / 0.72);
  color: #29251f;
  pointer-events: auto;
  animation: bonsai-keepsake-in 900ms cubic-bezier(0.22, 1, 0.36, 1) both;
  backdrop-filter: blur(20px) saturate(105%);
}
.bonsai__ending-label {
  margin: 0;
  color: rgb(41 37 31 / 0.54);
  font-family: var(--studio-mono);
  font-size: 0.61rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}
.bonsai__keepsake h2,
.bonsai__fallback h2 {
  margin: 13px 0 18px;
  font-family: var(--studio-display);
  font-size: clamp(2.6rem, 5vw, 5rem);
  font-weight: 400;
  letter-spacing: -0.065em;
  line-height: 0.86;
}
.bonsai__keepsake > p:not(.bonsai__ending-label) { margin: 0; color: rgb(41 37 31 / 0.68); font-size: 0.91rem; line-height: 1.55; }
.bonsai__keepsake dl { display: grid; grid-template-columns: repeat(4, 1fr); margin: 26px 0 18px; border-block: 1px solid rgb(46 40 34 / 0.18); }
.bonsai__keepsake dl div { min-width: 0; padding: 13px 8px 13px 0; }
.bonsai__keepsake dl div + div { padding-left: 10px; border-left: 1px solid rgb(46 40 34 / 0.18); }
.bonsai__keepsake dt { color: rgb(41 37 31 / 0.52); font-family: var(--studio-mono); font-size: 0.54rem; letter-spacing: 0.07em; text-transform: uppercase; }
.bonsai__keepsake dd { max-width: 100%; margin: 5px 0 0; overflow: hidden; font-family: var(--studio-mono); font-size: 0.67rem; text-overflow: ellipsis; white-space: nowrap; }
.bonsai__gallery { margin: 0 0 20px; }
.bonsai__gallery > header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.bonsai__gallery > header p { margin: 0; font-family: var(--studio-display); font-size: 0.9rem; }
.bonsai__gallery > header small { color: rgb(41 37 31 / 0.45); font-family: var(--studio-mono); font-size: 0.48rem; letter-spacing: 0.05em; text-transform: uppercase; }
.bonsai__gallery > div { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 5px; padding-block: 6px; border-bottom: 3px solid rgb(67 47 32 / 0.58); }
.bonsai__gallery figure { min-width: 0; margin: 0; color: #404634; }
.bonsai__gallery svg { display: block; width: 100%; aspect-ratio: 1 / 0.85; border: 1px solid rgb(47 43 36 / 0.1); background: rgb(255 253 242 / 0.35); }
.bonsai__gallery-tree { fill: none; stroke: currentColor; stroke-linecap: round; stroke-width: 2.8; }
.bonsai__gallery-foliage { fill: currentColor; opacity: 0.42; }
.bonsai__gallery-pot { fill: #6f8e80; stroke: #30493f; stroke-width: 1; }
.bonsai__gallery figcaption { min-height: 2.3em; margin-top: 4px; overflow: hidden; color: rgb(41 37 31 / 0.72); font-family: var(--studio-mono); font-size: 0.45rem; font-weight: 500; line-height: 1.15; text-align: center; }
.bonsai__keepsake button {
  width: 100%;
  min-height: 50px;
  padding: 12px 18px;
  border: 1px solid #2b302a;
  background: #2b302a;
  color: #f5f1e3;
  cursor: pointer;
  font-size: 0.86rem;
  transition: background 180ms ease, transform 180ms ease;
}
.bonsai__keepsake button:hover { background: #4c5b49; }
.bonsai__keepsake button:active { transform: translateY(1px); }

.bonsai__fallback {
  position: absolute;
  z-index: 7;
  display: grid;
  inset: 0;
  place-content: center;
  justify-items: center;
  padding: 80px 24px 34px;
  background: radial-gradient(circle at 50% 35%, #dfe1d0, #a9b19f);
  color: #263129;
  text-align: center;
}
.bonsai__fallback svg { width: min(330px, 75vw); filter: drop-shadow(0 22px 22px rgb(40 50 39 / 0.18)); }
.bonsai__fallback h2 { margin-bottom: 14px; font-size: clamp(2.4rem, 8vw, 4.4rem); }
.bonsai__fallback > p:last-child { max-width: 42ch; margin: 0; color: rgb(38 49 41 / 0.68); line-height: 1.5; }

@keyframes bonsai-wake { from { transform: rotate(-32deg) scale(0.82); } to { transform: rotate(-18deg) scale(1.08); } }
@keyframes bonsai-snip { 0% { opacity: 0; transform: scale(0.28) rotate(-24deg); } 35% { opacity: 1; } 100% { opacity: 0; transform: scale(1.7) rotate(12deg); } }
@keyframes bonsai-shutter { 0%, 100% { opacity: 0; } 36% { opacity: 0.32; } 48% { opacity: 0.08; } }
@keyframes bonsai-keepsake-in { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: translateX(0); } }
@keyframes bonsai-reflection-in { from { opacity: 0; transform: translateY(18px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }

@media (max-width: 980px) {
  .bonsai__guidance { bottom: auto; top: 86px; }
  .bonsai__orbit { display: none; }
  .bonsai__ending { align-items: end; justify-items: center; padding: 80px 18px 18px; background: linear-gradient(180deg, transparent 23%, rgb(24 21 19 / 0.5)); }
  .bonsai__keepsake { width: min(560px, 100%); padding: 25px 28px 28px; }
  .bonsai__keepsake h2 { font-size: clamp(2.4rem, 8vw, 4rem); }
}

@media (min-width: 641px) and (max-width: 980px) {
  .bonsai__ending { align-items: center; justify-items: end; padding: 82px 28px 28px; background: linear-gradient(90deg, transparent 18%, rgb(26 23 21 / 0.06) 46%, rgb(22 20 18 / 0.4)); }
  .bonsai__keepsake { width: min(420px, 47vw); padding: 25px 27px 27px; }
  .bonsai__keepsake h2 { font-size: clamp(2.45rem, 5.2vw, 3.5rem); }
  .bonsai__keepsake dl { margin-block: 18px 14px; }
}

@media (max-width: 640px) {
  .game-dialog[data-game="bonsai"] .game-dialog__chrome { top: 8px; }
  .bonsai__status { top: 64px; left: 12px; min-width: 0; border-radius: 14px; }
  .bonsai__status > p { padding: 8px 10px; }
  .bonsai__status span { font-size: 0.98rem; }
  .bonsai__seed { display: none !important; }
  .bonsai__guidance { top: 128px; right: 12px; left: 12px; width: auto; padding: 10px 13px; font-size: 0.86rem; text-align: center; }
  .bonsai__message { top: 68px; left: auto; right: 12px; max-width: calc(100% - 132px); padding: 8px 11px; font-size: 0.7rem; text-align: right; transform: translateY(-6px); }
  .bonsai__message.is-visible { transform: translateY(0); }
  .bonsai__tools { right: 10px; bottom: max(10px, env(safe-area-inset-bottom)); left: 10px; gap: 3px; padding: 5px; border-radius: 18px; transform: none; }
  .bonsai__tools button { min-width: 0; min-height: 58px; flex: 1 1 0; grid-template-columns: 20px 1fr; gap: 6px; padding: 8px 9px; border-radius: 13px; }
  .bonsai__tools button kbd { display: none; }
  .bonsai__tools .bonsai__next { min-width: 0; flex: 1.35 1 0; }
  .bonsai__tools span { font-size: 0.7rem; }
  .bonsai__reflection { padding: 72px 12px 88px; }
  .bonsai__reflection > div { padding: 23px 21px 21px; }
  .bonsai__reflection h2 { font-size: clamp(2rem, 10vw, 2.8rem); }
  .bonsai__reflection-actions { grid-template-columns: 1fr; gap: 6px; margin-top: 18px; }
  .bonsai__reflection-actions button { min-height: 68px; padding: 11px 14px; }
  .bonsai__ending { padding: 70px 10px 10px; }
  .bonsai__keepsake { padding: 17px 19px 19px; }
  .bonsai__keepsake h2 { margin: 9px 0 10px; font-size: clamp(2.25rem, 11vw, 3.5rem); }
  .bonsai__keepsake > p:not(.bonsai__ending-label) { display: none; }
  .bonsai__keepsake dl { margin: 12px 0; }
  .bonsai__keepsake dl div { padding-block: 9px; }
  .bonsai__keepsake button { min-height: 46px; }
  .bonsai__keepsake dd { font-size: 0.6rem; }
  .bonsai__gallery { margin-bottom: 12px; }
  .bonsai__gallery > div { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .bonsai__gallery figure:nth-child(n + 5) { display: none; }
  .bonsai__gallery figcaption { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .bonsai__loading span,
  .bonsai__snip,
  .bonsai__flash,
  .bonsai__keepsake,
  .bonsai__reflection > div { animation: none !important; }
  .bonsai__vignette,
  .bonsai__message,
  .bonsai__tools button { transition-duration: 0.01ms !important; }
}

/* Worldsong ------------------------------------------------------------- */

.game-dialog[data-game="worldsong"] { background: #0b1020; }

.ws {
  position: relative;
  min-height: 100svh;
  overflow: clip;
  color: #e9eef7;
  background: #0b1020;
  font-family: var(--studio-sans);
}
.ws button, .ws input { font: inherit; }
.ws button:focus-visible, .ws input:focus-visible, .ws__canvas:focus-visible { outline: 3px solid #ffd79a; outline-offset: 3px; }
.ws__canvas { display: block; width: 100%; height: 100svh; }

.ws__kicker {
  margin: 0;
  color: #9fb0cd;
  font-family: var(--studio-mono);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.ws__landing {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 76px 18px 28px;
  background: radial-gradient(circle at 50% 34%, #1b2748, #0b1020 68%);
}
.ws__landing[hidden] { display: none; }
.ws__landing-card {
  width: min(560px, 100%);
  display: grid;
  gap: 14px;
}
.ws__landing-card h1 {
  margin: 0;
  font-family: var(--studio-display);
  font-size: clamp(2.1rem, 6vw, 3.1rem);
  font-weight: 400;
  line-height: 1.05;
}
.ws__landing-card p { margin: 0; color: #c4d0e4; line-height: 1.55; }
.ws__choices { display: grid; gap: 12px; margin-top: 4px; }
.ws__primary {
  min-height: 50px;
  padding: 12px 20px;
  border: 1px solid #f2e0c2;
  background: #f2e0c2;
  color: #131a2c;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}
.ws__primary:hover { background: #fff1d8; }
.ws__primary--ghost { border-color: #55618a; background: transparent; color: #e9eef7; }
.ws__primary--ghost:hover { background: #1c264a; }

/* Microphone is the highlighted default: a full-width hero with a live pulse. */
.ws__primary--hero {
  display: flex;
  align-items: center;
  gap: 16px;
  text-align: left;
  padding: 16px 22px;
  border-radius: 4px;
  background: linear-gradient(120deg, #f5e4c6, #f0d4b0);
  box-shadow: 0 14px 40px -20px rgb(242 224 194 / .8);
}
.ws__primary--hero:hover { transform: translateY(-1px); background: linear-gradient(120deg, #fff1d8, #f6ddba); }
.ws__hero-icon {
  flex: none;
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #131a2c;
}
.ws__hero-icon::before {
  content: "";
  position: absolute;
  inset: 9px 12px 6px;
  border-radius: 6px 6px 8px 8px;
  background: #f2e0c2;
}
.ws__hero-icon::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid #131a2c;
  opacity: 0;
  animation: ws-mic-pulse 2.4s ease-out infinite;
}
@keyframes ws-mic-pulse {
  0% { transform: scale(0.7); opacity: 0.5; }
  70% { opacity: 0; }
  100% { transform: scale(1.25); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .ws__hero-icon::after { animation: none; }
  .ws__primary { transition: none; }
}
.ws__hero-text { display: grid; gap: 2px; }
.ws__hero-text strong { font-size: 1.05rem; font-weight: 600; }

/* Everything past the microphone folds away behind a native disclosure. */
.ws__more {
  border: 1px solid rgb(233 238 247 / .16);
  border-radius: 4px;
  background: rgb(17 26 44 / .35);
}
.ws__more > summary {
  padding: 12px 16px;
  color: #c4d0e4;
  font-size: 0.86rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.ws__more > summary::-webkit-details-marker { display: none; }
.ws__more > summary::before {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 1.5px solid #9fb0cd;
  border-bottom: 1.5px solid #9fb0cd;
  transform: rotate(-45deg);
  transition: transform .15s ease;
}
.ws__more[open] > summary::before { transform: rotate(45deg); }
.ws__more > summary:hover { color: #e9eef7; }
.ws__more-body {
  display: grid;
  gap: 14px;
  padding: 4px 16px 16px;
}

.ws__aside {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
  padding-top: 2px;
}
.ws__primary--mini { min-height: 38px; padding: 8px 14px; font-size: 0.86rem; }

.ws__file { display: grid; gap: 6px; color: #9fb0cd; font-size: 0.82rem; }
.ws__aside .ws__file { flex: 1; min-width: 180px; }
.ws__note { color: #8fa0bd; font-size: 0.8rem; }
.ws__error { color: #ffc9a8; }
.ws__error[hidden] { display: none; }

.ws__hud {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: grid;
  align-content: space-between;
  padding: 74px clamp(14px, 3vw, 30px) clamp(16px, 3vh, 28px);
  pointer-events: none;
}
.ws__hud[hidden] { display: none; }
.ws__hud > * { pointer-events: auto; }
.ws__status { display: grid; gap: 4px; }
.ws__foot { display: grid; justify-items: start; }
.ws__event {
  margin: 0;
  font-family: var(--studio-mono);
  font-size: clamp(0.82rem, 2.4vw, 0.96rem);
  text-shadow: 0 1px 12px rgb(6 10 22 / .85);
}
.ws__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin: 0 0 12px;
  justify-self: start;
  padding: 10px 14px;
  border: 1px solid rgb(233 238 247 / .16);
  border-radius: 2px;
  background: rgb(9 13 27 / .55);
  font-size: 0.78rem;
}
.ws__legend div { display: grid; gap: 2px; }
.ws__legend dt { color: #90a2c1; font-family: var(--studio-mono); font-size: 0.64rem; letter-spacing: 0.1em; text-transform: uppercase; }
.ws__legend dd { margin: 0; }
.ws__finish {
  justify-self: start;
  min-height: 46px;
  padding: 10px 18px;
  border: 1px solid #55618a;
  background: rgb(9 13 27 / .72);
  color: #e9eef7;
  cursor: pointer;
}
.ws__finish:hover { background: #1c264a; }
.ws__loading {
  position: absolute;
  z-index: 3;
  inset: auto 0 42px;
  margin: 0;
  color: #9fb0cd;
  font-family: var(--studio-mono);
  font-size: 0.8rem;
  text-align: center;
}
.ws__loading[hidden] { display: none; }

@media (max-width: 640px) {
  .ws__hud { padding-top: 66px; }
  .ws__legend { gap: 6px 14px; font-size: 0.72rem; }
}

.ws__ending {
  position: absolute;
  z-index: 3;
  inset: 0;
  display: grid;
  align-content: end;
  padding: 0 clamp(14px, 3vw, 30px) clamp(16px, 3vh, 28px);
  pointer-events: none;
}
.ws__ending[hidden] { display: none; }
.ws__inspect {
  position: absolute;
  z-index: 3;
  top: 74px;
  right: clamp(14px, 3vw, 30px);
  width: min(340px, calc(100% - 28px));
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid rgb(233 238 247 / .18);
  border-radius: 2px;
  background: rgb(9 13 27 / .8);
  backdrop-filter: blur(6px);
  font-size: 0.86rem;
  line-height: 1.5;
  color: #e9eef7;
}
.ws__inspect[hidden] { display: none; }
.ws__inspect p { margin: 0; }
.ws__inspect .ws__open { justify-self: start; }
@media (max-width: 640px) {
  .ws__inspect { top: auto; right: 10px; bottom: 120px; left: 10px; width: auto; font-size: 0.8rem; }
}
.ws__minimize {
  pointer-events: auto;
  justify-self: start;
  margin-bottom: 8px;
  min-height: 36px;
  padding: 6px 12px;
  border: 1px solid #55618a;
  background: rgb(9 13 27 / .72);
  color: #e9eef7;
  font-size: 0.8rem;
  cursor: pointer;
}
.ws__minimize:hover { background: #1c264a; }
.ws__card[hidden] { display: none; }
.ws__canvas { cursor: grab; touch-action: none; }
.ws__canvas:active { cursor: grabbing; }
.ws__card {
  pointer-events: auto;
  width: min(640px, 100%);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 18px;
  padding: 16px 18px;
  border: 1px solid rgb(233 238 247 / .18);
  border-radius: 2px;
  background: rgb(9 13 27 / .78);
  backdrop-filter: blur(6px);
}
.ws__card h2 {
  grid-column: 2;
  margin: 0;
  font-family: var(--studio-display);
  font-size: clamp(1.4rem, 3.6vw, 2rem);
  font-weight: 400;
  line-height: 1.1;
}
.ws__card > .ws__kicker { grid-column: 2; }
.ws__card p { grid-column: 2; margin: 0; color: #c4d0e4; font-size: 0.88rem; line-height: 1.5; }
.ws__core { grid-column: 1; grid-row: 1 / span 4; width: 54px; height: 150px; border: 1px solid rgb(233 238 247 / .2); background: #060913; }
.ws__map { grid-column: 1; width: 54px; height: 54px; border: 1px solid rgb(233 238 247 / .2); image-rendering: pixelated; }
.ws__card-actions { grid-column: 2; display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.ws__encore { grid-column: 2; display: grid; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid #2a3454; }
.ws__encore .ws__card-actions { margin-top: 0; align-items: center; }
.ws__card-actions .ws__primary { min-height: 44px; padding: 10px 16px; }
.ws__shelf { grid-column: 1 / -1; display: grid; gap: 8px; margin: 6px 0 0; padding: 0; list-style: none; }
.ws__shelf-title { grid-column: 1 / -1; margin: 8px 0 0; }
.ws__shelf li { display: grid; grid-template-columns: 36px 1fr auto; gap: 10px; align-items: center; font-size: 0.8rem; color: #c4d0e4; }
.ws__shelf-actions { display: flex; gap: 6px; }
.ws__open { min-height: 34px; padding: 6px 12px; border: 1px solid #55618a; background: rgb(9 13 27 / .72); color: #e9eef7; cursor: pointer; }
.ws__open:hover { background: #1c264a; }
.ws__landing-card .ws__shelf { margin-top: 0; }
.ws__shelf img { width: 36px; height: 36px; border: 1px solid rgb(233 238 247 / .2); image-rendering: pixelated; }
.ws__shelf time { display: block; color: #8fa0bd; font-family: var(--studio-mono); font-size: 0.66rem; }
@media (max-width: 640px) {
  .ws__ending { padding: 0 10px 10px; }
  .ws__card { max-height: 52svh; overflow: auto; gap: 6px 12px; padding: 12px; }
  .ws__card h2 { font-size: 1.3rem; }
  .ws__card p { font-size: 0.8rem; }
  .ws__core { width: 40px; height: 110px; }
  .ws__card > .ws__note { display: none; }
}

.ws__modes { display: grid; gap: 10px; margin: 0; padding: 0; border: 0; }
.ws__modes legend { padding: 0; margin-bottom: 2px; }
/* Selectable cards, not radio dots: the whole tile lights up when picked. */
.ws__mode {
  display: grid;
  gap: 3px;
  padding: 13px 16px;
  border: 1px solid rgb(233 238 247 / .16);
  border-radius: 4px;
  background: rgb(17 26 44 / .35);
  line-height: 1.45;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.ws__mode input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.ws__mode > span { display: grid; gap: 3px; }
.ws__mode strong { color: #e9eef7; font-weight: 600; font-size: 0.96rem; }
.ws__mode small { color: #9fb0cd; font-size: 0.82rem; }
.ws__mode:hover { border-color: #55618a; background: rgb(28 38 74 / .5); }
.ws__mode:has(input:checked) { border-color: #f2e0c2; background: rgb(242 224 194 / .09); }
.ws__mode:has(input:focus-visible) { outline: 2px solid #f2e0c2; outline-offset: 2px; }
.ws__era { display: grid; gap: 4px; width: min(280px, 60vw); margin-top: 6px; font-family: var(--studio-mono); font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: #dfe6f4; text-shadow: 0 1px 12px rgb(6 10 22 / .85); }
.ws__era[hidden] { display: none; }
.ws__era-bar { display: block; height: 4px; background: rgb(233 238 247 / .18); }
.ws__era-fill { display: block; width: 0; height: 100%; background: #f2e0c2; transition: width .4s linear; }
.ws__title {
  position: absolute;
  z-index: 3;
  inset: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 8px;
  padding: 0 24px;
  text-align: center;
  pointer-events: none;
  background: radial-gradient(ellipse at center, rgb(6 9 19 / .55), transparent 70%);
  animation: ws-title 4.2s ease-out both;
}
.ws__title[hidden] { display: none; }
.ws__title h2 { margin: 0; font-family: var(--studio-display); font-size: clamp(2.6rem, 9vw, 5rem); font-weight: 400; line-height: 1; letter-spacing: 0.04em; }
.ws__title p:last-child { max-width: 34ch; margin: 0; color: #dfe6f4; font-size: clamp(0.88rem, 2.4vw, 1.02rem); line-height: 1.5; text-shadow: 0 1px 12px rgb(6 10 22 / .9); }
@keyframes ws-title {
  0% { opacity: 0; transform: translateY(8px); }
  12% { opacity: 1; transform: none; }
  80% { opacity: 1; }
  100% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .ws__title { animation: none; }
  .ws__era-fill { transition: none; }
}
/* Roundabout God */
.game-dialog[data-game="roundabout"] {
  background: #182c25;
}
.game-dialog[data-game="roundabout"] .game-dialog__chrome {
  border: 1px solid rgb(32 50 43 / 0.15);
  background: rgb(249 246 225 / 0.88);
  color: #24342f;
  box-shadow: 0 10px 28px rgb(18 35 29 / 0.2);
  backdrop-filter: blur(12px);
}
.game-dialog[data-game="roundabout"] .game-dialog__count { display: none; }
.roundabout-game {
  --roundabout-ink: #26352f;
  --roundabout-paper: #fff7df;
  --roundabout-red: #e55448;
  --roundabout-green: #62c677;
  position: relative;
  width: 100%;
  height: 100svh;
  min-height: 620px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 44%, #c8e39a 0 34%, transparent 63%),
    linear-gradient(145deg, #79aa63, #436d55);
  color: var(--roundabout-ink);
  isolation: isolate;
}
.roundabout-canvas {
  position: absolute;
  z-index: 0;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  outline: none;
  touch-action: none;
}
.roundabout-canvas:focus-visible {
  box-shadow: inset 0 0 0 4px #fff3a3;
}
.roundabout-hud {
  position: absolute;
  z-index: 3;
  top: 76px;
  right: clamp(16px, 2.6vw, 34px);
  left: clamp(16px, 2.6vw, 34px);
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 24px;
  pointer-events: none;
}
.roundabout-title {
  color: #fff9e6;
  filter: drop-shadow(0 2px 2px rgb(25 47 36 / 0.35));
}
.roundabout-title p,
.roundabout-phase,
.roundabout-pressure > span,
.roundabout-guide > p,
.roundabout-report__card > p {
  margin: 0;
  font-family: var(--studio-mono);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.roundabout-title h1 {
  margin: 3px 0 0;
  font-family: var(--studio-display);
  font-size: clamp(2.25rem, 4.8vw, 4.6rem);
  font-weight: 400;
  letter-spacing: -0.065em;
  line-height: 0.84;
}
.roundabout-readouts {
  display: flex;
  align-items: stretch;
  gap: 7px;
  padding: 6px;
  border: 1px solid rgb(38 53 47 / 0.16);
  border-radius: 15px;
  background: rgb(255 247 223 / 0.92);
  box-shadow: 0 12px 28px rgb(20 43 33 / 0.2);
  pointer-events: auto;
  backdrop-filter: blur(10px);
}
.roundabout-readouts span {
  display: grid;
  min-width: 58px;
  align-content: center;
  padding: 3px 10px;
  border-right: 1px solid rgb(38 53 47 / 0.14);
}
.roundabout-readouts small {
  color: #627069;
  font-family: var(--studio-mono);
  font-size: 0.54rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.roundabout-readouts strong {
  margin-top: 1px;
  font-family: var(--studio-mono);
  font-size: 0.93rem;
  font-variant-numeric: tabular-nums;
}
.roundabout-readouts button,
.roundabout-guide button,
.roundabout-report button {
  min-height: 44px;
  border: 1px solid var(--roundabout-ink);
  border-radius: 10px;
  background: var(--roundabout-ink);
  color: var(--roundabout-paper);
  cursor: pointer;
  font-family: var(--studio-mono);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.roundabout-readouts button { padding: 8px 13px; }
.roundabout-readouts button:hover,
.roundabout-readouts button:focus-visible,
.roundabout-guide button:hover,
.roundabout-guide button:focus-visible,
.roundabout-report button:hover,
.roundabout-report button:focus-visible {
  background: #e8b945;
  color: #27352f;
}
.roundabout-phase {
  position: absolute;
  z-index: 2;
  bottom: 24px;
  left: clamp(16px, 2.6vw, 34px);
  max-width: 40vw;
  padding: 9px 12px;
  border: 1px solid rgb(255 247 223 / 0.36);
  border-radius: 8px;
  background: rgb(31 52 43 / 0.72);
  color: #fff7df;
  box-shadow: 0 8px 22px rgb(19 36 29 / 0.18);
  backdrop-filter: blur(7px);
}
.roundabout-pressure {
  position: absolute;
  z-index: 2;
  right: clamp(16px, 2.6vw, 34px);
  bottom: 20px;
  display: grid;
  width: min(250px, 42vw);
  grid-template-columns: auto minmax(75px, 1fr);
  align-items: center;
  gap: 5px 10px;
  padding: 10px 12px;
  border: 1px solid rgb(255 247 223 / 0.36);
  border-radius: 10px;
  background: rgb(31 52 43 / 0.76);
  color: #fff7df;
  box-shadow: 0 8px 22px rgb(19 36 29 / 0.18);
  backdrop-filter: blur(7px);
}
.roundabout-pressure i {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.22);
}
.roundabout-pressure b {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #72d483 0 34%, #edc54f 58%, #e55448 100%);
  transition: width 240ms ease;
}
.roundabout-pressure strong {
  grid-column: 1 / -1;
  min-height: 0.75em;
  color: #ffd8c8;
  font-family: var(--studio-mono);
  font-size: 0.61rem;
  letter-spacing: 0.05em;
  text-align: right;
  text-transform: uppercase;
}
.roundabout-signal {
  position: absolute;
  z-index: 4;
  display: grid;
  width: 62px;
  min-height: 70px;
  place-items: center;
  padding: 3px;
  border: 0;
  border-radius: 15px;
  background: rgb(255 247 223 / 0.88);
  color: #24342f;
  cursor: pointer;
  box-shadow: 0 7px 14px rgb(18 29 25 / 0.28);
  transform: translate(-50%, -50%);
  transition: transform 150ms ease, box-shadow 150ms ease;
  touch-action: manipulation;
}
.roundabout-signal:hover,
.roundabout-signal:focus-visible {
  box-shadow: 0 0 0 4px #fff3a3, 0 9px 19px rgb(18 29 25 / 0.32);
  transform: translate(-50%, -50%) scale(1.06);
}
.roundabout-signal:active { transform: translate(-50%, -50%) scale(0.96); }
.roundabout-signal:disabled { cursor: default; opacity: 0.48; }
.roundabout-signal.is-guided {
  box-shadow: 0 0 0 5px #fff3a3, 0 0 0 11px rgb(255 243 163 / 0.3), 0 10px 24px rgb(18 29 25 / 0.34);
  animation: roundabout-signal-pulse 1.1s ease-in-out infinite alternate;
}
.roundabout-signal__body {
  display: grid;
  width: 23px;
  gap: 3px;
  padding: 3px;
  border-radius: 6px;
  background: #26312d;
  box-shadow: inset 0 1px 1px rgb(255 255 255 / 0.18);
}
.roundabout-signal__body i {
  width: 17px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #772d2b;
  box-shadow: inset 0 -2px 3px rgb(10 14 12 / 0.4);
}
.roundabout-signal__body i:last-child { background: #275f36; }
.roundabout-signal:not(.is-green) .roundabout-signal__body i:first-child { background: var(--roundabout-red); box-shadow: 0 0 9px rgb(229 84 72 / 0.7); }
.roundabout-signal.is-green .roundabout-signal__body i:last-child { background: var(--roundabout-green); box-shadow: 0 0 9px rgb(98 198 119 / 0.72); }
.roundabout-signal__label {
  display: flex;
  align-items: center;
  gap: 2px;
  font-family: var(--studio-mono);
  font-size: 0.55rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  white-space: nowrap;
  text-transform: uppercase;
}
.roundabout-signal kbd {
  display: grid;
  min-width: 16px;
  min-height: 16px;
  place-items: center;
  border: 1px solid rgb(38 53 47 / 0.25);
  border-radius: 5px;
  background: #fffdf2;
  font: inherit;
}
.roundabout-signal__label em {
  display: grid;
  min-width: 16px;
  min-height: 16px;
  place-items: center;
  border-radius: 999px;
  background: #e8b945;
  color: #26352f;
  font: inherit;
  font-style: normal;
}
.roundabout-notice {
  position: absolute;
  z-index: 3;
  top: 158px;
  left: 50%;
  width: min(520px, calc(100% - 32px));
  padding: 11px 17px;
  border: 1px solid rgb(38 53 47 / 0.22);
  border-radius: 11px;
  background: rgb(255 247 223 / 0.94);
  box-shadow: 0 12px 30px rgb(28 46 38 / 0.24);
  font-family: var(--studio-mono);
  font-size: clamp(0.67rem, 1.1vw, 0.8rem);
  font-weight: 750;
  line-height: 1.4;
  text-align: center;
  transform: translateX(-50%);
  backdrop-filter: blur(8px);
}
.roundabout-notice[hidden],
.roundabout-guide[hidden],
.roundabout-report[hidden] { display: none; }
.roundabout-guide {
  position: absolute;
  z-index: 6;
  display: grid;
  width: min(360px, calc(100% - 32px));
  gap: 10px;
  padding: 20px;
  border: 1px solid #27352f;
  border-radius: 16px;
  background: #fff7df;
  box-shadow: 8px 10px 0 rgb(31 52 43 / 0.3), 0 20px 60px rgb(21 38 31 / 0.35);
}
.roundabout-guide--first {
  right: clamp(18px, 4vw, 60px);
  bottom: 88px;
}
.roundabout-guide--quick {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
.roundabout-guide h2 {
  margin: 0;
  font-family: var(--studio-display);
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 400;
  letter-spacing: -0.05em;
  line-height: 0.95;
}
.roundabout-guide > span {
  color: #4f5d57;
  font-size: 0.9rem;
  line-height: 1.5;
}
.roundabout-guide button { justify-self: start; margin-top: 3px; padding: 9px 14px; }
.roundabout-game.has-guide::after {
  position: absolute;
  z-index: 5;
  inset: 0;
  background: rgb(20 37 30 / 0.18);
  content: "";
  pointer-events: none;
}
.roundabout-game.has-guide .roundabout-guide,
.roundabout-game.has-guide .roundabout-signal.is-guided { z-index: 7; }
.roundabout-report {
  position: absolute;
  z-index: 8;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 90px 20px 24px;
  overflow: auto;
  background: rgb(19 36 29 / 0.74);
  backdrop-filter: blur(11px);
}
.roundabout-report__card {
  width: min(760px, 100%);
  padding: clamp(24px, 4vw, 44px);
  border: 1px solid #26352f;
  border-radius: 18px;
  background: #fff7df;
  box-shadow: 10px 12px 0 rgb(17 31 26 / 0.28), 0 26px 80px rgb(8 20 15 / 0.42);
}
.roundabout-report__heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 7px 0 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgb(38 53 47 / 0.22);
}
.roundabout-report__heading h2 {
  margin: 0;
  font-family: var(--studio-display);
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 400;
  letter-spacing: -0.065em;
  line-height: 0.82;
}
.bake-header h1 i { color: var(--bake-rust); font-weight: 400; }
.bake-header > p { max-width: 42ch; margin: 0; color: var(--bake-muted); line-height: 1.55; }

/* The recipe rack ------------------------------------------------------- */

.bake-cards {
  display: grid;
  width: min(1480px, 100%);
  grid-template-columns: repeat(auto-fit, minmax(238px, 1fr));
  gap: clamp(14px, 1.8vw, 26px);
  margin-inline: auto;
}
.bake-card {
  position: relative;
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 26px 20px 18px;
  border: 1px solid var(--bake-rule);
  background: var(--bake-paper);
  box-shadow: 7px 9px 0 rgb(42 33 24 / 0.14);
  color: var(--bake-ink);
  cursor: pointer;
  text-align: left;
  transform: rotate(var(--card-tilt, -0.7deg));
  transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 220ms ease;
}
.bake-card:nth-child(even) { --card-tilt: 0.9deg; }
.bake-card:nth-child(3n) { --card-tilt: -1.4deg; }
.bake-card:hover,
.bake-card:focus-visible { box-shadow: 10px 13px 0 rgb(42 33 24 / 0.2); transform: rotate(0deg) translateY(-4px); }
.bake-card__pin {
  position: absolute;
  top: -7px;
  left: 50%;
  width: 54px;
  height: 15px;
  background: rgb(198 176 133 / 0.85);
  transform: translateX(-50%) rotate(-2deg);
}
.bake-card__number { color: var(--bake-rust); font-family: var(--studio-mono); font-size: 0.6rem; letter-spacing: 0.09em; }
.bake-card strong { font-family: var(--studio-display); font-size: clamp(1.5rem, 2.1vw, 2.1rem); font-weight: 400; letter-spacing: -0.04em; line-height: 0.98; }
.bake-card p { margin: 0; color: var(--bake-muted); font-size: 0.82rem; line-height: 1.45; }
.bake-card__needs { color: var(--bake-green); font-family: var(--studio-mono); font-size: 0.55rem; letter-spacing: 0.07em; text-transform: uppercase; }

/* The counter ----------------------------------------------------------- */

.bake-counter-header {
  display: grid;
  width: min(1480px, 100%);
  grid-template-columns: minmax(210px, 0.4fr) minmax(0, 1fr) minmax(280px, 0.7fr);
  gap: clamp(20px, 3vw, 52px);
  align-items: end;
  margin: 0 auto 22px;
}
.bake-counter-header h1 {
  margin: 0;
  font-family: var(--studio-display);
  font-size: clamp(1.7rem, 2.6vw, 2.7rem);
  font-weight: 400;
  letter-spacing: -0.055em;
  line-height: 0.9;
}
.bake-counter-header button {
  display: grid;
  gap: 4px;
  padding: 12px 0;
  border: 0;
  border-block: 1px solid var(--bake-rule);
  background: transparent;
  color: var(--bake-ink);
  cursor: pointer;
  text-align: left;
}
.bake-counter-header button:hover,
.bake-counter-header button:focus-visible { padding-left: 10px; background: var(--bake-paper-deep); }
.bake-counter-header button span { color: var(--bake-muted); font-family: var(--studio-mono); font-size: 0.5rem; letter-spacing: 0.08em; text-transform: uppercase; }
.bake-counter-header button strong { font-family: var(--studio-display); font-size: 0.92rem; font-weight: 400; }

.bake-progress { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; padding: 0; border-top: 1px solid var(--bake-rule); list-style: none; }
.bake-progress li { display: grid; gap: 5px; padding: 11px 10px 0; border-right: 1px solid var(--bake-rule); color: var(--bake-muted); }
.bake-progress li:last-child { border-right: 0; }
.bake-progress span { width: 18px; height: 18px; border: 1px solid currentColor; border-radius: 50%; font-family: var(--studio-mono); font-size: 0.48rem; line-height: 16px; text-align: center; }
.bake-progress strong { font-family: var(--studio-display); font-size: 0.76rem; font-weight: 400; }
.bake-progress li.is-current { color: var(--bake-rust); }
.bake-progress li.is-current span { background: var(--bake-rust); color: var(--bake-paper); }
.bake-progress li.is-done { color: var(--bake-green); }
.bake-progress li.is-done span { background: var(--bake-green); color: var(--bake-paper); }

.bake-workspace {
  display: grid;
  width: min(1480px, 100%);
  min-height: 548px;
  grid-template-columns: minmax(230px, 0.5fr) minmax(330px, 1fr) minmax(320px, 0.95fr);
  margin-inline: auto;
  border: 1px solid var(--bake-rule);
  background: rgb(247 241 231 / 0.88);
  box-shadow: 0 28px 80px rgb(42 33 24 / 0.15);
}
.bake-workspace[data-stage="mix"],
.bake-workspace[data-stage="oven"] { grid-template-columns: minmax(190px, 0.26fr) minmax(0, 1fr); }
.bake-recipe-panel,
.bake-stage,
.bake-pantry { min-width: 0; padding: clamp(18px, 2.2vw, 32px); }
.bake-recipe-panel { border-right: 1px solid var(--bake-rule); background: rgb(244 236 222 / 0.8); }
/* The panel is a <details>: a static header on desktop (kept open, no toggle),
   a tappable disclosure below 960px where stacking it above the stage would
   otherwise bury the bowl. */
.bake-recipe-panel > summary { position: relative; display: block; cursor: pointer; list-style: none; }
.bake-recipe-panel > summary::-webkit-details-marker { display: none; }
.bake-recipe-panel > summary::after {
  content: "";
  position: absolute;
  top: 8px;
  right: 2px;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--bake-muted);
  border-bottom: 2px solid var(--bake-muted);
  transform: rotate(45deg);
  transition: transform 160ms ease;
}
.bake-recipe-panel[open] > summary::after { transform: rotate(-135deg); }
@media (min-width: 961px) {
  .bake-recipe-panel > summary { pointer-events: none; }
  .bake-recipe-panel > summary::after { display: none; }
}
.bake-recipe-panel h2 { margin: 6px 0 9px; font-family: var(--studio-display); font-size: clamp(1.15rem, 1.6vw, 1.6rem); font-weight: 400; letter-spacing: -0.05em; line-height: 0.94; }
.bake-recipe-panel[open] > summary h2 { margin-bottom: 13px; }
.bake-recipe-panel__card { margin: 0 0 13px; color: var(--bake-muted); font-size: 0.72rem; line-height: 1.45; }
.bake-recipe-panel__list { display: grid; gap: 0; margin: 0; padding: 0; border-top: 1px solid var(--bake-rule); list-style: none; }
.bake-recipe-panel__list li { padding: 6px 0; border-bottom: 1px solid var(--bake-rule); font-family: var(--studio-mono); font-size: 0.56rem; letter-spacing: 0.03em; text-transform: uppercase; }

.bake-stage {
  position: relative;
  display: flex;
  overflow: hidden;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
  border-right: 1px solid var(--bake-rule);
  background: #e6e0d2;
  isolation: isolate;
}
/* The kitchen plate sits well behind the work, washed back far enough that the
   bowl and the oven stay the only things worth looking at. */
.bake-stage::before {
  position: absolute;
  z-index: -2;
  inset: 0;
  background: var(--bake-kitchen) center 62% / cover no-repeat;
  content: "";
  filter: saturate(0.5) brightness(1.12) contrast(0.88);
  opacity: 0.32;
}
.bake-stage::after {
  position: absolute;
  z-index: -1;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 44%, rgb(252 249 242 / 0.86), transparent 62%),
    repeating-linear-gradient(90deg, transparent 0 39px, rgb(42 33 24 / 0.03) 40px);
  content: "";
  pointer-events: none;
}
.bake-stage__actions { display: grid; width: min(320px, 100%); gap: 6px; margin-top: auto; justify-items: stretch; }
.bake-go,
.bake-quiet { min-height: 40px; padding: 9px 14px; border: 1px solid var(--bake-ink); cursor: pointer; font-size: 0.8rem; }
.bake-go { background: var(--bake-ink); color: var(--bake-paper); }
.bake-quiet { background: transparent; color: var(--bake-ink); }
.bake-go:hover,
.bake-go:focus-visible { background: var(--bake-green); }
.bake-quiet:hover,
.bake-quiet:focus-visible { background: var(--bake-paper-deep); }
.bake-go:disabled { cursor: not-allowed; opacity: 0.38; }
.bake-requirement { margin: 0; color: var(--bake-muted); font-size: 0.64rem; text-align: center; }

/* Paper objects: a clean cutout sits bare, a scrap gets a torn mount. */
.bake-object { position: relative; display: block; }
.bake-object img { display: block; width: 100%; height: 100%; object-fit: contain; }
.bake-object--cut img { filter: drop-shadow(0 5px 5px rgb(42 33 24 / 0.26)); }
.bake-object--scrap {
  padding: 4px;
  background: var(--bake-paper);
  box-shadow: 3px 4px 0 rgb(42 33 24 / 0.22);
  clip-path: polygon(2% 4%, 26% 0, 54% 3%, 78% 0, 100% 5%, 97% 32%, 100% 62%, 98% 96%, 71% 100%, 43% 97%, 18% 100%, 0 95%, 3% 61%, 0 33%);
}
.bake-object--scrap img { object-fit: cover; }

/* The paper diorama: a back wall, a worktop slab, and props standing on it -- */

.bake-diorama {
  position: relative;
  width: 100%;
  flex: 1 1 auto;
  min-height: 322px;
  isolation: isolate;
}
.bake-workspace[data-stage="mix"] .bake-diorama,
.bake-workspace[data-stage="oven"] .bake-diorama { min-height: 530px; }
.bake-diorama__wall {
  position: absolute;
  z-index: 0;
  inset: 0 0 26% 0;
  background:
    repeating-linear-gradient(92deg, transparent 0 26px, rgb(96 78 52 / 0.035) 27px),
    repeating-linear-gradient(2deg, transparent 0 19px, rgb(96 78 52 / 0.028) 20px),
    linear-gradient(178deg, #efe7d6, #e2d8c2);
  box-shadow: inset 0 -14px 22px rgb(72 58 40 / 0.13);
  /* A hand-cut top edge, so the wall reads as a paper flat and not a div. */
  clip-path: polygon(0 3%, 12% 0, 27% 2%, 41% 0, 58% 3%, 73% 0, 88% 2%, 100% 0, 100% 100%, 0 100%);
}
/* A shelf rail across the back wall adds the second plane a diorama needs. */
.bake-diorama__rail {
  position: absolute;
  z-index: 1;
  top: 22%;
  right: 6%;
  left: 6%;
  height: 11px;
  background: linear-gradient(180deg, #d8c9a8, #bda87f);
  box-shadow: 0 7px 10px rgb(72 58 40 / 0.22);
  clip-path: polygon(0 8%, 4% 0, 96% 4%, 100% 0, 100% 100%, 0 96%);
}
.bake-diorama__prop {
  position: absolute;
  z-index: 3;
  right: 0;
  bottom: 25%;
  left: 0;
  display: flex;
  justify-content: center;
}
/* The worktop the props stand on, torn along its front edge. */
.bake-diorama__top {
  position: absolute;
  z-index: 2;
  right: -2%;
  bottom: 8%;
  left: -2%;
  height: 20%;
  background:
    repeating-linear-gradient(90deg, transparent 0 33px, rgb(88 68 40 / 0.06) 34px),
    linear-gradient(178deg, #ddcdaa 0 24%, #cbb890 25%, #b6a074);
  box-shadow: 0 -6px 16px rgb(72 58 40 / 0.16), inset 0 3px 0 rgb(255 251 240 / 0.5);
  clip-path: polygon(0 6%, 9% 1%, 23% 7%, 38% 2%, 52% 8%, 67% 2%, 81% 7%, 93% 1%, 100% 6%, 100% 100%, 0 100%);
}
.bake-diorama__lip {
  position: absolute;
  z-index: 6;
  right: -3%;
  bottom: -1%;
  left: -3%;
  height: 10%;
  background: #6f6446;
  filter: drop-shadow(0 -5px 6px rgb(48 38 24 / 0.28));
  opacity: 0.92;
  clip-path: polygon(0 34%, 14% 16%, 31% 38%, 48% 14%, 66% 36%, 82% 15%, 100% 32%, 100% 100%, 0 100%);
}
.bake-diorama__hint {
  position: absolute;
  z-index: 7;
  right: 0;
  bottom: 1%;
  left: 0;
  margin: 0;
  color: #4a4130;
  font-family: var(--studio-mono);
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  text-align: center;
  text-transform: uppercase;
}
/* The gather checklist: what the card needs, ticking off as each lands. */
.bake-checklist {
  position: absolute;
  z-index: 7;
  top: 4%;
  right: 0;
  left: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: center;
  margin: 0;
  padding: 0 8px;
  list-style: none;
}
.bake-checklist li {
  padding: 3px 9px 3px 20px;
  border: 1px solid rgb(58 44 26 / 0.25);
  border-radius: 999px;
  background: rgb(249 244 232 / 0.86);
  color: var(--bake-muted);
  font-family: var(--studio-mono);
  font-size: 0.56rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  background-image: radial-gradient(circle at 10px 50%, transparent 4px, rgb(58 44 26 / 0.28) 4px 5px, transparent 5px);
}
.bake-checklist li.is-in {
  border-color: var(--bake-green);
  background: #dfe7db;
  color: var(--bake-green);
  /* A filled tick dot once it is in the bowl. */
  background-image: radial-gradient(circle at 10px 50%, var(--bake-green) 4px, transparent 5px);
}

/* The bowl: two paper flats with the ingredients sandwiched between them. */
.bake-bowl {
  position: relative;
  z-index: 3;
  width: min(78%, 330px);
  aspect-ratio: 200 / 132;
  rotate: var(--bowl-rock, 0deg);
  transition: rotate 120ms linear;
}
.bake-workspace[data-stage="mix"] .bake-bowl { width: min(60%, 430px); }
.bake-workspace[data-stage="oven"] .bake-oven { width: min(58%, 460px); }
.bake-bowl__flat { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.bake-bowl__flat--back { z-index: 1; }
.bake-bowl__flat--front { z-index: 3; }
.bake-bowl__well { fill: #cdbb96; stroke: #efe6d2; stroke-width: 1.6; }
.bake-bowl__mouth { fill: #8d7b58; stroke: #b6a681; stroke-width: 1.4; }
.bake-bowl__wall {
  fill: #f3ecdb;
  stroke: #fffdf6;
  stroke-width: 2;
  filter: drop-shadow(0 -4px 6px rgb(72 58 40 / 0.3));
}
.bake-bowl__band { fill: #ddcfae; opacity: 0.85; }
.bake-bowl__contents { position: absolute; z-index: 2; inset: 9% 12% 30%; rotate: var(--batter-spin, 0deg); }
.bake-bowl__piece {
  position: absolute;
  z-index: var(--piece-layer, 1);
  top: calc(58% + var(--piece-y));
  left: calc(50% + var(--piece-x));
  width: 40%;
  height: 60%;
  transform:
    translate(-50%, -50%)
    translate(calc(var(--piece-x) * -1 * var(--blend, 0)), calc(var(--piece-y) * -0.6 * var(--blend, 0)))
    rotate(calc(var(--piece-rotate) * (1 - var(--blend, 0) * 0.7)))
    scale(calc(1 - var(--blend, 0) * 0.16));
  /* The pieces sink into the batter as it comes together, so a well-mixed bowl
     reads as batter rather than a heap of visible ingredients. */
  opacity: calc(1 - var(--blend, 0) * 0.72);
  animation: bake-drop-in 420ms cubic-bezier(0.16, 1, 0.3, 1) both;
  transition: transform 260ms cubic-bezier(0.16, 1, 0.3, 1), opacity 300ms ease;
}
/* A film of batter, this recipe's colour, creeps over the pieces as they blend
   — pale cream for a sponge, dark for brownies. */
.bake-bowl__contents::after {
  position: absolute;
  z-index: 40;
  inset: 4% 2% 0;
  border-radius: 46% 46% 40% 40% / 34% 34% 60% 60%;
  background: radial-gradient(ellipse at 50% 38%,
    color-mix(in srgb, var(--bake-batter, #efe1c2) 88%, #fff),
    var(--bake-batter, #efe1c2) 68%,
    color-mix(in srgb, var(--bake-batter, #efe1c2) 82%, #000));
  content: "";
  opacity: calc(var(--blend, 0) * 0.9);
  pointer-events: none;
  transition: opacity 300ms ease;
}
.bake-bowl__shadow {
  position: absolute;
  z-index: 0;
  right: 4%;
  bottom: -5%;
  left: 4%;
  height: 12%;
  border-radius: 50%;
  background: rgb(58 46 30 / 0.3);
  filter: blur(7px);
}
.bake-bowl.is-target .bake-bowl__mouth { fill: #a8bb92; }
.bake-bowl.is-target .bake-bowl__wall { stroke: var(--bake-green); }
.bake-bowl--mixing { cursor: grab; touch-action: none; }
.bake-bowl--mixing.is-stirring { cursor: grabbing; }
.bake-bowl--mixing.is-stirring .bake-mixer { filter: drop-shadow(3px 8px 6px rgb(58 44 26 / 0.42)); }
.bake-bowl--mixing:active { cursor: grabbing; }
.bake-bowl--mixing:focus-visible { outline: 2px solid var(--bake-green); outline-offset: 6px; }

/* The wooden spoon is a paper flat too. It keeps its handle up and orbits its
   head around the well, because a spoon pivoting about one point sweeps its
   handle down through the bowl and out the bottom. */
.bake-mixer {
  position: absolute;
  z-index: 2;
  top: -30%;
  left: 50%;
  width: 19%;
  height: 84%;
  overflow: visible;
  margin-left: -9.5%;
  translate: var(--spoon-x, 0) var(--spoon-y, 0);
  rotate: var(--spoon-tilt, 0deg);
  transform-origin: 50% 16%;
  filter: drop-shadow(3px 6px 5px rgb(58 44 26 / 0.34));
  transition: translate 90ms linear, rotate 90ms linear;
}
.bake-mixer__handle { fill: #c79c62; stroke: #e9d0a6; stroke-width: 1.8; }
.bake-mixer__head { fill: #b98d51; stroke: #e0c294; stroke-width: 1.8; }
.bake-mixer__dish { fill: #9c7440; opacity: 0.8; }

/* Rubbing: fingertips press down into the bowl, one squash per rub. */
.bake-bowl--rubbing { cursor: pointer; touch-action: none; }
.bake-bowl--rubbing:focus-visible { outline: 2px solid var(--bake-green); outline-offset: 6px; }
.bake-hand {
  position: absolute;
  z-index: 3;
  top: -18%;
  left: 50%;
  width: 34%;
  height: 46%;
  margin-left: -17%;
  overflow: visible;
  transform-origin: 50% 0;
  filter: drop-shadow(2px 7px 5px rgb(58 44 26 / 0.36));
}
.bake-hand__fingers path { fill: #e7c7a6; stroke: #cda874; stroke-width: 1.6; }
.bake-bowl--rubbing.is-pressing .bake-hand { animation: bake-press 240ms ease-out; }
@keyframes bake-press {
  0% { transform: translateY(-6%); }
  45% { transform: translateY(12%); }
  100% { transform: translateY(0); }
}

/* Rolling: a slab, a dough disc that widens and thins as it is worked, and a
   paper rolling pin that follows the pointer left and right. */
.bake-roller {
  position: relative;
  display: grid;
  width: min(78%, 360px);
  aspect-ratio: 1.9;
  place-items: center;
  cursor: ew-resize;
  touch-action: none;
}
.bake-roller:focus-visible { outline: 2px solid var(--bake-green); outline-offset: 8px; }
.bake-roller__slab {
  position: absolute;
  inset: 34% 2% 10%;
  border-radius: 12px;
  background: linear-gradient(178deg, #efe6d2, #d8c6a2);
  box-shadow: inset 0 3px 10px rgb(255 255 255 / 0.4), 0 10px 18px rgb(58 44 26 / 0.24);
}
.bake-roller__dough {
  position: absolute;
  z-index: 1;
  bottom: 16%;
  left: 50%;
  /* Starts as a tall mound, ends a wide thin sheet as --rolled climbs to 1. */
  width: calc((34% + var(--rolled, 0) * 46%));
  height: calc((44% - var(--rolled, 0) * 26%));
  border-radius: 46% 46% 44% 44% / 54% 54% 46% 46%;
  background: radial-gradient(ellipse at 50% 34%,
    color-mix(in srgb, var(--bake-batter, #ecdcb6) 88%, #fff),
    var(--bake-batter, #ecdcb6) 70%,
    color-mix(in srgb, var(--bake-batter, #ecdcb6) 82%, #000));
  box-shadow: inset 0 3px 7px rgb(255 255 255 / 0.4), 0 4px 8px rgb(42 33 24 / 0.22);
  transform: translateX(-50%);
  transition: width 220ms ease, height 220ms ease;
}
.bake-roller__pin {
  position: absolute;
  z-index: 2;
  top: 6%;
  left: 50%;
  width: 74%;
  height: auto;
  margin-left: -37%;
  translate: var(--pin-x, 0);
  filter: drop-shadow(0 8px 6px rgb(58 44 26 / 0.34));
  transition: translate 90ms linear;
}
.bake-roller.is-rolling .bake-roller__pin { filter: drop-shadow(0 12px 8px rgb(58 44 26 / 0.42)); }
.bake-roller__barrel { fill: #d8b785; stroke: #e6d0aa; stroke-width: 2; }
.bake-roller__grip { fill: #b98d51; stroke: #e0c294; stroke-width: 2; }
.bake-roller__shadow {
  position: absolute;
  z-index: 0;
  right: 6%;
  bottom: 6%;
  left: 6%;
  height: 10%;
  border-radius: 50%;
  background: rgb(42 33 24 / 0.22);
  filter: blur(4px);
}

/* Portion: a baking tin of cases you tap to fill. */
.bake-tray {
  position: relative;
  display: grid;
  width: min(82%, 380px);
  aspect-ratio: 1.55;
  place-items: center;
  padding: 7% 6%;
}
.bake-tray__tin {
  position: absolute;
  inset: 0;
  border-radius: 14px;
  background: linear-gradient(178deg, #cbb898, #a98f68);
  box-shadow: inset 0 3px 8px rgb(255 255 255 / 0.3), 0 12px 22px rgb(42 33 24 / 0.28);
}
.bake-tray__cases {
  position: relative;
  z-index: 1;
  display: grid;
  width: 100%;
  height: 100%;
  gap: 6%;
  grid-template-columns: repeat(3, 1fr);
}
.bake-case {
  position: relative;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 38%, #efe3c8, #cdb789 78%, #b49f74);
  box-shadow: inset 0 4px 8px rgb(58 44 26 / 0.34);
  cursor: pointer;
}
.bake-case:focus-visible { outline: 2px solid var(--bake-green); outline-offset: 3px; }
.bake-case__fill {
  width: 58%;
  height: 58%;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 38%,
    color-mix(in srgb, var(--bake-batter, #7a1533) 84%, #fff),
    var(--bake-batter, #7a1533) 72%,
    color-mix(in srgb, var(--bake-batter, #7a1533) 78%, #000));
  box-shadow: inset 0 2px 4px rgb(255 255 255 / 0.4);
  opacity: 0;
  transform: scale(0.4);
  transition: opacity 160ms ease, transform 200ms cubic-bezier(0.16, 1, 0.3, 1);
}
.bake-case.is-filled .bake-case__fill { opacity: 1; transform: scale(1); }

/* Assemble: a base with a marked spot and one piece you drag onto it. */
.bake-assemble {
  position: relative;
  display: grid;
  width: min(72%, 320px);
  aspect-ratio: 1.2;
  place-items: center;
  touch-action: none;
}
.bake-assemble:focus-visible { outline: 2px solid var(--bake-green); outline-offset: 8px; }
.bake-assemble__base {
  position: absolute;
  inset: 22% 12%;
  border-radius: 46% 46% 44% 44% / 48% 48% 52% 52%;
  background: radial-gradient(ellipse at 50% 36%, #efe6d2, #d3c19c 76%, #b9a67e);
  box-shadow: inset 0 3px 9px rgb(255 255 255 / 0.35), 0 10px 18px rgb(42 33 24 / 0.24);
}
.bake-assemble__target {
  position: absolute;
  top: 46%;
  left: 50%;
  width: 30%;
  height: 30%;
  border: 2px dashed rgb(58 44 26 / 0.45);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}
.bake-assemble.is-placed .bake-assemble__target { opacity: 0; }
.bake-assemble__piece {
  position: absolute;
  z-index: 2;
  top: 12%;
  left: 24%;
  width: 30%;
  height: 30%;
  margin: 0;
  transform: translate(-50%, -50%);
  cursor: grab;
  transition: filter 160ms ease;
}
.bake-assemble__piece.is-held { cursor: grabbing; filter: drop-shadow(0 10px 8px rgb(42 33 24 / 0.4)); }
.bake-assemble__piece--disc {
  border-radius: 50%;
  background: radial-gradient(circle at 50% 36%,
    color-mix(in srgb, var(--bake-batter, #ecdcb6) 88%, #fff),
    var(--bake-batter, #ecdcb6) 70%,
    color-mix(in srgb, var(--bake-batter, #ecdcb6) 82%, #000));
  box-shadow: inset 0 3px 6px rgb(255 255 255 / 0.4), 0 5px 8px rgb(42 33 24 / 0.26);
}
.bake-assemble__piece--blade { height: 44%; }
.bake-piece__blade { width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 5px 5px rgb(42 33 24 / 0.3)); }
.bake-piece__blade-metal { fill: #d9dde0; stroke: #aeb4b8; stroke-width: 1.5; }
.bake-piece__blade-grip { fill: #7a5a34; stroke: #9c7a4a; stroke-width: 1.5; }

/* Melt: a pan over a flame. The pool goes solid -> glossy -> seized as it heats. */
.bake-pan {
  position: relative;
  display: grid;
  width: min(64%, 300px);
  aspect-ratio: 1.4;
  place-items: center;
}
.bake-pan__flame {
  position: absolute;
  z-index: 0;
  bottom: 6%;
  left: 50%;
  display: flex;
  gap: 6%;
  width: 46%;
  height: 34%;
  transform: translateX(-50%);
}
.bake-pan__flame i {
  flex: 1;
  align-self: flex-end;
  height: 100%;
  border-radius: 50% 50% 46% 46% / 62% 62% 38% 38%;
  background: linear-gradient(0deg, #f0a02a, #e2571c 58%, transparent);
  transform-origin: 50% 100%;
  animation: bake-flame 0.5s ease-in-out infinite alternate;
}
.bake-pan__flame i:nth-child(2) { height: 84%; animation-delay: 0.14s; }
.bake-pan__flame i:nth-child(3) { height: 92%; animation-delay: 0.28s; }
@keyframes bake-flame { from { transform: scaleY(0.82) skewX(-4deg); opacity: 0.82; } to { transform: scaleY(1.06) skewX(5deg); opacity: 1; } }
.bake-pan__body {
  position: relative;
  z-index: 1;
  display: grid;
  width: 78%;
  aspect-ratio: 1.9;
  place-items: center;
  border-radius: 12% 12% 46% 46% / 16% 16% 92% 92%;
  background: linear-gradient(178deg, #3f3a38, #211d1b);
  box-shadow: inset 0 4px 10px rgb(255 255 255 / 0.12), 0 12px 20px rgb(20 12 6 / 0.4);
}
.bake-pan__handle {
  position: absolute;
  z-index: 1;
  top: 46%;
  right: 2%;
  width: 30%;
  height: 9%;
  border-radius: 6px;
  background: linear-gradient(180deg, #4a4038, #2b2521);
}
.bake-pan__pool {
  width: 84%;
  height: 62%;
  border-radius: 46% 46% 48% 48% / 40% 40% 60% 60%;
  background:
    radial-gradient(circle at 34% 30%, color-mix(in srgb, var(--bake-batter, #4b2e1e) 70%, #000) 18%, transparent 19%),
    radial-gradient(circle at 66% 56%, color-mix(in srgb, var(--bake-batter, #4b2e1e) 70%, #000) 14%, transparent 15%),
    radial-gradient(ellipse at 50% 34%, color-mix(in srgb, var(--bake-batter, #4b2e1e) 88%, #fff), var(--bake-batter, #4b2e1e) 72%, color-mix(in srgb, var(--bake-batter, #4b2e1e) 78%, #000));
  transition: background 300ms ease, filter 300ms ease;
}
.bake-pan__sheen {
  position: absolute;
  top: 30%;
  left: 32%;
  width: 30%;
  height: 16%;
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 40%, rgb(255 246 224 / 0.7), transparent 70%);
  opacity: 0;
  transition: opacity 300ms ease;
}
/* Solid: lumpy, matte, chunky (the radial dots read as unmelted pieces). */
.bake-pan[data-molten="solid"] .bake-pan__pool { filter: contrast(1.2) brightness(0.82); }
/* Glossy: smooth and shining — the window to pull it in. */
.bake-pan[data-molten="glossy"] .bake-pan__pool { filter: brightness(1.08) saturate(1.1); background: radial-gradient(ellipse at 50% 32%, color-mix(in srgb, var(--bake-batter, #4b2e1e) 78%, #fff), var(--bake-batter, #4b2e1e) 68%, color-mix(in srgb, var(--bake-batter, #4b2e1e) 82%, #000)); }
.bake-pan[data-molten="glossy"] .bake-pan__sheen { opacity: 1; }
/* Seized: dull, grainy, gone. */
.bake-pan[data-molten="seized"] .bake-pan__pool { filter: contrast(1.35) brightness(0.6) saturate(0.7); background-size: 7px 7px, 9px 9px, cover; }
.bake-dial--melt strong { font-family: var(--studio-display); font-size: 1.2rem; }

/* The piece that follows the pointer while a jar is being dragged. */
.bake-ghost {
  position: fixed;
  z-index: 60;
  top: 0;
  left: 0;
  width: 132px;
  height: 132px;
  object-fit: contain;
  filter: drop-shadow(7px 12px 9px rgb(42 33 24 / 0.45));
  pointer-events: none;
}

.bake-dial {
  position: absolute;
  z-index: 7;
  right: 5%;
  bottom: 3%;
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 7px 17px;
  border: 1px solid var(--bake-rule);
  background: var(--bake-paper);
  box-shadow: 4px 5px 0 rgb(42 33 24 / 0.2);
  transform: rotate(-1.6deg);
}
.bake-dial span { color: var(--bake-muted); font-family: var(--studio-mono); font-size: 0.52rem; letter-spacing: 0.1em; text-transform: uppercase; }
.bake-dial strong { font-family: var(--studio-display); font-size: 1.9rem; font-weight: 400; line-height: 1; }


/* Oven ------------------------------------------------------------------ */

.bake-oven {
  position: relative;
  display: grid;
  width: min(96%, 380px);
  gap: 12px;
  justify-items: center;
  padding: 20px 20px 16px;
  border: 3px solid #4a4038;
  border-radius: 6px;
  background: linear-gradient(178deg, #584d43, #3b332c);
  box-shadow: 0 18px 30px rgb(42 33 24 / 0.3);
}
.bake-oven__door { position: absolute; inset: 6px; border: 1px solid rgb(246 239 226 / 0.16); border-radius: 4px; pointer-events: none; }
.bake-oven__window {
  display: grid;
  width: 100%;
  min-height: 200px;
  overflow: hidden;
  place-items: center;
  padding: 16px;
  border: 4px solid #2b2521;
  border-radius: 4px;
  background: radial-gradient(ellipse at 50% 62%, #d59a3f, #8a5320 62%, #4d2f16);
  box-shadow: inset 0 0 30px rgb(20 12 6 / 0.6);
}
.bake-oven[data-doneness="raw"] .bake-oven__window { background: radial-gradient(ellipse at 50% 62%, #c99a55, #7d5527 62%, #43301a); }
.bake-oven[data-doneness="burnt"] .bake-oven__window { background: radial-gradient(ellipse at 50% 62%, #b8511f, #6d2c10 62%, #341509); }
.bake-oven__dial { display: grid; justify-items: center; gap: 1px; padding: 5px 18px; border: 1px solid rgb(246 239 226 / 0.3); background: rgb(246 239 226 / 0.94); }
.bake-oven__dial span { color: var(--bake-muted); font-family: var(--studio-mono); font-size: 0.52rem; letter-spacing: 0.1em; text-transform: uppercase; }
.bake-oven__dial strong { font-family: var(--studio-display); font-size: 1.9rem; font-weight: 400; line-height: 1; }
.bake-oven__word { margin-top: 2px; color: var(--bake-muted); font-family: var(--studio-mono); font-size: 0.58rem; font-style: normal; letter-spacing: 0.08em; text-transform: uppercase; transition: color 300ms ease; }
.bake-oven[data-doneness="golden"] .bake-oven__word { color: var(--bake-rust); }
.bake-oven[data-doneness="burnt"] .bake-oven__word { color: #9a3316; }

/* The bake itself, coloured by what actually happened to it. */
.bake-result { position: relative; display: block; width: min(100%, 220px); aspect-ratio: 1.12; }
.bake-result__body { width: 100%; height: 100%; transition: filter 420ms ease, opacity 420ms ease; }
.bake-result__body img { transition: transform 420ms ease, filter 420ms ease; }
/* Raw is still batter: the cake cutout gives way to a flat, unrisen disc of
   this recipe's batter colour, so minute 0 never looks like a finished bake. */
.bake-result__raw {
  position: absolute;
  z-index: 1;
  display: none;
  inset: 30% 16% 26%;
  border-radius: 46% 46% 44% 44% / 40% 40% 60% 60%;
  background: radial-gradient(ellipse at 50% 36%,
    color-mix(in srgb, var(--bake-batter, #efe1c2) 86%, #fff),
    var(--bake-batter, #efe1c2) 70%,
    color-mix(in srgb, var(--bake-batter, #efe1c2) 80%, #000));
  box-shadow: inset 0 3px 8px rgb(255 255 255 / 0.4), 0 4px 8px rgb(42 33 24 / 0.24);
}
.bake-result[data-doneness="raw"] .bake-result__raw { display: block; }
.bake-result[data-doneness="raw"] .bake-result__body { opacity: 0; }
/* Pale is risen but underbaked: flatter dome, bright and washed out. Golden is
   the shipped look. The jump between them has to be visible at a glance. */
.bake-result[data-doneness="pale"] .bake-result__body img { filter: saturate(0.62) brightness(1.22) contrast(0.86) drop-shadow(0 5px 5px rgb(42 33 24 / 0.24)); transform: scaleY(0.9) translateY(4%); }
.bake-result[data-doneness="burnt"] .bake-result__body img { filter: sepia(0.5) saturate(0.7) brightness(0.5) contrast(1.2) drop-shadow(0 5px 5px rgb(42 33 24 / 0.3)); }
.bake-result[data-mix="over"] .bake-result__body { transform: scaleY(0.86) translateY(7%); }
.bake-result[data-mix="under"]::after {
  position: absolute;
  z-index: 3;
  inset: 12% 14% 20%;
  background-image: radial-gradient(circle, rgb(252 249 240 / 0.95) 1.6px, transparent 1.7px);
  background-size: 17px 15px;
  content: "";
  opacity: 0.8;
  pointer-events: none;
}
.bake-result__char { position: absolute; z-index: 2; inset: 0; opacity: 0; pointer-events: none; }
.bake-result[data-doneness="burnt"] .bake-result__char {
  background: radial-gradient(ellipse at 50% 60%, transparent 44%, rgb(30 16 8 / 0.72) 78%);
  opacity: 1;
}
.bake-result__poke {
  position: absolute;
  z-index: 4;
  top: 2%;
  left: var(--poke-left);
  width: 22%;
  height: auto;
  filter: drop-shadow(0 3px 3px rgb(42 33 24 / 0.34));
  transform: translateX(-50%) rotate(var(--poke-rotate));
}
.bake-result--in-oven { width: min(100%, 190px); }
.bake-result--trophy { width: min(78%, 230px); margin-inline: auto; }

/* Pantry ---------------------------------------------------------------- */

.bake-pantry { display: flex; flex-direction: column; background: var(--bake-paper); }
.bake-pantry h2 { margin: 4px 0 5px; font-family: var(--studio-display); font-size: clamp(1.3rem, 1.9vw, 1.9rem); font-weight: 400; letter-spacing: -0.048em; line-height: 0.95; }
.bake-pantry > p { max-width: 46ch; margin: 0 0 12px; color: var(--bake-muted); font-size: 0.72rem; line-height: 1.4; }
.bake-pantry--closed { align-items: center; justify-content: center; text-align: center; }
.bake-pantry--closed p { max-width: 24ch; margin: 0; color: var(--bake-muted); font-family: var(--studio-display); font-size: 1.25rem; line-height: 1.25; }

/* A paper cupboard: a recessed case, and shelves the jars actually stand on. */
.bake-cupboard {
  position: relative;
  display: grid;
  gap: 0;
  padding: 14px 13px 6px;
  background:
    repeating-linear-gradient(90deg, transparent 0 22px, rgb(92 70 44 / 0.05) 23px),
    linear-gradient(178deg, #d7c7a6, #c2ae88);
  box-shadow: inset 0 14px 22px rgb(64 48 28 / 0.26), inset 0 -6px 12px rgb(64 48 28 / 0.16);
  isolation: isolate;
}
/* The case frame reads as the cupboard's cut paper sides. */
.bake-cupboard__case {
  position: absolute;
  z-index: 5;
  inset: 0;
  border: 7px solid #b09468;
  box-shadow: inset 0 0 0 1px rgb(255 250 238 / 0.4), 0 12px 26px rgb(58 44 26 / 0.22);
  pointer-events: none;
}
.bake-cupboard__row {
  position: relative;
  display: flex;
  min-height: 128px;
  align-items: flex-end;
  justify-content: space-around;
  gap: 3px;
  padding: 6px 5px 56px;
}
/* The plank sits in front of the jars' feet, which is what makes them read as
   standing on the shelf rather than floating over a picture of one. */
.bake-cupboard__board {
  position: absolute;
  z-index: 3;
  right: -4px;
  bottom: 38px;
  left: -4px;
  height: 16px;
  background: linear-gradient(180deg, #e3d3ae 0 34%, #c8b184 35%, #ab9163);
  box-shadow: 0 -7px 11px rgb(58 44 26 / 0.3);
  clip-path: polygon(0 8%, 12% 2%, 29% 9%, 47% 3%, 63% 9%, 79% 2%, 92% 8%, 100% 3%, 100% 100%, 0 100%);
}

.bake-jar {
  position: relative;
  z-index: 2;
  display: grid;
  min-width: 0;
  flex: 1 1 0;
  gap: 0;
  justify-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--bake-ink);
  cursor: grab;
  text-align: center;
  transition: transform 200ms cubic-bezier(0.16, 1, 0.3, 1);
}
.bake-jar:active { cursor: grabbing; }
.bake-jar:hover,
.bake-jar:focus-visible { transform: translateY(-5px); }
.bake-jar:focus-visible { outline: 2px solid var(--bake-green); outline-offset: 3px; }
.bake-jar__image { position: relative; display: block; width: 100%; height: 68px; }
.bake-jar__image .bake-object { position: absolute; inset: 0; }
.bake-jar__image .bake-object img { filter: drop-shadow(2px 6px 5px rgb(58 44 26 / 0.34)); }
/* The name rides on the plank like a shelf-edge label. */
.bake-jar__label {
  position: absolute;
  z-index: 4;
  right: -1px;
  bottom: -54px;
  left: -1px;
  /* Fixed height, bottom-anchored: a two-line name (Bicarbonate of soda) no
     longer grows upward and sits taller than its neighbours. All labels share
     one shelf-edge line. */
  display: flex;
  height: 36px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 3px 3px;
  background: rgb(249 244 232 / 0.94);
  box-shadow: 1px 2px 0 rgb(58 44 26 / 0.2);
  color: #3d3020;
  font-family: var(--studio-mono);
  font-size: 0.48rem;
  letter-spacing: 0.01em;
  line-height: 1.08;
  text-transform: uppercase;
  text-wrap: balance;
}
/* Taken off the shelf: the jar leaves a faint paper ghost behind. */
.bake-jar.is-in .bake-jar__image .bake-object { opacity: 0.3; filter: grayscale(0.9); }
.bake-jar.is-in .bake-jar__label { border: 1px solid var(--bake-green); background: #dfe7db; color: var(--bake-green); }
.bake-note { margin: 10px 0 0; color: var(--bake-muted); font-size: 0.68rem; }


/* The judging tent ------------------------------------------------------ */

.bake-scene {
  position: relative;
  width: min(1480px, 100%);
  min-height: clamp(430px, 54vh, 640px);
  overflow: hidden;
  margin-inline: auto;
  border: 1px solid var(--bake-rule);
  background: #d8d0bf;
  box-shadow: 0 28px 80px rgb(42 33 24 / 0.16);
  isolation: isolate;
}
.bake-scene::before { position: absolute; z-index: 10; inset: 10px; border: 1px solid rgb(246 239 226 / 0.6); box-shadow: inset 0 0 0 1px rgb(42 33 24 / 0.14); content: ""; pointer-events: none; }
.bake-set { position: absolute; z-index: 0; inset: 0; overflow: hidden; }
.bake-set::after { position: absolute; z-index: 9; inset: 0; background: repeating-linear-gradient(4deg, transparent 0 7px, rgb(58 48 39 / 0.028) 8px); content: ""; mix-blend-mode: multiply; pointer-events: none; }
.bake-set__backdrop {
  position: absolute;
  z-index: 0;
  top: -3%;
  left: -3%;
  width: 106%;
  height: 106%;
  object-fit: cover;
  object-position: 50% 58%;
  filter: saturate(0.92) contrast(1.02);
  animation: bake-backdrop-pan 4.6s cubic-bezier(0.18, 0.65, 0.22, 1) both;
}
.bake-set__wash { position: absolute; z-index: 1; inset: 0; background: linear-gradient(90deg, rgb(239 229 210 / 0.22), transparent 30% 72%, rgb(38 30 22 / 0.14)), radial-gradient(ellipse at 52% 60%, transparent 26%, rgb(38 30 22 / 0.12) 100%); pointer-events: none; }
.bake-set__cast { position: absolute; z-index: 3; inset: 0; pointer-events: none; }
.bake-set__judge {
  position: absolute;
  bottom: 30%;
  display: block;
  width: clamp(74px, 9.5vw, 128px);
  opacity: 0;
  filter: sepia(0.14) saturate(0.85) drop-shadow(6px 8px 5px rgb(42 33 24 / 0.24));
  transform-origin: 50% 100%;
  animation: bake-judge-life 4.6s steps(6, end) both;
}
.bake-set__judge img { display: block; width: 100%; height: auto; }
/* The trio stays left of the verdict card's landing zone in the top right, so
   the card never sits on a judge's face. */
.bake-set__judge--0 { left: 16%; --judge-tilt: -1.4deg; }
.bake-set__judge--1 { left: 36%; --judge-tilt: 0.9deg; animation-delay: 0.1s; }
.bake-set__judge--2 { left: 56%; --judge-tilt: -0.6deg; animation-delay: 0.2s; }
.bake-set__particles { position: absolute; z-index: 4; inset: 0; overflow: hidden; pointer-events: none; }
.bake-set__particles i {
  position: absolute;
  top: -12%;
  left: 8%;
  display: block;
  width: 9px;
  height: 9px;
  border-radius: 50% 12% 50% 12%;
  background: #cbb98f;
  opacity: 0.5;
  animation: bake-particle-fall 3.1s linear infinite;
}
.bake-set__particles i:nth-child(2) { left: 19%; animation-delay: -0.9s; }
.bake-set__particles i:nth-child(3) { left: 30%; animation-delay: -1.6s; }
.bake-set__particles i:nth-child(4) { left: 41%; animation-delay: -0.4s; }
.bake-set__particles i:nth-child(5) { left: 53%; animation-delay: -2.1s; }
.bake-set__particles i:nth-child(6) { left: 64%; animation-delay: -1.2s; }
.bake-set__particles i:nth-child(7) { left: 76%; animation-delay: -0.2s; }
.bake-set__particles i:nth-child(8) { left: 86%; animation-delay: -1.8s; }
.bake-set__particles i:nth-child(9) { left: 95%; animation-delay: -0.7s; }
.bake-set__sign {
  position: absolute;
  z-index: 8;
  top: 7%;
  left: 5%;
  padding: 10px 14px 9px;
  border: 1px solid var(--bake-ink);
  background: rgb(246 239 226 / 0.96);
  box-shadow: 6px 7px 0 rgb(42 33 24 / 0.2);
  color: var(--bake-ink);
  font-family: var(--studio-mono);
  font-size: clamp(0.56rem, 1vw, 0.72rem);
  letter-spacing: 0.09em;
  opacity: 0;
  text-transform: uppercase;
  transform: scale(0.72) rotate(-5deg);
  animation: bake-sign-in 0.42s steps(3, end) 0.2s both, bake-sign-away 0.3s steps(2, end) 2.2s forwards;
}
.bake-set__sign::before { position: absolute; top: -8px; left: 36%; width: 44px; height: 14px; background: rgb(214 196 161 / 0.85); content: ""; transform: rotate(3deg); }
.bake-set__foreground { position: absolute; z-index: 7; right: 0; bottom: -2%; left: 0; height: 14%; pointer-events: none; }
.bake-set__foreground i { position: absolute; bottom: 0; display: block; width: 37%; height: 100%; background: #4f5a3c; filter: drop-shadow(0 -5px 5px rgb(42 33 24 / 0.22)); opacity: 0.88; }
.bake-set__foreground i:first-child { left: -4%; clip-path: polygon(0 20%, 21% 4%, 46% 24%, 71% 8%, 100% 34%, 92% 100%, 0 100%); }
.bake-set__foreground i:last-child { right: -4%; clip-path: polygon(0 32%, 25% 7%, 52% 23%, 77% 3%, 100% 18%, 100% 100%, 8% 100%); }

.bake-walker {
  position: absolute;
  z-index: 6;
  bottom: 7%;
  left: 0;
  width: clamp(150px, 18vw, 225px);
  will-change: transform;
  animation: bake-cross 4.2s cubic-bezier(0.2, 0.62, 0.24, 1) both;
}
.bake-walker::after { position: absolute; z-index: -1; bottom: -6%; left: 16%; width: 68%; height: 8%; border-radius: 50%; background: rgb(28 20 12 / 0.26); content: ""; filter: blur(3px); animation: bake-walk-shadow 0.48s steps(2, end) infinite; }
.bake-walker__tray {
  position: absolute;
  z-index: 1;
  bottom: 4%;
  left: 4%;
  width: 92%;
  height: 13%;
  border-radius: 3px;
  background: linear-gradient(180deg, #b9a67f, #8a7752);
  box-shadow: 0 5px 7px rgb(42 33 24 / 0.32);
}
.bake-walker .bake-result--carried { position: relative; z-index: 2; width: 74%; margin: 0 auto; animation: bake-tray-bob 0.48s steps(2, end) infinite; }
.bake-walker__hand { position: absolute; z-index: 3; bottom: 0; width: 15%; height: 15%; border-radius: 44% 44% 38% 38%; background: #d8bb95; box-shadow: inset -4px -3px 6px rgb(96 68 44 / 0.28); }
.bake-walker__hand--left { left: -3%; transform: rotate(-8deg); }
.bake-walker__hand--right { right: -3%; transform: rotate(8deg); }
.bake-scene[data-band="showstopper"] .bake-result--carried { animation: bake-tray-bob 0.48s steps(2, end) infinite, bake-hop 0.62s steps(3, end) 2.1s 1; }
.bake-scene[data-band="edible"] .bake-result--carried { animation: bake-tray-bob 0.48s steps(2, end) infinite, bake-wobble 0.84s steps(4, end) 2.1s 1; }
.bake-scene[data-band="disaster"] .bake-result--carried { animation: bake-tray-bob 0.48s steps(2, end) infinite, bake-slump 0.96s steps(5, end) 2.05s 1; }
.bake-scene[data-band="showstopper"] .bake-set__judge { animation: bake-judge-life 4.6s steps(6, end) both, bake-judge-lean 0.8s steps(3, end) 2.2s 1; }

.bake-scene__reaction { position: absolute; z-index: 6; bottom: 24%; left: 55%; width: clamp(110px, 14vw, 180px); aspect-ratio: 1; pointer-events: none; }
.bake-scene__reaction i {
  --rx: -60px; --ry: -64px; --rr: -26deg;
  position: absolute;
  top: 52%;
  left: 46%;
  display: block;
  width: 15px;
  height: 15px;
  border: 1px solid currentColor;
  background: #f2e6c8;
  color: var(--bake-green);
  opacity: 0;
  clip-path: polygon(50% 0, 64% 33%, 100% 36%, 72% 58%, 81% 100%, 50% 76%, 18% 100%, 28% 58%, 0 36%, 36% 33%);
  animation: bake-burst 0.86s steps(5, end) 2.15s both;
}
.bake-scene__reaction i:nth-child(2) { --rx: 6px; --ry: -90px; --rr: 34deg; }
.bake-scene__reaction i:nth-child(3) { --rx: 66px; --ry: -60px; --rr: 70deg; }
.bake-scene__reaction i:nth-child(4) { --rx: 80px; --ry: 4px; --rr: 116deg; }
.bake-scene__reaction i:nth-child(5) { --rx: 44px; --ry: 62px; --rr: 162deg; }
.bake-scene__reaction i:nth-child(6) { --rx: -44px; --ry: 58px; --rr: -144deg; }
.bake-scene__reaction i:nth-child(7) { --rx: -82px; --ry: 5px; --rr: -90deg; }
.bake-scene[data-band="edible"] .bake-scene__reaction i { width: 19px; height: 12px; border-color: var(--bake-amber); background: #e7d6a6; color: var(--bake-amber); clip-path: polygon(0 8%, 100% 0, 94% 100%, 5% 88%); animation-name: bake-flutter; }
.bake-scene[data-band="disaster"] .bake-scene__reaction i { width: 7px; height: 32px; border: 0; background: var(--bake-rust); color: var(--bake-rust); clip-path: polygon(0 0, 100% 8%, 62% 47%, 100% 100%, 0 91%, 36% 51%); animation-name: bake-rip; }

.bake-verdict-card {
  position: absolute;
  z-index: 8;
  top: clamp(16px, 4vw, 46px);
  right: clamp(16px, 4vw, 52px);
  width: min(330px, calc(100% - 34px));
  padding: 16px 19px 18px;
  border: 2px solid currentColor;
  background: rgb(246 239 226 / 0.97);
  color: var(--bake-rust);
  box-shadow: 9px 10px 0 rgb(42 33 24 / 0.2);
  clip-path: polygon(2% 2%, 98% 0, 100% 94%, 4% 100%, 0 54%);
  opacity: 0;
  transform: scale(0.68) rotate(7deg);
  transform-origin: 80% 0;
  animation: bake-card-in 0.5s steps(4, end) 2.55s both;
}
.bake-verdict-card::before { position: absolute; top: -7px; right: 24%; width: 56px; height: 15px; background: rgb(214 196 161 / 0.86); content: ""; transform: rotate(-3deg); }
.bake-scene[data-band="showstopper"] .bake-verdict-card { color: var(--bake-green); }
.bake-scene[data-band="edible"] .bake-verdict-card { color: var(--bake-amber); }
.bake-verdict-card > span { font-family: var(--studio-mono); font-size: 0.53rem; letter-spacing: 0.09em; text-transform: uppercase; }
.bake-verdict-card > strong { display: block; margin-top: 2px; font-family: var(--studio-display); font-size: clamp(2rem, 3.4vw, 3.4rem); font-weight: 400; letter-spacing: -0.04em; line-height: 0.9; }
.bake-verdict-card p { margin: 8px 0 0; color: var(--bake-ink); font-size: 0.81rem; line-height: 1.38; }

.bake-judging__footer { display: flex; width: min(1480px, 100%); align-items: center; justify-content: space-between; gap: 18px; margin: 14px auto 0; }
.bake-judging__footer p { margin: 0; color: var(--bake-muted); font-size: 0.75rem; }
.bake-judging__footer .bake-quiet { min-height: 40px; }

/* Report ---------------------------------------------------------------- */

.bake-results { display: grid; width: min(1480px, 100%); grid-template-columns: minmax(300px, 0.5fr) minmax(0, 1.5fr); margin-inline: auto; border: 1px solid var(--bake-rule); background: var(--bake-paper); box-shadow: 0 28px 80px rgb(42 33 24 / 0.16); }
.bake-results__summary { display: flex; min-width: 0; flex-direction: column; align-items: center; padding: clamp(22px, 3vw, 42px); border-right: 1px solid var(--bake-rule); background: #e7e3d5; text-align: center; }
.bake-results__band { margin: 14px 0 8px; padding: 7px 14px; border: 2px solid var(--bake-rust); color: var(--bake-rust); font-family: var(--studio-mono); font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase; transform: rotate(-1.6deg); }
.bake-results__band[data-band="showstopper"] { border-color: var(--bake-green); color: var(--bake-green); }
.bake-results__band[data-band="edible"] { border-color: var(--bake-amber); color: var(--bake-amber); }
.bake-results__summary h2 { max-width: 22ch; margin: 0; font-family: var(--studio-display); font-size: clamp(1.5rem, 2.2vw, 2.2rem); font-weight: 400; letter-spacing: -0.04em; line-height: 1.06; }
.bake-results__numbers { display: grid; width: 100%; grid-template-columns: repeat(3, 1fr); gap: 0; margin: 22px 0 0; border-top: 1px solid var(--bake-rule); }
.bake-results__numbers > div { padding: 12px 6px; border-right: 1px solid var(--bake-rule); }
.bake-results__numbers > div:last-child { border-right: 0; }
.bake-results__numbers dt { color: var(--bake-muted); font-family: var(--studio-mono); font-size: 0.52rem; letter-spacing: 0.08em; text-transform: uppercase; }
.bake-results__numbers dd { margin: 3px 0 0; font-family: var(--studio-display); font-size: 1.5rem; text-transform: capitalize; }
.bake-results__actions { display: grid; width: 100%; gap: 7px; margin-top: 20px; }
.bake-report { display: grid; min-width: 0; align-content: start; }
.bake-report section { padding: clamp(20px, 2.6vw, 36px); border-bottom: 1px solid var(--bake-rule); }
.bake-report h3 { margin: 0 0 14px; font-family: var(--studio-display); font-size: clamp(1.6rem, 2.4vw, 2.4rem); font-weight: 400; letter-spacing: -0.04em; }
.bake-report__evidence ul { display: grid; gap: 0; margin: 0; padding: 0; border-top: 1px solid var(--bake-rule); list-style: none; }
.bake-report__evidence li { padding: 12px 0; border-bottom: 1px solid var(--bake-rule); line-height: 1.5; }
.bake-report__objects ul { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0; margin: 0; padding: 0; border-top: 1px solid var(--bake-rule); list-style: none; }
.bake-report__objects li { min-width: 0; border-right: 1px solid var(--bake-rule); border-bottom: 1px solid var(--bake-rule); }
.bake-report__objects a { display: grid; gap: 3px; padding: 11px 13px; text-decoration: none; }
.bake-report__objects a:hover,
.bake-report__objects a:focus-visible { background: var(--bake-paper-deep); }
.bake-report__objects strong { overflow: hidden; font-family: var(--studio-display); font-size: 0.98rem; font-weight: 400; text-overflow: ellipsis; white-space: nowrap; }
.bake-report__objects span { overflow: hidden; color: var(--bake-muted); font-family: var(--studio-mono); font-size: 0.5rem; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }

@keyframes bake-drop-in {
  0% { opacity: 0; transform: translate(-50%, -230%) rotate(calc(var(--piece-rotate) - 14deg)); }
  70% { opacity: 1; transform: translate(-50%, -38%) rotate(calc(var(--piece-rotate) + 3deg)); }
  100% { opacity: 1; transform: translate(-50%, -50%) rotate(var(--piece-rotate)); }
}
@keyframes bake-backdrop-pan { 0% { transform: scale(1.06) translate3d(-1.4%, 0, 0); } 50% { transform: scale(1.04) translate3d(0, -0.4%, 0); } 100% { transform: scale(1.055) translate3d(1.4%, 0, 0); } }
@keyframes bake-cross {
  0% { transform: translate3d(-118%, 4%, 0) rotate(-3deg); }
  14% { transform: translate3d(6vw, 0, 0) rotate(1deg); }
  55% { transform: translate3d(48vw, 0, 0) rotate(-1deg); }
  74% { transform: translate3d(52vw, 0, 0) rotate(0.5deg); }
  85% { transform: translate3d(56vw, 0, 0) rotate(-0.5deg); }
  100% { transform: translate3d(106vw, 1%, 0) rotate(2deg); }
}
@keyframes bake-tray-bob { 0%, 100% { transform: translateY(0) rotate(-0.8deg); } 50% { transform: translateY(-7px) rotate(0.8deg); } }
@keyframes bake-walk-shadow { 50% { opacity: 0.58; transform: scaleX(0.82); } }
@keyframes bake-hop { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-24px) rotate(-2deg); } }
@keyframes bake-wobble { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-7deg); } 65% { transform: rotate(8deg); } }
@keyframes bake-slump { 0%, 100% { transform: translateY(0) rotate(0) scaleY(1); } 40% { transform: translateY(12px) rotate(9deg) scaleY(0.84); } 72% { transform: translateY(4px) rotate(-6deg) scaleY(0.9); } }
@keyframes bake-judge-life { 0% { opacity: 0; transform: translateY(20px) rotate(var(--judge-tilt)); } 14%, 100% { opacity: 0.92; transform: translateY(0) rotate(var(--judge-tilt)); } }
@keyframes bake-judge-lean { 0%, 100% { transform: translateY(0) rotate(var(--judge-tilt)); } 50% { transform: translateY(-8px) rotate(calc(var(--judge-tilt) + 2deg)); } }
@keyframes bake-sign-in { to { opacity: 1; transform: scale(1) rotate(-1.5deg); } }
@keyframes bake-sign-away { to { opacity: 0; transform: translateY(-18px) rotate(2deg); } }
@keyframes bake-card-in { to { opacity: 1; transform: scale(1) rotate(-1deg); } }
@keyframes bake-burst { 0% { opacity: 0; transform: translate(0, 0) scale(0.2) rotate(0); } 24% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--rx), var(--ry)) scale(1.1) rotate(var(--rr)); } }
@keyframes bake-flutter { 0% { opacity: 0; transform: translate(0, 0) scale(0.2) rotate(0); } 28%, 62% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--rx), var(--ry)) scale(1) rotate(var(--rr)); } }
@keyframes bake-rip { 0% { opacity: 0; transform: translate(0, 0) scaleY(0.2) rotate(0); } 22%, 70% { opacity: 0.9; } 100% { opacity: 0; transform: translate(var(--rx), var(--ry)) scaleY(1.2) rotate(var(--rr)); } }
@keyframes bake-particle-fall { to { transform: translate3d(-40px, 700px, 0) rotate(140deg); } }

@media (max-width: 1180px) {
  .bake-workspace { grid-template-columns: minmax(220px, 0.55fr) minmax(300px, 1fr); }
  .bake-workspace[data-stage="mix"],
  .bake-workspace[data-stage="oven"] { grid-template-columns: minmax(190px, 0.3fr) minmax(0, 1fr); }
  .bake-workspace[data-stage="mix"] .bake-bowl { width: min(70%, 380px); }
  .bake-workspace[data-stage="mix"] .bake-diorama,
  .bake-workspace[data-stage="oven"] .bake-diorama { min-height: 430px; }
  .bake-pantry { grid-column: 1 / -1; border-top: 1px solid var(--bake-rule); }
  .bake-counter-header { grid-template-columns: minmax(190px, 0.5fr) minmax(0, 1fr); }
  .bake-progress { grid-column: 1 / -1; }
}

@media (max-width: 780px) {
  .bake-experience { padding: 78px 10px 24px; }
  .bake-header { grid-template-columns: 1fr; gap: 14px; }
  .bake-header h1 { font-size: clamp(3rem, 13vw, 5rem); }
  .bake-counter-header { grid-template-columns: 1fr; gap: 14px; }
  .bake-counter-header h1 { font-size: clamp(2.6rem, 12vw, 4.2rem); }
  .bake-counter-header button { width: min(320px, 100%); }
  .bake-workspace,
  .bake-workspace[data-stage="mix"],
  .bake-workspace[data-stage="oven"] { grid-template-columns: 1fr; min-height: 0; }
  .bake-workspace[data-stage="mix"] .bake-bowl { width: min(72%, 300px); }
  .bake-workspace[data-stage="oven"] .bake-oven { width: min(92%, 340px); }
  .bake-workspace[data-stage="mix"] .bake-diorama,
  .bake-workspace[data-stage="oven"] .bake-diorama { min-height: 340px; }
  /* The dial lands on the hint at this width, so send it to the top corner. */
  .bake-dial { top: 3%; right: 4%; bottom: auto; }
  .bake-recipe-panel { border-right: 0; border-bottom: 1px solid var(--bake-rule); }
  .bake-stage { min-height: 430px; border-right: 0; border-bottom: 1px solid var(--bake-rule); }
  .bake-bowl { width: min(70%, 250px); }
  .bake-diorama { min-height: 290px; }
  /* On the pantry stage the bowl stays pinned to the top while the cupboard
     scrolls under it, so a drag from a jar up into the bowl is always possible
     — the whole reason this game reads as baking. The drop test already uses
     the bowl's live rect, so nothing in JS changes. */
  .bake-workspace[data-stage="pantry"] .bake-stage {
    position: sticky;
    z-index: 5;
    top: 6px;
    min-height: 0;
    box-shadow: 0 14px 22px rgb(42 33 24 / 0.16);
  }
  .bake-workspace[data-stage="pantry"] .bake-diorama { min-height: 190px; }
  .bake-workspace[data-stage="pantry"] .bake-bowl { width: min(58%, 200px); }
  .bake-cards { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
  .bake-scene { min-height: 470px; }
  .bake-walker { bottom: 11%; width: clamp(140px, 34vw, 190px); }
  .bake-set__judge { bottom: 34%; width: clamp(60px, 15vw, 96px); }
  .bake-verdict-card { top: 4%; right: 10px; width: min(268px, calc(100% - 20px)); padding: 13px 15px; }
  .bake-verdict-card > strong { font-size: 2.3rem; }
  .bake-results { grid-template-columns: 1fr; }
  .bake-results__summary { border-right: 0; border-bottom: 1px solid var(--bake-rule); }
  .bake-judging__footer { align-items: stretch; flex-direction: column; gap: 8px; }
}

@media (max-width: 480px) {
  .bake-cupboard__row { min-height: 118px; padding-bottom: 54px; }
  .bake-jar__image { height: 54px; }
  .bake-bowl { width: min(76%, 230px); }
  .bake-scene { min-height: 420px; }
  .bake-walker { width: 140px; bottom: 14%; }
  .bake-set__judge { width: 58px; }
  .bake-set__judge--0 { left: 8%; }
  .bake-set__judge--1 { left: 38%; }
  .bake-set__judge--2 { left: 66%; }
  .bake-scene__reaction { bottom: 30%; left: 52%; width: 118px; }
  .bake-results__numbers dd { font-size: 1.2rem; }
}

@media (prefers-reduced-motion: reduce) {
  .bake-results [data-bake-replay] { display: none; }
  .bake-card,
  .bake-bowl__piece,
  .bake-set__backdrop,
  .bake-set__judge,
  .bake-set__sign,
  .bake-set__particles i,
  .bake-walker,
  .bake-walker::after,
  .bake-result--carried,
  .bake-scene__reaction i,
  .bake-verdict-card { animation: none !important; transition: none !important; }
  .bake-set__backdrop { transform: scale(1.04); }
  .bake-set__sign,
  .bake-set__judge,
  .bake-verdict-card { opacity: 1; transform: none; }
  .bake-walker { left: 34%; transform: none; }
  .bake-scene__reaction { display: none; }
}
.roundabout-report__heading strong {
  display: grid;
  min-width: 84px;
  aspect-ratio: 1;
  place-items: center;
  border: 3px solid #26352f;
  border-radius: 50%;
  background: #edc54f;
  font-family: var(--studio-display);
  font-size: clamp(3.6rem, 8vw, 6rem);
  font-weight: 400;
  line-height: 1;
  transform: rotate(4deg);
}
.roundabout-report__copy {
  display: grid;
  gap: 5px;
  max-width: 68ch;
  color: #46554e;
  font-size: clamp(0.86rem, 1.4vw, 1rem);
  line-height: 1.48;
}
.roundabout-report__copy p { margin: 0; }
.roundabout-report dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 24px 0;
  border-top: 1px solid rgb(38 53 47 / 0.22);
  border-left: 1px solid rgb(38 53 47 / 0.22);
}
.roundabout-report dl div {
  padding: 11px 12px;
  border-right: 1px solid rgb(38 53 47 / 0.22);
  border-bottom: 1px solid rgb(38 53 47 / 0.22);
}
.roundabout-report dt {
  color: #65716c;
  font-family: var(--studio-mono);
  font-size: 0.56rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.roundabout-report dd {
  margin: 2px 0 0;
  font-family: var(--studio-mono);
  font-size: 1rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}
.roundabout-report button { padding: 10px 16px; }
.roundabout-game.is-paused .roundabout-pressure b { transition: none; }

@keyframes roundabout-signal-pulse {
  from { transform: translate(-50%, -50%) scale(1); }
  to { transform: translate(-50%, -50%) scale(1.07); }
}

@media (max-width: 760px) {
  .roundabout-game { min-height: 680px; }
  .roundabout-hud {
    top: 58px;
    right: 12px;
    left: 12px;
    display: grid;
    gap: 8px;
  }
  .roundabout-title { display: flex; align-items: baseline; gap: 8px; }
  .roundabout-title p { font-size: 0.54rem; }
  .roundabout-title h1 { margin: 0; font-size: clamp(2rem, 10vw, 3.1rem); }
  .roundabout-readouts {
    width: 100%;
    gap: 3px;
    padding: 4px;
  }
  .roundabout-readouts span { min-width: 0; flex: 1; padding: 3px 5px; }
  .roundabout-readouts span:nth-child(4) { display: none; }
  .roundabout-readouts small { font-size: 0.47rem; }
  .roundabout-readouts strong { font-size: 0.78rem; }
  .roundabout-readouts button { min-width: 56px; min-height: 40px; padding: 6px 8px; font-size: 0.57rem; }
  .roundabout-notice { top: 139px; width: calc(100% - 24px); padding: 8px 12px; }
  .roundabout-signal { width: 54px; min-height: 62px; border-radius: 13px; }
  .roundabout-signal__body { width: 20px; }
  .roundabout-signal__body i { width: 14px; }
  .roundabout-signal__label { gap: 3px; font-size: 0.47rem; }
  .roundabout-signal kbd { min-width: 16px; min-height: 16px; }
  .roundabout-signal__label em { min-width: 16px; min-height: 16px; }
  .roundabout-phase { bottom: 18px; left: 12px; max-width: 45vw; padding: 8px 9px; font-size: 0.51rem; }
  .roundabout-pressure { right: 12px; bottom: 13px; width: 47vw; padding: 8px 9px; }
  .roundabout-pressure > span { font-size: 0.51rem; }
  .roundabout-pressure strong { font-size: 0.5rem; }
  .roundabout-guide--first { right: 12px; bottom: 75px; left: 12px; width: auto; }
  .roundabout-guide { padding: 17px; }
  .roundabout-guide h2 { font-size: clamp(2rem, 10vw, 2.8rem); }
  .roundabout-guide > span { font-size: 0.84rem; }
  .roundabout-report { place-items: start center; padding: 72px 10px 14px; }
  .roundabout-report__card { padding: 22px 18px; border-radius: 14px; }
  .roundabout-report__heading { align-items: end; gap: 12px; margin-bottom: 14px; padding-bottom: 14px; }
  .roundabout-report__heading h2 { font-size: clamp(3rem, 15vw, 4.4rem); }
  .roundabout-report__heading strong { min-width: 64px; font-size: 3.6rem; }
  .roundabout-report dl { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 18px 0; }
  .roundabout-report button { width: 100%; }
}

@media (max-height: 700px) and (min-width: 761px) {
  .roundabout-hud { top: 68px; }
  .roundabout-notice { top: 132px; }
  .roundabout-title h1 { font-size: 2.7rem; }
  .roundabout-guide--first { right: 24px; bottom: 68px; }
}

@media (prefers-reduced-motion: reduce) {
  .roundabout-signal,
  .roundabout-signal.is-guided,
  .roundabout-pressure b { transition: none !important; animation: none !important; }
}

/* Roundabout God diorama */
.game-dialog[data-game="roundabout"] {
  background: #241a35;
}
.game-dialog[data-game="roundabout"] .game-dialog__chrome {
  border: 2px solid #332b3d;
  border-radius: 8px;
  background: #fff0c7;
  color: #292238;
  box-shadow: 5px 6px 0 rgb(18 13 28 / 0.48);
  backdrop-filter: none;
}
.roundabout-game {
  --roundabout-ink: #292238;
  --roundabout-paper: #fff0c7;
  --roundabout-red: #f05a50;
  --roundabout-green: #59c97a;
  min-height: 620px;
  background:
    radial-gradient(ellipse at 50% 42%, rgb(91 70 121 / 0.86) 0 14%, transparent 56%),
    radial-gradient(circle at 12% 18%, rgb(76 196 194 / 0.2), transparent 29%),
    linear-gradient(155deg, #392a4b, #21172f 58%, #181021);
  color: var(--roundabout-paper);
}
.roundabout-game::before {
  position: absolute;
  z-index: 1;
  inset: 0;
  background:
    linear-gradient(105deg, transparent 0 47%, rgb(255 239 194 / 0.035) 47.4% 48%, transparent 48.4%),
    radial-gradient(circle at 50% 50%, transparent 45%, rgb(10 7 16 / 0.42) 100%);
  content: "";
  pointer-events: none;
}
.roundabout-canvas {
  z-index: 0;
  cursor: grab;
}
.roundabout-game.is-dragging .roundabout-canvas { cursor: grabbing; }
.roundabout-game.has-failure .roundabout-canvas { animation: roundabout-crash-shake 540ms steps(6, end) both; }
.roundabout-game.is-reduced-motion.has-failure .roundabout-canvas { animation: none; }
.roundabout-game.is-reduced-motion .roundabout-signal,
.roundabout-game.is-reduced-motion .roundabout-signal.is-guided,
.roundabout-game.is-reduced-motion .roundabout-pressure b,
.roundabout-game.is-reduced-motion .roundabout-loading::after {
  transition: none !important;
  animation: none !important;
}
.roundabout-canvas:focus-visible {
  box-shadow: inset 0 0 0 4px #f2cc3d;
}
.roundabout-loading {
  position: absolute;
  z-index: 9;
  top: 50%;
  left: 50%;
  display: grid;
  width: min(300px, calc(100% - 40px));
  gap: 8px;
  padding: 20px 24px;
  border: 3px solid #292238;
  border-radius: 8px;
  background: #fff0c7;
  color: #292238;
  box-shadow: 8px 9px 0 rgb(16 11 25 / 0.5);
  font-family: var(--studio-mono);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
  transform: translate(-50%, -50%) rotate(-1.5deg);
}
.roundabout-loading[hidden] { display: none; }
.roundabout-loading::after {
  width: 34px;
  height: 34px;
  justify-self: center;
  border: 7px solid #f05a50;
  border-top-color: #f2cc3d;
  border-radius: 50%;
  content: "";
  animation: roundabout-build 0.75s steps(6, end) infinite;
}
.roundabout-loading strong { font-family: var(--studio-display); font-size: 1.75rem; letter-spacing: -0.035em; text-transform: none; }
.roundabout-loading span { line-height: 1.4; }
.roundabout-loading.is-failed::after { display: none; }
.roundabout-hud {
  z-index: 5;
  top: 70px;
}
.roundabout-title {
  color: #fff0c7;
  filter: drop-shadow(4px 5px 0 rgb(22 14 31 / 0.5));
  transform: rotate(-1.2deg);
}
.roundabout-title p,
.roundabout-phase,
.roundabout-pressure > span,
.roundabout-guide > p,
.roundabout-report__card > p {
  letter-spacing: 0.12em;
}
.roundabout-title h1 {
  color: #f5d547;
  font-size: clamp(2.4rem, 5vw, 4.9rem);
  font-weight: 500;
  line-height: 0.82;
  text-shadow: 2px 2px 0 #292238, 4px 5px 0 rgb(18 12 28 / 0.38);
}
.roundabout-readouts {
  gap: 0;
  padding: 5px;
  border: 3px solid #292238;
  border-radius: 8px;
  background: #fff0c7;
  box-shadow: 6px 7px 0 rgb(17 11 26 / 0.45);
  transform: rotate(0.7deg);
  backdrop-filter: none;
}
.roundabout-readouts span {
  border-right: 2px solid rgb(41 34 56 / 0.2);
}
.roundabout-readouts small { color: #6a5c70; }
.roundabout-readouts strong { color: #292238; }
.roundabout-readouts button,
.roundabout-camera button,
.roundabout-guide button,
.roundabout-report button {
  border: 2px solid #292238;
  border-radius: 8px;
  background: #4cc4c2;
  color: #292238;
  box-shadow: 2px 3px 0 #292238;
}
.roundabout-readouts button:hover,
.roundabout-readouts button:focus-visible,
.roundabout-camera button:hover,
.roundabout-camera button:focus-visible,
.roundabout-guide button:hover,
.roundabout-guide button:focus-visible,
.roundabout-report button:hover,
.roundabout-report button:focus-visible {
  background: #f2cc3d;
  color: #292238;
  transform: translateY(-1px);
}
.roundabout-readouts button:active,
.roundabout-camera button:active,
.roundabout-guide button:active,
.roundabout-report button:active {
  box-shadow: 0 1px 0 #292238;
  transform: translate(2px, 2px);
}
.roundabout-camera {
  position: absolute;
  z-index: 4;
  bottom: 19px;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 6px 6px 12px;
  border: 2px solid #292238;
  border-radius: 8px;
  background: #fff0c7;
  color: #292238;
  box-shadow: 4px 5px 0 rgb(18 12 28 / 0.42);
  font-family: var(--studio-mono);
  font-size: 0.59rem;
  font-weight: 900;
  line-height: 1.35;
  transform: translateX(-50%) rotate(-0.6deg);
}
.roundabout-camera span { transition: opacity 180ms ease; }
.roundabout-camera__touch { display: none; }
.roundabout-camera.is-used span { opacity: 0.48; }
.roundabout-camera button {
  min-height: 34px;
  padding: 6px 9px;
  cursor: pointer;
  font: inherit;
  text-transform: uppercase;
}
.roundabout-phase {
  z-index: 4;
  border: 2px solid #292238;
  border-radius: 8px;
  background: #8d5e98;
  color: #fff0c7;
  box-shadow: 4px 5px 0 rgb(18 12 28 / 0.38);
  transform: rotate(1deg);
  backdrop-filter: none;
}
.roundabout-pressure {
  z-index: 4;
  border: 2px solid #292238;
  border-radius: 8px;
  background: #fff0c7;
  color: #292238;
  box-shadow: 4px 5px 0 rgb(18 12 28 / 0.38);
  transform: rotate(-0.7deg);
  backdrop-filter: none;
}
.roundabout-pressure i { background: #cdbf9f; }
.roundabout-pressure b { background: linear-gradient(90deg, #59c97a 0 34%, #f2cc3d 58%, #f05a50 100%); }
.roundabout-pressure strong { color: #b83f3f; }
.roundabout-signal {
  z-index: 5;
  width: 66px;
  min-height: 74px;
  padding: 4px;
  border: 3px solid #292238;
  border-radius: 8px;
  background: #fff0c7;
  box-shadow: 5px 6px 0 rgb(18 12 28 / 0.48);
}
.roundabout-signal:hover,
.roundabout-signal:focus-visible {
  box-shadow: 0 0 0 4px #f2cc3d, 6px 7px 0 rgb(18 12 28 / 0.5);
}
.roundabout-signal.is-guided {
  box-shadow: 0 0 0 5px #f2cc3d, 0 0 0 11px rgb(242 204 61 / 0.28), 6px 7px 0 rgb(18 12 28 / 0.5);
}
.roundabout-signal__body {
  border: 2px solid #292238;
  border-radius: 8px;
  background: #3a3442;
  box-shadow: none;
}
.roundabout-signal:not(.is-green) .roundabout-signal__body i:first-child { box-shadow: inset 0 0 0 3px #ff8c80; }
.roundabout-signal.is-green .roundabout-signal__body i:last-child { box-shadow: inset 0 0 0 3px #a4edaa; }
.roundabout-signal kbd { border: 1px solid #292238; border-radius: 5px; background: #fff8dc; }
.roundabout-signal__label em { background: #f2cc3d; }
.roundabout-notice {
  z-index: 6;
  top: 157px;
  width: min(460px, calc(100% - 32px));
  border: 3px solid #292238;
  border-radius: 8px;
  background: #f05a50;
  color: #fff7de;
  box-shadow: 6px 7px 0 rgb(18 12 28 / 0.45);
  transform: translateX(-50%) rotate(-0.8deg);
  backdrop-filter: none;
}
.roundabout-guide {
  z-index: 8;
  border: 3px solid #292238;
  border-radius: 8px;
  background: #fff0c7;
  color: #292238;
  box-shadow: 9px 10px 0 rgb(18 12 28 / 0.52);
  transform: rotate(0.8deg);
}
.roundabout-guide--quick { transform: translate(-50%, -50%) rotate(-1deg); }
.roundabout-guide > span { color: #5f5267; }
.roundabout-game.has-guide::after { z-index: 7; background: rgb(21 13 31 / 0.55); }
.roundabout-game.has-guide .roundabout-guide,
.roundabout-game.has-guide .roundabout-signal.is-guided { z-index: 9; }
.roundabout-report {
  z-index: 10;
  background: rgb(22 14 31 / 0.8);
  backdrop-filter: blur(6px);
}
.roundabout-report__card {
  border: 3px solid #292238;
  border-radius: 8px;
  background: #fff0c7;
  color: #292238;
  box-shadow: 12px 14px 0 rgb(10 7 16 / 0.5);
  clip-path: polygon(0.7% 1.5%, 98.9% 0, 100% 97.8%, 2% 100%);
  transform: rotate(-0.35deg);
}
.roundabout-report__heading strong {
  border-color: #292238;
  background: #f2cc3d;
}
.roundabout-report__copy { color: #5f5267; }

@keyframes roundabout-build {
  to { transform: rotate(1turn); }
}

@keyframes roundabout-crash-shake {
  0%, 100% { transform: translate(0); }
  20% { transform: translate(-7px, 3px) rotate(-0.25deg); }
  40% { transform: translate(6px, -2px) rotate(0.2deg); }
  60% { transform: translate(-4px, -1px); }
  80% { transform: translate(3px, 2px); }
}

@media (max-width: 760px) {
  .roundabout-game { min-height: 680px; }
  .roundabout-hud {
    z-index: 6;
    top: 55px;
  }
  .roundabout-title { align-items: end; }
  .roundabout-title h1 { font-size: clamp(2.05rem, 10.5vw, 3.1rem); }
  .roundabout-readouts { box-shadow: 4px 5px 0 rgb(17 11 26 / 0.45); transform: none; }
  .roundabout-camera {
    right: auto;
    bottom: 76px;
    width: min(300px, calc(100% - 36px));
    justify-content: space-between;
    padding-left: 9px;
    font-size: 0.52rem;
  }
  .roundabout-camera__desktop { display: none; }
  .roundabout-camera__touch { display: inline; }
  .roundabout-camera button { min-height: 32px; white-space: nowrap; }
  .roundabout-notice { top: 188px; font-size: 0.62rem; }
  .roundabout-signal { width: 58px; min-height: 66px; }
  .roundabout-signal__label { font-size: 0.48rem; }
  .roundabout-phase { bottom: 18px; max-width: 39vw; }
  .roundabout-pressure { bottom: 14px; width: 44vw; }
  .roundabout-guide--first { right: 12px; bottom: 118px; left: 12px; }
  .roundabout-guide--quick { width: calc(100% - 28px); }
  .roundabout-report__card { clip-path: none; transform: none; }
}

@media (max-height: 700px) and (min-width: 761px) {
  .roundabout-camera { bottom: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  .roundabout-loading::after { animation: none; }
  .roundabout-game.has-failure .roundabout-canvas { animation: none; }
  .roundabout-camera span { transition: none; }
}

/* Star Chart — a quiet drawing sky and its engraved keepsake. */
.game-dialog[data-game="star-chart"] { overflow: hidden; background: #030711; }
.game-dialog[data-game="star-chart"] .game-dialog__chrome {
  padding-right: 5px;
  border-color: rgb(225 226 213 / 0.18);
  background: rgb(4 9 18 / 0.68);
  color: #e9e7d7;
}
.game-dialog[data-game="star-chart"] .game-dialog__count { display: none; }
.star-chart-experience {
  position: relative;
  width: 100%;
  min-height: 100svh;
  overflow: hidden;
  background: #030711;
  color: #e9e7d7;
  isolation: isolate;
}
.star-chart-sky {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 100svh;
  touch-action: none;
  user-select: none;
}
.star-chart-sky:focus-visible { outline: 1px solid rgb(231 213 173 / 0.72); outline-offset: -7px; }
.star-chart-mast {
  position: absolute;
  z-index: 2;
  top: clamp(28px, 4vw, 58px);
  right: clamp(24px, 4vw, 64px);
  left: clamp(24px, 4vw, 64px);
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 24px;
  pointer-events: none;
}
.star-chart-mast div { display: grid; gap: 4px; }
.star-chart-mast span,
.star-chart-mast p,
.star-chart-progress span,
.star-chart-naming > p,
.celestial-card__kicker,
.celestial-card__copy > p:first-child,
.celestial-card__traits {
  font-family: var(--studio-mono);
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.star-chart-mast span { color: rgb(225 229 221 / 0.48); }
.star-chart-mast strong {
  font-family: var(--studio-display);
  font-size: clamp(2.35rem, 4.1vw, 4.6rem);
  font-weight: 400;
  letter-spacing: -0.055em;
  line-height: 0.85;
}
.star-chart-mast p {
  margin: 3px 0 0;
  color: rgb(225 229 221 / 0.47);
  text-align: right;
}
.star-chart-guidance {
  position: absolute;
  z-index: 2;
  top: 39%;
  left: clamp(22px, 4vw, 64px);
  max-width: 24ch;
  margin: 0;
  color: rgb(235 227 205 / 0.66);
  font-family: var(--studio-display);
  font-size: clamp(1.05rem, 1.8vw, 1.55rem);
  font-style: italic;
  line-height: 1.2;
  pointer-events: none;
  transition: opacity 450ms ease, transform 450ms ease;
}
.star-chart-guidance.is-quiet { opacity: 0; transform: translateY(-8px); }
.star-chart-toolbar {
  position: absolute;
  z-index: 2;
  right: clamp(18px, 3vw, 42px);
  bottom: clamp(18px, 3vw, 38px);
  left: clamp(18px, 3vw, 42px);
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 13px 14px 13px 19px;
  border: 1px solid rgb(222 225 213 / 0.16);
  background: rgb(3 9 18 / 0.62);
  box-shadow: 0 18px 52px rgb(0 0 0 / 0.32), inset 0 1px 0 rgb(255 255 255 / 0.04);
  backdrop-filter: blur(18px) saturate(112%);
  -webkit-backdrop-filter: blur(18px) saturate(112%);
}
.star-chart-progress { display: grid; min-width: 0; gap: 5px; }
.star-chart-progress strong { font-family: var(--studio-display); font-size: 1.12rem; font-weight: 400; }
.star-chart-progress span { overflow: hidden; color: rgb(226 230 221 / 0.46); text-overflow: ellipsis; white-space: nowrap; }
.star-chart-actions { display: flex; flex: 0 0 auto; gap: 7px; }
.star-chart-actions button,
.star-chart-suggestions button,
.star-chart-naming form button,
.star-chart-panel-close,
.star-chart-another {
  min-height: 44px;
  border: 1px solid rgb(225 229 218 / 0.18);
  background: rgb(224 226 211 / 0.055);
  color: #e9e7d7;
  cursor: pointer;
}
.star-chart-actions button { min-width: 66px; padding: 9px 13px; }
.star-chart-actions button:hover,
.star-chart-actions button:focus-visible,
.star-chart-suggestions button:hover,
.star-chart-suggestions button:focus-visible { background: rgb(224 226 211 / 0.13); }
.star-chart-actions button:disabled { cursor: default; opacity: 0.32; }
.star-chart-actions .star-chart-name-action {
  border-color: rgb(232 208 157 / 0.5);
  background: #d6bd85;
  color: #171510;
  font-family: var(--studio-display);
  font-size: 1.02rem;
}
.star-chart-actions .star-chart-name-action:hover,
.star-chart-actions .star-chart-name-action:focus-visible { background: #ead8ae; }
.star-chart-naming {
  position: absolute;
  z-index: 3;
  top: 50%;
  left: 50%;
  display: grid;
  width: min(540px, calc(100% - 36px));
  gap: 18px;
  padding: clamp(26px, 4.2vw, 48px);
  border: 1px solid rgb(226 222 201 / 0.24);
  background: rgb(7 14 24 / 0.9);
  box-shadow: 0 38px 100px rgb(0 0 0 / 0.56), inset 0 1px 0 rgb(255 255 255 / 0.05);
  transform: translate(-50%, -50%);
  backdrop-filter: blur(25px) saturate(118%);
  -webkit-backdrop-filter: blur(25px) saturate(118%);
  animation: star-chart-panel-in 420ms cubic-bezier(0.22, 1, 0.36, 1);
}
.star-chart-naming[hidden],
.star-chart-finale[hidden] { display: none; }
.star-chart-panel-close {
  position: absolute;
  top: 11px;
  right: 11px;
  width: 42px;
  padding: 0;
  border: 0;
  background: transparent;
  color: rgb(235 233 218 / 0.6);
  font-size: 1.25rem;
}
.star-chart-naming > p { margin: 0; color: rgb(228 227 210 / 0.5); }
.star-chart-naming h2 {
  max-width: 10ch;
  margin: 0 0 3px;
  font-family: var(--studio-display);
  font-size: clamp(2.7rem, 5.8vw, 5rem);
  font-weight: 400;
  letter-spacing: -0.065em;
  line-height: 0.85;
}
.star-chart-suggestions { display: flex; flex-wrap: wrap; gap: 7px; }
.star-chart-suggestions button { min-height: 36px; padding: 7px 10px; color: rgb(235 233 219 / 0.68); font-size: 0.76rem; }
.star-chart-suggestions button.is-selected { border-color: #d8bc83; background: rgb(216 188 131 / 0.15); color: #f1e4c8; }
.star-chart-naming form { display: grid; grid-template-columns: 1fr auto; gap: 7px; }
.star-chart-naming label {
  grid-column: 1 / -1;
  color: rgb(228 227 210 / 0.52);
  font-family: var(--studio-mono);
  font-size: 0.57rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}
.star-chart-naming input {
  width: 100%;
  min-width: 0;
  height: 48px;
  padding: 10px 12px;
  border: 1px solid rgb(229 226 205 / 0.25);
  border-radius: 0;
  background: rgb(237 232 211 / 0.07);
  color: #f0ecdc;
  font-family: var(--studio-display);
  font-size: 1.12rem;
}
.star-chart-naming form button { padding: 10px 17px; border-color: #d8bc83; background: #d8bc83; color: #15130f; font-weight: 700; }
.star-chart-naming form button:hover,
.star-chart-naming form button:focus-visible { background: #ead8ae; }
.star-chart-finale {
  position: absolute;
  z-index: 3;
  inset: 0;
  display: grid;
  overflow: auto;
  place-items: center;
  gap: 18px;
  padding: clamp(76px, 8vh, 108px) 24px 28px;
  background: rgb(1 5 10 / 0.78);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
}
.celestial-card {
  position: relative;
  display: grid;
  width: min(820px, 100%);
  grid-template-rows: auto minmax(230px, 38vh) auto;
  gap: clamp(16px, 2.4vw, 26px);
  padding: clamp(24px, 4vw, 50px);
  border: 1px solid #6e4c30;
  outline: 5px double rgb(101 67 42 / 0.66);
  outline-offset: -14px;
  background:
    radial-gradient(circle at 22% 17%, rgb(255 247 213 / 0.42), transparent 25%),
    linear-gradient(145deg, #eedcb5, #d0ae78 68%, #b88d5d);
  box-shadow: 0 42px 100px rgb(0 0 0 / 0.68), inset 0 0 70px rgb(97 60 33 / 0.14);
  color: #4c3425;
  animation: star-chart-card-in 600ms cubic-bezier(0.22, 1, 0.36, 1);
}
.celestial-card::before,
.celestial-card::after {
  position: absolute;
  width: 34px;
  height: 34px;
  border-color: rgb(81 54 37 / 0.64);
  content: "";
  pointer-events: none;
}
.celestial-card::before { top: 20px; left: 20px; border-top: 1px solid; border-left: 1px solid; }
.celestial-card::after { right: 20px; bottom: 20px; border-right: 1px solid; border-bottom: 1px solid; }
.celestial-card__kicker { display: flex; justify-content: space-between; gap: 20px; color: rgb(77 52 36 / 0.68); }
.celestial-card canvas { display: block; width: 100%; height: 100%; min-height: 230px; border: 1px solid rgb(91 59 38 / 0.32); mix-blend-mode: multiply; }
.celestial-card__copy { display: grid; gap: 10px; text-align: center; }
.celestial-card__copy > p:first-child { margin: 0; color: rgb(77 52 36 / 0.62); }
.celestial-card__copy h2 {
  margin: 0;
  font-family: var(--studio-display);
  font-size: clamp(3rem, 6.5vw, 6.4rem);
  font-weight: 400;
  letter-spacing: -0.065em;
  line-height: 0.82;
}
.celestial-card__myth {
  max-width: 68ch;
  margin: 3px auto 2px;
  color: rgb(66 45 32 / 0.86);
  font-family: var(--studio-display);
  font-size: clamp(0.9rem, 1.4vw, 1.08rem);
  line-height: 1.55;
}
.celestial-card__traits { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px 14px; color: rgb(77 52 36 / 0.63); }
.celestial-card__traits span + span::before { margin-right: 14px; content: "✦"; }
.star-chart-another {
  min-width: 170px;
  padding: 11px 18px;
  border-color: rgb(225 215 189 / 0.5);
  background: rgb(226 211 174 / 0.12);
  color: #f0ead8;
  font-family: var(--studio-display);
  font-size: 1rem;
  backdrop-filter: blur(12px);
}
.star-chart-another:hover,
.star-chart-another:focus-visible { background: rgb(226 211 174 / 0.23); }
@keyframes star-chart-panel-in { from { opacity: 0; transform: translate(-50%, calc(-50% + 20px)) scale(0.96); } }
@keyframes star-chart-card-in { from { opacity: 0; transform: translateY(28px) scale(0.96) rotate(-0.6deg); } }

@media (max-width: 620px) {
  .star-chart-mast { top: 70px; right: 18px; left: 18px; }
  .star-chart-mast p { display: none; }
  .star-chart-mast span { font-size: 0.5rem; }
  .star-chart-mast strong { font-size: 2.65rem; }
  .star-chart-guidance { top: 35%; left: 20px; font-size: 1.05rem; }
  .star-chart-toolbar {
    right: 10px;
    bottom: 10px;
    left: 10px;
    min-height: 0;
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
  }
  .star-chart-progress { gap: 2px; }
  .star-chart-progress strong { font-size: 1rem; }
  .star-chart-progress span { font-size: 0.5rem; }
  .star-chart-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .star-chart-actions button { min-width: 0; min-height: 42px; padding: 8px 7px; }
  .star-chart-naming { top: 52%; gap: 15px; padding: 25px 19px 20px; }
  .star-chart-naming h2 { font-size: 2.75rem; }
  .star-chart-suggestions { display: grid; grid-template-columns: 1fr; }
  .star-chart-suggestions button { overflow: hidden; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
  .star-chart-naming form { grid-template-columns: 1fr; }
  .star-chart-naming form button { min-height: 46px; }
  .star-chart-finale { align-content: start; place-items: start center; padding: 82px 12px 20px; }
  .celestial-card { grid-template-rows: auto 190px auto; gap: 14px; padding: 24px 18px 28px; outline-offset: -10px; }
  .celestial-card canvas { min-height: 190px; }
  .celestial-card__kicker { font-size: 0.47rem; }
  .celestial-card__copy h2 { font-size: clamp(2.65rem, 14vw, 4.2rem); }
  .celestial-card__myth { font-size: 0.88rem; line-height: 1.48; }
  .celestial-card__traits { gap: 4px 9px; font-size: 0.48rem; }
  .celestial-card__traits span + span::before { margin-right: 9px; }
  .star-chart-another { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .star-chart-guidance,
  .star-chart-naming,
  .celestial-card { transition: none; animation: none; }
}
/* Pass the Butter */
/* Author display rules would otherwise defeat the [hidden] attribute. */
.butter-game [hidden] { display: none; }
.game-dialog[data-game="butter"] {
  background: #2b241a;
}
.game-dialog[data-game="butter"] .game-dialog__chrome {
  border: 1px solid rgb(58 46 30 / 0.18);
  background: rgb(250 244 224 / 0.86);
  color: #34291b;
  box-shadow: 0 10px 28px rgb(32 24 14 / 0.24);
  backdrop-filter: blur(12px);
}
.game-dialog[data-game="butter"] .game-dialog__count { display: none; }
.butter-game {
  --butter-ink: #33291c;
  --butter-paper: #fdf6e0;
  position: relative;
  width: 100%;
  height: 100svh;
  min-height: 620px;
  overflow: hidden;
  background: linear-gradient(160deg, #c8b48b, #6f6552);
  color: var(--butter-ink);
  isolation: isolate;
}
.butter-canvas {
  position: absolute;
  z-index: 0;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  outline: none;
  touch-action: none;
}
.butter-canvas:focus-visible { box-shadow: inset 0 0 0 4px #ffe9a3; }
.butter-loading {
  position: absolute;
  z-index: 4;
  inset: 0;
  display: grid;
  gap: 6px;
  place-content: center;
  padding: 24px;
  background: #2b241a;
  color: #f4e9c8;
  font-size: 0.95rem;
  text-align: center;
}
.butter-loading.is-failed { gap: 10px; }
.butter-loading strong { font-size: 1.05rem; }
.butter-hud {
  position: absolute;
  z-index: 3;
  top: 76px;
  right: clamp(16px, 2.6vw, 34px);
  left: clamp(16px, 2.6vw, 34px);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
  pointer-events: none;
}
.butter-title p,
.butter-title h1 {
  /* The scene behind this runs from pale cloth to his dark shirt. */
  text-shadow: 0 1px 12px rgb(250 244 224 / 0.75), 0 0 3px rgb(250 244 224 / 0.6);
}
.butter-title p {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.75;
}
.butter-title h1 {
  margin: 2px 0 0;
  font-size: clamp(1.1rem, 2.6vw, 1.5rem);
  letter-spacing: 0.01em;
}
.butter-readouts {
  display: flex;
  gap: 10px;
}
.butter-readouts span {
  display: grid;
  min-width: 68px;
  padding: 6px 10px;
  border: 1px solid rgb(52 41 27 / 0.16);
  border-radius: 10px;
  background: rgb(253 246 224 / 0.82);
  text-align: center;
}
.butter-readouts small {
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.7;
}
.butter-readouts strong {
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}
.butter-mute {
  align-self: stretch;
  padding: 6px 12px;
  border: 1px solid rgb(52 41 27 / 0.16);
  border-radius: 10px;
  background: rgb(253 246 224 / 0.82);
  color: var(--butter-ink);
  font: inherit;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  pointer-events: auto;
}
.butter-mute:hover { background: #fff; }
.butter-mute:focus-visible { outline: 3px solid #ffd873; outline-offset: 2px; }
.butter-mute[disabled] { cursor: default; opacity: 0.55; }
.butter-task {
  position: absolute;
  z-index: 3;
  top: 148px;
  left: 50%;
  margin: 0;
  padding: 6px 14px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: rgb(43 36 26 / 0.7);
  color: #fdf6e0;
  font-size: 0.86rem;
  pointer-events: none;
}
.butter-caption {
  position: absolute;
  z-index: 3;
  bottom: clamp(120px, 20vh, 190px);
  left: 50%;
  display: flex;
  gap: 8px;
  align-items: baseline;
  max-width: min(620px, 88vw);
  padding: 10px 16px;
  transform: translateX(-50%);
  border-radius: 12px;
  background: rgb(28 23 16 / 0.82);
  color: #fdf6e0;
  font-size: clamp(0.92rem, 2.3vw, 1.06rem);
  line-height: 1.35;
  pointer-events: none;
}
.butter-caption b {
  flex: none;
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.62;
}
.butter-caption.is-stage { font-style: italic; opacity: 0.86; }
.butter-choice {
  position: absolute;
  z-index: 4;
  bottom: clamp(48px, 9vh, 88px);
  left: 50%;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  transform: translateX(-50%);
}
.butter-choice button {
  padding: 12px 20px;
  border: 1px solid rgb(52 41 27 / 0.2);
  border-radius: 999px;
  background: var(--butter-paper);
  color: var(--butter-ink);
  font: inherit;
  font-size: clamp(0.9rem, 2.2vw, 1rem);
  cursor: pointer;
}
.butter-choice button:hover { background: #fff;}
.butter-choice button:focus-visible { outline: 3px solid #ffd873; outline-offset: 2px; }
.butter-controls {
  position: absolute;
  z-index: 3;
  right: clamp(16px, 3vw, 30px);
  bottom: clamp(20px, 5vh, 46px);
  left: clamp(16px, 3vw, 30px);
  display: none;
  align-items: flex-end;
  justify-content: space-between;
  pointer-events: none;
}
.butter-game.is-touch .butter-controls { display: flex; }
.butter-game.is-touch .butter-keys { display: none; }
/* Nothing to drive while he is waiting for an answer, and the stick sits
   exactly where the answers go. */
.butter-game.is-choosing .butter-controls { display: none; }
.butter-stick {
  position: relative;
  width: 116px;
  height: 116px;
  border: 1px solid rgb(52 41 27 / 0.22);
  border-radius: 50%;
  background: rgb(253 246 224 / 0.42);
  pointer-events: auto;
  touch-action: none;
}
.butter-stick i {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 46px;
  height: 46px;
  margin: -23px 0 0 -23px;
  border-radius: 50%;
  background: rgb(253 246 224 / 0.92);
}
.butter-grip {
  padding: 18px 26px;
  border: 1px solid rgb(52 41 27 / 0.22);
  border-radius: 999px;
  background: rgb(253 246 224 / 0.92);
  color: var(--butter-ink);
  font: inherit;
  pointer-events: auto;
  touch-action: none;
}
.butter-keys {
  position: absolute;
  z-index: 3;
  bottom: clamp(14px, 3vh, 26px);
  left: 50%;
  margin: 0;
  transform: translateX(-50%);
  color: #fdf6e0;
  font-size: 0.76rem;
  opacity: 0.68;
  pointer-events: none;
}
/* The lens dirties from stage two and never comes clean again. */
.butter-lens {
  position: absolute;
  z-index: 2;
  inset: 0;
  opacity: 0;
  transition: opacity 900ms ease;
  pointer-events: none;
  background:
    radial-gradient(58% 48% at 38% 34%, rgb(255 246 214 / 0.3) 0 42%, transparent 72%),
    radial-gradient(30% 26% at 68% 62%, rgb(226 210 168 / 0.34) 0 44%, transparent 76%),
    radial-gradient(120% 96% at 50% 50%, transparent 44%, rgb(28 22 14 / 0.55) 100%);
}
.butter-lens[data-stage="2"] { opacity: 0.55; }
.butter-lens[data-stage="3"] { opacity: 0.72; }
.butter-lens[data-stage="4"] { opacity: 0.85; }
.butter-lens[data-stage="5"] { opacity: 0.94; }
.butter-lens[data-stage="6"] { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .butter-lens { transition: none; }
  /* No frame drops without motion, so the smear carries the fault alone. */
  .butter-lens[data-stage="4"],
  .butter-lens[data-stage="5"],
  .butter-lens[data-stage="6"] { opacity: 1; }
}
/* From the stage the camera starts failing, the picture admits it is a
   picture: interlace lines, and a tear whenever a frame does not arrive. */
.butter-signal {
  position: absolute;
  z-index: 2;
  inset: 0;
  opacity: 0;
  transition: opacity 700ms ease;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgb(12 10 6 / 0.16) 0 1px,
    transparent 1px 3px
  );
}
.butter-signal[data-stage="4"],
.butter-signal[data-stage="5"],
.butter-signal[data-stage="6"] { opacity: 1; }
.butter-canvas {
  transition: transform 60ms steps(2, end), filter 60ms linear;
}
.butter-game.is-tearing .butter-canvas {
  transform: translateY(-7px) scaleY(1.012);
  filter: brightness(0.82) contrast(1.22) saturate(0.72);
}
/* The band of nothing where the missing frame should be. */
.butter-game.is-tearing .butter-signal::after {
  position: absolute;
  content: "";
  inset: 0;
  background:
    linear-gradient(to bottom, transparent 28%, rgb(232 226 205 / 0.5) 29%, rgb(24 20 13 / 0.55) 31%, transparent 34%),
    linear-gradient(to bottom, transparent 62%, rgb(24 20 13 / 0.4) 64%, transparent 67%);
}
@media (prefers-reduced-motion: reduce) {
  /* No frames are dropped without motion, so nothing tears either. */
  .butter-canvas { transition: none; }
  .butter-game.is-tearing .butter-canvas { transform: none; filter: none; }
  .butter-game.is-tearing .butter-signal::after { content: none; }
}

/* Hardware speaking for itself: the lens has no microphone, so it says so
   once and then never mentions it again. */
.butter-notice {
  position: absolute;
  z-index: 3;
  right: clamp(16px, 2.6vw, 34px);
  bottom: clamp(200px, 30vh, 260px);
  margin: 0;
  padding: 7px 12px;
  border: 1px solid rgb(253 246 224 / 0.28);
  border-radius: 8px;
  background: rgb(28 23 16 / 0.72);
  color: rgb(253 246 224 / 0.82);
  font-size: 0.64rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  pointer-events: none;
}
.butter-notice::before {
  margin-right: 8px;
  content: "⃠";
  opacity: 0.7;
}
@media (max-width: 620px) {
  .butter-notice {
    right: auto;
    bottom: auto;
    top: 232px;
    left: 50%;
    transform: translateX(-50%);
  }
}

/* The one morning he looks up: nothing on screen but him. */
.butter-game.is-held .butter-hud,
.butter-game.is-held .butter-task,
.butter-game.is-held .butter-controls,
.butter-game.is-held .butter-keys { opacity: 0; transition: opacity 500ms ease; }
@media (prefers-reduced-motion: reduce) {
  .butter-game.is-held .butter-hud,
  .butter-game.is-held .butter-task,
  .butter-game.is-held .butter-controls,
  .butter-game.is-held .butter-keys { transition: none; }
}

/* Being replaced: nothing is yours to read any more. */
.butter-game.is-finale .butter-hud,
.butter-game.is-finale .butter-task,
.butter-game.is-finale .butter-controls,
.butter-game.is-finale .butter-keys { display: none; }
.butter-game.is-finale .butter-signal { opacity: 0; }
.butter-game.is-finale .butter-caption { bottom: clamp(60px, 12vh, 110px); }
.butter-card.is-bare h2,
.butter-card.is-bare > .butter-card__inner > p { display: none; }
.butter-card.is-bare .butter-card__inner { gap: 18px; padding: 34px 30px; }
.butter-fade {
  position: absolute;
  z-index: 4;
  inset: 0;
  background: #1b160f;
  opacity: 0;
  transition: opacity 300ms ease;
  pointer-events: none;
}
.butter-fade.is-on { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .butter-lens { transition: none; }
  /* No frame drops without motion, so the smear carries the fault alone. */
  .butter-lens[data-stage="4"],
  .butter-lens[data-stage="5"],
  .butter-lens[data-stage="6"] { opacity: 1; }
  .butter-fade { transition-duration: 110ms; }
}
.butter-card {
  position: absolute;
  z-index: 5;
  inset: 0;
  display: grid;
  place-content: center;
  padding: 24px;
  background: rgb(24 19 13 / 0.72);
}
.butter-card__inner {
  display: grid;
  gap: 10px;
  width: min(420px, 90vw);
  padding: 26px;
  border-radius: 16px;
  background: var(--butter-paper);
  text-align: center;
}
.butter-card__inner p {
  margin: 0;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.66;
}
.butter-card__inner h2 { margin: 0; font-size: clamp(1.1rem, 3vw, 1.4rem); }
.butter-card__inner dl {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 0;
}
.butter-card__inner dt {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.7;
}
.butter-card__inner dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.butter-card__inner button {
  justify-self: center;
  padding: 11px 22px;
  border: 1px solid rgb(52 41 27 / 0.24);
  border-radius: 999px;
  background: transparent;
  color: var(--butter-ink);
  font: inherit;
  cursor: pointer;
}
@media (max-width: 620px) {
  .butter-hud {
    top: 68px;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .butter-title h1 { font-size: 1.05rem; }
  /* The readouts stack under the title here, so the task clears both. */
  .butter-task { top: 196px; }
  .butter-choice { bottom: clamp(40px, 8vh, 72px); }
}

/* Fireplace — orbitable bonfire diorama */
.game-card__icon--fireplace { background: #140c09; }
.game-dialog[data-game="fireplace"] { background: #09090d; color: #f3e5d1; }
.game-dialog[data-game="fireplace"] .game-dialog__chrome {
  top: max(8px, env(safe-area-inset-top));
  padding-right: 5px;
  border: 1px solid rgb(238 207 166 / 0.38);
  border-radius: 4px;
  background: #2f2728;
  box-shadow: 5px 6px 0 rgb(0 0 0 / 0.48);
  transform: rotate(0.7deg);
}
.game-dialog[data-game="fireplace"] .game-dialog__count { display: none; }
.game-dialog[data-game="fireplace"] .icon-button { color: #eed6bb; }
.game-dialog[data-game="fireplace"] .icon-button:hover { background: rgb(255 181 111 / 0.12); }

.fireplace-experience {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 100svh;
  overflow: hidden;
  color: #f3e5d1;
  background: #09090d;
  isolation: isolate;
}
.fireplace-experience canvas {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 100svh;
  touch-action: none;
  cursor: grab;
}
.fireplace-experience canvas:focus-visible {
  outline: 2px solid rgb(255 181 105 / 0.7);
  outline-offset: -8px;
}
.fireplace-experience canvas.is-blowing { cursor: crosshair; }
.fireplace-experience canvas.is-orbiting,
.fireplace-experience canvas.is-moving-poker { cursor: grabbing; }

.fireplace-camera {
  position: absolute;
  z-index: 4;
  top: max(20px, env(safe-area-inset-top));
  left: max(20px, env(safe-area-inset-left));
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 7px 6px 10px;
  border: 1px solid rgb(230 207 171 / 0.3);
  border-radius: 2px;
  background: #283128;
  box-shadow: 4px 5px 0 rgb(0 0 0 / 0.42);
  color: rgb(240 224 194 / 0.72);
  font-family: var(--studio-mono);
  font-size: 0.54rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  transform: rotate(-0.6deg);
}
.fireplace-camera button {
  display: flex;
  min-height: 30px;
  align-items: center;
  gap: 7px;
  padding: 5px 7px;
  border: 1px solid rgb(238 206 163 / 0.22);
  border-radius: 2px;
  background: #182019;
  color: #f0dfc6;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
}
.fireplace-camera button:hover,
.fireplace-camera button:focus-visible { background: #46553f; outline: 2px solid rgb(236 173 100 / 0.58); }
.fireplace-camera kbd {
  color: rgb(244 203 149 / 0.66);
  font-family: var(--studio-mono);
}

.fireplace-controls {
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: max(16px, env(safe-area-inset-bottom));
  display: flex;
  gap: 3px;
  padding: 6px;
  border: 1px solid rgb(236 204 162 / 0.42);
  border-radius: 3px;
  background: #2d2220;
  box-shadow: 7px 8px 0 rgb(0 0 0 / 0.54), 0 20px 46px rgb(0 0 0 / 0.24);
  clip-path: polygon(0.5% 3%, 34% 0, 63% 2%, 99.5% 0, 100% 96%, 69% 100%, 32% 97%, 0 100%);
  transform: translateX(-50%) rotate(-0.35deg);
}
.fireplace-controls::before,
.fireplace-controls::after {
  position: absolute;
  z-index: 2;
  top: -5px;
  width: 38px;
  height: 10px;
  background: rgb(203 173 132 / 0.62);
  box-shadow: 1px 2px 0 rgb(0 0 0 / 0.18);
  content: "";
  pointer-events: none;
}
.fireplace-controls::before {
  left: 18px;
  transform: rotate(-5deg);
}
.fireplace-controls::after {
  right: 22px;
  transform: rotate(4deg);
}
.fireplace-controls button {
  display: grid;
  min-width: 128px;
  min-height: 52px;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 3px 13px;
  padding: 9px 10px 8px 12px;
  border: 1px solid rgb(230 190 144 / 0.1);
  border-radius: 2px;
  background: rgb(72 49 42 / 0.2);
  color: rgb(247 229 207 / 0.82);
  text-align: left;
  cursor: pointer;
  transition: background 120ms steps(2, end), color 120ms linear, transform 120ms steps(2, end);
}
.fireplace-controls button + button {
  box-shadow: -3px 0 0 rgb(12 9 9 / 0.26);
}
.fireplace-controls button:hover,
.fireplace-controls button:focus-visible,
.fireplace-controls button[aria-pressed="true"] {
  background: #57301f;
  color: #fff0d9;
  transform: translate(-1px, -2px) rotate(0.4deg);
}
.fireplace-controls button:focus-visible {
  outline: 2px solid rgb(236 155 84 / 0.72);
  outline-offset: 1px;
}
.fireplace-controls button:disabled {
  opacity: 0.36;
  cursor: default;
  transform: none;
}
.fireplace-controls span {
  font-family: var(--studio-mono);
  font-size: 0.64rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.fireplace-controls kbd {
  display: grid;
  width: 23px;
  height: 23px;
  place-items: center;
  border: 1px solid rgb(236 194 144 / 0.32);
  border-radius: 2px;
  background: #1b1515;
  color: rgb(255 218 176 / 0.78);
  font-family: var(--studio-mono);
  font-size: 0.62rem;
  box-shadow: 2px 2px 0 rgb(0 0 0 / 0.35);
  transform: rotate(1.5deg);
}
.fireplace-controls small {
  grid-column: 1 / -1;
  color: rgb(224 190 157 / 0.5);
  font-family: var(--studio-mono);
  font-size: 0.54rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.fireplace-cue {
  position: absolute;
  z-index: 3;
  top: 22%;
  right: clamp(12px, 6vw, 84px);
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: 172px;
  padding: 8px 10px 8px;
  border: 1px solid rgb(237 211 172 / 0.3);
  border-radius: 2px;
  background: rgb(46 51 38 / 0.9);
  box-shadow: 4px 5px 0 rgb(0 0 0 / 0.42);
  color: rgb(239 222 192 / 0.76);
  font-family: var(--studio-mono);
  font-size: 0.58rem;
  line-height: 1.35;
  letter-spacing: 0.075em;
  pointer-events: none;
  text-transform: uppercase;
  clip-path: polygon(1% 5%, 98% 0, 100% 92%, 72% 97%, 42% 94%, 2% 100%);
  transform: rotate(-1.6deg);
  transition: opacity 360ms steps(3, end), transform 360ms steps(3, end);
}
.fireplace-cue::before {
  position: absolute;
  top: -5px;
  left: 50%;
  width: 36px;
  height: 10px;
  background: rgb(195 169 128 / 0.48);
  content: "";
  transform: translateX(-50%) rotate(3deg);
}
.fireplace-cue span {
  width: 7px;
  height: 7px;
  border-radius: 1px;
  background: #c76a36;
  box-shadow: 0 0 0 0 rgb(98 27 18 / 0.28);
  animation: fireplace-cue 2.2s steps(4, end) infinite;
  transform: rotate(45deg);
}
.fireplace-cue p { margin: 0; }
.fireplace-cue.is-hidden { opacity: 0; transform: translateY(8px) rotate(-3deg); }

.fireplace-relight {
  position: absolute;
  z-index: 3;
  top: 53%;
  left: 50%;
  display: grid;
  gap: 7px;
  min-width: min(280px, calc(100vw - 40px));
  padding: 19px 24px;
  border: 1px solid rgb(239 211 176 / 0.52);
  border-radius: 3px;
  background: #a47754;
  color: #241513;
  box-shadow: 7px 8px 0 rgb(0 0 0 / 0.55);
  clip-path: polygon(1% 2%, 98% 0, 100% 95%, 74% 100%, 2% 97%);
  transform: translate(-50%, -50%) rotate(-1deg);
  cursor: pointer;
  animation: fireplace-relight 900ms ease both;
}
.fireplace-relight[hidden] { display: none !important; }
.fireplace-relight small {
  font-family: var(--studio-mono);
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.fireplace-relight span {
  font-family: var(--studio-display);
  font-size: 1.7rem;
}
.fireplace-relight:hover,
.fireplace-relight:focus-visible { border-color: #f4d5aa; color: #100b0a; background: #c19268; }

@keyframes fireplace-cue {
  70%, 100% { box-shadow: 0 0 0 12px transparent; }
}
@keyframes fireplace-relight {
  from { opacity: 0; transform: translate(-50%, -45%) rotate(2deg); }
}

@media (max-width: 600px) {
  .fireplace-camera {
    top: max(72px, calc(env(safe-area-inset-top) + 58px));
    left: 10px;
    max-width: 154px;
    gap: 6px;
    padding: 5px 6px;
    font-size: 0.48rem;
  }
  .fireplace-camera span {
    display: block;
    max-width: 42px;
    line-height: 1.2;
  }
  .fireplace-camera button { min-height: 29px; }
  .fireplace-controls {
    right: 10px;
    bottom: max(10px, env(safe-area-inset-bottom));
    left: 10px;
    gap: 2px;
    padding: 4px;
    transform: rotate(-0.35deg);
  }
  .fireplace-controls button {
    min-width: 0;
    min-height: 54px;
    flex: 1;
    gap: 2px 5px;
    padding: 8px 7px 7px;
  }
  .fireplace-controls span { font-size: 0.56rem; }
  .fireplace-controls kbd { width: 20px; height: 20px; font-size: 0.55rem; }
  .fireplace-controls small { font-size: 0.48rem; }
  .fireplace-cue { top: 24%; right: 9px; max-width: 150px; font-size: 0.52rem; }
}

@media (max-width: 420px) {
  .fireplace-controls button {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }
  .fireplace-controls button + button { box-shadow: -1px 0 rgb(255 224 189 / 0.14); }
  .fireplace-controls span { font-size: 0.52rem; letter-spacing: 0.045em; }
  .fireplace-controls kbd { display: none; }
  .fireplace-camera kbd { display: none; }
  .fireplace-controls small { text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  .fireplace-cue span,
  .fireplace-relight { animation: none; }
  .fireplace-cue,
  .fireplace-controls button,
  .fireplace-camera { transition: none; }
}
/* The Fly */
.fly-experience { position: relative; height: 100%; background: #000; }
.fly-sim { display: block; width: 100%; height: 100%; border: 0; }
.fly-vote {
  position: absolute;
  right: clamp(12px, 3vw, 24px);
  bottom: clamp(12px, 3vw, 24px);
  z-index: 2;
  width: min(320px, calc(100% - 24px));
  max-height: calc(100% - 80px);
  overflow: auto;
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border: 1px solid rgb(255 255 255 / 0.16);
  border-radius: 12px;
  background: rgb(12 14 18 / 0.86);
  backdrop-filter: blur(10px);
  color: #f1f1ec;
  font-family: var(--studio-mono);
  font-size: 0.74rem;
}
.fly-vote p { margin: 0; }
.fly-vote__head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.fly-vote__eyebrow { font-size: 0.62rem; letter-spacing: 0.1em; text-transform: uppercase; color: rgb(241 241 236 / 0.6); }
.fly-vote__name { font-family: var(--studio-serif, Georgia, serif); font-size: 1.15rem; }
.fly-vote__age { line-height: 1.45; }
.fly-vote__hunger { color: rgb(241 241 236 / 0.7); }
.fly-vote__hunger.is-urgent { color: #ff9f7a; }
.fly-vote__feed, .fly-vote__button {
  padding: 10px 0;
  border: 1px solid rgb(255 255 255 / 0.2);
  border-radius: 8px;
  background: rgb(255 255 255 / 0.06);
  color: inherit;
  font: inherit;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.fly-vote__feed:not(:disabled):hover { background: #c98f2e; border-color: #c98f2e; color: #14100a; }
.fly-vote__clock { display: flex; justify-content: space-between; align-items: baseline; padding: 6px 0; border-top: 1px solid rgb(255 255 255 / 0.1); border-bottom: 1px solid rgb(255 255 255 / 0.1); }
.fly-vote__clock small { font-size: 0.62rem; letter-spacing: 0.1em; text-transform: uppercase; color: rgb(241 241 236 / 0.6); }
.fly-vote__clock strong { font-size: 1rem; font-weight: 500; font-variant-numeric: tabular-nums; }
.fly-vote__bar { height: 6px; border-radius: 3px; background: #4c9a6a; overflow: hidden; }
.fly-vote__bar span { display: block; height: 100%; background: #b8422f; transition: width 400ms ease; }
.fly-vote__tally { color: rgb(241 241 236 / 0.75); }
.fly-vote__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fly-vote__button span:last-child { position: relative; }
.fly-vote__hold { position: absolute; inset: 0; width: 0; background: #b8422f; }
.fly-vote__button.is-holding .fly-vote__hold { width: 100%; transition: width 2s linear; }
.fly-vote__button--save:not(:disabled):hover, .fly-vote__button--save.is-chosen { background: #4c9a6a; border-color: #4c9a6a; }
.fly-vote__button--kill.is-chosen { background: #b8422f; border-color: #b8422f; }
.fly-vote__button:disabled, .fly-vote__feed:disabled { cursor: default; opacity: 0.55; }
.fly-vote__button.is-chosen { opacity: 1; }
.fly-vote__note { color: rgb(241 241 236 / 0.6); line-height: 1.4; }
.fly-vote__lineage { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.fly-vote__lineage:empty { display: none; }
.fly-vote__past { display: grid; padding: 4px 8px; border-radius: 6px; border: 1px solid rgb(255 255 255 / 0.12); font-size: 0.62rem; }
.fly-vote__past small { color: rgb(241 241 236 / 0.55); }
.fly-vote__past--killed { border-color: rgb(184 66 47 / 0.7); }
.fly-vote__past--starved { border-color: rgb(201 143 46 / 0.7); }
.fly-final[hidden], .fly-memorial[hidden], .fly-vote[hidden], .fly-splash[hidden] { display: none; }
.fly-splash {
  position: absolute; inset: 0; z-index: 5;
  display: grid; place-items: center; padding: 24px;
  background: rgb(6 7 10 / 0.78); backdrop-filter: blur(6px);
  color: #f1f1ec; font-family: var(--studio-mono);
}
.fly-splash__card { display: grid; gap: 14px; max-width: 46ch; padding: 28px 30px; border: 1px solid rgb(255 255 255 / 0.16); border-radius: 14px; background: rgb(12 14 18 / 0.92); }
.fly-splash__card p { margin: 0; font-size: 0.8rem; line-height: 1.55; }
.fly-splash__eyebrow { font-size: 0.62rem; letter-spacing: 0.14em; text-transform: uppercase; color: #ff9f7a; }
.fly-splash__title { margin: 0; font-family: var(--studio-serif, Georgia, serif); font-size: clamp(1.5rem, 4vw, 2.1rem); font-weight: 500; line-height: 1.15; }
.fly-splash .primary-action { justify-self: start; margin-top: 6px; }
.fly-splash__fine { color: rgb(241 241 236 / 0.5); font-size: 0.64rem !important; }
@media (max-width: 640px) { .fly-splash { padding: 12px; align-items: end; } .fly-splash__card { padding: 20px; } }
.fly-final {
  position: absolute; inset: 0; z-index: 3;
  display: grid; place-content: center; text-align: center; gap: 6px;
  background: rgb(0 0 0 / 0.55); color: #f1f1ec; font-family: var(--studio-mono);
  pointer-events: none;
}
.fly-final p { margin: 0; }
.fly-final__eyebrow { font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; }
.fly-final__digits { font-size: clamp(5rem, 22vw, 11rem); line-height: 1; font-variant-numeric: tabular-nums; }
.fly-final__tally { font-size: 0.9rem; }
.fly-memorial {
  position: absolute; inset: 0; z-index: 4;
  display: grid; place-content: center; gap: 12px; padding: 24px; text-align: center;
  background: #000; color: #f1f1ec; font-family: var(--studio-mono);
}
.fly-memorial p, .fly-memorial h2 { margin: 0; max-width: 34ch; }
.fly-memorial__eyebrow { font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase; color: #ff9f7a; }
.fly-memorial__title { font-family: var(--studio-serif, Georgia, serif); font-size: clamp(1.6rem, 5vw, 2.4rem); font-weight: 500; }
.fly-memorial__line { font-size: 0.85rem; line-height: 1.5; }
.fly-memorial__stats { font-size: 0.7rem; color: rgb(241 241 236 / 0.6); line-height: 1.5; }
.fly-memorial .primary-action { justify-self: center; margin-top: 12px; }
.fly-experience.is-spared::after {
  content: "SPARED";
  position: absolute; top: 18%; left: 50%; z-index: 3;
  transform: translateX(-50%) rotate(-8deg);
  padding: 8px 18px; border: 4px solid #4c9a6a; border-radius: 6px;
  color: #4c9a6a; font: 700 2.2rem var(--studio-mono); letter-spacing: 0.2em;
  animation: fly-stamp 4s ease forwards;
}
@keyframes fly-stamp { 0% { opacity: 0; transform: translateX(-50%) rotate(-8deg) scale(1.6); } 10% { opacity: 1; transform: translateX(-50%) rotate(-8deg) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .fly-vote__bar span { transition: none; }
  .fly-experience.is-spared::after { animation: none; opacity: 1; }
}
@media (max-width: 640px) {
  .fly-vote { left: 12px; right: 12px; width: auto; max-height: 55%; }
}
.fly-splash .primary-action, .fly-memorial .primary-action {
  padding: 12px 22px; border: 0; border-radius: 999px;
  background: #f1f1ec; color: #0c0e12; font: 600 0.78rem var(--studio-mono); letter-spacing: 0.08em; text-transform: uppercase; cursor: pointer;
}
.fly-splash .primary-action:hover, .fly-memorial .primary-action:hover { background: #ffd28a; }

.fly-vote__sound { margin-left: auto; padding: 4px 8px; border: 1px solid rgb(255 255 255 / 0.2); border-radius: 6px; background: transparent; color: inherit; font: inherit; font-size: 0.62rem; cursor: pointer; }
.fly-vote__sound[aria-pressed="false"] { opacity: 0.55; }
.fly-vote__watching { font-size: 0.64rem; color: #ffd28a; }
.fly-vote__names { display: grid; gap: 6px; padding-top: 6px; border-top: 1px solid rgb(255 255 255 / 0.1); }
.fly-vote__name-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.fly-vote__name-option { display: grid; gap: 2px; padding: 8px 4px; border: 1px solid rgb(255 255 255 / 0.16); border-radius: 8px; background: rgb(255 255 255 / 0.04); color: inherit; font: inherit; cursor: pointer; }
.fly-vote__name-option small { color: rgb(241 241 236 / 0.55); }
.fly-vote__name-option:not(:disabled):hover, .fly-vote__name-option.is-chosen { border-color: #ffd28a; }
.fly-vote__name-option:disabled { cursor: default; opacity: 0.6; }
.fly-vote__name-option.is-chosen { opacity: 1; }
.fly-vote__share { padding: 8px 0; border: 1px dashed rgb(255 255 255 / 0.25); border-radius: 8px; background: transparent; color: inherit; font: inherit; font-size: 0.66rem; letter-spacing: 0.06em; text-transform: uppercase; cursor: pointer; }
.fly-vote__share:hover { border-style: solid; }
.fly-memorial__actions { display: grid; gap: 10px; justify-items: center; margin-top: 12px; }
.fly-memorial .fly-vote__share { padding: 8px 16px; }

/* Scrollera */
.worldfall-experience { position: relative; height: 100%; background: #ece9e2; }
.worldfall-stage { display: block; width: 100%; height: 100%; border: 0; }

.fly-vote__body { display: grid; gap: 8px; }
.fly-vote.is-locked .fly-vote__body { pointer-events: none; opacity: 0.6; }
.fly-vote__collapse {
  padding: 4px 8px; border: 1px solid rgb(255 255 255 / 0.2); border-radius: 6px;
  background: transparent; color: inherit; font: inherit; font-size: 0.62rem;
  letter-spacing: 0.06em; text-transform: uppercase; cursor: pointer;
}
.fly-vote__collapse:hover { background: rgb(255 255 255 / 0.1); }
.fly-vote.is-collapsed { width: auto; max-height: none; }
.fly-vote.is-collapsed .fly-vote__body { display: none; }
.fly-vote.is-collapsed .fly-vote__head { gap: 10px; }
@media (max-width: 640px) {
  .fly-vote.is-collapsed { left: auto; }
}

/* The Fly: poke the brain, reasons, night, obituaries */
.fly-mode { position: absolute; top: 10px; right: clamp(12px, 3vw, 24px); z-index: 3; display: grid; grid-template-columns: auto auto; justify-content: end; gap: 4px; font-family: var(--studio-mono); font-size: 0.62rem; }
.fly-mode__button { padding: 5px 10px; border: 1px solid rgb(255 255 255 / 0.25); border-radius: 999px; background: rgb(12 14 18 / 0.86); color: rgb(241 241 236 / 0.7); font: inherit; letter-spacing: 0.08em; text-transform: uppercase; cursor: pointer; }
.fly-mode__button[aria-pressed="true"] { background: #f1f1ec; border-color: #f1f1ec; color: #0c0e12; }
.fly-mode__hint { grid-column: 1 / -1; margin: 0; max-width: 32ch; text-align: right; color: rgb(241 241 236 / 0.55); line-height: 1.4; }
.fly-mode__local { grid-column: 1 / -1; display: grid; grid-template-columns: auto auto; justify-content: end; gap: 4px; margin-top: 4px; }
.fly-mode__local[hidden] { display: none; }
.fly-mode__local-line { grid-column: 1 / -1; margin: 0 0 2px; text-align: right; color: #ffd28a; }
.fly-mode__local .fly-mode__button { background: rgb(184 66 47 / 0.25); border-color: rgb(184 66 47 / 0.7); color: #f1f1ec; }
.fly-mode__local [data-fly-local-new] { background: rgb(76 154 106 / 0.25); border-color: rgb(76 154 106 / 0.7); }
/* local mode shows the sim's own toolbar, so the toggle drops below it */
.fly-experience.is-local .fly-mode { top: 110px; } /* the sim toolbar sits under the close pill, 100px tall */
@media (max-width: 640px) { .fly-mode { top: 8px; right: 8px; } .fly-experience.is-local .fly-mode { top: 100px; } .fly-mode__hint { display: none; } }
.fly-vote { top: 64px; bottom: auto; }
@media (max-width: 640px) { .fly-vote { top: auto; bottom: 12px; } }
.fly-poke { display: grid; gap: 6px; padding-top: 6px; border-top: 1px solid rgb(255 255 255 / 0.1); }
.fly-poke__buttons { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.fly-poke__button { display: grid; gap: 1px; padding: 6px 2px; border: 1px solid rgb(255 255 255 / 0.16); border-radius: 8px; background: rgb(255 255 255 / 0.04); color: inherit; font: inherit; font-size: 0.6rem; line-height: 1.2; cursor: pointer; }
.fly-poke__button small { color: rgb(241 241 236 / 0.5); font-size: 0.56rem; }
.fly-poke__button:not(:disabled):hover, .fly-poke__button.is-active { border-color: #a078ff; }
.fly-poke__button.is-active { background: rgb(160 120 255 / 0.18); }
.fly-poke__button:disabled { cursor: default; opacity: 0.55; }
.fly-poke__button.is-active:disabled { opacity: 1; }
.fly-poke__readout { color: rgb(241 241 236 / 0.7); font-size: 0.64rem; line-height: 1.45; }
.fly-poke__readout strong { color: #f1f1ec; font-weight: 600; }
.fly-poke__rows { display: grid; gap: 2px; margin: 6px 0; padding: 0; list-style: none; }
.fly-poke__rows li { display: grid; grid-template-columns: auto 1fr auto; gap: 6px; align-items: baseline; }
.fly-poke__rows span { color: #c9b5ff; }
.fly-poke__rows small { overflow: hidden; color: rgb(241 241 236 / 0.5); white-space: nowrap; text-overflow: ellipsis; }
.fly-poke__rows b { color: #f1f1ec; font-weight: 500; font-variant-numeric: tabular-nums; }
.fly-poke__state { display: block; color: #ffd28a; }
.fly-poke__fine { display: block; margin-top: 4px; color: rgb(241 241 236 / 0.45); font-size: 0.58rem; line-height: 1.4; }
.fly-vote__reason { padding: 8px 10px; border: 1px solid rgb(255 255 255 / 0.2); border-radius: 8px; background: rgb(255 255 255 / 0.04); color: inherit; font: inherit; }
.fly-vote__reason::placeholder { color: rgb(241 241 236 / 0.4); }
.fly-vote__reason[hidden] { display: none; }
.fly-vote__reasons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; font-size: 0.62rem; line-height: 1.4; }
.fly-vote__reasons[hidden] { display: none; }
.fly-vote__reasons-side { display: grid; gap: 2px; align-content: start; }
.fly-vote__reasons-side small { font-size: 0.56rem; letter-spacing: 0.08em; text-transform: uppercase; }
.fly-vote__reasons-side--kill small { color: #e0745f; }
.fly-vote__reasons-side--save small { color: #6fc08d; }
.fly-vote__reasons-side .is-empty { color: rgb(241 241 236 / 0.4); font-style: italic; }
.fly-experience { --fly-night: 0; }
.fly-sim { filter: brightness(calc(1 - var(--fly-night) * 0.72)) saturate(calc(1 - var(--fly-night) * 0.5)); transition: filter 2s linear; }
.fly-night { position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: var(--fly-night); background: radial-gradient(ellipse at 50% 45%, rgb(0 0 0 / 0) 30%, rgb(4 6 14 / 0.9) 100%); transition: opacity 2s linear; }
.fly-graves {
  position: absolute; inset: 0; z-index: 6; overflow: auto;
  padding: clamp(16px, 4vw, 40px);
  background: #0c0e12; color: #f1f1ec; font-family: var(--studio-mono); font-size: 0.74rem;
}
.fly-graves[hidden] { display: none; }
.fly-graves__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 12px; max-width: 72ch; margin: 0 auto 20px; }
.fly-graves__head p { margin: 0; }
.fly-graves__title { margin: 4px 0 6px; font-family: var(--studio-serif, Georgia, serif); font-size: clamp(1.6rem, 4vw, 2.4rem); font-weight: 500; line-height: 1.1; }
.fly-graves__sum { color: rgb(241 241 236 / 0.7); line-height: 1.5; }
.fly-graves__actions { display: flex; gap: 8px; }
.fly-graves__actions .fly-vote__share { padding: 8px 12px; }
.fly-graves__list { display: grid; gap: 10px; max-width: 72ch; margin: 0 auto; padding: 0; list-style: none; }
.fly-graves__list:empty::after { content: "Nobody yet."; color: rgb(241 241 236 / 0.4); }
.fly-grave { display: grid; gap: 3px; padding: 12px 14px; border: 1px solid rgb(255 255 255 / 0.12); border-left-width: 4px; border-radius: 8px; }
.fly-grave--killed { border-left-color: #b8422f; }
.fly-grave--starved { border-left-color: #c98f2e; }
.fly-grave__who { font-family: var(--studio-serif, Georgia, serif); font-size: 1.05rem; }
.fly-grave__life { color: rgb(241 241 236 / 0.55); font-size: 0.64rem; }
.fly-grave__how { margin-top: 2px; }
.fly-grave__why { color: #ffd28a; font-size: 0.66rem; line-height: 1.45; }
.fly-grave__numbers { color: rgb(241 241 236 / 0.7); font-size: 0.66rem; line-height: 1.45; }
@media (prefers-reduced-motion: reduce) { .fly-sim, .fly-night { transition: none; } }
.fly-fold { display: grid; gap: 6px; padding-top: 6px; border-top: 1px solid rgb(255 255 255 / 0.1); }
.fly-fold > .fly-vote__eyebrow, .fly-fold > .fly-vote__clock { display: flex; align-items: center; gap: 8px; }
.fly-fold > .fly-vote__clock { padding: 0; border: 0; }
.fly-fold > .fly-vote__clock strong { margin-left: auto; }
.fly-fold__meta { margin-left: auto; text-transform: none; letter-spacing: 0; color: rgb(241 241 236 / 0.45); }
.fly-fold__toggle { flex: none; width: 20px; height: 20px; padding: 0; border: 1px solid rgb(255 255 255 / 0.2); border-radius: 5px; background: transparent; color: inherit; font: inherit; line-height: 1; cursor: pointer; }
.fly-fold > .fly-vote__eyebrow .fly-fold__toggle:only-of-type { margin-left: auto; }
.fly-fold__body { display: grid; gap: 8px; }
.fly-fold.is-folded .fly-fold__body { display: none; }
.fly-vote__names[hidden] { display: none; }
.fly-poke { padding-top: 0; border-top: 0; }
.fly-env__options { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.fly-env__option { display: grid; gap: 1px; padding: 7px 2px; border: 1px solid rgb(255 255 255 / 0.16); border-radius: 8px; background: rgb(255 255 255 / 0.04); color: inherit; font: inherit; font-size: 0.6rem; line-height: 1.2; cursor: pointer; }
.fly-env__option small { color: rgb(241 241 236 / 0.5); font-size: 0.56rem; }
.fly-env__option:not(:disabled):hover, .fly-env__option.is-chosen { border-color: #c98f2e; }
.fly-env__option.is-chosen { background: rgb(201 143 46 / 0.18); opacity: 1; }
.fly-env__option:disabled { cursor: default; opacity: 0.55; }
.fly-env__state, .fly-vote__life { color: rgb(241 241 236 / 0.7); font-size: 0.64rem; line-height: 1.45; }
.fly-vote__life[hidden] { display: none; }
.fly-vote__plot { display: grid; gap: 2px; }
.fly-vote__plot[hidden] { display: none; }
.fly-vote__plot small { color: rgb(241 241 236 / 0.5); font-size: 0.6rem; }
.fly-vote__spark { display: block; width: 100%; height: 30px; }
.fly-vote__spark line { stroke: rgb(255 255 255 / 0.18); stroke-width: 0.5; vector-effect: non-scaling-stroke; }
.fly-vote__spark path { fill: none; stroke: #e0745f; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.fly-traits { display: grid; gap: 4px; }
.fly-traits__row { display: grid; grid-template-columns: 5.2em repeat(3, 1fr); gap: 4px; align-items: stretch; }
.fly-traits__row > small { align-self: center; font-size: 0.58rem; letter-spacing: 0.08em; text-transform: uppercase; color: rgb(241 241 236 / 0.5); }
.fly-traits .fly-vote__name-option { padding: 5px 2px; font-size: 0.6rem; }
@media (max-width: 640px) {
  .fly-poke__buttons { grid-template-columns: repeat(3, 1fr); }
  .fly-env__options { grid-template-columns: repeat(3, 1fr); }
}

/* --- The Universal Race --------------------------------------------------- */
.ur {
  position: relative;
  min-height: 100svh;
  overflow: clip;
  color: #eef2f8;
  background: #0a0d16;
  font-family: var(--studio-sans);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.ur button { font: inherit; }
.ur button:focus-visible, .ur__canvas:focus-visible { outline: 3px solid #ffd27a; outline-offset: 3px; }
.ur__canvas { display: block; width: 100%; height: 100svh; }
.ur__kicker {
  margin: 0;
  color: #9db0cf;
  font-family: var(--studio-mono);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.ur__primary, .ur__ghost {
  min-height: 48px;
  padding: 12px 22px;
  border: 1px solid #ffd27a;
  border-radius: 4px;
  background: linear-gradient(120deg, #ffd27a, #ffb347);
  color: #1a1206;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform .15s ease, filter .15s ease;
}
.ur__primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
.ur__primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.ur__ghost { border-color: #4d5c80; background: transparent; color: #eef2f8; font-weight: 500; }
.ur__ghost:hover { background: #17203a; }
.ur__start-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* Landing */
.ur__landing {
  position: absolute;
  inset: 0;
  z-index: 3;
  overflow: auto;
  overscroll-behavior: contain;
  background: radial-gradient(circle at 30% 20%, #1b2a4a, #0a0d16 62%);
}
.ur__landing[hidden] { display: none; }
.ur__landing-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(320px, 1.1fr);
  gap: 28px;
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 72px 20px 40px;
  box-sizing: border-box;
}
.ur__showroom {
  position: sticky;
  top: 72px;
  align-self: start;
  aspect-ratio: 1 / 1.05;
  border-radius: 10px;
  overflow: hidden;
  background: #0d1220;
  box-shadow: 0 30px 80px -40px rgb(255 210 122 / .45), inset 0 0 0 1px #24304d;
}
.ur__showroom-canvas { display: block; width: 100%; height: 100%; }
.ur__showroom-form {
  position: absolute;
  left: 16px;
  bottom: 12px;
  margin: 0;
  color: #ffd27a;
  font-family: var(--studio-mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.ur__landing-copy { display: grid; gap: 14px; align-content: start; }
.ur__landing-copy h1 {
  margin: 0;
  font-family: var(--studio-display);
  font-size: clamp(2.2rem, 6vw, 3.4rem);
  font-weight: 400;
  line-height: 1.02;
}
.ur__lede { margin: 0; max-width: 60ch; color: #c8d3e8; line-height: 1.55; }
.ur__vehicles { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 8px; }
.ur__vehicle {
  display: grid;
  gap: 4px;
  padding: 10px 10px 12px;
  border: 1px solid #27314d;
  border-radius: 8px;
  background: #10162a;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
}
.ur__vehicle:hover { border-color: #4d5c80; transform: translateY(-1px); }
.ur__vehicle[aria-checked="true"] { border-color: var(--paint); background: #172040; box-shadow: 0 0 0 1px var(--paint), 0 12px 30px -18px var(--paint); }
.ur__vehicle canvas { width: 100%; height: auto; }
.ur__vehicle strong { font-size: 0.95rem; }
.ur__vehicle small { color: #9db0cf; font-size: 0.72rem; }
.ur__stats { display: grid; gap: 2px; margin-top: 4px; }
.ur__stat { display: grid; grid-template-columns: 52px 1fr; align-items: center; gap: 6px; color: #7f90b0; font-family: var(--studio-mono); font-size: 0.58rem; letter-spacing: 0.06em; text-transform: uppercase; }
.ur__stat i { display: block; height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--paint, #ffd27a) var(--v), #232b45 var(--v)); }
.ur__tracks { display: grid; gap: 8px; }
.ur__track {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px;
  align-items: center;
  padding: 8px 12px 8px 8px;
  border: 1px solid #27314d;
  border-radius: 8px;
  background: #10162a;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.ur__track:hover { border-color: #4d5c80; }
.ur__track[aria-checked="true"] { border-color: #ffd27a; background: #172040; box-shadow: 0 0 0 1px #ffd27a; }
.ur__track canvas { width: 72px; height: 72px; }
.ur__track strong { display: block; font-size: 1rem; }
.ur__track small { display: block; color: #9db0cf; font-size: 0.78rem; line-height: 1.4; }
.ur__controls { margin: 0; color: #8a9bbb; font-size: 0.78rem; line-height: 1.6; }
.ur__controls span { color: #eef2f8; font-family: var(--studio-mono); font-size: 0.66rem; letter-spacing: 0.08em; text-transform: uppercase; }
.ur__error { margin: 0; color: #ffb4a8; }
.ur__error[hidden] { display: none; }
.ur__loading {
  position: absolute;
  z-index: 5;
  left: 50%;
  bottom: 22px;
  margin: 0;
  padding: 10px 16px;
  transform: translateX(-50%);
  border-radius: 4px;
  background: rgb(10 13 22 / .85);
  color: #ffd27a;
  font-family: var(--studio-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.ur__loading[hidden] { display: none; }

/* HUD */
.ur__hud { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.ur__hud[hidden] { display: none; }
.ur__hud button { pointer-events: auto; }
.ur__place { position: absolute; top: 60px; left: 18px; display: grid; gap: 2px; text-shadow: 0 2px 12px rgb(0 0 0 / .6); }
.ur__place b { font-family: var(--studio-display); font-size: clamp(2.6rem, 7vw, 4.2rem); font-weight: 400; line-height: 0.9; letter-spacing: -0.03em; }
.ur__place span { font-family: var(--studio-mono); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: #dbe4f5; }
.ur__time { color: #9db0cf; }
.ur__split { color: #ffd27a; font-family: var(--studio-mono); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; }
.ur__split[hidden] { display: none; }
.ur__place b.is-changed { animation: ur-place .5s ease-out; }
@keyframes ur-place { 0% { transform: scale(1.35); color: #ffd27a; } 100% { transform: scale(1); } }
.ur__item {
  position: absolute;
  top: 60px;
  right: 18px;
  display: grid;
  justify-items: center;
  gap: 4px;
  min-width: 84px;
  padding: 10px 12px 8px;
  border: 1px solid rgb(255 255 255 / .18);
  border-radius: 10px;
  background: rgb(10 13 22 / .55);
  backdrop-filter: blur(8px);
  text-align: center;
}
.ur__item-icon { display: grid; place-items: center; width: 44px; height: 44px; font-size: 1.7rem; line-height: 1; }
.ur__item-name { font-family: var(--studio-mono); font-size: 0.6rem; letter-spacing: 0.1em; text-transform: uppercase; color: #dbe4f5; }
.ur__item.has-item { border-color: #ffd27a; box-shadow: 0 0 24px -8px #ffd27a; }
.ur__item.is-spinning .ur__item-icon { animation: ur-spin .5s linear infinite; color: #ffd27a; font-family: var(--studio-display); font-size: 2rem; }
@keyframes ur-spin { from { transform: rotateY(0); } to { transform: rotateY(360deg); } }
.ur__speed { position: absolute; left: 18px; bottom: 22px; display: grid; gap: 4px; text-shadow: 0 2px 12px rgb(0 0 0 / .6); }
.ur__speed b { font-family: var(--studio-mono); font-size: clamp(1.8rem, 5vw, 2.8rem); font-weight: 400; line-height: 1; }
.ur__speed small { font-family: var(--studio-mono); font-size: 0.62rem; letter-spacing: 0.12em; text-transform: uppercase; color: #9db0cf; }
.ur__form { display: inline-flex; align-items: center; gap: 8px; font-style: normal; font-family: var(--studio-mono); font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; }
.ur__form i { width: 12px; height: 12px; border-radius: 50%; background: #ffb347; box-shadow: 0 0 12px currentColor; }
.ur__drift { display: flex; gap: 4px; width: 150px; opacity: 0; transition: opacity .2s ease; }
.ur__drift.is-live { opacity: 1; }
.ur__drift i { flex: 1; height: 7px; border-radius: 4px; background: linear-gradient(90deg, var(--tier, #8fe8ff) var(--fill, 0%), rgb(255 255 255 / .18) var(--fill, 0%)); box-shadow: 0 0 0 1px rgb(0 0 0 / .35); }
.ur__drift i:nth-child(2) { --tier: #ffd24a; }
.ur__drift i:nth-child(3) { --tier: #ff7a2a; }
.ur__drift i.is-full { box-shadow: 0 0 10px var(--tier, #8fe8ff), 0 0 0 1px rgb(0 0 0 / .35); }
/* Damage: three pips that light as the car takes it, red at the last one. */
.ur__damage[hidden] { display: none; }
.ur__damage { display: flex; gap: 4px; width: 90px; }
.ur__damage i { flex: 1; height: 6px; border-radius: 4px; background: rgb(255 255 255 / .18); box-shadow: 0 0 0 1px rgb(0 0 0 / .35); }
.ur__damage i.is-lit { background: #ffb347; }
.ur__damage.is-critical i.is-lit { background: #ff5a3c; box-shadow: 0 0 10px #ff5a3c, 0 0 0 1px rgb(0 0 0 / .35); animation: ur-blink .5s steps(2) infinite; }
.ur__banner--wreck { color: #ff6a4a; }
/* Coaching: said once, in the middle, quieter than a place or a wreck. */
/* Coaching is a quiet line low on the screen: it must never cover the race. */
.ur__coach {
  position: absolute;
  left: 50%;
  bottom: 15%;
  transform: translateX(-50%);
  margin: 0;
  padding: 7px 14px;
  max-width: min(460px, 76vw);
  border-radius: 999px;
  background: rgb(6 10 18 / .72);
  color: #cfe7ff;
  font-family: var(--studio-mono);
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  text-align: center;
  text-wrap: balance;
  pointer-events: none;
}
.ur__coach[hidden] { display: none; }
.ur__wrong { color: #ff6b5c; font-family: var(--studio-mono); font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; animation: ur-blink .5s steps(2) infinite; }
.ur__wrong[hidden] { display: none; }
@keyframes ur-blink { to { opacity: 0.3; } }
.ur__map { position: absolute; right: 18px; bottom: 22px; width: 150px; height: 150px; opacity: 0.85; }
.ur__banner {
  position: absolute;
  left: 50%;
  top: 34%;
  margin: 0;
  transform: translate(-50%, -50%);
  font-family: var(--studio-display);
  font-size: clamp(3rem, 12vw, 7rem);
  line-height: 1;
  letter-spacing: -0.04em;
  text-shadow: 0 6px 30px rgb(0 0 0 / .6);
  pointer-events: none;
}
.ur__banner[hidden] { display: none; }
.ur__banner.is-live { animation: ur-banner .9s ease-out both; }
.ur__banner--go { color: #ffd27a; }

/* The rev gauge on the start line: the band you want the needle inside. */
.ur__revs {
  position: absolute;
  left: 50%;
  bottom: 22%;
  transform: translateX(-50%);
  width: min(230px, 46vw);
  height: 10px;
  border-radius: 999px;
  background: rgba(8, 10, 16, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.22);
  overflow: hidden;
}
.ur__revs i {
  display: block;
  width: var(--revs, 0%);
  height: 100%;
  background: linear-gradient(90deg, #7fd4ff, #ffd27a);
  transition: width 60ms linear;
}
/* The band sits where REV_BAND says: 0.55 to 1.05 of REV_MAX 1.45. */
.ur__revs b {
  position: absolute;
  inset: 0 auto 0 37.9%;
  width: 34.5%;
  border-left: 1px solid rgba(255, 255, 255, 0.55);
  border-right: 1px solid rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.12);
}
.ur__revs.is-ready { box-shadow: 0 0 14px rgba(126, 233, 155, 0.75); border-color: rgba(126, 233, 155, 0.9); }
.ur__revs.is-flooded { box-shadow: 0 0 14px rgba(255, 106, 106, 0.7); border-color: rgba(255, 106, 106, 0.85); }
.ur__revs.is-flooded i { background: linear-gradient(90deg, #ffd27a, #ff6a6a); }

/* The tow light: how much of a rival's slipstream you are sitting in. */
/* `display` on the class would otherwise beat the hidden attribute. */
.ur__tow[hidden] { display: none; }
.ur__tow {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #bfe9ff;
}
.ur__tow i {
  display: block;
  width: calc(6px + var(--tow, 0) * 0.34px);
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, #7fd4ff, #ffffff);
  box-shadow: 0 0 10px rgba(127, 212, 255, 0.8);
}

.ur__vehicle.is-locked { opacity: 0.5; filter: grayscale(0.7); }
.ur__vehicle.is-locked canvas { opacity: 0.6; }
.ur__record[hidden] { display: none; }
.ur__record {
  display: block;
  margin-top: 0.35em;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #ffd27a;
  font-variant-numeric: tabular-nums;
}

/* The cup: the track list is the cup's own running order, not a choice. */
.ur__tracks.is-locked { opacity: 0.55; }
.ur__tracks.is-locked::after {
  content: "The cup runs all three in this order";
  display: block;
  margin-top: 0.4em;
  font-size: 0.78rem;
  opacity: 0.85;
}
.ur__standings--cup[hidden] { display: none; }
.ur__standings--cup { margin-top: 0.35em; }
.ur__standings--cup b { font-variant-numeric: tabular-nums; }

/* An item being carried behind the car rather than sitting in the slot. */
.ur__item.is-trailing { border-color: rgba(255, 210, 122, 0.8); }
.ur__item.is-trailing .ur__item-icon { animation: ur-trail 1.1s ease-in-out infinite; }
@keyframes ur-trail {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(3px); }
}
.ur__banner--finish { color: #ffd27a; }
@keyframes ur-banner { from { opacity: 0; transform: translate(-50%, -50%) scale(1.4); } 30% { opacity: 1; transform: translate(-50%, -50%) scale(1); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
.ur__toast {
  position: absolute;
  left: 50%;
  top: 52%;
  margin: 0;
  padding: 8px 14px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: rgb(10 13 22 / .7);
  color: #ffd27a;
  font-family: var(--studio-mono);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.ur__toast[hidden] { display: none; }
.ur__pause { position: absolute; top: 60px; left: 50%; transform: translateX(-50%); padding: 6px 14px; border: 1px solid rgb(255 255 255 / .25); border-radius: 999px; background: rgb(10 13 22 / .5); color: #eef2f8; font-family: var(--studio-mono); font-size: 0.62rem; letter-spacing: 0.12em; text-transform: uppercase; cursor: pointer; }
.ur__quality { position: absolute; top: 96px; left: 50%; transform: translateX(-50%); margin: 0; color: #9db0cf; font-family: var(--studio-mono); font-size: 0.6rem; letter-spacing: 0.12em; text-transform: uppercase; }
.ur__quality[hidden] { display: none; }
.ur__touch { position: absolute; inset: 0; }
.ur__touch[hidden] { display: none; }
/* One thumb per side: the stick sits where the left thumb rests, the buttons
   where the right one does, and both stay clear of the map and the pause. */
.ur__stick { position: absolute; left: max(84px, 13vw); bottom: max(104px, 17vh); width: 116px; height: 116px; margin: -58px 0 0 -58px; border: 2px solid rgb(255 255 255 / .35); border-radius: 50%; background: rgb(10 13 22 / .35); opacity: 0.55; transition: opacity .15s ease; }
.ur__stick.is-active { opacity: 1; }
.ur__knob { position: absolute; left: 50%; top: 50%; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%; background: rgb(255 255 255 / .8); }
.ur__buttons { position: absolute; right: max(20px, 3vw); bottom: max(150px, 22vh); display: grid; gap: 14px; justify-items: end; }
/* Drift and Item are the two a thumb reaches without looking; Reset is
   smaller and further away, because it is the one you must mean. */
.ur__buttons .ur__button--drift { transform: translateX(-26px); }
.ur__buttons .ur__button--reset, .ur__buttons .ur__button--back { width: 60px; height: 60px; font-size: 0.58rem; opacity: 0.8; }
.ur__buttons { grid-template-areas: "back" "reset" "item" "drift"; }
.ur__button--back { border-color: #ff9ad2; }
.ur__button { width: 96px; height: 96px; border: 2px solid rgb(255 255 255 / .35); border-radius: 50%; background: rgb(10 13 22 / .5); color: #eef2f8; font-family: var(--studio-mono); font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; touch-action: none; }
.ur__button--drift { border-color: #ffb347; }
.ur__button--item { border-color: #8ff5ff; }
.ur__button--reset { border-color: rgb(255 255 255 / .4); }

/* A phone held sideways is about 390 tall: the column of buttons will not fit,
   so Drift and Item sit side by side under the right thumb with Reset above
   Item, the stick shrinks and drops, and the HUD gets out of their way. */
@media (pointer: coarse) and (max-height: 540px) {
  .ur__stick { left: 74px; bottom: 78px; width: 96px; height: 96px; margin: -48px 0 0 -48px; }
  .ur__buttons {
    right: 16px;
    bottom: 16px;
    gap: 10px;
    grid-template-areas: "back reset" "item drift";
    grid-template-columns: auto auto;
    align-items: end;
  }
  .ur__buttons .ur__button { width: 78px; height: 78px; font-size: 0.6rem; }
  .ur__buttons .ur__button--drift { grid-area: drift; transform: none; }
  .ur__buttons .ur__button--item { grid-area: item; }
  .ur__buttons .ur__button--reset { grid-area: reset; width: 48px; height: 48px; font-size: 0.5rem; justify-self: start; }
  .ur__buttons .ur__button--back { grid-area: back; width: 48px; height: 48px; font-size: 0.5rem; }
  .ur__coach { bottom: 22%; font-size: 0.68rem; }
  /* The minimap is the one thing worth giving up for a clear thumb corner. */
  .ur__map { display: none; }
  .ur__place { top: 46px; }
  .ur__place b { font-size: 2rem; }
  /* Clear of the stick, so a thumb never covers the speed. */
  .ur__speed { bottom: 10px; left: 136px; }
  .ur__speed b { font-size: 1.5rem; }
  .ur__item { top: 46px; right: 14px; transform: scale(0.8); transform-origin: top right; }
  .ur__drift { width: 108px; }
  .ur__revs { bottom: 32%; }
}

/* Portrait on a phone is mostly sky: say so rather than pretend it plays. */
.ur__rotate {
  position: absolute;
  inset: 0;
  display: none;
  place-content: center;
  justify-items: center;
  gap: 10px;
  padding: 24px;
  text-align: center;
  background: rgb(6 8 14 / .92);
  z-index: 6;
}
.ur__rotate strong { font-family: var(--studio-display); font-size: 1.5rem; font-weight: 400; }
.ur__rotate span { font-family: var(--studio-mono); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: #9db0cf; }
.ur__rotate i { display: block; width: 46px; height: 74px; border: 2px solid rgb(255 255 255 / .5); border-radius: 8px; animation: ur-rotate 2.2s ease-in-out infinite; }
@keyframes ur-rotate {
  0%, 30% { transform: rotate(0deg); }
  60%, 100% { transform: rotate(-90deg); }
}
@media (pointer: coarse) and (orientation: portrait) {
  .ur.is-racing .ur__rotate { display: grid; }
}
.ur__button.is-down { background: rgb(255 210 122 / .6); color: #1a1206; }

/* Pause and results */
.ur__paused, .ur__results {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  padding: 70px 20px 30px;
  background: rgb(6 8 14 / .72);
  backdrop-filter: blur(6px);
}
.ur__paused[hidden], .ur__results[hidden] { display: none; }
.ur__paused { text-align: center; }
.ur__paused h2, .ur__card h2 { margin: 6px 0 12px; font-family: var(--studio-display); font-size: clamp(2.2rem, 7vw, 4rem); font-weight: 400; line-height: 1; letter-spacing: -0.03em; }
.ur__card { width: min(560px, 100%); display: grid; gap: 14px; padding: 24px; border: 1px solid #27314d; border-radius: 12px; background: #0f1527; }
.ur__card p { margin: 0; color: #c8d3e8; line-height: 1.55; }
.ur__standings { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.ur__standings li { display: grid; grid-template-columns: 28px 1fr 1fr auto; gap: 10px; align-items: baseline; padding: 6px 10px; border-radius: 6px; background: #131b31; font-size: 0.9rem; }
.ur__standings li.is-you { background: #26305a; box-shadow: 0 0 0 1px #ffd27a; }
.ur__standings span { color: #9db0cf; font-family: var(--studio-mono); font-size: 0.72rem; }
.ur__standings em { color: #9db0cf; font-style: normal; font-size: 0.8rem; }
.ur__standings b { font-family: var(--studio-mono); font-weight: 400; font-size: 0.8rem; }

@media (max-width: 860px) {
  .ur__landing-grid { grid-template-columns: 1fr; padding-top: 64px; }
  .ur__showroom { position: relative; top: 0; aspect-ratio: 16 / 10; }
  .ur__map { width: 110px; height: 110px; }
  .ur__buttons { right: 18px; bottom: 140px; }
  .ur__place { top: 56px; }
  .ur__item { top: 56px; }
}
@media (prefers-reduced-motion: reduce) {
  .ur__item.is-spinning .ur__item-icon, .ur__wrong, .ur__banner.is-live { animation: none; }
}

/* Dragon Sim — breed, farm, and fight in a cartoon sky */
.game-card__icon--dragon-fight { background: #63b9ff; }
.game-dialog[data-game="dragon-fight"] { background: #63b9ff; color: #1c1430; }
.game-dialog[data-game="dragon-fight"] .game-dialog__chrome { background: rgb(255 255 255 / 0.82); border-color: rgb(28 20 48 / 0.25); }
.game-dialog[data-game="dragon-fight"] .game-dialog__count { display: none; }

.df [hidden] { display: none !important; }
.df { position: relative; width: 100%; height: 100%; min-height: 100svh; overflow: hidden; font-family: var(--studio-sans); color: #1c1430; background: #63b9ff; isolation: isolate; }
.df__canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
.df__canvas:active { cursor: grabbing; }
.df__loading { position: absolute; inset: 0; display: grid; place-items: center; background: #63b9ff; color: #1c1430; z-index: 5; }
.df__top { position: absolute; z-index: 4; top: max(10px, env(safe-area-inset-top)); left: max(64px, env(safe-area-inset-left)); right: max(64px, env(safe-area-inset-right)); display: flex; flex-wrap: wrap; align-items: center; gap: 8px; pointer-events: none; }
.df__top > * { pointer-events: auto; }
.df__stat { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: rgb(255 255 255 / 0.86); border: 2px solid rgb(28 20 48 / 0.18); font-weight: 700; font-size: 0.95rem; box-shadow: 0 3px 0 rgb(28 20 48 / 0.12); }
.df__stat small { font-weight: 600; opacity: 0.6; font-size: 0.75rem; }
.df__coin { color: #e0a51b; }
.df__islands { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; margin-left: auto; max-width: 42%; order: 3; }
.df__zoom { order: 1; margin-left: auto; }
.df__top > [data-df-action="menu"] { order: 2; }
.df__island { padding: 6px 12px; border-radius: 999px; border: 2px solid rgb(28 20 48 / 0.18); background: rgb(255 255 255 / 0.7); font: inherit; font-weight: 700; font-size: 0.85rem; cursor: pointer; }
.df__island.is-active { background: #ffd83d; border-color: #b8851b; }
.df__island:hover, .df__island:focus-visible { background: #fff; outline: 2px solid #1c1430; outline-offset: 1px; }
.df__button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; padding: 8px 14px; border-radius: 12px; border: 2px solid #1c1430; background: #fff; color: #1c1430; font: inherit; font-weight: 700; font-size: 0.9rem; cursor: pointer; box-shadow: 0 3px 0 #1c1430; transition: transform 0.08s, box-shadow 0.08s; text-align: left; }
.df__button:hover, .df__button:focus-visible { transform: translateY(-1px); box-shadow: 0 4px 0 #1c1430; outline: none; }
.df__button:active { transform: translateY(2px); box-shadow: 0 1px 0 #1c1430; }
.df__button:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: 0 2px 0 rgb(28 20 48 / 0.5); }
.df__button--primary { background: #ffd83d; }
.df__button--ghost { background: rgb(255 255 255 / 0.7); border-color: rgb(28 20 48 / 0.35); box-shadow: 0 3px 0 rgb(28 20 48 / 0.35); }
.df__dock { position: absolute; z-index: 4; left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; gap: 8px; padding: 8px; border-radius: 18px; background: rgb(255 255 255 / 0.82); border: 2px solid rgb(28 20 48 / 0.18); box-shadow: 0 6px 0 rgb(28 20 48 / 0.12); }
.df__dock-button { min-height: 44px; padding: 8px 16px; border-radius: 12px; border: 2px solid #1c1430; background: #fff; font: inherit; font-weight: 800; cursor: pointer; box-shadow: 0 3px 0 #1c1430; }
.df__dock-button:hover, .df__dock-button:focus-visible { background: #fff6cc; outline: none; }
.df__dock-button--arena { background: #ff6a2b; color: #fff; }
.df__panel { position: absolute; z-index: 5; top: max(64px, calc(env(safe-area-inset-top) + 56px)); right: max(12px, env(safe-area-inset-right)); width: min(380px, calc(100% - 24px)); max-height: calc(100% - 150px); overflow: auto; padding: 16px; border-radius: 18px; background: rgb(255 255 255 / 0.95); border: 2px solid #1c1430; box-shadow: 0 6px 0 #1c1430; }
.df__panel h3 { margin: 0 24px 6px 0; font-size: 1.1rem; }
.df__panel p { margin: 0 0 10px; font-size: 0.9rem; line-height: 1.4; }
.df__close { position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; border-radius: 50%; border: 2px solid #1c1430; background: #fff; font: inherit; font-size: 1.2rem; line-height: 1; cursor: pointer; }
.df__modal { position: absolute; inset: 0; z-index: 6; display: grid; place-items: center; padding: 16px; background: rgb(28 20 48 / 0.45); }
.df__modal-card { position: relative; width: min(760px, 100%); max-height: calc(100% - 32px); overflow: auto; padding: 22px; border-radius: 20px; background: #fff; border: 2px solid #1c1430; box-shadow: 0 8px 0 #1c1430; }
.df__modal-card h2 { margin: 0 30px 8px 0; font-size: 1.4rem; }
.df-modal__note { margin: 0 0 12px; font-size: 0.9rem; line-height: 1.45; opacity: 0.85; }
.df-help { margin: 0; padding-left: 18px; font-size: 0.92rem; line-height: 1.5; }
.df-help li + li { margin-top: 6px; }
.df-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid rgb(28 20 48 / 0.5); vertical-align: -1px; margin-right: 2px; }
.df-list { display: grid; gap: 6px; }
.df-list--grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.df-row { display: grid; gap: 2px; padding: 8px 12px; border-radius: 12px; border: 2px solid rgb(28 20 48 / 0.2); background: #f7f9ff; font: inherit; text-align: left; cursor: pointer; }
.df-row:hover, .df-row:focus-visible { border-color: #1c1430; background: #fff; outline: none; }
.df-row.is-picked { background: #ffd83d; border-color: #b8851b; }
.df-row b { font-size: 0.95rem; }
.df-row span { font-size: 0.8rem; opacity: 0.8; }
.df-row:disabled { opacity: 0.5; cursor: not-allowed; }
.df-build { display: grid; gap: 6px; }
.df-card__head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; margin-right: 24px; }
.df-card__name { margin: 0; font-size: 1.15rem; }
.df-card__species { margin: 2px 0 0; font-size: 0.85rem; }
.df-card__gen { opacity: 0.6; font-size: 0.75rem; }
.df-card__level { text-align: right; min-width: 72px; }
.df-card__level b { display: block; font-size: 0.95rem; }
.df-bar { display: block; height: 8px; border-radius: 4px; background: rgb(28 20 48 / 0.15); overflow: hidden; margin-top: 4px; }
.df-bar i { display: block; height: 100%; background: #6ccb4a; transition: width 0.2s; }
.df-bar--fury i { background: #ffd83d; }
.df-bar--wide { margin: 6px 0 10px; height: 10px; }
.df-card__power { margin: 8px 0; font-size: 0.85rem; line-height: 1.4; padding: 8px 10px; border-radius: 10px; background: #fff3c4; }
.df-stats { display: flex; gap: 8px; margin: 6px 0 8px; padding: 0; list-style: none; }
.df-stats li { flex: 1; padding: 6px; border-radius: 10px; background: #eef2ff; text-align: center; }
.df-stats small { display: block; font-size: 0.65rem; opacity: 0.7; letter-spacing: 0.05em; }
.df-stats b { font-size: 0.95rem; }
.df-card__home { font-size: 0.82rem; opacity: 0.85; }
.df-card__actions { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.df-plans { display: flex; gap: 4px; margin: 6px 0; }
.df-plan { flex: 1; padding: 6px 4px; border-radius: 10px; border: 2px solid rgb(28 20 48 / 0.2); background: #fff; font: inherit; font-size: 0.8rem; font-weight: 700; cursor: pointer; }
.df-plan.is-active { background: #1c1430; color: #fff; border-color: #1c1430; }
.df-plan__text { margin: 4px 0 8px; font-size: 0.78rem; line-height: 1.35; opacity: 0.8; }
.df-row--static { cursor: default; display: grid; gap: 4px; }
.df-row--static .df-card__actions { margin: 4px 0 0; }
.df-genes summary { cursor: pointer; font-weight: 700; font-size: 0.85rem; }
.df-genes__elements { display: flex; gap: 6px; margin: 8px 0; }
.df-locus { display: inline-flex; padding: 3px 4px; border-radius: 999px; background: #eef2ff; }
.df-genes__body { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; margin-bottom: 8px; }
.df-gene { display: grid; font-size: 0.8rem; }
.df-gene small { opacity: 0.6; font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.05em; }
.df-gene em { font-style: normal; opacity: 0.6; font-size: 0.72rem; }
.df-genes__note { font-size: 0.75rem; opacity: 0.7; line-height: 1.4; }
.df-move, .df-rename { display: grid; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px solid rgb(28 20 48 / 0.15); }
.df-rename input { min-height: 38px; padding: 6px 10px; border-radius: 10px; border: 2px solid #1c1430; font: inherit; }
.df-book { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.df-book__entry { display: grid; gap: 3px; padding: 10px; border-radius: 12px; border: 2px solid rgb(28 20 48 / 0.15); background: #f3f3f8; opacity: 0.65; }
.df-book__entry.is-seen { opacity: 0.85; }
.df-book__entry.is-known { opacity: 1; background: linear-gradient(135deg, color-mix(in srgb, var(--c) 35%, #fff), #fff); border-color: #1c1430; }
.df-book__entry b { font-size: 0.9rem; }
.df-book__entry small { font-size: 0.7rem; opacity: 0.75; line-height: 1.3; }
.df__toasts { position: absolute; z-index: 7; left: 50%; bottom: max(80px, calc(env(safe-area-inset-bottom) + 76px)); transform: translateX(-50%); display: grid; gap: 6px; pointer-events: none; width: min(420px, calc(100% - 24px)); }
.df-toast { padding: 8px 14px; border-radius: 12px; background: #1c1430; color: #fff; font-size: 0.88rem; font-weight: 600; opacity: 0; transform: translateY(8px); transition: opacity 0.25s, transform 0.25s; text-align: center; }
.df-toast.is-visible { opacity: 1; transform: none; }
.df-toast.good { background: #2f8f4e; }
.df-toast.warn { background: #b8322e; }
/* the first steps */
.df__tutorial { position: absolute; z-index: 5; left: 50%; bottom: max(84px, calc(env(safe-area-inset-bottom) + 80px)); transform: translateX(-50%); width: min(460px, calc(100% - 24px)); padding: 10px 14px; border-radius: 14px; background: #fff; color: #1c1430; border: 2px solid #1c1430; box-shadow: 0 6px 0 #1c1430; pointer-events: auto; }
.df__tutorial b { display: block; font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.7; }
.df__tutorial p { margin: 4px 0 6px; font-size: 0.92rem; line-height: 1.35; }
.df__button--small { min-height: 30px; padding: 4px 10px; font-size: 0.78rem; }
@media (max-width: 720px) { .df__tutorial { bottom: max(88px, calc(env(safe-area-inset-bottom) + 84px)); } }
@media (max-height: 520px) and (orientation: landscape) { .df__tutorial { bottom: 66px; width: min(380px, calc(100% - 24px)); padding: 6px 10px; } .df__tutorial p { font-size: 0.82rem; } }
/* fight */
.df__fight { position: absolute; inset: 0; z-index: 4; pointer-events: none; color: #fff; }
.df__fight > * { pointer-events: none; }
.df-team { position: absolute; top: max(12px, env(safe-area-inset-top)); display: flex; gap: 6px; }
.df-team--a { left: max(60px, env(safe-area-inset-left)); }
.df-team--b { right: max(60px, env(safe-area-inset-right)); flex-direction: row-reverse; }
.df-fighter { width: 132px; padding: 6px 10px; border-radius: 12px; background: rgb(20 14 40 / 0.75); border: 2px solid rgb(255 255 255 / 0.35); }
.df-fighter b { display: block; font-size: 0.78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.df-fighter.is-active { border-color: #ffd83d; }
.df-fighter.is-out { opacity: 0.35; }
.df-fight__floats { position: absolute; inset: 0; }
.df-float { position: absolute; transform: translate(-50%, -50%); font-weight: 900; font-size: 1.5rem; text-shadow: 0 2px 0 #000, 0 0 8px rgb(0 0 0 / 0.6); animation: df-rise 1.1s ease-out forwards; }
.df-float.crit { color: #ffd83d; font-size: 2.2rem; }
.df-float.heal { color: #8aff9a; }
.df-float.miss, .df-float.status, .df-float.buff { font-size: 0.95rem; font-weight: 700; color: #dff6ff; }
.df-float.dot { font-size: 1.05rem; color: #ff9a6a; }
.df-float.strong { color: #ff9a3a; font-size: 1.8rem; }
.df-float.weak { color: #b8c0d0; font-size: 1.05rem; }
.df-float small { display: block; font-size: 0.58rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; line-height: 1; }
.df-fight__side { position: absolute; left: max(60px, env(safe-area-inset-left)); bottom: max(64px, calc(env(safe-area-inset-bottom) + 60px)); display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.df-fight__legend { display: flex; gap: 12px; font-size: 0.72rem; font-weight: 600; opacity: 0.85; text-shadow: 0 1px 0 rgb(0 0 0 / 0.6); }
.df-fight__legend span { display: inline-flex; align-items: center; gap: 5px; }
.df-fight__legend i { width: 22px; height: 7px; border-radius: 4px; background: #6ccb4a; }
.df-fight__legend i.df-legend__fury { background: #ffd83d; }
@media (max-height: 520px) and (orientation: landscape) { .df-fight__legend { display: none; } .df-fight__side { bottom: 40px; } }
/* a cheer from the stands */
.df-fight__cheer { display: flex; align-items: center; gap: 8px; pointer-events: auto; }
.df-fight__cheer .df__button { padding: 6px 12px; min-height: 34px; }
.df-fight__cheer small { font-size: 0.68rem; font-weight: 700; opacity: 0.8; }
.df-cheer__note { font-size: 0.7rem; opacity: 0.85; text-shadow: 0 1px 0 rgb(0 0 0 / 0.6); max-width: 180px; line-height: 1.2; }
@media (max-width: 720px) { .df-cheer__note { display: none; } }
/* the bench during a league fight */
.df-fight__swap { display: flex; flex-direction: column; gap: 6px; pointer-events: auto; }
.df-swap__label { font-size: 0.72rem; font-weight: 700; opacity: 0.85; text-shadow: 0 1px 0 rgb(0 0 0 / 0.6); }
.df-swap__button { display: grid; gap: 2px; min-width: 160px; padding: 6px 10px; border-radius: 12px; border: 2px solid rgb(255 255 255 / 0.4); background: rgb(20 14 40 / 0.8); color: #fff; font: inherit; text-align: left; cursor: pointer; }
.df-swap__button:disabled { opacity: 0.45; cursor: default; }
.df-swap__button b { font-size: 0.82rem; }
.df-swap__button small { display: flex; gap: 4px; align-items: center; font-size: 0.68rem; opacity: 0.85; }
.df-swap__button.is-strong { border-color: #ff9a3a; }
.df-swap__button.is-weak { border-color: rgb(255 255 255 / 0.2); }
@media (max-height: 520px) and (orientation: landscape) { .df-swap__button { min-width: 120px; padding: 4px 8px; } }
/* phones: the island tabs become one scrolling strip under the stats instead of a wall down the side */
@media (max-width: 720px) { .df__islands { flex: 1 0 100%; order: 9; flex-wrap: nowrap; justify-content: flex-start; max-width: 100%; overflow-x: auto; scrollbar-width: none; padding: 2px 0; } .df__islands::-webkit-scrollbar { display: none; } .df__island { flex: 0 0 auto; } }
@keyframes df-rise { from { opacity: 1; margin-top: 0; } to { opacity: 0; margin-top: -60px; } }
.df-fight__power { position: absolute; left: 50%; bottom: 18%; transform: translateX(-50%); padding: 10px 26px; border-radius: 14px; background: rgb(20 14 40 / 0.85); border: 3px solid #ffd83d; font-size: 1.8rem; font-weight: 900; opacity: 0; transition: opacity 0.2s; white-space: nowrap; }
.df-fight__power.is-shown { opacity: 1; }
.df-fight__line { position: absolute; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); transform: translateX(-50%); padding: 8px 16px; border-radius: 10px; background: rgb(0 0 0 / 0.5); font-size: 0.95rem; font-weight: 600; white-space: nowrap; max-width: calc(100% - 24px); overflow: hidden; text-overflow: ellipsis; }
.df-fight__line.crit, .df-fight__line.power { color: #ffd83d; }
.df-fight__line.ko, .df-fight__line.lose { color: #ff6a6a; }
.df-fight__line.win { color: #8aff9a; }
.df-fight__ko { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%) scale(0); font-size: clamp(4rem, 14vw, 8rem); font-weight: 900; color: #ff4d4d; text-shadow: 0 6px 0 #000; transition: transform 0.25s; }
.df-fight__ko.is-shown { transform: translate(-50%, -50%) scale(1); }
.df-fight__result { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(460px, calc(100% - 32px)); padding: 22px; border-radius: 20px; background: #fff; color: #1c1430; border: 2px solid #1c1430; box-shadow: 0 8px 0 #1c1430; pointer-events: auto; text-align: center; }
.df-fight__result h2 { margin: 0 0 8px; font-size: 1.6rem; }
.df-fight__result p { margin: 0 0 8px; font-size: 0.92rem; line-height: 1.45; }
.df-fight__xp { font-size: 0.8rem !important; opacity: 0.75; }
/* story */
.df__story { position: absolute; inset: 0; z-index: 8; display: grid; place-items: center; padding: 16px; background: rgb(28 20 48 / 0.55); }
.df__story-card { width: min(520px, 100%); padding: 24px; border-radius: 20px; background: #fff8e6; border: 2px solid #1c1430; box-shadow: 0 8px 0 #1c1430; }
.df__story-card h2 { margin: 0 0 10px; font-family: var(--studio-display); font-size: 1.6rem; }
.df__story-card p { margin: 0 0 10px; line-height: 1.5; font-size: 0.95rem; }
.df-story__kicker { font-size: 0.72rem !important; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.6; }
@media (max-width: 720px) {
  .df__top { left: 10px; right: 10px; top: max(52px, calc(env(safe-area-inset-top) + 48px)); }
  .df__stat { padding: 4px 10px; font-size: 0.85rem; }
  .df__island { padding: 4px 9px; font-size: 0.75rem; }
  .df__dock { gap: 4px; padding: 6px; width: calc(100% - 16px); justify-content: center; }
  .df__dock-button { min-height: 40px; padding: 6px 9px; font-size: 0.78rem; }
  .df__panel { top: auto; right: 8px; left: 8px; bottom: 74px; width: auto; max-height: 52%; }
  .df-team--a { left: 8px; top: 48px; } .df-team--b { right: 8px; top: 48px; }
  .df-fighter { width: 96px; padding: 4px 6px; }
  .df-fight__power { font-size: 1.2rem; }
}
@media (prefers-reduced-motion: reduce) { .df-float { animation-duration: 0.01s; } .df-toast { transition: none; } }
/* Rubble ------------------------------------------------------------------ */

.rubble {
  --rubble-ink: #f2f2ee;
  --rubble-shake: 0px;
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #b3b7b9;
  color: var(--rubble-ink);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
.rubble.is-shaking { animation: rubble-shake 0.32s linear; }
@keyframes rubble-shake {
  0% { transform: translate(0, 0); }
  20% { transform: translate(var(--rubble-shake), calc(var(--rubble-shake) * -0.6)); }
  40% { transform: translate(calc(var(--rubble-shake) * -0.8), calc(var(--rubble-shake) * 0.5)); }
  60% { transform: translate(calc(var(--rubble-shake) * 0.5), calc(var(--rubble-shake) * 0.4)); }
  80% { transform: translate(calc(var(--rubble-shake) * -0.3), calc(var(--rubble-shake) * -0.2)); }
  100% { transform: translate(0, 0); }
}

.rubble__canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  touch-action: none;
}
.rubble__canvas:focus-visible { outline: 2px solid var(--rubble-ink); outline-offset: -4px; }

.rubble [hidden] { display: none; }

.rubble__veil,
.rubble__touch {
  position: absolute;
  z-index: 3;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 32px 24px;
  background: #2b2d2e;
}

.rubble__intro {
  width: min(100%, 520px);
  display: grid;
  gap: 14px;
}
.rubble__eyebrow { margin: 0; font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.7; }
.rubble__intro h1 { margin: 0; font-size: clamp(2.4rem, 6vw, 4rem); font-weight: 500; letter-spacing: -0.02em; }
.rubble__lead { margin: 0; font-size: 1rem; line-height: 1.5; opacity: 0.85; }
.rubble__bar { height: 2px; background: rgb(242 242 238 / 0.2); }
.rubble__bar span { display: block; height: 100%; width: 0; background: var(--rubble-ink); transition: width 120ms linear; }
.rubble__progress { margin: 0; font-size: 0.85rem; opacity: 0.8; }
.rubble__begin {
  justify-self: start;
  padding: 10px 22px;
  border: 1px solid var(--rubble-ink);
  background: transparent;
  color: var(--rubble-ink);
  font: inherit;
  font-size: 0.95rem;
  cursor: pointer;
}
.rubble__begin:disabled { opacity: 0.45; cursor: wait; }
.rubble__begin:not(:disabled):hover { background: var(--rubble-ink); color: #2b2d2e; }
.rubble__note { margin: 0; font-size: 0.8rem; opacity: 0.6; }
.rubble__quality { display: flex; gap: 8px; align-items: center; margin: 0; font-size: 0.8rem; opacity: 0.75; cursor: pointer; }
.rubble__quality input { margin: 0; accent-color: var(--rubble-ink); }

.rubble__hud { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.rubble__crosshair {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 14px;
  height: 14px;
  transform: translate(-50%, -50%);
  background:
    linear-gradient(var(--rubble-ink), var(--rubble-ink)) center / 1px 100% no-repeat,
    linear-gradient(var(--rubble-ink), var(--rubble-ink)) center / 100% 1px no-repeat;
  mix-blend-mode: difference;
}
.rubble__readout {
  position: absolute;
  bottom: 16px;
  font-size: 0.8rem;
  line-height: 1.5;
  letter-spacing: 0.04em;
  white-space: pre;
  text-shadow: 0 0 4px rgb(0 0 0 / 0.6);
}
.rubble__readout--left { left: 18px; }
.rubble__readout--right { right: 18px; text-align: right; }
.rubble__marker {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 22px;
  height: 22px;
  transform: translate(-50%, -50%) rotate(45deg);
  opacity: 0;
  background:
    linear-gradient(var(--rubble-ink), var(--rubble-ink)) center / 1px 100% no-repeat,
    linear-gradient(var(--rubble-ink), var(--rubble-ink)) center / 100% 1px no-repeat;
  mask: radial-gradient(circle, transparent 5px, #000 6px);
}
.rubble__marker.is-hit { opacity: 1; }
.rubble__hurt {
  position: absolute;
  inset: 0;
  opacity: 0;
  background: radial-gradient(ellipse at center, transparent 55%, rgb(120 30 20 / 0.55) 100%);
  transition: opacity 200ms ease-out;
}
.rubble__hurt.is-hurt { opacity: 1; transition: none; }
.rubble__hits { position: absolute; inset: 0; pointer-events: none; }
.rubble__hit-arrow {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  opacity: 0;
}
.rubble__hit-arrow::before {
  content: "";
  position: absolute;
  left: -16px;
  top: -112px;
  border-left: 16px solid transparent;
  border-right: 16px solid transparent;
  border-bottom: 18px solid rgb(214 62 46 / 0.92);
  filter: drop-shadow(0 0 3px rgb(0 0 0 / 0.6));
}
.rubble__hit-arrow.is-live { animation: rubble-hit-arrow 0.9s ease-out; }
@keyframes rubble-hit-arrow {
  0% { opacity: 1; }
  60% { opacity: 1; }
  100% { opacity: 0; }
}
.rubble__death { background: rgb(43 45 46 / 0.92); }
/* Read against their world still coming apart: the veil barely darkens
   anything, and the words carry their own scrim instead. */
.rubble__death.is-live {
  background: radial-gradient(ellipse at 50% 50%, rgb(8 4 14 / 0) 0%, rgb(8 4 14 / 0.1) 55%, rgb(8 4 14 / 0.55) 100%);
  animation: rubble-card-in 1.4s ease-out both;
}
.rubble__death.is-live .rubble__intro {
  padding: 22px 26px;
  background: rgb(8 5 12 / 0.62);
  backdrop-filter: blur(3px);
  border-left: 2px solid rgb(255 233 214 / 0.55);
}
.rubble__death.is-live .rubble__title { text-shadow: 0 0 18px rgb(0 0 0 / 0.9), 0 2px 6px rgb(0 0 0 / 0.9); }
.rubble__death.is-live .rubble__eyebrow,
.rubble__death.is-live .rubble__summary { text-shadow: 0 0 12px rgb(0 0 0 / 0.95); }
@keyframes rubble-card-in { from { opacity: 0; } to { opacity: 1; } }
.rubble__row { display: flex; gap: 12px; }
.rubble__objective {
  position: absolute;
  left: 50%;
  bottom: 52px;
  margin: 0;
  max-width: min(56vw, 560px);
  transform: translateX(-50%);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-align: center;
  text-shadow: 0 0 4px rgb(0 0 0 / 0.6);
  transition: opacity 300ms;
}
.rubble__objective.is-complete { animation: rubble-complete 1.4s ease-out; }
@keyframes rubble-complete {
  0% { opacity: 0; transform: translateX(-50%) translateY(6px); }
  30% { opacity: 1; transform: translateX(-50%) translateY(0); }
  100% { opacity: 1; }
}
.rubble__unlock {
  position: absolute;
  left: 50%;
  top: 40%;
  margin: 0;
  transform: translateX(-50%);
  font-size: 1.05rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-shadow: 0 0 6px rgb(0 0 0 / 0.7);
  opacity: 0;
}
.rubble__unlock.is-live { animation: rubble-unlock 3.2s ease-out; }
@keyframes rubble-unlock {
  0% { opacity: 0; transform: translate(-50%, 8px); }
  12% { opacity: 1; transform: translate(-50%, 0); }
  80% { opacity: 1; }
  100% { opacity: 0; }
}
.rubble__target {
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin: -7px 0 0 -7px;
  pointer-events: none;
  will-change: transform;
}
.rubble__target-mark {
  width: 14px;
  height: 14px;
  border: 1px solid var(--rubble-ink);
  transform: rotate(45deg);
  box-shadow: 0 0 4px rgb(0 0 0 / 0.6);
}
.rubble__target.is-edge .rubble__target-mark { border-style: dashed; }
.rubble__target.is-area .rubble__target-mark { border-radius: 50%; transform: none; }
.rubble__bar {
  display: inline-block;
  width: 160px;
  height: 7px;
  background: rgb(255 255 255 / 0.14);
  box-shadow: 0 0 0 1px rgb(0 0 0 / 0.45);
  vertical-align: middle;
  overflow: hidden;
}
.rubble__bar i { display: block; height: 100%; width: 100%; background: #bfe8ff; transition: width 120ms linear; }
.rubble__bar i.is-low { background: #ff5a5a; }
.rubble__bar--jet i { background: #e8792a; }
.rubble__mech {
  position: absolute;
  left: 18px;
  bottom: 62px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-shadow: 0 0 4px rgb(0 0 0 / 0.7);
}
.rubble__mech-row { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.rubble__mech-key { width: 34px; opacity: 0.75; }
.rubble__mech-val { min-width: 34px; }
.rubble__mech-weapons { gap: 6px; }
.rubble__mech-slot { padding: 2px 7px; border: 1px solid rgb(255 255 255 / 0.28); opacity: 0.6; }
.rubble__mech-slot b { font-weight: 600; margin-right: 2px; }
.rubble__mech-slot.is-held { opacity: 1; border-color: #38e0ff; box-shadow: inset 0 0 0 1px #38e0ff, 0 0 6px rgb(56 224 255 / 0.5); }
.rubble__mech-cues { opacity: 0.8; white-space: pre; }
.rubble__boss {
  position: absolute;
  left: 50%;
  top: 118px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-shadow: 0 0 4px rgb(0 0 0 / 0.7);
}
.rubble__bar--boss { width: min(420px, 50vw); height: 9px; }
.rubble__bar--boss i { background: linear-gradient(90deg, #d54dff, #ff4df0); }
.rubble__boss-text { font-size: 0.7rem; letter-spacing: 0.06em; opacity: 0.85; }
.rubble__levels {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(560px, 88%);
  max-height: 76%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  background: rgb(12 12 14 / 0.92);
  border: 1px solid rgb(255 255 255 / 0.16);
  border-radius: 10px;
  pointer-events: auto;
}
.rubble__levels-title {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.7;
}
.rubble__levels-list { display: flex; flex-direction: column; gap: 4px; overflow-y: auto; }
.rubble__level {
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding: 7px 9px;
  font: inherit;
  font-size: 0.78rem;
  text-align: left;
  color: inherit;
  background: rgb(255 255 255 / 0.04);
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
}
.rubble__level:hover, .rubble__level:focus-visible { background: rgb(255 255 255 / 0.12); border-color: rgb(255 255 255 / 0.25); }
.rubble__level-no { flex: none; width: 4.8em; opacity: 0.65; letter-spacing: 0.08em; }
.rubble__level-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rubble__foes { position: absolute; inset: 0; pointer-events: none; }
.rubble__foe {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  margin: -7px 0 0 -7px;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-bottom: 12px solid #ff8a3c;
  transform-origin: 7px 7px;
  filter: drop-shadow(0 0 3px rgb(0 0 0 / 0.85));
  will-change: transform;
}
.rubble__foe[data-type="shooter"] { border-bottom-color: #45d3ff; }
.rubble__foe[data-type="rocketeer"] { border-bottom-color: #ffd23c; }
.rubble__foe[data-type="brute"] { margin: -9px 0 0 -9px; border-left-width: 9px; border-right-width: 9px; border-bottom: 15px solid #ff3d64; transform-origin: 9px 9px; }
.rubble__foe.is-edge { opacity: 0.8; }
.rubble__target-label { font-size: 0.72rem; letter-spacing: 0.06em; text-shadow: 0 0 4px rgb(0 0 0 / 0.7); white-space: nowrap; }
.rubble__title { margin: 0; font-size: clamp(1.6rem, 4vw, 2.4rem); font-weight: 500; }
.rubble__summary { margin: 0; font-size: 0.9rem; line-height: 1.6; opacity: 0.85; }
/* The meteor warning: a red band across the top that keeps pulsing until
   the ship is reached. */
.rubble__warning {
  position: absolute;
  left: 50%;
  top: 112px;
  margin: 0;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 22px;
  border: 1px solid rgb(255 70 60 / 0.75);
  background: rgb(58 12 10 / 0.62);
  color: #ffd9d3;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-shadow: 0 0 8px rgb(255 60 40 / 0.8);
  animation: rubble-warn 1.1s ease-in-out infinite;
}
.rubble__warning span {
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  opacity: 0.8;
}
@keyframes rubble-warn {
  0%, 100% { opacity: 1; border-color: rgb(255 70 60 / 0.75); }
  50% { opacity: 0.72; border-color: rgb(255 70 60 / 0.25); }
}
@media (prefers-reduced-motion: reduce) { .rubble__warning { animation: none; } }
/* The rail reticle: two rings ahead of the ship, the far one where the
   guns cross. Positioned by transform from the top-left like the marker. */
.rubble__reticle {
  position: absolute;
  left: 0;
  top: 0;
  border: 2px solid rgb(143 233 255 / 0.9);
  border-radius: 50%;
  box-shadow: 0 0 6px rgb(143 233 255 / 0.5);
  pointer-events: none;
  will-change: transform;
}
.rubble__reticle--near { width: 44px; height: 44px; margin: -22px 0 0 -22px; border-width: 1px; opacity: 0.7; }
.rubble__reticle--far { width: 18px; height: 18px; margin: -9px 0 0 -9px; }
.rubble__reticle--far::after { content: ""; position: absolute; left: 6px; top: 6px; width: 2px; height: 2px; background: rgb(143 233 255); }
/* The choice at the crater: the same band, in the beam's own colour. */
.rubble__choice {
  top: 150px;
  border-color: rgb(255 170 70 / 0.8);
  background: rgb(60 30 8 / 0.66);
  color: #ffe4c4;
  text-shadow: 0 0 8px rgb(255 160 60 / 0.8);
  animation: none;
}
/* The launch takes the whole view: nothing on top of it but the sky. */
.rubble.is-cinema .rubble__hud > * { display: none; }
/* Said over the picture. Outside the HUD on purpose, so the cinematics
   can carry a line; a caption sits low and quiet, a chapter title sits
   high and spaced like a weapon coming in. Both hold for --rubble-say. */
.rubble__caption,
.rubble__chapter {
  position: absolute;
  left: 50%;
  z-index: 2;
  margin: 0;
  max-width: min(64vw, 640px);
  transform: translateX(-50%);
  text-align: center;
  pointer-events: none;
  opacity: 0;
}
.rubble__caption {
  bottom: 23%;
  font-size: 1.02rem;
  letter-spacing: 0.05em;
  line-height: 1.5;
  text-shadow: 0 0 6px rgb(0 0 0 / 0.85), 0 1px 2px rgb(0 0 0 / 0.8);
}
.rubble__chapter {
  top: 36%;
  font-size: 1.35rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  text-shadow: 0 0 10px rgb(0 0 0 / 0.85), 0 1px 2px rgb(0 0 0 / 0.8);
}
.rubble__caption.is-live { animation: rubble-say var(--rubble-say, 4s) ease-out both; }
.rubble__chapter.is-live { animation: rubble-say var(--rubble-say, 3.4s) ease-out both; }
@keyframes rubble-say {
  0% { opacity: 0; transform: translate(-50%, 6px); }
  10% { opacity: 1; transform: translate(-50%, 0); }
  82% { opacity: 1; }
  100% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .rubble__caption.is-live, .rubble__chapter.is-live { animation: none; opacity: 1; }
}
.rubble__hint {
  position: absolute;
  left: 50%;
  top: 78px;
  margin: 0;
  transform: translateX(-50%);
  font-size: 0.8rem;
  text-shadow: 0 0 4px rgb(0 0 0 / 0.6);
}
.rubble__sound {
  position: absolute;
  top: 18px;
  right: 18px;
  padding: 6px 10px;
  border: 1px solid rgb(242 242 238 / 0.5);
  background: rgb(43 45 46 / 0.6);
  color: var(--rubble-ink);
  font: inherit;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  cursor: pointer;
  pointer-events: auto;
}
.rubble__sound:hover { background: rgb(43 45 46 / 0.9); }
.rubble__touch p { margin: 0; max-width: 32ch; text-align: center; line-height: 1.5; }
.df__zoom { display: inline-flex; gap: 4px; }
.df__island.is-locked { padding-left: 8px; padding-right: 8px; }
.df__zoom .df__button { min-width: 38px; padding: 6px 10px; font-size: 1.1rem; line-height: 1; }
@media (max-width: 720px) {
  .df__zoom { display: none; }
  .df__modal, .df__story { padding: 60px 10px 12px; align-items: start; }
  .df__modal-card { max-height: calc(100% - 8px); padding: 16px; }
  .df__modal-card h2 { font-size: 1.2rem; }
  .df__list--grid { grid-template-columns: 1fr; }
  .df-team { top: 60px; flex-direction: column; gap: 4px; width: 46%; }
  .df-team--a { left: 6px; } .df-team--b { right: 6px; align-items: flex-end; }
  .df-fighter { width: 100%; padding: 4px 8px; }
  .df-fighter b { font-size: 0.72rem; }
  .df-fighter .df-bar { height: 5px; margin-top: 3px; }
  .df-fight__power { bottom: 26%; font-size: 1.1rem; padding: 8px 16px; }
  .df-fight__ko { top: 44%; }
  .df-fight__result { top: 52%; }
  .df__toasts { bottom: max(84px, calc(env(safe-area-inset-bottom) + 80px)); }
}
@media (max-height: 520px) and (orientation: landscape) {
  .df__top { top: 8px; left: 56px; right: 56px; gap: 6px; }
  .df__stat { padding: 4px 10px; font-size: 0.85rem; }
  .df__island { padding: 4px 9px; font-size: 0.75rem; }
  .df__zoom { display: none; }
  .df__panel { top: 54px; right: 8px; left: auto; bottom: 62px; width: min(360px, 48%); max-height: none; padding: 12px; }
  .df__dock { bottom: 8px; gap: 4px; padding: 5px; width: auto; }
  .df__dock-button { min-height: 36px; padding: 4px 10px; font-size: 0.8rem; }
  .df__modal, .df__story { padding: 54px 48px 8px; align-items: start; }
  .df__modal-card { max-height: calc(100% - 4px); padding: 14px 18px; }
  .df__modal-card h2 { font-size: 1.15rem; }
  .df-modal__note, .df__panel p { font-size: 0.82rem; }
  .df-team { top: 6px; flex-direction: row; width: auto; gap: 4px; }
  .df-team--a { left: 48px; } .df-team--b { right: 48px; }
  .df-fighter { width: 92px; padding: 4px 6px; }
  .df-fighter b { font-size: 0.7rem; }
  .df-fight__power { bottom: 20%; font-size: 1.2rem; }
  .df-fight__result { padding: 14px; }
  .df-fight__result h2 { font-size: 1.2rem; margin-bottom: 4px; }
  .df__toasts { bottom: 62px; }
}
.df__modal-card { position: relative; }
.df-showcase { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.df-market { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.df-market__cell { position: relative; z-index: 2; display: grid; gap: 4px; padding: 8px; border-radius: 14px; border: 2px solid rgb(28 20 48 / 0.15); background: linear-gradient(180deg, #f3f6ff, #e6ecff); text-align: center; }
.df-market__cell.is-locked { opacity: 0.75; background: #f1f1f4; }
.df-market__stage { height: 130px; }
.df-market__cell b { font-size: 0.9rem; }
.df-market__cell small { font-size: 0.75rem; opacity: 0.7; }
.df-market__cell .df__button { justify-content: center; }
.df-hatch__stage { height: 240px; margin: -8px -8px 6px; border-radius: 14px; background: radial-gradient(circle at 50% 70%, #fff6cc, #dff1ff 70%); }
.df__modal-card > .df-market, .df__modal-card > .df-hatch__stage { position: relative; z-index: 0; }
.df__modal-card > .df__close { z-index: 3; }
@media (max-width: 720px) { .df-market { grid-template-columns: repeat(2, 1fr); } .df-market__stage { height: 110px; } .df-hatch__stage { height: 200px; } }
.df__island.is-locked { opacity: 0.6; background: rgb(255 255 255 / 0.45); }
.df__mute { min-width: 40px; padding: 6px 8px; font-size: 1rem; }
.df-odds { margin: 8px 0 4px; padding: 10px 12px; border-radius: 12px; background: #eef2ff; }
.df-odds h3 { margin: 0 0 6px; font-size: 0.95rem; }
.df-odds__list { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 4px; }
.df-odds__list li { position: relative; padding: 4px 8px; border-radius: 8px; overflow: hidden; font-size: 0.85rem; }
.df-odds__list li b { display: inline-block; min-width: 42px; }
.df-odds__bar { position: absolute; inset: 0 auto 0 0; background: rgb(255 216 61 / 0.55); z-index: 0; }
.df-odds__list li > *:not(.df-odds__bar) { position: relative; z-index: 1; }
.df-card__actions--center { justify-content: center; }
.df__dock-button--quests { position: relative; }
.df__badge { position: absolute; top: -8px; right: -8px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: #c9302c; color: #fff; font-size: 0.72rem; line-height: 20px; text-align: center; border: 2px solid #fff; }
.df-quests { display: grid; gap: 8px; }
.df-quest { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 10px 12px; border-radius: 12px; border: 2px solid rgb(28 20 48 / 0.15); background: #f7f9ff; }
.df-quest > div { flex: 1; min-width: 0; }
.df-quest b { font-size: 0.95rem; }
.df-quest p { margin: 2px 0 4px; font-size: 0.85rem; opacity: 0.85; }
.df-quest small { font-size: 0.75rem; opacity: 0.7; }
.df-quest.is-done { border-color: #b8851b; background: #fff6cc; }
.df-quest.is-claimed { opacity: 0.55; }
.df-quest__state { font-size: 0.8rem; font-weight: 700; opacity: 0.7; white-space: nowrap; }
@media (max-width: 720px) { .df__dock-button--quests { font-size: 0.72rem; } }
.df-book__entry { position: relative; z-index: 0; }
.df-book__stage { height: 96px; margin: -4px -4px 2px; border-radius: 10px; }
.df-book__stage--unknown { display: grid; place-items: center; font-size: 2rem; font-weight: 900; opacity: 0.25; }
.df-rivals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 6px 0 8px; }
.df-rivals__cell { display: grid; gap: 2px; padding: 6px; border-radius: 12px; border: 2px solid rgb(28 20 48 / 0.15); background: linear-gradient(180deg, #fff3e6, #ffe3cc); text-align: center; font-size: 0.85rem; }
.df-rivals__stage { height: 120px; }
.df-rivals__cell small { font-size: 0.75rem; opacity: 0.8; }
.df__modal-card > .df-book, .df__modal-card > .df-rivals { position: relative; z-index: 0; }
@media (max-width: 720px) { .df-rivals__stage { height: 90px; } .df-book__stage { height: 80px; } }
/* name tags over the dragons on the focused island */
.df__labels { position: absolute; inset: 0; z-index: 1; overflow: hidden; pointer-events: none; }
.df__label { position: absolute; left: 0; top: 0; transform: translate(-50%, -100%); display: grid; justify-items: center; padding: 3px 9px 4px; border-radius: 999px; border: 2px solid transparent; background: rgb(28 20 48 / 0.7); color: #fff; font-size: 0.74rem; line-height: 1.15; white-space: nowrap; }
.df__label small { font-size: 0.62rem; opacity: 0.8; }
.df__label--wild { background: rgb(184 50 46 / 0.85); }
.df__label.is-selected { border-color: #ffd83d; }
/* moving a roost between browsers */
.df-save__code { display: block; width: 100%; box-sizing: border-box; min-height: 110px; margin: 6px 0; padding: 8px 10px; border-radius: 10px; border: 2px solid rgb(28 20 48 / 0.3); font: 0.7rem/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; word-break: break-all; resize: vertical; }
.df-save__file { cursor: pointer; }
@media (max-width: 720px) { .df__label { font-size: 0.66rem; padding: 2px 7px 3px; } .df__label small { display: none; } }
/* Tarot reveal ceremony: one card, flipped slowly, meaning in big letters */
.tarot-reveal {
  position: fixed;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  padding: clamp(64px, 9vh, 96px) 20px 44px;
  overflow-y: auto;
  background:
    radial-gradient(ellipse at 50% 42%, rgb(30 41 72 / 0.96) 0%, rgb(9 13 23 / 0.99) 66%),
    #090d17;
  color: var(--tarot-parchment);
  cursor: pointer;
  outline: none;
  animation: tarot-reveal-in 500ms ease;
}
.tarot-reveal[hidden] { display: none; }
.tarot-reveal__stage { display: grid; width: 100%; place-items: center; }
.tarot-reveal__scene {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(12px, 2.2vh, 22px);
  width: 100%;
  max-width: 860px;
  text-align: center;
  opacity: 0;
  transform: scale(0.6) translateY(30px);
  transition: opacity 850ms ease, transform 950ms cubic-bezier(0.22, 1, 0.36, 1);
}
.tarot-reveal__scene.is-in { opacity: 1; transform: none; }
.tarot-reveal__scene.is-out {
  opacity: 0;
  transform: scale(1.05) translateY(-16px);
  transition: opacity 520ms ease, transform 560ms ease;
}
.tarot-reveal__position {
  margin: 0;
  color: var(--tarot-gold);
  font-family: var(--studio-mono);
  font-size: clamp(0.66rem, 1.1vw, 0.8rem);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.tarot-reveal__position span { margin-right: 10px; opacity: 0.7; }
.tarot-reveal__card {
  position: relative;
  height: clamp(180px, 32vh, 290px);
  aspect-ratio: 130 / 206;
  perspective: 1400px;
  filter: drop-shadow(0 26px 52px rgb(0 0 0 / 0.7));
}
.tarot-reveal__card .tarot-card-inner {
  transition: transform 1.9s cubic-bezier(0.45, 0.02, 0.2, 1);
  box-shadow: 0 0 0 1px rgb(214 155 50 / 0.3), 0 0 60px rgb(214 155 50 / 0.15);
}
.tarot-reveal__card.is-flipped .tarot-card-inner { transform: rotateY(180deg); }
.tarot-reveal__meaning {
  display: grid;
  gap: clamp(8px, 1.4vh, 14px);
  width: 100%;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 600ms ease, transform 700ms cubic-bezier(0.22, 1, 0.36, 1);
}
.tarot-reveal__meaning.is-in { opacity: 1; transform: none; }
.tarot-reveal__big {
  margin: 0;
  font-family: var(--studio-display);
  font-size: clamp(2rem, 5.6vw, 4rem);
  font-weight: 400;
  line-height: 1.04;
  letter-spacing: -0.035em;
  color: var(--tarot-gold-bright);
  text-wrap: balance;
}
.tarot-reveal__big--verdict {
  font-size: clamp(1.4rem, 3vw, 2.3rem);
  line-height: 1.24;
  letter-spacing: -0.02em;
  color: var(--tarot-parchment);
}
.tarot-reveal__keywords {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: var(--tarot-silver);
  font-family: var(--studio-mono);
  font-size: clamp(0.66rem, 1.1vw, 0.78rem);
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
.tarot-reveal__orientation {
  padding: 3px 9px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 0.9em;
}
.tarot-reveal__orientation.is-upright { color: var(--tarot-gold-bright); }
.tarot-reveal__orientation.is-reversed { color: #ff9ba8; }
.tarot-reveal__kicker {
  margin: 0;
  color: var(--tarot-gold);
  font-family: var(--studio-mono);
  font-size: clamp(0.66rem, 1.1vw, 0.78rem);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.tarot-reveal__line {
  max-width: 58ch;
  margin: 0 auto;
  font-size: clamp(0.95rem, 1.6vw, 1.15rem);
  line-height: 1.5;
  color: var(--tarot-silver);
}
.tarot-reveal__hint {
  position: fixed;
  bottom: 16px;
  left: 50%;
  margin: 0;
  color: var(--tarot-gold-dim);
  font-family: var(--studio-mono);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transform: translateX(-50%);
  opacity: 0.65;
}
@keyframes tarot-reveal-in { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .tarot-reveal { animation: none; }
  .tarot-reveal__scene,
  .tarot-reveal__scene.is-out,
  .tarot-reveal__meaning { transition-duration: 150ms; transform: none; }
  .tarot-reveal__card .tarot-card-inner { transition-duration: 300ms; }
}
@media (max-width: 680px) {
  .tarot-reveal { padding-top: 74px; }
  .tarot-reveal__card { height: clamp(150px, 26vh, 220px); }
  .tarot-reveal__big { font-size: clamp(1.9rem, 8.5vw, 2.8rem); }
}

.df-plans--wear { flex-wrap: wrap; }
.df__event { position: absolute; z-index: 5; left: 50%; top: 60px; transform: translateX(-50%); width: min(440px, calc(100% - 24px)); display: grid; gap: 3px; padding: 10px 14px; border-radius: 14px; background: #fff8e1; color: #1c1430; border: 2px solid #1c1430; box-shadow: 0 6px 0 #1c1430; pointer-events: auto; }
.df__event b { font-size: 0.95rem; }
.df__event span { font-size: 0.85rem; line-height: 1.35; }
.df__event small { font-size: 0.75rem; opacity: 0.7; }
.df__event-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.df-collections { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; margin-bottom: 12px; }
.df-collection { display: grid; gap: 4px; align-content: start; padding: 10px; border-radius: 12px; border: 2px solid rgb(28 20 48 / 0.15); background: #f7f9ff; font-size: 0.85rem; }
.df-collection.is-done { border-color: #1c1430; background: #fff3c4; }
.df-collection.is-claimed { opacity: 0.6; }
.df-collection small { font-size: 0.72rem; opacity: 0.75; line-height: 1.3; }
.df-collection__tag { font-size: 0.72rem; font-weight: 700; opacity: 0.8; }
.df-book__star { font-style: normal; color: #c98a00; }
.df-collections__box { margin-bottom: 12px; }
.df-collections__box summary { cursor: pointer; font-weight: 700; padding: 6px 0; }
.df-collections__box[open] summary { margin-bottom: 4px; }
.df-fight__speed { pointer-events: auto; }
.df-fight__speed .df__button { padding: 4px 10px; min-height: 30px; font-size: 0.78rem; }
.df-fight__speed .df__button.is-active { background: #ffd83d; color: #1c1430; }
@media (max-width: 720px) { .df-fight__legend { display: none; } .df-fight__power { bottom: 42%; font-size: 1.4rem; padding: 8px 18px; } .df-collections { grid-template-columns: repeat(2, 1fr); gap: 6px; } .df-collection { padding: 8px; font-size: 0.78rem; } .df-collection .df__button { padding: 4px 8px; min-height: 30px; font-size: 0.78rem; } }
@media (max-width: 720px) { .df__panel:not([hidden]) ~ .df__tutorial { display: none; } }

.game-card__icon--common-area { background: #21191a; }
.game-card__common-art {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background:
    linear-gradient(90deg, #302521 0 21%, transparent 21% 79%, #302521 79%),
    radial-gradient(ellipse at 50% 38%, #967b59, #3e322b 50%, #141216 85%);
}
.game-card__common-art::before {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 47%, rgb(240 213 165 / 0.34) 50%, transparent 53%);
  clip-path: polygon(25% 0, 75% 0, 58% 100%, 42% 100%);
  content: "";
}
.game-card__common-door {
  position: absolute;
  top: 10%;
  width: 29%;
  height: 67%;
  border: 5px solid #4b382f;
  background: #19151a url("./assets/apartment/paper-night.webp") center / cover;
  box-shadow: inset 0 0 0 7px rgb(206 172 123 / 0.52);
}
.game-card__common-door--left { left: -4%; transform: skewY(4deg); }
.game-card__common-door--right { right: -4%; transform: skewY(-4deg); }
.game-card__common-tenant {
  position: absolute;
  z-index: 2;
  bottom: 2%;
  left: 10%;
  display: block;
  width: 80%;
  height: 96%;
  object-fit: contain;
  filter: drop-shadow(5px 4px 3px rgb(0 0 0 / 0.55));
}
.game-card__common-number {
  position: absolute;
  z-index: 1;
  top: 23%;
  left: 8%;
  padding: 2px 4px;
  border: 1px solid #806747;
  background: #292322;
  color: #d3bb91;
  font-family: var(--studio-mono);
  font-size: 0.56rem;
  letter-spacing: 0.08em;
}
/* The Apartment Across ------------------------------------------------- */

.game-dialog[data-game="apartment"] { background: #070a12; color: #efe8d6; }
.game-dialog[data-game="apartment"] .game-dialog__chrome {
  padding-right: 5px;
  border: 1px solid rgb(246 226 190 / 0.12);
  background: rgb(10 12 20 / 0.62);
  color: #f6ead0;
}
.game-dialog[data-game="apartment"] .game-dialog__count { display: none; }

.apartment {
  --deep-night: 0;
  --near-dawn: 0;
  --night-fade: 0;
  --focus-x: 50%;
  --focus-y: 50%;
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 100svh;
  overflow: hidden;
  background: #080b14;
  color: #f7edd7;
  font-family: var(--studio-sans);
  isolation: isolate;
}
.apartment:focus { outline: 0; }
.ap-speed {
  position: absolute;
  z-index: 13;
  top: max(56px, 6vh);
  left: max(30px, 5vw);
  display: grid;
  grid-template-columns: auto auto;
  grid-template-rows: auto auto;
  min-width: 84px;
  min-height: 49px;
  padding: 7px 11px 8px;
  border: 1px solid #4b382a;
  background:
    repeating-linear-gradient(8deg, transparent 0 6px, rgb(83 57 35 / 0.045) 7px 8px),
    #e7d3a8;
  box-shadow: 3px 4px 0 #241b18, 0 10px 24px rgb(0 0 0 / 0.3);
  color: #281e19;
  clip-path: polygon(3% 4%, 96% 0, 100% 88%, 92% 100%, 4% 96%, 0 17%);
  cursor: pointer;
  rotate: -1.5deg;
}
.ap-speed__chevrons {
  grid-row: 1 / 3;
  align-self: center;
  padding-right: 7px;
  font-family: Georgia, serif;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.28em;
  line-height: 1;
  translate: -2px 0;
}
.ap-speed small {
  align-self: end;
  font-size: 0.55rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  line-height: 1;
  text-transform: uppercase;
}
.ap-speed b {
  align-self: start;
  font-family: var(--studio-display);
  font-size: 1.1rem;
  line-height: 1;
}
.ap-speed[aria-pressed="true"] {
  background:
    repeating-linear-gradient(-7deg, transparent 0 6px, rgb(83 57 35 / 0.055) 7px 8px),
    #dfb96f;
  box-shadow: 2px 3px 0 #241b18, 0 8px 20px rgb(0 0 0 / 0.34);
  rotate: 1deg;
}
.ap-speed:active { translate: 2px 2px; box-shadow: 1px 1px 0 #241b18; }
.ap-speed:focus-visible { outline: 3px solid #fff0c8; outline-offset: 4px; }
.apartment__viewport {
  position: absolute;
  z-index: 1;
  inset: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
  touch-action: pan-x;
}
.apartment__viewport::-webkit-scrollbar { display: none; }
.apartment__world {
  position: relative;
  width: 100%;
  min-width: 760px;
  height: 100%;
  min-height: 620px;
  overflow: hidden;
  background: #141827;
}
.apartment__sky {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 78% 12%, rgb(232 225 198 / 0.12) 0 1px, transparent 2px),
    radial-gradient(circle at 18% 21%, rgb(232 225 198 / 0.2) 0 1px, transparent 2px),
    radial-gradient(circle at 57% 9%, rgb(232 225 198 / 0.16) 0 1px, transparent 2px),
    linear-gradient(180deg, #685d78 0%, #343448 35%, #141827 82%);
}
.apartment__sky::before,
.apartment__sky::after { content: ""; position: absolute; inset: 0; pointer-events: none; }
.apartment__sky::before {
  background: linear-gradient(180deg, #080c19 0%, #151a2a 54%, #22283a 100%);
  opacity: var(--deep-night);
}
.apartment__sky::after {
  background: linear-gradient(180deg, #556479 0%, #887a7d 46%, #b58d75 100%);
  opacity: calc(var(--near-dawn) * 0.82);
}
.apartment__sky > i {
  position: absolute;
  z-index: 2;
  display: block;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #fff6d9;
  box-shadow: 72px 18px #fff6d9, 161px -4px #fff6d9, 244px 27px #fff6d9, 386px 7px #fff6d9, 511px 34px #fff6d9;
  opacity: calc(var(--deep-night) * 0.54);
}
.apartment__sky > i:nth-child(1) { top: 11%; left: 8%; transform: scale(0.55); }
.apartment__sky > i:nth-child(2) { top: 19%; left: 38%; transform: scale(0.8); }
.apartment__sky > i:nth-child(3) { top: 8%; left: 71%; transform: scale(0.45); }
.apartment__city {
  position: absolute;
  right: -4%;
  bottom: 8%;
  left: -4%;
  height: 39%;
  background:
    linear-gradient(90deg, transparent 0 3%, #0c101b 3% 10%, transparent 10% 13%, #0d111d 13% 21%, transparent 21% 23%, #0b101a 23% 33%, transparent 33% 37%, #0d111d 37% 44%, transparent 44% 48%, #0b0f1a 48% 59%, transparent 59% 62%, #0d111b 62% 71%, transparent 71% 74%, #0a0e18 74% 84%, transparent 84% 88%, #0c101b 88% 97%, transparent 97%),
    linear-gradient(180deg, transparent 0 25%, #0b0f19 25% 100%);
  clip-path: polygon(0 34%, 4% 34%, 4% 12%, 10% 12%, 10% 42%, 14% 42%, 14% 22%, 22% 22%, 22% 38%, 27% 38%, 27% 5%, 35% 5%, 35% 42%, 41% 42%, 41% 28%, 49% 28%, 49% 16%, 58% 16%, 58% 43%, 63% 43%, 63% 8%, 71% 8%, 71% 37%, 77% 37%, 77% 20%, 85% 20%, 85% 45%, 90% 45%, 90% 12%, 98% 12%, 98% 32%, 100% 32%, 100% 100%, 0 100%);
  opacity: 0.86;
}
.ap-building {
  position: absolute;
  z-index: 3;
  bottom: 7%;
  left: 50%;
  width: clamp(650px, 76vw, 980px);
  height: min(80vh, 760px);
  min-height: 600px;
  translate: -50% 0;
  scale: 1;
  transform-origin: var(--focus-x) var(--focus-y);
  transition: scale 1100ms cubic-bezier(0.2, 0.78, 0.16, 1), filter 900ms ease;
}
.apartment.is-focused .ap-building { scale: 1.3; filter: saturate(1.05) contrast(1.03); }
.ap-roof {
  position: relative;
  height: 12%;
  border-bottom: 7px solid #24212a;
  background: linear-gradient(178deg, transparent 0 56%, #4b3840 57% 100%);
}
.ap-water-tank {
  position: absolute;
  right: 4%;
  bottom: 5px;
  width: 74px;
  height: 56px;
  border: 5px solid #23242b;
  border-radius: 48% 48% 12% 12%;
  background: linear-gradient(90deg, #373740, #5a5052 48%, #302f38);
  box-shadow: 0 8px 12px rgb(4 5 9 / 0.36);
}
.ap-water-tank::before,
.ap-water-tank::after { content: ""; position: absolute; top: 50px; width: 5px; height: 26px; background: #24252c; }
.ap-water-tank::before { left: 12px; }
.ap-water-tank::after { right: 12px; }
.ap-water-tank i { position: absolute; top: -12px; left: 30px; width: 5px; height: 12px; background: #24252c; }
.ap-chimney { position: absolute; bottom: 4px; left: 12%; width: 35px; height: 55px; border: 4px solid #32282d; background: #6a4542; }
.ap-roof__scene { position: absolute; z-index: 5; inset: -36px 7% 5px; opacity: 0; transition: opacity 1200ms ease; }
.ap-roof__scene.is-active { opacity: 1; }
.ap-building__face {
  position: relative;
  height: 88%;
  overflow: visible;
  border: 8px solid #302129;
  border-top: 0;
  background:
    linear-gradient(90deg, transparent 0 49.5%, rgb(62 35 39 / 0.22) 49.8% 50.2%, transparent 50.5%),
    repeating-linear-gradient(0deg, rgb(255 255 255 / 0.025) 0 2px, transparent 2px 31px),
    repeating-linear-gradient(90deg, transparent 0 54px, rgb(48 27 32 / 0.2) 55px 57px),
    linear-gradient(135deg, #68464a, #51363e 54%, #3f303a);
  box-shadow: 0 42px 70px rgb(1 3 8 / 0.58), inset 0 0 80px rgb(17 8 13 / 0.32);
}
.ap-building__face::after {
  content: "";
  position: absolute;
  z-index: 8;
  inset: 0;
  background: linear-gradient(105deg, transparent 18%, rgb(255 229 164 / 0.04) 40%, transparent 62%);
  pointer-events: none;
  mix-blend-mode: screen;
}
.ap-building__windows {
  position: absolute;
  z-index: 4;
  inset: 5% 10% 10%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(4, minmax(0, 1fr));
  gap: 5.6% 10%;
}
.ap-window {
  --window-light: #e8aa67;
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  padding: 0;
  border: 5px solid #241e25;
  border-radius: 1px;
  background: #070910;
  box-shadow: 0 10px 15px rgb(10 4 8 / 0.42), inset 0 0 0 2px #514149;
  cursor: zoom-in;
  outline: 0;
  transition: box-shadow 500ms ease, filter 600ms ease, transform 700ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.ap-window:hover,
.ap-window:focus-visible { box-shadow: 0 0 0 2px rgb(246 227 183 / 0.64), 0 10px 22px rgb(4 2 7 / 0.64), inset 0 0 0 2px #66515c; }
.ap-window:focus-visible { transform: translateY(-2px); }
.ap-window.is-focused { z-index: 6; cursor: zoom-out; box-shadow: 0 0 0 3px rgb(255 236 190 / 0.75), 0 12px 35px rgb(2 2 5 / 0.78); }
.ap-window[data-light="off"] { --window-light: #13151b; }
.ap-window[data-light="dim"] { --window-light: #ac875f; }
.ap-window[data-light="warm"] { --window-light: #f0b36f; }
.ap-window[data-light="cool"] { --window-light: #9aa6b1; }
.ap-window[data-light="blue"] { --window-light: #758ca8; }
.ap-window[data-light="sage"] { --window-light: #9aa582; }
.ap-window[data-light="cream"] { --window-light: #d7c59b; }
.ap-window[data-light="gold"] { --window-light: #f1c85d; }
.ap-window[data-light="moon"] { --window-light: #78839a; }
.ap-window__room {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 70% 18%, color-mix(in srgb, var(--window-light) 82%, white) 0 4%, transparent 5%),
    linear-gradient(160deg, color-mix(in srgb, var(--window-light) 68%, #35262c), color-mix(in srgb, var(--window-light) 35%, #34252c));
  opacity: 1;
  transition: background 1500ms ease, filter 900ms ease, opacity 1500ms ease;
}
.ap-window[data-light="off"] .ap-window__room { filter: saturate(0.25) brightness(0.22); opacity: 0.48; }
.ap-window__wall { position: absolute; inset: 0 0 24%; background: repeating-linear-gradient(90deg, rgb(255 255 255 / 0.045) 0 1px, transparent 1px 17px); }
.ap-window__floor { position: absolute; right: 0; bottom: 0; left: 0; height: 25%; background: linear-gradient(165deg, rgb(67 42 42 / 0.42), rgb(28 20 25 / 0.72)); }
.ap-window__details { position: absolute; z-index: 1; inset: 0; opacity: 0.24; transition: opacity 650ms ease; }
.ap-window.is-focused .ap-window__details { opacity: 0.76; }
.ap-window[data-room="bakery"] .ap-window__details::before,
.ap-window[data-room="music"] .ap-window__details::before,
.ap-window[data-room="plants"] .ap-window__details::before,
.ap-window[data-room="laundry"] .ap-window__details::before {
  content: "";
  position: absolute;
  top: 13%;
  right: 7%;
  width: 31%;
  height: 5px;
  background: #463139;
  box-shadow: 0 20px #463139, -116px 12px #463139;
}
.ap-window[data-room="nursery"] .ap-window__details::before { content: ""; position: absolute; top: 17%; left: 12%; width: 22px; height: 22px; border-radius: 50%; background: rgb(255 245 205 / 0.15); box-shadow: 7px -3px 0 var(--window-light); }
.ap-window[data-room="studio"] .ap-window__details::before { content: ""; position: absolute; inset: 8% 7% 32%; border: 1px dashed rgb(53 32 39 / 0.34); transform: rotate(-1deg); }
.ap-window[data-room="landing"] .ap-window__details::before,
.ap-window[data-room="lobby"] .ap-window__details::before { content: ""; position: absolute; right: 9%; bottom: 22%; width: 34%; height: 64%; border: 4px solid rgb(42 34 42 / 0.36); border-bottom: 0; }
.ap-window[data-room="new-home"] .ap-window__details::before { content: ""; position: absolute; top: 13%; right: 8%; width: 37%; height: 54%; border: 1px solid rgb(255 255 255 / 0.13); background: linear-gradient(135deg, transparent 48%, rgb(255 255 255 / 0.07) 49% 52%, transparent 53%); }
.ap-window[data-room="cat-home"] .ap-window__details::before { content: ""; position: absolute; top: 10%; right: 12%; width: 21%; height: 47%; background: repeating-linear-gradient(0deg, #3d2d35 0 3px, transparent 3px 11px); }
.ap-window__scene { position: absolute; z-index: 3; inset: 0; transition: opacity 700ms ease; }
.ap-window__curtain { position: absolute; z-index: 5; top: -3%; bottom: 0; width: 25%; background: repeating-linear-gradient(90deg, rgb(73 40 50 / 0.88) 0 7px, rgb(112 65 72 / 0.9) 8px 14px); filter: drop-shadow(0 3px 3px rgb(10 5 9 / 0.34)); transition: width 900ms ease, translate 900ms ease; }
.ap-window__curtain--left { left: 0; transform-origin: left top; }
.ap-window__curtain--right { right: 0; transform-origin: right top; }
.ap-window[data-curtain="half"] .ap-window__curtain { width: 38%; }
.ap-window[data-curtain="closed"] .ap-window__curtain { width: 51%; }
.ap-window[data-curtain="open"] .ap-window__curtain--left { translate: -46% 0; }
.ap-window[data-curtain="open"] .ap-window__curtain--right { translate: 46% 0; }
.ap-window__blinds { position: absolute; z-index: 6; inset: 0; background: repeating-linear-gradient(0deg, transparent 0 9px, rgb(37 30 37 / 0.55) 10px 12px); opacity: 0; pointer-events: none; transition: opacity 600ms ease; }
.ap-window[data-blinds="half"] .ap-window__blinds { opacity: 0.52; }
.ap-window__frame { position: absolute; z-index: 7; inset: 0; background: linear-gradient(90deg, transparent calc(50% - 3px), #30272e calc(50% - 3px) calc(50% + 3px), transparent calc(50% + 3px)), linear-gradient(0deg, transparent calc(38% - 2px), #30272e calc(38% - 2px) calc(38% + 2px), transparent calc(38% + 2px)); box-shadow: inset 0 0 10px rgb(7 4 8 / 0.4); pointer-events: none; }
.ap-window__dialogue { position: absolute; z-index: 8; inset: 0; overflow: hidden; pointer-events: none; }
.ap-window.is-cued::after {
  content: "";
  position: absolute;
  z-index: 10;
  top: 50%;
  left: 50%;
  width: 34px;
  height: 21px;
  border: 2px solid rgb(255 239 196 / 0.9);
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgb(255 231 175 / 0.34);
  pointer-events: none;
  translate: -50% -50%;
  animation: ap-gaze-cue 1800ms ease-out infinite;
}
.ap-window.is-cued::before { content: ""; position: absolute; z-index: 11; top: 50%; left: 50%; width: 7px; height: 7px; border-radius: 50%; background: #fff2c9; translate: -50% -50%; pointer-events: none; }

.ap-person {
  --lean: 0deg;
  --arm-front: -9deg;
  --arm-back: 10deg;
  --leg-front: -5deg;
  --leg-back: 7deg;
  position: absolute;
  z-index: 4;
  bottom: 12%;
  left: var(--x);
  display: block;
  width: 18%;
  height: 67%;
  transform: translateX(-50%) scale(var(--scale)) scaleX(var(--facing)) rotate(var(--lean));
  transform-origin: 50% 100%;
  transition: left 900ms cubic-bezier(0.2, 0.8, 0.2, 1), transform 650ms ease;
}
.ap-person__head { position: absolute; z-index: 5; top: 2%; left: 31%; width: 38%; aspect-ratio: 0.9; border-radius: 48% 48% 45% 44%; background: #211b21; box-shadow: 2px 1px 0 rgb(255 255 255 / 0.06); }
.ap-person__torso { position: absolute; z-index: 3; top: 31%; left: 23%; width: 54%; height: 39%; border-radius: 45% 44% 20% 20%; background: linear-gradient(90deg, #171319, #2d252c 54%, #171319); clip-path: polygon(16% 0, 82% 0, 100% 100%, 0 100%); }
.ap-person__arm { position: absolute; z-index: 2; top: 34%; width: 15%; height: 38%; border-radius: 999px; background: #201a20; transform-origin: 50% 8%; }
.ap-person__arm--front { z-index: 5; left: 64%; transform: rotate(var(--arm-front)); }
.ap-person__arm--back { left: 22%; transform: rotate(var(--arm-back)); }
.ap-person__leg { position: absolute; top: 66%; width: 18%; height: 35%; border-radius: 5px 5px 2px 2px; background: #171318; transform-origin: 50% 6%; }
.ap-person__leg--front { z-index: 4; left: 52%; transform: rotate(var(--leg-front)); }
.ap-person__leg--back { z-index: 1; left: 30%; transform: rotate(var(--leg-back)); }
.ap-person[data-accent="red"]::after { content: ""; position: absolute; z-index: 8; top: 27%; left: 24%; width: 54%; height: 8%; border-radius: 2px; background: #9d4244; box-shadow: 13px -21px 0 -4px #9d4244; }
.ap-person[data-pose="slump"], .ap-person[data-pose="cry"] { --lean: 13deg; --arm-front: 34deg; --arm-back: 23deg; }
.ap-person[data-pose="wait"] { --lean: 5deg; --arm-front: 18deg; --arm-back: 15deg; }
.ap-person[data-pose="sit"] { bottom: 2%; height: 55%; --leg-front: -65deg; --leg-back: -76deg; }
.ap-person[data-pose="kneel"] { bottom: 2%; height: 52%; --lean: 8deg; --leg-front: -58deg; --leg-back: 46deg; }
.ap-person[data-pose="carry"], .ap-person[data-pose="hold"] { --arm-front: -58deg; --arm-back: 58deg; }
.ap-person[data-pose="offer"], .ap-person[data-pose="reach"], .ap-person[data-pose="place"] { --lean: 8deg; --arm-front: -78deg; --arm-back: -18deg; }
.ap-person[data-pose="set-table"], .ap-person[data-pose="eat"] { --lean: 14deg; --arm-front: -55deg; --arm-back: 38deg; }
.ap-person[data-pose="hesitate"], .ap-person[data-pose="pause"] { --lean: -3deg; --arm-front: 12deg; --arm-back: 15deg; }
.ap-person[data-pose="search"], .ap-person[data-pose="unpack"] { --lean: 16deg; --arm-front: -52deg; --arm-back: 52deg; }
.ap-person[data-pose="hold-door"] { --arm-front: -108deg; --arm-back: 10deg; }
.ap-person[data-pose="roll"], .ap-person[data-pose="unfurl"] { --lean: 11deg; --arm-front: -74deg; --arm-back: 74deg; }
.ap-person[data-pose="bow"] { --lean: 32deg; --arm-front: 40deg; --arm-back: 45deg; }
.ap-person[data-pose="delight"], .ap-person[data-pose="clap"] { --arm-front: -43deg; --arm-back: 43deg; }
.ap-person[data-pose="keys"] { --arm-front: -62deg; }
.ap-person:is([data-pose="pace"], [data-pose="hurry"], [data-pose="chase"], [data-pose="dance"]) { --arm-front: 28deg; --arm-back: -29deg; --leg-front: -18deg; --leg-back: 19deg; animation: ap-person-step 850ms steps(2, end) infinite; }
.ap-person[data-pose="hurry"], .ap-person[data-pose="chase"] { --lean: 13deg; animation-duration: 520ms; }
.ap-person[data-pose="dance"] { animation: ap-person-dance 1100ms steps(3, end) infinite; }
.ap-person:is([data-pose="knead"], [data-pose="decorate"], [data-pose="build"], [data-pose="wrap"], [data-pose="fold"], [data-pose="hang"], [data-pose="water"], [data-pose="sweep"]) { --lean: 8deg; --arm-front: -42deg; --arm-back: 44deg; }
.ap-person:is([data-pose="knead"], [data-pose="decorate"], [data-pose="build"], [data-pose="paint"], [data-pose="water"], [data-pose="sweep"]) .ap-person__arm--front { animation: ap-hand-work 900ms steps(2, end) infinite; }
.ap-person[data-pose="paint"] { --lean: -4deg; --arm-front: -105deg; --arm-back: 26deg; }
.ap-person[data-pose="play"] { --arm-front: -88deg; --arm-back: 68deg; }
.ap-person[data-pose="soft-play"] { --arm-front: -72deg; --arm-back: 54deg; }
.ap-person:is([data-pose="play"], [data-pose="soft-play"]) .ap-person__arm--front { animation: ap-bow-arm 1200ms ease-in-out infinite alternate; }
.ap-person[data-pose="soft-play"] .ap-person__arm--front { animation-duration: 1900ms; }
.ap-person:is([data-pose="rock"], [data-pose="hold"]) { animation: ap-rock 1800ms ease-in-out infinite alternate; }
.ap-person:is([data-pose="wave"], [data-pose="laugh"]) { --arm-front: -126deg; --arm-back: 8deg; }
.ap-person[data-pose="wave"] .ap-person__arm--front { animation: ap-wave 850ms ease-in-out infinite alternate; }
.ap-person[data-pose="laugh"] { animation: ap-laugh 700ms steps(2, end) infinite; }

.ap-cat { position: absolute; z-index: 7; bottom: 10%; left: var(--x); display: block; width: 15%; height: 31%; transform: translateX(-50%) scale(var(--scale)) scaleX(var(--facing)); transform-origin: 50% 100%; }
.ap-cat__body { position: absolute; right: 8%; bottom: 0; width: 67%; height: 50%; border-radius: 55% 48% 35% 40%; background: #18151b; }
.ap-cat__head { position: absolute; right: 0; bottom: 35%; width: 42%; aspect-ratio: 1; border-radius: 45%; background: #1e1a20; }
.ap-cat__head::before { content: ""; position: absolute; top: -33%; left: 5%; width: 90%; height: 50%; background: #1e1a20; clip-path: polygon(0 100%, 18% 0, 44% 100%, 70% 0, 100% 100%); }
.ap-cat__tail { position: absolute; bottom: 20%; left: -12%; width: 56%; height: 54%; border: 5px solid #18151b; border-right: 0; border-bottom-color: transparent; border-radius: 60% 0 0 0; transform-origin: 100% 100%; }
.ap-cat[data-pose="pounce"], .ap-cat[data-pose="climb"] { transform: translateX(-50%) translateY(-20%) scale(var(--scale)) scaleX(var(--facing)) rotate(-8deg); }
.ap-cat:is([data-pose="stalk"], [data-pose="prowl"], [data-pose="drag"], [data-pose="follow"]) { animation: ap-cat-prowl 1100ms steps(3, end) infinite; }
.ap-cat[data-pose="shake"] { animation: ap-cat-shake 600ms steps(4, end) infinite; }
.ap-cat[data-pose="sleep"] { height: 21%; transform: translateX(-50%) scale(var(--scale)) scaleX(var(--facing)); }
.ap-cat[data-pose="sleep"] .ap-cat__tail { transform: rotate(-24deg); }
.ap-cat[data-pose="box"] { bottom: 6%; height: 24%; }

.ap-prop { position: absolute; z-index: 3; bottom: calc(9% + var(--y) * 1%); left: var(--x); display: block; width: 18%; height: 28%; transform: translateX(-50%) scale(var(--scale)); transform-origin: 50% 100%; }
.ap-prop[data-prop="table"], .ap-prop[data-prop="counter"] { bottom: 17%; width: 54%; height: 12%; border-radius: 2px; background: #4a3030; box-shadow: inset 0 3px rgb(255 255 255 / 0.06); }
.ap-prop[data-prop="table"]::before, .ap-prop[data-prop="counter"]::before { content: ""; position: absolute; top: 75%; left: 9%; width: 7%; height: 150%; background: #342329; box-shadow: 176px 0 #342329; }
.ap-prop[data-prop="counter"] { bottom: 11%; width: 64%; height: 23%; background: linear-gradient(#66504a 0 18%, #49353a 19%); }
.ap-prop[data-prop="chair"] { bottom: 11%; width: 16%; height: 41%; border: 5px solid #3b282f; border-top-width: 8px; background: transparent; }
.ap-prop[data-prop="mug"], .ap-prop[data-prop="fallen-mug"] { bottom: 30%; width: 8%; height: 13%; border: 3px solid #d1a66e; border-radius: 1px 1px 4px 4px; background: rgb(255 246 220 / 0.18); }
.ap-prop[data-prop="mug"]::after, .ap-prop[data-prop="fallen-mug"]::after { content: ""; position: absolute; top: 20%; right: -65%; width: 64%; height: 55%; border: 2px solid #d1a66e; border-left: 0; border-radius: 0 50% 50% 0; }
.ap-prop[data-prop="fallen-mug"] { bottom: 12%; rotate: 78deg; }
.ap-prop[data-prop="photo"] { bottom: 29%; width: 10%; height: 19%; border: 3px solid #6c4c42; background: radial-gradient(circle at 50% 36%, #30252b 0 19%, transparent 21%), linear-gradient(#baa481, #806e5c); transform: translateX(-50%) rotate(-4deg); }
.ap-prop[data-prop="oven"] { right: 2%; bottom: 10%; left: auto; width: 24%; height: 45%; border: 4px solid #49383b; border-radius: 2px; background: linear-gradient(#62595a 0 22%, #272329 23% 72%, #52494a 73%); transform: none; }
.ap-prop[data-prop="oven"]::before { content: ""; position: absolute; top: 8%; left: 18%; width: 8%; height: 8%; border-radius: 50%; background: #17151a; box-shadow: 14px 0 #17151a, 28px 0 #17151a; }
.ap-prop[data-prop="bowl"] { bottom: 29%; width: 17%; height: 10%; border-radius: 2px 2px 50% 50%; background: #9b6f57; }
.ap-prop[data-prop="cake"], .ap-prop[data-prop="cake-slice"] { bottom: 29%; width: 18%; height: 16%; border-radius: 3px; background: linear-gradient(#ead6a7 0 29%, #9d5f56 30% 48%, #dfc68f 49% 72%, #9d5f56 73%); box-shadow: 0 -4px #efe3bc; }
.ap-prop[data-prop="cake"]::before { content: ""; position: absolute; top: -42%; left: 48%; width: 3px; height: 42%; background: #8e4342; box-shadow: 0 -3px 0 1px #f4c55d; }
.ap-prop[data-prop="cake-slice"] { width: 9%; clip-path: polygon(0 0, 100% 50%, 0 100%); }
.ap-prop[data-prop="bread"] { bottom: 29%; width: 18%; height: 13%; border-radius: 60% 60% 25% 25%; background: repeating-linear-gradient(105deg, transparent 0 7px, rgb(77 43 35 / 0.25) 8px 10px), #c98b54; }
.ap-prop[data-prop="plant"] { bottom: 10%; width: 17%; height: 39%; border-radius: 0 0 35% 35%; background: linear-gradient(90deg, #62413b, #7f5a46); clip-path: polygon(17% 66%, 83% 66%, 71% 100%, 29% 100%); }
.ap-prop[data-prop="plant"]::before { content: ""; position: absolute; inset: 0 0 30%; background: #28382e; clip-path: polygon(48% 100%, 0 42%, 38% 46%, 22% 0, 52% 40%, 73% 3%, 65% 50%, 100% 30%, 67% 72%); }
.ap-prop[data-prop="box"] { bottom: 8%; width: 25%; height: 26%; border: 2px solid #5d493c; background: #98795c; box-shadow: inset 0 0 0 1px rgb(255 245 215 / 0.13); }
.ap-prop[data-prop="box"]::after { content: ""; position: absolute; top: -2px; left: 48%; width: 2px; height: 100%; background: #6f5744; }
.ap-prop[data-prop="lamp"] { bottom: 9%; width: 13%; height: 51%; border-bottom: 5px solid #3c2d33; background: linear-gradient(90deg, transparent 45%, #3c2d33 46% 55%, transparent 56%); }
.ap-prop[data-prop="lamp"]::before { content: ""; position: absolute; top: 0; left: -22%; width: 144%; height: 34%; background: #d6b173; clip-path: polygon(22% 0, 78% 0, 100% 100%, 0 100%); }
.ap-prop[data-prop="broken-lamp"] { bottom: 8%; width: 28%; height: 21%; border-bottom: 5px solid #3c2d33; background: linear-gradient(13deg, transparent 44%, #3c2d33 45% 53%, transparent 54%); rotate: 11deg; }
.ap-prop[data-prop="card-shade"] { bottom: 10%; width: 24%; height: 25%; border: 2px dashed #644a3e; background: #b89267; clip-path: polygon(19% 0, 81% 0, 100% 100%, 0 100%); }
.ap-prop[data-prop="lantern"] { bottom: 18%; width: 22%; height: 35%; border: 2px dashed #805a3f; background: radial-gradient(circle, #fff5b7, #e7aa4d 64%, #9a5a3d); clip-path: polygon(20% 0, 80% 0, 100% 83%, 50% 100%, 0 83%); filter: drop-shadow(0 0 12px #efbd61); animation: ap-lantern 2100ms ease-in-out infinite alternate; }
.ap-prop[data-prop="bulb"] { bottom: 25%; width: 8%; height: 14%; border-radius: 50% 50% 35% 35%; background: #f5e4a4; box-shadow: 0 0 9px #f5e4a4; }
.ap-prop[data-prop="bundle"] { z-index: 6; bottom: 35%; width: 15%; height: 18%; border-radius: 48% 48% 38% 38%; background: repeating-linear-gradient(45deg, #a86f64 0 4px, #c68b76 5px 8px); transform: translateX(-50%) rotate(-10deg); }
.ap-prop[data-prop="crib"] { bottom: 9%; width: 27%; height: 35%; border: 4px solid #56424a; background: repeating-linear-gradient(90deg, transparent 0 8px, #56424a 9px 11px); }
.ap-prop[data-prop="star-lamp"] { bottom: 44%; width: 14%; height: 24%; background: #f5d16b; clip-path: polygon(50% 0, 61% 34%, 98% 34%, 68% 55%, 80% 94%, 50% 70%, 20% 94%, 32% 55%, 2% 34%, 39% 34%); filter: drop-shadow(0 0 8px #f5d16b); }
.ap-prop[data-prop="violin"] { z-index: 6; bottom: 32%; width: 8%; height: 31%; border-radius: 50% 25% 50% 25%; background: #6e382d; transform: translateX(-50%) rotate(-28deg); box-shadow: 0 -16px 0 -2px #3c292b; }
.ap-prop[data-prop="music-stand"] { bottom: 9%; width: 20%; height: 44%; background: linear-gradient(90deg, transparent 47%, #383039 48% 53%, transparent 54%); }
.ap-prop[data-prop="music-stand"]::before { content: ""; position: absolute; top: 0; left: 10%; width: 80%; height: 31%; background: #42343d; clip-path: polygon(7% 0, 93% 0, 100% 88%, 0 100%); }
.ap-prop[data-prop="barrier"] { bottom: 8%; width: 34%; height: 29%; border: 4px dashed #76604f; background: repeating-linear-gradient(45deg, transparent 0 7px, rgb(108 78 59 / 0.55) 8px 11px); }
.ap-prop[data-prop="cat-castle"] { bottom: 8%; width: 37%; height: 45%; border: 3px solid #665042; background: linear-gradient(90deg, #a27d5c 0 30%, #87684e 31% 68%, #a27d5c 69%); clip-path: polygon(0 19%, 18% 19%, 18% 0, 35% 0, 35% 19%, 65% 19%, 65% 0, 82% 0, 82% 19%, 100% 19%, 100% 100%, 0 100%); }
.ap-prop[data-prop="scarf"], .ap-prop[data-prop="scarf-thread"] { z-index: 7; bottom: 14%; width: 44%; height: 12%; border-radius: 50%; border-top: 7px solid #9b4c53; transform: translateX(-50%) rotate(8deg); }
.ap-prop[data-prop="scarf-thread"] { height: 4%; border-top-width: 2px; }
.ap-prop[data-prop="for-rent"] { top: 15%; bottom: auto; width: 30%; height: 25%; border: 2px solid #40333a; background: #d8c8ab; color: #5e4140; font: 700 clamp(5px, 0.55vw, 8px)/1 var(--studio-mono); letter-spacing: 0.03em; transform: translateX(-50%) rotate(-5deg); }
.ap-prop[data-prop="for-rent"]::after { content: "FOR RENT"; position: absolute; inset: 0; display: grid; place-items: center; }
.ap-prop[data-prop="easel"] { bottom: 8%; width: 25%; height: 60%; border: solid #4e3731; border-width: 5px 2px 0; clip-path: polygon(14% 0, 86% 0, 100% 100%, 62% 100%, 51% 15%, 38% 100%, 0 100%); }
.ap-prop[data-prop="roll"], .ap-prop[data-prop="banner-roll"] { bottom: 12%; width: 12%; height: 57%; border: 3px solid #5b4440; border-radius: 50%; background: repeating-linear-gradient(90deg, #c9b594 0 5px, #948069 6px 8px); transform: translateX(-50%) rotate(78deg); }
.ap-prop[data-prop="paint-can"] { bottom: 9%; width: 14%; height: 22%; border: 3px solid #3e363a; border-radius: 1px 1px 5px 5px; background: linear-gradient(#7990a8 0 17%, #4d5f74 18%); }
.ap-prop[data-prop="paint-can"]::before { content: ""; position: absolute; top: -37%; left: 8%; width: 74%; height: 57%; border: 2px solid #4b4245; border-bottom: 0; border-radius: 50% 50% 0 0; }
.ap-prop[data-prop="tarp"], .ap-prop[data-prop="paper-panels"] { right: 5%; bottom: 9%; left: auto; width: 57%; height: 72%; border: 2px dashed #4f4544; background: repeating-linear-gradient(90deg, #b8aa91 0 31%, #89796a 32% 34%); transform: rotate(1deg); }
.ap-prop[data-prop="paper-panels"] { background: linear-gradient(135deg, rgb(90 118 136 / 0.78), rgb(177 126 102 / 0.78)), repeating-linear-gradient(90deg, #b8aa91 0 31%, #89796a 32% 34%); }
.ap-prop[data-prop="banner"], .ap-prop[data-prop="sagging-banner"] { z-index: 2; bottom: 0; width: 62%; height: 61%; border: 3px solid #68564d; background: repeating-linear-gradient(90deg, transparent 0 14%, rgb(96 70 61 / 0.3) 14% 15%), repeating-linear-gradient(0deg, #d1b48e 0 23%, #765d59 24% 27%); box-shadow: 0 7px 12px rgb(0 0 0 / 0.3); }
.ap-prop[data-prop="banner"]::before, .ap-prop[data-prop="sagging-banner"]::before {
  content: "";
  position: absolute;
  inset: 12% 8%;
  border: 2px solid rgb(72 49 55 / 0.7);
  background:
    linear-gradient(90deg, transparent 0 9%, #f2c879 9% 22%, transparent 22% 43%, #e7b66c 43% 56%, transparent 56% 77%, #f2c879 77% 90%, transparent 90%) top / 100% 42% no-repeat,
    linear-gradient(90deg, transparent 0 9%, #df9e65 9% 22%, transparent 22% 43%, #f0cf81 43% 56%, transparent 56% 77%, #df9e65 77% 90%, transparent 90%) bottom / 100% 42% no-repeat,
    linear-gradient(135deg, #77525a, #513c45);
  box-shadow: inset 0 0 0 2px rgb(231 194 131 / 0.18);
  opacity: 0.9;
}
.ap-prop[data-prop="banner"]::after, .ap-prop[data-prop="sagging-banner"]::after { content: ""; position: absolute; top: 2%; left: 17%; width: 66%; height: 10%; background: #563a43; clip-path: polygon(0 100%, 50% 0, 100% 100%); }
.ap-prop[data-prop="sagging-banner"] { clip-path: polygon(0 0, 100% 7%, 97% 87%, 79% 100%, 57% 85%, 31% 94%, 0 79%); }
.ap-prop[data-prop="broom"] { bottom: 8%; width: 7%; height: 65%; background: linear-gradient(90deg, transparent 42%, #72553c 43% 58%, transparent 59%); transform: translateX(-50%) rotate(-11deg); }
.ap-prop[data-prop="broom"]::after { content: ""; position: absolute; bottom: 0; left: -52%; width: 200%; height: 21%; background: #7d6144; clip-path: polygon(32% 0, 68% 0, 100% 100%, 0 100%); }
.ap-prop:is([data-prop="keys"], [data-prop="bulb"]) { z-index: 7; }
.ap-prop[data-prop="keys"] { bottom: 31%; width: 11%; height: 20%; border: 3px solid #aaa085; border-radius: 50%; box-shadow: 7px 10px 0 -3px #aaa085, 12px 12px 0 -3px #aaa085; }
.ap-prop[data-prop="shelf"] { bottom: 21%; width: 31%; height: 5%; background: #49373a; box-shadow: 0 5px 0 rgb(30 22 27 / 0.3); }
.ap-prop[data-prop="laundry"] { bottom: 19%; width: 24%; height: 32%; background: #b9ae9e; clip-path: polygon(10% 0, 34% 0, 42% 13%, 58% 13%, 66% 0, 90% 0, 100% 30%, 81% 39%, 74% 100%, 26% 100%, 19% 39%, 0 30%); }
.ap-prop[data-prop="basket"] { bottom: 8%; width: 25%; height: 22%; border: 4px solid #6d5143; background: repeating-linear-gradient(45deg, transparent 0 5px, #6d5143 6px 8px); }
.ap-prop[data-prop="oven-mitt"] { bottom: 12%; width: 13%; height: 25%; border-radius: 45% 45% 35% 35%; background: #a75850; transform: translateX(-50%) rotate(34deg); }
.ap-prop[data-prop="rain-puddle"] { bottom: 3%; width: 31%; height: 8%; border-radius: 50%; background: rgb(124 153 174 / 0.35); }
.ap-prop[data-prop="paint-mark"] { bottom: 30%; width: 11%; height: 18%; background: #698ca2; clip-path: polygon(14% 13%, 82% 0, 100% 81%, 36% 100%, 0 58%); }
.ap-prop[data-prop="paper-star"] { bottom: 41%; width: 13%; height: 22%; background: #f2d180; clip-path: polygon(50% 0, 61% 34%, 98% 34%, 68% 55%, 80% 94%, 50% 70%, 20% 94%, 32% 55%, 2% 34%, 39% 34%); }

/* Apartment paper cast and evidence atlas */
.apartment__paper-backdrop {
  position: absolute;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
  filter: saturate(0.78) brightness(0.64);
  opacity: 0.9;
  pointer-events: none;
}
.apartment__sky { z-index: 1; background: linear-gradient(180deg, rgb(31 37 65 / 0.28), rgb(6 8 16 / 0.58)); }
.apartment__sky::before { mix-blend-mode: multiply; }
.apartment__city { display: none; }
.ap-building__face {
  background:
    linear-gradient(92deg, transparent 0 49.5%, rgb(43 26 31 / 0.32) 49.8% 50.2%, transparent 50.5%),
    repeating-linear-gradient(1deg, rgb(255 243 216 / 0.035) 0 2px, transparent 2px 31px),
    repeating-linear-gradient(91deg, transparent 0 53px, rgb(48 27 32 / 0.3) 54px 57px),
    radial-gradient(circle at 18% 12%, rgb(207 160 135 / 0.2), transparent 25%),
    linear-gradient(137deg, #744d51, #51353d 55%, #392b35);
}
.ap-building__face::before {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  opacity: 0.27;
  pointer-events: none;
  background: repeating-radial-gradient(circle at 17% 29%, rgb(255 255 255 / 0.2) 0 0.6px, transparent 0.8px 4px);
  mix-blend-mode: overlay;
}
.ap-window {
  border-color: #251d23;
  border-radius: 1px 3px 2px 1px;
  box-shadow: 2px 5px 0 #1f181f, 0 10px 22px rgb(5 3 8 / 0.58), inset 0 0 0 2px #705760;
  rotate: var(--paper-window-turn, 0deg);
}
.ap-window:nth-child(3n + 1) { --paper-window-turn: -0.35deg; }
.ap-window:nth-child(3n) { --paper-window-turn: 0.3deg; }
.ap-window__room::after {
  content: "";
  position: absolute;
  z-index: 4;
  inset: 0;
  opacity: 0.16;
  background: repeating-radial-gradient(circle at 30% 40%, rgb(255 255 255 / 0.38) 0 0.5px, transparent 0.8px 3px);
  mix-blend-mode: soft-light;
  pointer-events: none;
}
.ap-window__curtain { clip-path: polygon(0 0, 98% 1%, 95% 98%, 78% 96%, 62% 100%, 45% 96%, 24% 100%, 2% 96%); }

.ap-paper-person {
  --pose-turn: 0deg;
  position: absolute;
  z-index: 5;
  bottom: 7%;
  left: var(--x);
  display: block;
  height: 77%;
  aspect-ratio: 0.476;
  background-image: var(--ap-cast);
  background-repeat: no-repeat;
  background-size: 400% 200%;
  filter: drop-shadow(3px 5px 2px rgb(12 7 10 / 0.46));
  transform: translateX(-50%) scaleX(var(--facing)) scale(var(--scale)) rotate(var(--pose-turn));
  transform-origin: 50% 100%;
  transition: filter 550ms ease, transform 550ms steps(2, end);
}
.ap-paper-person > i {
  position: absolute;
  inset: 4% 14% 2%;
  border-radius: 48%;
  box-shadow: inset 0 0 0 1px rgb(255 240 202 / 0.13);
  pointer-events: none;
}
.ap-paper-person[data-person="vale"] { background-position: 0 0; }
.ap-paper-person[data-person="mara"] { background-position: 33.333% 0; }
.ap-paper-person[data-person="leo"] { background-position: 66.667% 0; }
.ap-paper-person[data-person="ren"] { background-position: 100% 0; }
.ap-paper-person[data-person="jules"] { background-position: 0 100%; }
.ap-paper-person[data-person="bo"] { background-position: 33.333% 100%; }
.ap-paper-person[data-person="celia"] { background-position: 66.667% 100%; }
.ap-paper-person[data-person="inspector"] { background-position: 100% 100%; }
.ap-paper-person:is([data-pose="write"], [data-pose="read"], [data-pose="work"], [data-pose="inspect"], [data-pose="kneel"]) { --pose-turn: 5deg; }
.ap-paper-person:is([data-pose="argue"], [data-pose="point"], [data-pose="accuse"], [data-pose="block"]) { --pose-turn: -6deg; }
.ap-paper-person:is([data-pose="offer"], [data-pose="take"], [data-pose="pour"], [data-pose="reach"], [data-pose="question"]) { --pose-turn: -3deg; }
.ap-paper-person:is([data-pose="hurry"], [data-pose="arrive"], [data-pose="depart"], [data-pose="escort"]) { --pose-turn: 8deg; animation: ap-paper-hurry 760ms steps(3, end) infinite; }
.ap-paper-person:is([data-pose="wait"], [data-pose="listen"], [data-pose="relief"], [data-pose="cornered"], [data-pose="caught"]) { --pose-turn: 2deg; }
.ap-paper-person:is([data-pose="play"], [data-pose="soft-play"]) { animation: ap-paper-play 1400ms steps(2, end) infinite; }
.ap-paper-person[data-pose="soft-play"] { animation-duration: 2200ms; }
.ap-paper-person:is([data-pose="collapse"], [data-pose="fallen"]) {
  bottom: 3%;
  height: 62%;
  --pose-turn: 82deg;
  filter: grayscale(0.7) drop-shadow(5px 7px 2px rgb(7 4 7 / 0.58));
}
.ap-paper-person[data-pose="collapse"] { animation: ap-paper-collapse 900ms steps(4, end) both; }
.ap-paper-person[data-pose="sit"] { height: 62%; }

.ap-paper-cat {
  position: absolute;
  z-index: 7;
  bottom: 8%;
  left: var(--x);
  display: block;
  width: 29%;
  aspect-ratio: 1.2;
  background-image: var(--ap-evidence);
  background-repeat: no-repeat;
  background-position: 0 66.667%;
  background-size: 500% 400%;
  filter: drop-shadow(2px 4px 2px rgb(9 5 8 / 0.5));
  transform: translateX(-50%) scaleX(var(--facing)) scale(var(--scale));
  transform-origin: 50% 100%;
}
.ap-paper-cat:is([data-pose="drag"], [data-pose="prowl"], [data-pose="climb"]) { animation: ap-paper-cat-walk 900ms steps(3, end) infinite; }
.ap-paper-cat[data-pose="pounce"] { animation: ap-paper-cat-pounce 700ms steps(3, end) infinite; }
.ap-paper-cat[data-pose="sniff"] { animation: ap-paper-sniff 1300ms steps(2, end) infinite; }

.ap-paper-line {
  position: absolute;
  z-index: 9;
  top: 1%;
  left: var(--line-x);
  display: flex;
  max-width: 88%;
  align-items: baseline;
  gap: 0.35em;
  padding: 4px 7px 3px;
  color: #241a1e;
  background: #eee0ba;
  box-shadow: 2px 3px 0 rgb(35 20 25 / 0.42);
  clip-path: polygon(1% 9%, 98% 0, 100% 87%, 3% 100%);
  font: 750 clamp(0.64rem, 0.85vw, 0.76rem) / 1.05 var(--studio-sans);
  letter-spacing: 0.01em;
  white-space: nowrap;
  transform: translateX(-50%) rotate(-1.2deg);
  animation: ap-paper-line-in 420ms steps(3, end) both;
}
.ap-paper-line b { color: #7b343a; font-size: 0.8em; letter-spacing: 0.05em; text-transform: uppercase; }

.ap-prop.ap-prop--paper {
  bottom: calc(10% + var(--y) * 1%);
  width: 22%;
  height: auto;
  aspect-ratio: 1.2;
  border: 0;
  border-radius: 0;
  background-color: transparent;
  background-image: var(--ap-evidence);
  background-repeat: no-repeat;
  background-size: 500% 400%;
  box-shadow: none;
  clip-path: none;
  filter: drop-shadow(2px 3px 1px rgb(12 7 9 / 0.42));
  rotate: 0deg;
  transform: translateX(-50%) scale(var(--scale)) rotate(var(--prop-turn, -1deg));
}
.ap-prop.ap-prop--paper::before,
.ap-prop.ap-prop--paper::after { display: none; }
.ap-prop--paper[data-prop="teacup"] { background-position: 0 0; width: 19%; bottom: 18%; }
.ap-prop--paper[data-prop="teapot"] { background-position: 25% 0; width: 25%; bottom: 12%; }
.ap-prop--paper[data-prop="foxglove"] { background-position: 50% 0; width: 28%; bottom: 7%; }
.ap-prop--paper[data-prop="glove"] { background-position: 75% 0; width: 20%; --prop-turn: 6deg; }
.ap-prop--paper[data-prop="keys"] { z-index: 7; background-position: 100% 0; width: 18%; bottom: 17%; }
.ap-prop--paper[data-prop="knife"] { background-position: 0 33.333%; width: 24%; bottom: 18%; --prop-turn: -12deg; }
.ap-prop--paper[data-prop="violin"] { z-index: 6; background-position: 25% 33.333%; width: 24%; bottom: 12%; --prop-turn: -5deg; }
.ap-prop--paper[data-prop="scarf"] { z-index: 7; background-position: 50% 33.333%; width: 28%; bottom: 10%; --prop-turn: 7deg; }
.ap-prop--paper[data-prop="envelope"] { background-position: 75% 33.333%; width: 23%; bottom: 18%; }
.ap-prop--paper[data-prop="ledger"] { background-position: 100% 33.333%; width: 25%; bottom: 14%; }
.ap-prop--paper[data-prop="broken-lamp"] { background-position: 25% 66.667%; width: 28%; bottom: 7%; }
.ap-prop--paper[data-prop="packet"] { background-position: 50% 66.667%; width: 19%; bottom: 13%; }
.ap-prop--paper[data-prop="tipped-chair"] { background-position: 75% 66.667%; width: 30%; bottom: 5%; --prop-turn: 7deg; }
.ap-prop--paper[data-prop="cake"] { background-position: 100% 66.667%; width: 26%; bottom: 13%; }
.ap-prop--paper[data-prop="evidence-ribbon"] { z-index: 8; background-position: 0 100%; width: 28%; bottom: 30%; }
.ap-prop--paper[data-prop="footprint"] { background-position: 25% 100%; width: 20%; bottom: 4%; --prop-turn: -9deg; }
.ap-prop--paper[data-prop="paper-bag"] { background-position: 50% 100%; width: 24%; bottom: 6%; }
.ap-prop--paper[data-prop="petal"] { z-index: 8; background-position: 75% 100%; width: 15%; bottom: 19%; }
.ap-prop--paper[data-prop="magnifier"] { z-index: 8; background-position: 100% 100%; width: 18%; bottom: 14%; }

.apartment[data-consequence="death"] .ap-window.is-focused .ap-window__scene::before,
.apartment[data-consequence="clue"] .ap-window.is-focused .ap-window__scene::before {
  content: "";
  position: absolute;
  z-index: 2;
  inset: 13% 17%;
  opacity: 0.65;
  background: #702d38;
  clip-path: polygon(48% 0, 58% 33%, 92% 15%, 70% 47%, 100% 62%, 65% 65%, 73% 100%, 49% 73%, 23% 99%, 29% 64%, 0 55%, 34% 43%, 15% 12%, 43% 34%);
  filter: drop-shadow(3px 4px 2px rgb(13 6 9 / 0.38));
  animation: ap-paper-burst 650ms steps(4, end) both;
}
.apartment[data-consequence="clue"] .ap-window.is-focused .ap-window__scene::before { background: #9b7b3e; }

@keyframes ap-paper-hurry { 0%, 100% { translate: -2% 0; } 50% { translate: 3% -3%; } }
@keyframes ap-paper-play { 0%, 100% { rotate: -1deg; } 50% { rotate: 2deg; } }
@keyframes ap-paper-cat-walk { 0%, 100% { translate: -3% 0; rotate: -2deg; } 50% { translate: 3% -4%; rotate: 2deg; } }
@keyframes ap-paper-cat-pounce { 0%, 100% { translate: 0 0; rotate: 0; } 45% { translate: 7% -20%; rotate: -8deg; } }
@keyframes ap-paper-sniff { 0%, 100% { rotate: -2deg; } 50% { rotate: 4deg; translate: 2% 3%; } }
@keyframes ap-paper-collapse { from { rotate: 0deg; translate: 0 -8%; } to { rotate: 82deg; translate: 7% 0; } }
@keyframes ap-paper-burst { from { scale: 0.2; rotate: -12deg; opacity: 0; } to { scale: 1; rotate: 3deg; opacity: 0.65; } }
@keyframes ap-paper-line-in { from { opacity: 0; transform: translateX(-50%) rotate(-5deg) scale(0.75); } to { opacity: 1; transform: translateX(-50%) rotate(-1.2deg) scale(1); } }

.ap-roof__scene .ap-paper-person { bottom: 0; height: 74%; }
.ap-roof__scene .ap-paper-cat { bottom: 1%; width: 9%; }
.ap-roof__scene .ap-prop[data-prop="banner"],
.ap-roof__scene .ap-prop[data-prop="sagging-banner"] { bottom: 0; width: 66%; height: 58%; }
.ap-roof__scene .ap-prop[data-prop="lantern"] { bottom: 8%; width: 5%; height: 26%; }
.ap-roof__scene .ap-prop[data-prop="cake"] { bottom: 5%; width: 7%; height: 12%; }
.ap-roof__scene .ap-prop[data-prop="violin"] { bottom: 18%; width: 2.8%; height: 25%; }
.ap-roof__scene .ap-paper-person { bottom: -15%; height: 118%; }
.ap-roof__scene .ap-paper-cat { bottom: -2%; width: 10%; }
.ap-roof__scene .ap-prop.ap-prop--paper { bottom: 0; width: 9%; height: auto; }
.ap-roof__scene .ap-prop--paper[data-prop="foxglove"] { width: 11%; }
.ap-roof__scene .ap-prop--paper[data-prop="teapot"] { width: 10%; }
.ap-roof__scene .ap-prop--paper[data-prop="teacup"],
.ap-roof__scene .ap-prop--paper[data-prop="glove"],
.ap-roof__scene .ap-prop--paper[data-prop="keys"],
.ap-roof__scene .ap-prop--paper[data-prop="packet"],
.ap-roof__scene .ap-prop--paper[data-prop="ledger"],
.ap-roof__scene .ap-prop--paper[data-prop="magnifier"],
.ap-roof__scene .ap-prop--paper[data-prop="paper-bag"] { width: 8%; }

.ap-drainpipe { position: absolute; z-index: 6; top: 0; bottom: -2%; left: 3%; width: 11px; border: 2px solid #28272d; border-radius: 5px; background: linear-gradient(90deg, #302f37, #575259 50%, #2b2a31); box-shadow: 4px 0 5px rgb(10 6 10 / 0.3); }
.ap-fire-escape { position: absolute; z-index: 7; top: 6%; right: -8%; width: 28%; height: 84%; pointer-events: none; }
.ap-fire-escape > i { position: absolute; right: 0; width: 82%; height: 7px; border: 2px solid #1e2026; background: repeating-linear-gradient(90deg, #292b31 0 4px, transparent 4px 13px); box-shadow: 0 5px 8px rgb(5 4 7 / 0.35); }
.ap-fire-escape > i:nth-child(1) { top: 16%; }
.ap-fire-escape > i:nth-child(2) { top: 41%; }
.ap-fire-escape > i:nth-child(3) { top: 66%; }
.ap-fire-escape > i:nth-child(4) { top: 91%; }
.ap-fire-escape::before, .ap-fire-escape::after { content: ""; position: absolute; top: 15%; bottom: 8%; width: 5px; background: repeating-linear-gradient(0deg, #272930 0 5px, transparent 5px 18px); border-right: 2px solid #272930; }
.ap-fire-escape::before { right: 12%; }
.ap-fire-escape::after { right: 71%; }
.ap-fire-escape [data-ap-fire-scene] { position: absolute; inset: 0; opacity: 0; transition: opacity 850ms ease; }
.ap-fire-escape [data-ap-fire-scene].is-active { opacity: 1; }
.ap-fire-escape .ap-paper-person { bottom: 29%; height: 27%; }
.ap-fire-escape .ap-paper-cat { bottom: 37%; width: 18%; }
.ap-fire-escape .ap-prop { width: 12%; height: 14%; bottom: 37%; }
.ap-building__door { position: absolute; z-index: 5; bottom: -1%; left: 50%; width: 11%; height: 11%; border: 5px solid #28222a; background: linear-gradient(90deg, #292431, #4e3d43); translate: -50% 0; }
.ap-building__door i { position: absolute; top: 47%; right: 13%; width: 5px; height: 5px; border-radius: 50%; background: #c69c57; }
.ap-building__brick { position: absolute; z-index: 2; width: 28px; height: 12px; border: 2px solid rgb(45 25 31 / 0.35); opacity: 0.5; }
.ap-building__brick--one { top: 31%; left: 5%; box-shadow: 31px 2px rgb(74 44 49 / 0.2), 620px 77px rgb(74 44 49 / 0.2); }
.ap-building__brick--two { right: 5%; bottom: 22%; box-shadow: -28px 14px rgb(74 44 49 / 0.2), -620px -45px rgb(74 44 49 / 0.2); }

.ap-street { position: absolute; z-index: 2; right: 0; bottom: 0; left: 0; height: 10%; overflow: hidden; background: linear-gradient(#0c0e15 0 24%, #171820 25% 100%); border-top: 2px solid #282630; }
.ap-bus { position: absolute; bottom: 13%; left: -24%; width: 190px; height: 55px; border: 3px solid #202129; border-radius: 8px 13px 4px 4px; background: linear-gradient(#303d54 0 65%, #705148 66%); box-shadow: 0 10px 18px rgb(0 0 0 / 0.45); animation: ap-bus-pass 38s linear infinite; }
.ap-bus::before { content: ""; position: absolute; inset: 8px 12px 20px; background: repeating-linear-gradient(90deg, #dfbe71 0 27px, #18202c 28px 33px); opacity: 0.76; }
.ap-bus > i { position: absolute; bottom: -9px; width: 18px; height: 18px; border: 4px solid #15161b; border-radius: 50%; background: #43434b; }
.ap-bus > i:first-child { left: 26px; }
.ap-bus > i:nth-child(2) { right: 26px; }
.ap-bus > i:nth-child(3) { display: none; }
.ap-car-light { position: absolute; bottom: 10%; left: -34%; width: 33%; height: 360%; background: linear-gradient(78deg, transparent 0 39%, rgb(255 230 166 / 0.16) 45%, transparent 56%); transform: skewX(-16deg); animation: ap-headlights 17s linear infinite 7s; mix-blend-mode: screen; }

.ap-rain { position: absolute; z-index: 6; inset: 0; background: repeating-linear-gradient(104deg, transparent 0 18px, rgb(190 210 224 / 0.16) 19px 20px, transparent 21px 33px); opacity: 0; pointer-events: none; transition: opacity 1400ms ease; animation: ap-rain-slide 1.8s linear infinite; backdrop-filter: blur(0); }
.apartment[data-weather="rain"] .ap-rain { opacity: 0.76; backdrop-filter: blur(0.45px); }
.apartment[data-weather="mist"] .ap-rain { opacity: 0.11; background: linear-gradient(180deg, transparent, rgb(210 215 221 / 0.23)); backdrop-filter: blur(0.8px); }
.ap-foreground { position: absolute; z-index: 8; inset: 0; pointer-events: none; }
.ap-frame { position: absolute; background: linear-gradient(90deg, #090b10, #1a171c 48%, #07090d); box-shadow: 0 0 35px rgb(0 0 0 / 0.75); }
.ap-frame--top { top: 0; right: 0; left: 0; height: clamp(22px, 4.5vh, 48px); }
.ap-frame--left { top: 0; bottom: 0; left: 0; width: clamp(18px, 4.2vw, 58px); }
.ap-frame--right { top: 0; right: 0; bottom: 0; width: clamp(18px, 4.2vw, 58px); }
.ap-sill { position: absolute; right: 0; bottom: 0; left: 0; height: clamp(45px, 8vh, 80px); border-top: 8px solid #2b252a; background: linear-gradient(#17151a, #07090d 75%); box-shadow: 0 -12px 28px rgb(0 0 0 / 0.46); }
.ap-houseplant { position: absolute; bottom: 72%; left: 6%; width: 54px; height: 45px; border-radius: 2px 2px 16px 16px; background: #28202a; }
.ap-houseplant > i { position: absolute; bottom: 31px; left: 21px; width: 18px; height: 54px; border-radius: 80% 0 80% 0; background: #202b26; transform-origin: bottom; transform: rotate(-34deg); }
.ap-houseplant > i:nth-child(2) { left: 17px; height: 63px; transform: rotate(8deg) scaleX(-1); }
.ap-houseplant > i:nth-child(3) { left: 29px; height: 48px; transform: rotate(37deg) scaleX(-1); }
.ap-mug { position: absolute; right: 8%; bottom: 70%; width: 47px; height: 42px; overflow: hidden; border: 4px solid #393038; border-top-color: #54434a; border-radius: 3px 3px 13px 13px; background: rgb(29 24 29 / 0.88); box-shadow: 5px 8px 12px rgb(0 0 0 / 0.3); }
.ap-mug::after { content: ""; position: absolute; top: 7px; right: -17px; width: 18px; height: 23px; border: 5px solid #393038; border-left: 0; border-radius: 0 12px 12px 0; }
.ap-mug > i { position: absolute; right: 2px; bottom: 2px; left: 2px; min-height: 3px; border-radius: 2px 2px 8px 8px; background: linear-gradient(#6d4637, #322522); opacity: 0.9; transition: height 1200ms ease; }

.ap-memory { position: absolute; z-index: 9; right: max(22px, 5vw); bottom: max(70px, 10vh); display: grid; width: 55px; height: 68px; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(4, 1fr); gap: 3px; padding: 5px; border: 1px solid rgb(236 224 199 / 0.13); background: rgb(8 10 16 / 0.42); box-shadow: 0 7px 20px rgb(0 0 0 / 0.2); pointer-events: none; backdrop-filter: blur(8px); }
.ap-memory > i { display: block; border: 1px solid rgb(238 225 193 / 0.13); background: rgb(6 8 13 / 0.65); transition: background 900ms ease, box-shadow 900ms ease; }
.ap-memory > i.is-noticed { background: linear-gradient(135deg, #9f7653, #e2b06d); box-shadow: 0 0 7px rgb(233 180 106 / 0.35); }
.ap-day-card { position: absolute; z-index: 12; inset: 0; display: grid; place-items: center; background: #080a10; opacity: 0; pointer-events: none; transition: opacity 1400ms ease; }
.ap-day-card.is-visible { opacity: 1; }
.ap-day-card span { font-family: var(--studio-display); font-size: clamp(2.8rem, 7vw, 6rem); font-weight: 400; letter-spacing: -0.045em; }
.ap-fade { position: absolute; z-index: 11; inset: 0; background: #06080d; opacity: var(--night-fade); pointer-events: none; }

@keyframes ap-gaze-cue { 0% { box-shadow: 0 0 0 0 rgb(255 231 175 / 0.34); opacity: 0.4; } 42% { opacity: 1; } 100% { box-shadow: 0 0 0 16px transparent; opacity: 0.2; } }
@keyframes ap-person-step { 0%, 100% { translate: 0 0; } 50% { translate: 0 -3%; } }
@keyframes ap-person-dance { 0%, 100% { translate: -4% 0; rotate: -3deg; } 50% { translate: 5% -5%; rotate: 4deg; } }
@keyframes ap-hand-work { from { rotate: -16deg; } to { rotate: 18deg; } }
@keyframes ap-bow-arm { from { rotate: -18deg; } to { rotate: 23deg; } }
@keyframes ap-rock { from { rotate: -2deg; } to { rotate: 3deg; } }
@keyframes ap-wave { from { rotate: -13deg; } to { rotate: 17deg; } }
@keyframes ap-laugh { 0%, 100% { translate: 0 0; } 50% { translate: 0 -4%; } }
@keyframes ap-cat-prowl { 0%, 100% { translate: -2% 0; } 50% { translate: 3% -4%; } }
@keyframes ap-cat-shake { 0%, 100% { rotate: -5deg; } 50% { rotate: 7deg; } }
@keyframes ap-lantern { from { filter: drop-shadow(0 0 8px #efbd61); } to { filter: drop-shadow(0 0 18px #ffe39a); } }
@keyframes ap-bus-pass { 0%, 7% { translate: 0 0; } 33%, 100% { translate: calc(100vw + 430px) 0; } }
@keyframes ap-headlights { 0%, 36% { translate: 0 0; opacity: 0; } 39% { opacity: 1; } 53% { translate: calc(100vw + 600px) 0; opacity: 0.8; } 56%, 100% { translate: calc(100vw + 600px) 0; opacity: 0; } }
@keyframes ap-rain-slide { from { background-position: 0 0; } to { background-position: 32px 90px; } }

@media (max-width: 700px) {
  .ap-speed { left: 29px; min-width: 80px; }
  .apartment__world { min-width: 720px; }
  .ap-building { width: 650px; height: min(78vh, 680px); min-height: 560px; }
  .apartment.is-focused .ap-building { scale: 1.16; }
  .ap-frame--left, .ap-frame--right { width: 18px; }
  .ap-building__windows { inset: 5% 8% 10%; gap: 5.2% 8%; }
  .ap-window { border-width: 4px; }
  .ap-window__frame { background: linear-gradient(90deg, transparent calc(50% - 2px), #30272e calc(50% - 2px) calc(50% + 2px), transparent calc(50% + 2px)), linear-gradient(0deg, transparent calc(38% - 1px), #30272e calc(38% - 1px) calc(38% + 1px), transparent calc(38% + 1px)); }
  .ap-memory { right: 28px; bottom: 68px; }
  .ap-houseplant { left: 30px; }
  .ap-mug { right: 34px; }
}

@media (max-height: 660px) {
  .ap-building { bottom: 4%; height: 590px; min-height: 590px; }
  .ap-sill { height: 45px; }
  .ap-houseplant, .ap-mug { bottom: 64%; }
  .ap-memory { bottom: 54px; }
}

.apartment.is-reduced .ap-building,
.apartment.is-reduced .ap-window,
.apartment.is-reduced .ap-window__room,
.apartment.is-reduced .ap-window__details,
.apartment.is-reduced .ap-window__curtain,
.apartment.is-reduced .ap-window__scene,
.apartment.is-reduced .ap-rain,
.apartment.is-reduced .ap-roof__scene,
.apartment.is-reduced .ap-fire-escape [data-ap-fire-scene],
.apartment.is-reduced .ap-memory > i,
.apartment.is-reduced .ap-day-card { transition-duration: 650ms !important; }
.apartment.is-reduced.is-focused .ap-building { scale: 1.06; }
.apartment.is-reduced .ap-window.is-cued::after,
.apartment.is-reduced .ap-paper-person,
.apartment.is-reduced .ap-paper-cat,
.apartment.is-reduced .ap-paper-line,
.apartment.is-reduced .ap-prop[data-prop="lantern"],
.apartment.is-reduced .ap-rain { animation: none !important; }
.apartment.is-reduced .ap-bus,
.apartment.is-reduced .ap-car-light { display: none; }


/* Common Area --------------------------------------------------------- */

.game-dialog[data-game="common-area"] { background: #161215; color: #f0dfbb; }
.game-dialog[data-game="common-area"] .game-dialog__chrome {
  padding-right: 5px;
  border: 1px solid rgb(236 213 171 / 0.2);
  background: rgb(31 24 24 / 0.7);
  color: #f4e5c6;
}
.game-dialog[data-game="common-area"] .game-dialog__count { display: none; }

.common-area {
  --ca-ink: #2a211d;
  --ca-paper: #ead5ac;
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 100svh;
  overflow: hidden;
  background: #161215;
  font-family: var(--studio-sans);
}
.common-area::before,
.common-area::after {
  position: absolute;
  z-index: 1;
  inset: 0;
  content: "";
  pointer-events: none;
}
.common-area::before {
  background:
    repeating-linear-gradient(2deg, transparent 0 5px, rgb(246 221 177 / 0.022) 6px 7px),
    repeating-linear-gradient(91deg, transparent 0 17px, rgb(27 17 16 / 0.025) 18px 19px);
  mix-blend-mode: soft-light;
}
.common-area::after {
  inset: 3px;
  border: 2px solid rgb(237 211 163 / 0.7);
  box-shadow: inset 0 0 82px 14px rgb(9 6 8 / 0.34);
  clip-path: polygon(0.2% 0.8%, 99.5% 0.2%, 99.8% 99.1%, 0.4% 99.7%);
}
.common-area [hidden] { display: none; }
.common-area__canvas {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 100svh;
  cursor: grab;
  touch-action: none;
}
.common-area.is-walking .common-area__canvas:active { cursor: grabbing; }
.common-area__canvas:focus-visible { outline: 3px solid #f0d8aa; outline-offset: -6px; }

.common-area__veil {
  position: absolute;
  z-index: 3;
  display: grid;
  inset: 0;
  padding: clamp(84px, 10vw, 118px) clamp(24px, 7vw, 96px) clamp(32px, 7vw, 72px);
  place-content: center start;
  background:
    linear-gradient(90deg, rgb(26 20 21 / 0.94), rgb(36 28 27 / 0.78) 52%, rgb(20 17 21 / 0.48)),
    repeating-linear-gradient(4deg, transparent 0 5px, rgb(255 236 194 / 0.018) 6px 7px);
  backdrop-filter: blur(3px);
}
.common-area__intro {
  width: min(36rem, calc(100vw - 48px));
  padding: clamp(26px, 4vw, 46px);
  background:
    repeating-linear-gradient(2deg, rgb(94 68 43 / 0.045) 0 1px, transparent 1px 7px),
    var(--ca-paper);
  color: var(--ca-ink);
  box-shadow: 18px 20px 46px rgb(0 0 0 / 0.34);
  clip-path: polygon(1% 1.5%, 24% 0, 53% 1.2%, 77% 0.4%, 99.2% 2%, 98% 31%, 100% 59%, 98.6% 98%, 69% 99.4%, 43% 98%, 18% 100%, 0.8% 97%, 1.7% 63%, 0 34%);
}
.common-area__eyebrow {
  margin: 0;
  color: #72563d;
  font-family: var(--studio-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.common-area__intro h1 {
  margin: 10px 0 18px;
  font-family: var(--studio-display);
  font-size: clamp(3.2rem, 8vw, 7rem);
  font-weight: 400;
  letter-spacing: -0.065em;
  line-height: 0.84;
}
.common-area__intro h1 i { color: #7c3e37; font-weight: 400; }
.common-area__lead { max-width: 34ch; margin: 0 0 24px; color: #4e3c31; font-size: 1.04rem; line-height: 1.55; }
.common-area__keys {
  display: flex;
  flex-wrap: wrap;
  margin: 0 0 26px;
  padding: 0;
  gap: 9px 16px;
  color: #5d4738;
  font-size: 0.84rem;
  list-style: none;
}
.common-area__keys span {
  display: inline-block;
  margin-right: 5px;
  padding: 3px 8px;
  border: 1px solid rgb(55 39 29 / 0.32);
  font-family: var(--studio-mono);
  font-size: 0.71rem;
  transform: rotate(-1deg);
}
.common-area__begin {
  min-height: 48px;
  padding: 12px 22px;
  border: 1px solid var(--ca-ink);
  border-radius: 0;
  background: var(--ca-ink);
  color: #f3e0b9;
  font-size: 0.95rem;
  cursor: pointer;
  clip-path: polygon(1% 3%, 98% 0, 100% 94%, 3% 100%);
}
.common-area__begin:hover:not(:disabled) { background: #49362e; }
.common-area__begin:focus-visible, .common-area__advance:focus-visible, .common-area__speed:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.common-area__begin:disabled { cursor: progress; opacity: 0.55; }
.common-area__note { margin: 15px 0 0; color: #6e5541; font-size: 0.79rem; line-height: 1.5; }

.common-area__hud { position: absolute; z-index: 2; inset: 0; pointer-events: none; }
.common-area__night,
.common-area__speed,
.common-area__advance,
.common-area__hint {
  position: absolute;
  border: 1px solid rgb(54 40 31 / 0.38);
  background:
    repeating-linear-gradient(3deg, rgb(88 61 38 / 0.04) 0 1px, transparent 1px 6px),
    rgb(234 213 172 / 0.94);
  color: var(--ca-ink);
  box-shadow: 5px 7px 18px rgb(0 0 0 / 0.24);
}
.common-area__night {
  top: 20px;
  left: 18px;
  display: grid;
  min-width: 136px;
  padding: 10px 15px 11px;
  clip-path: polygon(1% 3%, 100% 0, 98% 97%, 3% 100%);
  transform: rotate(-0.6deg);
}
.common-area__night small,
.common-area__night-card small {
  font-family: var(--studio-mono);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.common-area__night b { margin-top: 3px; font-family: var(--studio-display); font-size: 1.25rem; font-weight: 500; }
.common-area__night span { margin-top: 1px; color: #6b5140; font-size: 0.72rem; }
.common-area__week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin-top: 8px;
  gap: 3px;
}
.common-area__week i {
  display: block;
  height: 3px;
  background: rgb(72 50 38 / 0.22);
  clip-path: polygon(0 18%, 94% 0, 100% 82%, 7% 100%);
}
.common-area__week i.is-past { background: #91604e; }
.common-area__week i.is-current { background: #3b2924; transform: scaleY(1.8) rotate(-2deg); }
.common-area__speed {
  position: absolute;
  top: 105px;
  left: 22px;
  display: grid;
  grid-template-columns: auto auto;
  min-width: 86px;
  padding: 6px 10px 7px;
  border-radius: 0;
  font-family: var(--studio-mono);
  line-height: 1;
  cursor: pointer;
  clip-path: polygon(1% 4%, 98% 0, 100% 94%, 3% 100%);
  pointer-events: auto;
}
.common-area__speed span { align-self: center; margin-right: 6px; font-size: 0.72rem; letter-spacing: -0.12em; }
.common-area__speed b { font-size: 0.74rem; }
.common-area__speed small { grid-column: 1 / -1; margin-top: 4px; font-size: 0.47rem; letter-spacing: 0.08em; text-transform: uppercase; }
.common-area__speed[aria-pressed="true"] { background: #74433b; color: #f3dfb9; transform: rotate(0.8deg); }
.common-area__advance {
  top: 22px;
  right: 18px;
  min-height: 42px;
  padding: 9px 14px;
  border-radius: 0;
  font-family: var(--studio-mono);
  font-size: 0.66rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  clip-path: polygon(2% 0, 100% 4%, 97% 100%, 0 94%);
  pointer-events: auto;
}
.common-area__advance:hover { background: #f4e4c2; }
.common-area__advance i { font-style: normal; }
.common-area__room-tag {
  position: absolute;
  bottom: 22px;
  left: 20px;
  display: grid;
  min-width: 142px;
  margin: 0;
  padding: 8px 13px 9px;
  border: 1px solid rgb(54 40 31 / 0.38);
  background:
    repeating-linear-gradient(-3deg, transparent 0 6px, rgb(88 61 38 / 0.05) 7px 8px),
    rgb(231 207 164 / 0.93);
  box-shadow: 4px 6px 18px rgb(0 0 0 / 0.25);
  color: var(--ca-ink);
  opacity: 0;
  clip-path: polygon(2% 2%, 98% 0, 100% 91%, 4% 100%);
  transform: translateY(8px) rotate(-1deg);
  transition: opacity 220ms steps(2, end), transform 220ms steps(2, end);
  pointer-events: none;
}
.common-area__room-tag.is-visible { opacity: 1; transform: translateY(0) rotate(-1deg); }
.common-area__room-tag small { font-family: var(--studio-mono); font-size: 0.52rem; letter-spacing: 0.11em; text-transform: uppercase; }
.common-area__room-tag b { margin-top: 2px; font-family: var(--studio-display); font-size: 1.08rem; font-weight: 500; }
.common-area__reticle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 18px;
  opacity: 0.28;
  transform: translate(-50%, -50%) rotate(1deg);
  transition: opacity 260ms steps(2, end), transform 260ms steps(2, end);
}
.common-area__reticle::before,
.common-area__reticle::after {
  position: absolute;
  background: #ecd5a8;
  box-shadow: 1px 1px 0 rgb(22 14 15 / 0.7);
  content: "";
}
.common-area__reticle::before { top: 8px; left: 2px; width: 14px; height: 2px; }
.common-area__reticle::after { top: 2px; left: 8px; width: 2px; height: 14px; }
.common-area[data-room]:not([data-room=""]) .common-area__reticle { opacity: 0.72; transform: translate(-50%, -50%) rotate(4deg) scale(0.82); }
.common-area__hint {
  bottom: 24px;
  left: 50%;
  margin: 0;
  padding: 10px 16px;
  font-size: 0.76rem;
  text-align: center;
  transform: translateX(-50%) rotate(0.25deg);
  transition: opacity 800ms ease, visibility 800ms;
  white-space: nowrap;
  pointer-events: none;
}
.common-area__hint span { font-family: var(--studio-mono); font-size: 0.69rem; }
.common-area__hint.is-faded { visibility: hidden; opacity: 0; }
.common-area__stick {
  position: absolute;
  width: 126px;
  height: 126px;
  border: 2px solid rgb(238 219 180 / 0.46);
  border-radius: 50%;
  background: rgb(36 28 27 / 0.28);
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.common-area__stick span {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 52px;
  height: 52px;
  border: 2px solid rgb(57 40 29 / 0.25);
  border-radius: 50%;
  background: rgb(238 215 174 / 0.8);
  transform: translate(-50%, -50%);
}

.common-area__night-card {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  display: grid;
  min-width: min(254px, calc(100vw - 44px));
  padding: 17px 28px 18px;
  background: #e6cea0;
  color: var(--ca-ink);
  text-align: center;
  opacity: 0;
  transform: translate(-50%, -44%) rotate(-1deg);
  clip-path: polygon(2% 1%, 99% 4%, 97% 98%, 1% 96%);
  pointer-events: none;
}
.common-area__night-card b { margin: 5px 0 2px; font-family: var(--studio-display); font-size: 2.15rem; font-weight: 400; letter-spacing: -0.04em; }
.common-area__night-card span { color: #735844; font-size: 0.88rem; }
.common-area__night-card.is-visible { animation: common-area-card 1.9s steps(3, end) both; }
.common-area__fade { position: absolute; z-index: 3; inset: 0; background: #080709; opacity: 0; pointer-events: none; }
.common-area__fade::after {
  position: absolute;
  right: 36%;
  bottom: -3%;
  left: 36%;
  height: 12%;
  background: linear-gradient(#78604b 0 2px, #050405 2px);
  clip-path: polygon(5% 44%, 45% 0, 94% 38%, 100% 100%, 0 100%);
  content: "";
  filter: drop-shadow(0 -12px 20px rgb(0 0 0 / 0.72));
  opacity: 0;
}
.common-area.is-becoming-paper .common-area__fade::after { opacity: 0.9; }

.common-area--failed {
  display: grid;
  padding: 80px 24px 30px;
  place-content: center;
  background: #1d1718;
}

@keyframes common-area-card {
  0%, 100% { opacity: 0; transform: translate(-50%, -44%) rotate(-1deg); }
  12%, 72% { opacity: 1; transform: translate(-50%, -50%) rotate(-1deg); }
}

@media (max-width: 640px) {
  .common-area__veil { padding: 72px 18px 24px; place-content: center; }
  .common-area__intro { width: min(100%, 31rem); padding: 28px 24px 30px; }
  .common-area__intro h1 { font-size: clamp(3.2rem, 16vw, 5rem); }
  .common-area__lead { font-size: 0.95rem; }
  .common-area__night { top: 66px; left: 10px; min-width: 118px; padding: 8px 11px; }
  .common-area__night b { font-size: 1.08rem; }
  .common-area__speed { top: 136px; left: 12px; min-width: 74px; padding: 5px 8px 6px; }
  .common-area__advance { top: 68px; right: 10px; min-height: 38px; padding: 8px 10px; font-size: 0.59rem; }
  .common-area__room-tag { bottom: 18px; left: 12px; min-width: 124px; padding: 7px 10px 8px; }
  .common-area__room-tag b { font-size: 0.96rem; }
  .common-area__night-card { top: 42%; }
  .common-area__hint { bottom: 74px; max-width: calc(100% - 32px); white-space: normal; }
}

@media (pointer: coarse) {
  .common-area__hint { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .common-area__night-card.is-visible { animation: none; opacity: 1; transform: translate(-50%, -50%); }
  .common-area__hint, .common-area__reticle, .common-area__room-tag { transition: none; }
}
.common-area.is-reduced .common-area__night-card.is-visible { animation: none; opacity: 1; transform: translate(-50%, -50%); }
.common-area.is-reduced .common-area__hint, .common-area.is-reduced .common-area__reticle, .common-area.is-reduced .common-area__room-tag { transition: none; }
