: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__glass-art,
.game-card__bonsai-art,
.game-card__party-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 { transform: scale(1.06); }
.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); }
}

/* 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;
}
.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; }
}
