:root {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --ink: #25211d;
  --muted: #6e675f;
  --line: #d8d0c6;
  --accent: #2f6f73;
  --accent-dark: #1d4f52;
  --danger: #a33a3a;
  --success: #24724d;
  --shadow: 0 18px 45px rgba(48, 43, 37, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(47, 111, 115, 0.16), transparent 32rem),
    linear-gradient(135deg, #f6f4ef 0%, #ece7df 100%);
}

button {
  font: inherit;
}

.stage-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0;
}

.start-screen,
.stage-panel,
.room-inside {
  position: relative;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(216, 208, 198, 0.9);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.stage-panel {
  padding: clamp(20px, 4vw, 40px);
}

.start-screen {
  min-height: min(760px, calc(100vh - 80px));
  display: grid;
  align-items: end;
  padding: clamp(20px, 5vw, 48px);
}

.start-photo-grid,
.room-photo-bg,
.budgie-photo-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.start-photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 1fr;
  gap: 8px;
  padding: 8px;
  opacity: 0.72;
}

.start-photo-grid::after,
.room-photo-bg::after,
.budgie-photo-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(246, 244, 239, 0.18), rgba(246, 244, 239, 0.82));
}

.start-photo-grid img,
.room-photo-bg img,
.budgie-photo-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
}

.start-content {
  position: relative;
  z-index: 1;
  max-width: 620px;
  padding: clamp(18px, 4vw, 32px);
  background: rgba(255, 253, 249, 0.86);
  border: 1px solid rgba(216, 208, 198, 0.72);
  border-radius: 8px;
  backdrop-filter: blur(8px);
}

.start-content .primary-button {
  margin-top: 22px;
}

.budgie-photo-bg {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 10px;
  opacity: 0.2;
}

#stage-one > :not(.budgie-photo-bg) {
  position: relative;
  z-index: 1;
}

.stage-header {
  max-width: 720px;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1;
}

.stage-copy {
  max-width: 58ch;
  margin: 16px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.clue-box {
  margin-bottom: 28px;
  padding: 18px;
  background: #fffdf9;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.clue-box label,
.clue-box h2,
.budgie-tray h2,
.match-column h2,
.case-files h2,
.decoder-panel h2,
.repair-panel h2,
.mask-panel h2,
.evidence-panel h2,
.emotion-wheel-panel h2,
.safe-panel h2,
.forcefield-tray h2 {
  display: block;
  margin: 0 0 10px;
  font-size: 0.9rem;
  font-weight: 700;
}

.clue-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 20px;
  color: var(--ink);
  line-height: 1.5;
}

button:focus-visible {
  outline: 3px solid rgba(47, 111, 115, 0.28);
  outline-offset: 3px;
}

.puzzle-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
  align-items: stretch;
}

.budgie-tray,
.perch-board {
  min-width: 0;
}

.budgie-list {
  display: grid;
  gap: 12px;
}

.budgie {
  min-height: 56px;
  padding: 0 18px;
  border: 2px solid transparent;
  border-radius: 8px;
  color: #1f1a17;
  font-weight: 800;
  cursor: grab;
  box-shadow: 0 8px 20px rgba(37, 33, 29, 0.1);
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.budgie:active {
  cursor: grabbing;
}

.budgie.dragging {
  opacity: 0.55;
  transform: scale(0.98);
}

.budgie.selected {
  outline: 3px solid rgba(37, 33, 29, 0.38);
  outline-offset: 3px;
  transform: translateY(-2px);
}

.budgie-periwinkle {
  background: linear-gradient(135deg, #d8ddff, #7d8fe8);
  color: #161b3f;
}

.budgie-green {
  background: linear-gradient(135deg, #8de3a0, #2f9b5f);
  color: #062012;
}

.budgie-tinkerbell {
  background: linear-gradient(135deg, #fff48d, #77c95b);
  color: #263407;
}

.budgie-snowflake {
  background: linear-gradient(135deg, #ffffff, #d8dde5);
  border-color: #c4c9d1;
  color: #20242a;
}

.perch-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 14px;
}

.perch {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 176px;
  background: #fffdf9;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.perch-number {
  display: grid;
  place-items: center;
  min-height: 40px;
  color: var(--muted);
  font-weight: 800;
  background: #eee7dc;
  border-bottom: 1px solid var(--line);
}

.drop-zone {
  display: grid;
  place-items: center;
  min-height: 134px;
  padding: 12px;
  background:
    linear-gradient(90deg, transparent 0 45%, rgba(92, 66, 42, 0.4) 45% 55%, transparent 55%),
    linear-gradient(180deg, transparent 0 62%, rgba(92, 66, 42, 0.5) 62% 68%, transparent 68%);
  transition: background-color 160ms ease, box-shadow 160ms ease;
}

.drop-zone.over {
  background-color: rgba(47, 111, 115, 0.1);
  box-shadow: inset 0 0 0 3px rgba(47, 111, 115, 0.25);
}

.drop-zone .budgie {
  width: 100%;
}

.wiring-puzzle {
  position: relative;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr);
  gap: clamp(48px, 12vw, 180px);
  min-height: 340px;
  padding: 24px;
  background: #fffdf9;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

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

.wire-layer line {
  stroke: var(--accent);
  stroke-width: 5;
  stroke-linecap: round;
  filter: drop-shadow(0 3px 5px rgba(47, 111, 115, 0.22));
}

.match-column {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto repeat(3, minmax(64px, auto));
  gap: 16px;
  min-width: 0;
}

.match-column:last-of-type {
  text-align: right;
}

.match-node {
  width: 100%;
  min-height: 64px;
  padding: 12px 16px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(37, 33, 29, 0.08);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.match-node:hover {
  border-color: rgba(47, 111, 115, 0.58);
}

.match-node.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(47, 111, 115, 0.18), 0 8px 18px rgba(37, 33, 29, 0.08);
  transform: translateY(-2px);
}

.match-node.matched {
  color: #153d2b;
  background: #e9f6ef;
  border-color: rgba(36, 114, 77, 0.48);
}

.match-node.wrong {
  color: #5f1f1f;
  background: #fae9e9;
  border-color: rgba(163, 58, 58, 0.55);
}

.thought-lock {
  display: grid;
  grid-template-columns: minmax(260px, 1.25fr) minmax(220px, 0.95fr) minmax(240px, 1fr);
  gap: 18px;
  align-items: stretch;
}

.case-files,
.decoder-panel,
.repair-panel {
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
  padding: 16px;
  background: #fffdf9;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.thought-card,
.trap-button,
.repair-button {
  width: 100%;
  min-height: 76px;
  padding: 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(37, 33, 29, 0.07);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease, background 160ms ease;
}

.thought-card {
  display: grid;
  gap: 8px;
}

.case-label {
  color: var(--accent-dark);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.case-hint,
.trap-button span {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.4;
}

.thought-card:hover,
.trap-button:hover,
.repair-button:hover {
  border-color: rgba(47, 111, 115, 0.58);
}

.thought-card.selected,
.trap-button.selected,
.repair-button.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(47, 111, 115, 0.18), 0 8px 18px rgba(37, 33, 29, 0.08);
  transform: translateY(-2px);
}

.thought-card.solved {
  background: #e9f6ef;
  border-color: rgba(36, 114, 77, 0.48);
}

.thought-card.solved::after {
  content: "Repaired";
  justify-self: start;
  padding: 4px 9px;
  color: #153d2b;
  background: rgba(36, 114, 77, 0.14);
  border: 1px solid rgba(36, 114, 77, 0.25);
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.thought-card.wrong,
.trap-button.wrong,
.repair-button.wrong {
  color: #5f1f1f;
  background: #fae9e9;
  border-color: rgba(163, 58, 58, 0.55);
}

.emotion-safe {
  display: grid;
  grid-template-columns: minmax(280px, 1.1fr) minmax(240px, 0.85fr) minmax(280px, 1fr);
  gap: 18px;
  align-items: stretch;
}

.mask-panel,
.evidence-panel,
.emotion-wheel-panel,
.safe-panel {
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
  padding: 16px;
  background: #fffdf9;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.mask-card,
.emotion-token,
.safe-emotion-button {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(37, 33, 29, 0.07);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease, background 160ms ease;
}

.mask-card {
  display: grid;
  align-content: center;
  gap: 8px;
  width: 100%;
  min-height: 82px;
  padding: 14px;
  text-align: left;
}

.evidence-panel {
  grid-column: 2;
}

.emotion-wheel-panel {
  grid-column: 3;
  grid-row: 1 / span 2;
}

.safe-panel {
  grid-column: 1 / span 2;
}

.evidence-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 19px;
  color: var(--muted);
  line-height: 1.45;
}

.emotion-wheel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
  background:
    radial-gradient(circle, rgba(47, 111, 115, 0.1) 0 28%, transparent 29%),
    linear-gradient(135deg, rgba(223, 49, 79, 0.08), rgba(47, 111, 115, 0.1));
  border: 1px dashed rgba(47, 111, 115, 0.36);
  border-radius: 50%;
  aspect-ratio: 1;
  align-content: center;
}

.emotion-token {
  min-height: 48px;
  padding: 8px 10px;
  font-weight: 900;
}

.wide-button {
  width: 100%;
}

.safe-rule {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.safe-code {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.safe-slot {
  display: grid;
  place-items: center;
  min-height: 58px;
  color: var(--accent-dark);
  background: #eee7dc;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 1.35rem;
  font-weight: 900;
}

.safe-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.safe-emotion-button {
  min-height: 48px;
  padding: 8px 10px;
  font-weight: 900;
}

.safe-emotion-button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.mask-card:hover,
.emotion-token:hover,
.safe-emotion-button:not(:disabled):hover {
  border-color: rgba(47, 111, 115, 0.58);
}

.mask-card.selected,
.emotion-token.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(47, 111, 115, 0.18), 0 8px 18px rgba(37, 33, 29, 0.08);
  transform: translateY(-2px);
}

.mask-card.solved,
.emotion-token.unlocked {
  background: #e9f6ef;
  border-color: rgba(36, 114, 77, 0.48);
}

.mask-card.solved::after {
  content: "Named";
  justify-self: start;
  padding: 4px 9px;
  color: #153d2b;
  background: rgba(36, 114, 77, 0.14);
  border: 1px solid rgba(36, 114, 77, 0.25);
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.mask-card.wrong,
.emotion-token.wrong,
.safe-slot.wrong {
  color: #5f1f1f;
  background: #fae9e9;
  border-color: rgba(163, 58, 58, 0.55);
}

.subtext-bank {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 280px);
  gap: 18px;
  align-items: start;
}

.bank-window,
.response-panel,
.vault-panel {
  display: grid;
  align-content: start;
  gap: 14px;
  min-width: 0;
  padding: 18px;
  background: #fffdf9;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.bank-window {
  position: relative;
  z-index: 2;
  grid-column: 1 / -1;
}

.response-panel {
  grid-column: 1;
}

.vault-panel {
  grid-column: 2;
}

.bank-window blockquote {
  margin: 0;
  padding: 22px;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow-wrap: anywhere;
  font-size: clamp(1.55rem, 3vw, 2.8rem);
  font-weight: 900;
  line-height: 1.12;
}

.bank-note,
.vault-rule {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.response-panel h2,
.vault-panel h2 {
  margin: 0;
  font-size: 0.9rem;
}

.response-options {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.response-option {
  width: 100%;
  min-height: 62px;
  padding: 13px 14px;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: left;
  cursor: pointer;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
  box-shadow: 0 8px 18px rgba(37, 33, 29, 0.07);
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.response-option:hover {
  border-color: rgba(47, 111, 115, 0.58);
}

.response-option.correct {
  color: #153d2b;
  background: #e9f6ef;
  border-color: rgba(36, 114, 77, 0.48);
}

.response-option.wrong {
  color: #5f1f1f;
  background: #fae9e9;
  border-color: rgba(163, 58, 58, 0.55);
  transform: translateX(3px);
}

.vault-pins {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.vault-pins span {
  display: block;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #eee7dc;
  border: 1px solid var(--line);
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.45);
}

.vault-pins span.unlocked {
  background: var(--success);
  border-color: rgba(36, 114, 77, 0.68);
  box-shadow: 0 0 18px rgba(36, 114, 77, 0.28);
}

.laser-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
  align-items: start;
}

.forcefield-tray {
  min-width: 0;
}

.forcefield-palette {
  display: grid;
  gap: 14px;
  min-height: 260px;
  padding: 16px;
  background: #fffdf9;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.laser-grid {
  --cell-size: min(7vw, 62px);
  position: relative;
  width: calc(var(--cell-size) * 12);
  height: calc(var(--cell-size) * 8);
  max-width: 100%;
  aspect-ratio: 12 / 8;
  background:
    linear-gradient(rgba(47, 111, 115, 0.14) 1px, transparent 1px),
    linear-gradient(90deg, rgba(47, 111, 115, 0.14) 1px, transparent 1px),
    #10151a;
  background-size: calc(100% / 12) calc(100% / 8);
  border: 1px solid rgba(17, 21, 26, 0.86);
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06), 0 18px 35px rgba(37, 33, 29, 0.18);
  overflow: hidden;
  touch-action: none;
}

.laser-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

.laser-layer line {
  stroke: #ff3636;
  stroke-width: 5;
  stroke-linecap: round;
  filter: drop-shadow(0 0 8px rgba(255, 54, 54, 0.88));
}

.laser-layer circle {
  fill: rgba(255, 255, 255, 0.9);
  filter: drop-shadow(0 0 10px rgba(255, 54, 54, 0.95));
}

.iron-man,
.target-lock {
  position: absolute;
  z-index: 3;
  display: grid;
  place-items: center;
  width: calc(100% / 12 * 1.45);
  height: calc(100% / 8 * 1.2);
  color: #fff8db;
  border-radius: 8px;
  font-size: clamp(0.62rem, 1vw, 0.78rem);
  font-weight: 800;
  text-align: center;
  line-height: 1.1;
  pointer-events: none;
}

.iron-man img {
  width: 128%;
  height: 128%;
  object-fit: contain;
  filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.34));
}

.iron-man {
  left: calc(100% / 12 * 0.08);
  top: calc(100% / 8 * 5.9);
  background: radial-gradient(circle, rgba(255, 224, 89, 0.5), rgba(165, 31, 36, 0.18) 60%, transparent 72%);
  border: 0;
}

.target-lock {
  left: calc(100% / 12 * 8.78);
  top: calc(100% / 8 * 5.9);
  color: #ffffff;
  background:
    radial-gradient(circle, transparent 0 29%, rgba(255, 255, 255, 0.95) 30% 34%, transparent 35%),
    linear-gradient(135deg, #374151, #111827);
  border: 1px solid rgba(255, 255, 255, 0.46);
}

.laser-wall {
  position: absolute;
  z-index: 5;
  left: calc(100% / 12 * var(--wall-x));
  top: calc(100% / 8 * var(--wall-y));
  width: calc(100% / 12 * var(--wall-width));
  height: calc(100% / 8 * var(--wall-height));
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 4px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent),
    repeating-linear-gradient(45deg, #2e3640 0 8px, #20262f 8px 16px);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.28), 0 8px 18px rgba(0, 0, 0, 0.22);
  pointer-events: none;
}

.forcefield {
  position: relative;
  z-index: 4;
  width: 86px;
  height: 64px;
  margin: 0 auto;
  padding: 0;
  background: transparent;
  border: 0;
  cursor: grab;
  touch-action: none;
}

.forcefield::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 82px;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.28), rgba(125, 222, 255, 0.95), rgba(255, 255, 255, 0.28));
  box-shadow: 0 0 18px rgba(125, 222, 255, 0.85), inset 0 0 8px rgba(255, 255, 255, 0.8);
  transform: translate(-50%, -50%) rotate(var(--mirror-angle, 45deg));
}

.forcefield::after {
  content: "";
  position: absolute;
  inset: 11px 17px;
  border: 1px solid rgba(125, 222, 255, 0.52);
  border-radius: 50%;
  transform: rotate(var(--mirror-angle, 45deg));
}

.forcefield.dragging {
  opacity: 0.74;
  cursor: grabbing;
}

.laser-grid .forcefield {
  position: absolute;
  margin: 0;
  transform: translate(-50%, -50%);
}

.forcefield.hit::before {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.4), #ffffff, #7ddeff);
  box-shadow: 0 0 24px rgba(255, 255, 255, 0.95), 0 0 36px rgba(125, 222, 255, 0.85);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.primary-button,
.secondary-button {
  min-height: 44px;
  padding: 0 18px;
  border-radius: 8px;
  font-weight: 800;
  cursor: pointer;
}

.primary-button {
  color: #ffffff;
  background: var(--accent);
  border: 1px solid var(--accent-dark);
}

.primary-button:hover {
  background: var(--accent-dark);
}

.secondary-button {
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
}

.secondary-button:hover {
  background: #fffdf9;
}

.feedback {
  min-height: 24px;
  margin: 18px 0 0;
  font-weight: 700;
}

.feedback.error {
  color: var(--danger);
}

.feedback.success {
  color: var(--success);
}

.hidden {
  display: none;
}

.room-inside {
  display: grid;
  grid-template-columns: minmax(260px, 420px) 1fr;
  gap: clamp(24px, 5vw, 52px);
  align-items: center;
  padding: clamp(20px, 4vw, 44px);
}

.room-inside > :not(.room-photo-bg) {
  position: relative;
  z-index: 1;
}

.room-photo-bg {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 8px;
  opacity: 0.28;
  filter: saturate(0.95);
}

.room-photo-bg::after {
  background:
    linear-gradient(90deg, rgba(255, 253, 249, 0.84), rgba(255, 253, 249, 0.56)),
    linear-gradient(180deg, rgba(255, 253, 249, 0.12), rgba(255, 253, 249, 0.72));
}

.room-inside.hidden {
  display: none;
}

.room-art {
  position: relative;
  min-height: 360px;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.52), rgba(255, 255, 255, 0)),
    #dfcfc4;
  border: 1px solid var(--line);
  overflow: hidden;
}

.room-art::before {
  content: "";
  position: absolute;
  inset: auto 11% 16% 11%;
  height: 16px;
  border-radius: 999px;
  background: rgba(92, 66, 42, 0.2);
}

.character {
  position: absolute;
  bottom: 18%;
  width: 118px;
  height: 190px;
  border-radius: 60px 60px 34px 34px;
}

.character::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -54px;
  width: 82px;
  height: 82px;
  border-radius: 50%;
  transform: translateX(-50%);
  background: #f2c8a6;
  border: 1px solid rgba(87, 61, 43, 0.2);
}

.character::after {
  content: "";
  position: absolute;
  top: 42px;
  width: 92px;
  height: 26px;
  border-radius: 999px;
  background: inherit;
}

.character-left {
  left: 25%;
  background: #3b7b86;
  transform: rotate(4deg);
}

.character-left::after {
  right: -62px;
  transform: rotate(-24deg);
}

.character-right {
  right: 25%;
  background: #c86b58;
  transform: rotate(-4deg);
}

.character-right::after {
  left: -62px;
  transform: rotate(24deg);
}

.talking-art .character-left::after,
.talking-art .character-right::after {
  display: none;
}

.talking-art .character-left {
  left: 19%;
  transform: rotate(-2deg);
}

.talking-art .character-right {
  right: 19%;
  transform: rotate(2deg);
}

.speech-bubble {
  position: absolute;
  top: 17%;
  width: 112px;
  height: 64px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(216, 208, 198, 0.95);
  box-shadow: 0 12px 28px rgba(37, 33, 29, 0.1);
}

.speech-bubble::after {
  content: "";
  position: absolute;
  bottom: -9px;
  width: 18px;
  height: 18px;
  background: inherit;
  border-right: 1px solid rgba(216, 208, 198, 0.95);
  border-bottom: 1px solid rgba(216, 208, 198, 0.95);
  transform: rotate(45deg);
}

.speech-left {
  left: 12%;
}

.speech-left::after {
  right: 22px;
}

.speech-right {
  right: 12%;
}

.speech-right::after {
  left: 22px;
}

.final-room {
  min-height: min(760px, calc(100vh - 80px));
}

.final-art {
  display: grid;
  place-items: center;
  min-height: 430px;
  background:
    radial-gradient(circle at 50% 38%, rgba(255, 80, 104, 0.18), transparent 17rem),
    #f4ece8;
}

.large-heart {
  position: absolute;
  left: 50%;
  top: 45%;
  width: 138px;
  height: 138px;
  background: #df314f;
  transform: translate(-50%, -50%) rotate(45deg);
  animation: heartbeat 1150ms ease-in-out infinite;
  box-shadow: 0 0 44px rgba(223, 49, 79, 0.38);
}

.large-heart::before,
.large-heart::after {
  content: "";
  position: absolute;
  width: 138px;
  height: 138px;
  border-radius: 50%;
  background: inherit;
}

.large-heart::before {
  left: -69px;
}

.large-heart::after {
  top: -69px;
}

.hero-placeholder {
  position: absolute;
  bottom: 15%;
  display: grid;
  place-items: center;
  width: 132px;
  height: 188px;
  padding: 12px;
  color: #ffffff;
  border-radius: 70px 70px 30px 30px;
  font-weight: 900;
  text-align: center;
  box-shadow: 0 18px 35px rgba(37, 33, 29, 0.16);
}

.iron-placeholder {
  left: 14%;
  background: linear-gradient(135deg, #981b1f, #d8a62f);
}

.invisible-placeholder {
  right: 14%;
  color: #113241;
  background: linear-gradient(135deg, #e9fbff, #7edbfb);
}

.hero-image {
  position: absolute;
  bottom: 10%;
  width: min(34%, 210px);
  height: min(52%, 320px);
  object-fit: contain;
  filter: drop-shadow(0 22px 30px rgba(77, 11, 42, 0.25));
}

.hero-image.iron-placeholder {
  left: 9%;
  background: none;
}

.hero-image.invisible-placeholder {
  right: 9%;
  background: none;
}

.duo-image {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  width: min(72%, 520px);
  max-height: 72%;
  object-fit: contain;
  transform: translate(-50%, -50%);
  border: 4px solid rgba(255, 255, 255, 0.88);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 24px 54px rgba(77, 11, 42, 0.28);
}

.final-art .large-heart {
  z-index: 1;
  opacity: 0.72;
}

.final-art .hero-image {
  z-index: 3;
  width: min(24%, 150px);
  height: min(40%, 230px);
  opacity: 0.88;
}

.screwhim-corner {
  position: absolute;
  right: 16px;
  top: 16px;
  width: 92px;
  height: 92px;
  opacity: 0.78;
  transform: rotate(4deg);
}

.screwhim-corner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid rgba(255, 255, 255, 0.86);
  box-shadow: 0 12px 24px rgba(37, 33, 29, 0.18);
}

.screwhim-corner::before,
.screwhim-corner::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 112px;
  height: 8px;
  border-radius: 999px;
  background: rgba(205, 28, 44, 0.88);
  transform-origin: center;
  box-shadow: 0 1px 8px rgba(205, 28, 44, 0.32);
}

.screwhim-corner::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.screwhim-corner::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

@keyframes heartbeat {
  0%,
  100% {
    transform: translate(-50%, -50%) rotate(45deg) scale(1);
  }

  35% {
    transform: translate(-50%, -50%) rotate(45deg) scale(1.12);
  }

  55% {
    transform: translate(-50%, -50%) rotate(45deg) scale(0.98);
  }
}

.room-message h2 {
  max-width: 12ch;
  font-size: clamp(2rem, 5vw, 4.4rem);
  line-height: 1.02;
  margin-bottom: 24px;
}

@media (max-width: 820px) {
  .puzzle-layout,
  .laser-layout,
  .room-inside {
    grid-template-columns: 1fr;
  }

  .laser-grid {
    --cell-size: min(7.2vw, 52px);
  }

  .wiring-puzzle {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .thought-lock {
    grid-template-columns: 1fr;
  }

  .emotion-safe {
    grid-template-columns: 1fr;
  }

  .subtext-bank {
    grid-template-columns: 1fr;
  }

  .bank-window,
  .response-panel,
  .vault-panel {
    grid-column: auto;
  }

  .evidence-panel,
  .emotion-wheel-panel,
  .safe-panel {
    grid-column: auto;
    grid-row: auto;
  }

  .wire-layer {
    display: none;
  }

  .match-column:last-of-type {
    text-align: left;
  }

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

  .forcefield-palette {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    min-height: auto;
  }

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

@media (max-width: 520px) {
  .stage-shell {
    width: min(100% - 20px, 1120px);
    padding: 20px 0;
  }

  .start-photo-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stage-panel,
  .room-inside {
    padding: 18px;
  }

  .budgie-list,
  .perch-board {
    grid-template-columns: 1fr;
  }

  .forcefield-palette {
    grid-template-columns: 1fr;
  }

  .response-options {
    grid-template-columns: 1fr;
  }

  .laser-grid {
    --cell-size: calc((100vw - 58px) / 12);
  }

  .room-art {
    min-height: 300px;
  }

  .character-left {
    left: 20%;
  }

  .character-right {
    right: 20%;
  }
}

/* Love game overhaul */
:root {
  --bg: #fff0f6;
  --surface: rgba(255, 250, 253, 0.9);
  --ink: #321724;
  --muted: #7b5364;
  --line: rgba(239, 151, 185, 0.45);
  --accent: #e83f80;
  --accent-dark: #b91659;
  --danger: #c62146;
  --success: #12a66a;
  --shadow: 0 24px 70px rgba(139, 24, 78, 0.22);
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 14% 12%, rgba(255, 116, 168, 0.34), transparent 24rem),
    radial-gradient(circle at 88% 14%, rgba(255, 210, 226, 0.9), transparent 20rem),
    radial-gradient(circle at 72% 92%, rgba(232, 63, 128, 0.22), transparent 24rem),
    linear-gradient(135deg, #fff4fa 0%, #ffd6e6 52%, #fff8fb 100%);
}

body::before,
body::after {
  content: "♥ ♥ ♥ ♥ ♥ ♥";
  position: fixed;
  z-index: -1;
  color: rgba(232, 63, 128, 0.2);
  font-size: clamp(3rem, 8vw, 8rem);
  letter-spacing: 0.35em;
  white-space: nowrap;
  pointer-events: none;
  animation: floatHearts 16s linear infinite;
}

body::before {
  left: -12vw;
  top: 8vh;
}

body::after {
  right: -16vw;
  bottom: 4vh;
  animation-duration: 22s;
  animation-direction: reverse;
}

@keyframes floatHearts {
  0% {
    transform: translate3d(0, 0, 0) rotate(-8deg);
  }

  50% {
    transform: translate3d(7vw, -3vh, 0) rotate(5deg);
  }

  100% {
    transform: translate3d(0, 0, 0) rotate(-8deg);
  }
}

.stage-shell {
  width: 100%;
  min-height: 100vh;
  padding: clamp(12px, 2vw, 24px);
}

.start-screen,
.stage-panel,
.room-inside {
  min-height: calc(100vh - clamp(24px, 4vw, 48px));
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.86), rgba(255, 239, 247, 0.74)),
    rgba(255, 246, 250, 0.88);
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}

.stage-panel {
  display: grid;
  align-content: center;
  padding: clamp(20px, 4vw, 58px);
}

.stage-header {
  max-width: 980px;
  margin-bottom: clamp(18px, 3vw, 34px);
}

h1 {
  max-width: 13ch;
  color: #4a1230;
  font-size: clamp(2.55rem, 7vw, 6.7rem);
  line-height: 0.9;
  text-shadow: 0 8px 28px rgba(232, 63, 128, 0.2);
}

.eyebrow {
  color: var(--accent-dark);
}

.stage-copy,
.bank-note,
.vault-rule {
  color: #79475e;
  font-size: clamp(1rem, 1.3vw, 1.15rem);
}

.primary-button,
.secondary-button {
  min-height: 52px;
  border-radius: 999px;
  transform: translateY(0);
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.primary-button {
  border: 0;
  background: linear-gradient(135deg, #ff4f99, #d51d6d);
  box-shadow: 0 14px 28px rgba(213, 29, 109, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.primary-button:hover,
.secondary-button:hover,
.response-option:hover,
.budgie:hover {
  transform: translateY(-2px);
}

.secondary-button {
  color: #8a174b;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(232, 63, 128, 0.34);
}

.start-screen {
  align-items: center;
  padding: clamp(18px, 4vw, 64px);
}

.start-photo-grid {
  inset: -18px;
  grid-template-columns: repeat(6, minmax(160px, 1fr));
  gap: 14px;
  padding: 14px;
  opacity: 1;
}

.start-photo-grid::after {
  background:
    radial-gradient(circle at 30% 52%, rgba(255, 246, 250, 0.34), transparent 19rem),
    linear-gradient(90deg, rgba(255, 229, 240, 0.9), rgba(255, 229, 240, 0.3) 42%, rgba(255, 229, 240, 0.78));
}

.start-photo-grid img,
.room-photo-bg img,
.budgie-photo-bg img {
  border: 3px solid rgba(255, 255, 255, 0.86);
  border-radius: 18px;
  box-shadow: 0 18px 42px rgba(103, 19, 57, 0.24);
}

.start-photo-grid img:nth-child(odd),
.room-photo-bg img:nth-child(odd) {
  transform: rotate(-2.2deg) scale(1.02);
}

.start-photo-grid img:nth-child(even),
.room-photo-bg img:nth-child(even) {
  transform: rotate(2deg) scale(1.02);
}

.start-content {
  max-width: min(760px, 92vw);
  padding: clamp(24px, 5vw, 58px);
  background: rgba(255, 247, 251, 0.76);
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 24px;
  box-shadow: 0 24px 70px rgba(103, 19, 57, 0.24);
}

.start-content h1 {
  max-width: none;
  font-size: clamp(4rem, 14vw, 11rem);
}

.budgie-photo-bg {
  inset: -22px;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 16px;
  opacity: 0.54;
}

.budgie-photo-bg::after {
  background:
    linear-gradient(90deg, rgba(255, 245, 250, 0.8), rgba(255, 245, 250, 0.45), rgba(255, 245, 250, 0.86)),
    radial-gradient(circle at 50% 52%, rgba(255, 255, 255, 0.72), transparent 29rem);
}

.clue-box,
.budgie-tray,
.perch-board,
.bank-window,
.response-panel,
.vault-panel,
.forcefield-palette {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(232, 63, 128, 0.24);
  border-radius: 18px;
  box-shadow: 0 18px 40px rgba(139, 24, 78, 0.12);
  backdrop-filter: blur(7px);
}

.puzzle-layout,
.subtext-bank,
.laser-layout {
  gap: clamp(16px, 2vw, 28px);
}

.budgie,
.perch,
.response-option,
.drop-zone,
.laser-grid {
  border-radius: 16px;
}

.perch-number {
  background: linear-gradient(135deg, #ffd5e7, #fff2f8);
  color: #8c1b50;
}

.drop-zone {
  background:
    linear-gradient(90deg, transparent 0 45%, rgba(156, 84, 58, 0.42) 45% 55%, transparent 55%),
    linear-gradient(180deg, transparent 0 62%, rgba(156, 84, 58, 0.5) 62% 68%, transparent 68%),
    rgba(255, 248, 251, 0.78);
}

.subtext-bank {
  grid-template-columns: minmax(0, 1.5fr) minmax(260px, 0.55fr);
}

.bank-window blockquote {
  min-height: 150px;
  display: grid;
  align-items: center;
  border: 1px solid rgba(232, 63, 128, 0.22);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(255, 232, 243, 0.82));
  color: #5c1238;
  font-size: clamp(2.2rem, 5vw, 5.2rem);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.62);
}

.response-option {
  min-height: 78px;
  border-color: rgba(232, 63, 128, 0.18);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 12px 28px rgba(139, 24, 78, 0.1);
}

.response-option.correct {
  background: linear-gradient(135deg, #e8fff4, #d2f7e4);
}

.response-option.wrong {
  background: linear-gradient(135deg, #ffe1e8, #ffd1dd);
}

.vault-pins span {
  background: linear-gradient(135deg, #ffd6e7, #fff4f8);
}

.vault-pins span.unlocked {
  background: linear-gradient(135deg, #2ee28d, #0f9b61);
}

.laser-grid {
  --cell-size: min(6.3vw, 76px);
  justify-self: center;
  border: 2px solid rgba(255, 154, 194, 0.5);
  box-shadow: 0 24px 60px rgba(139, 24, 78, 0.24), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.room-inside {
  grid-template-columns: minmax(320px, 0.75fr) minmax(380px, 1fr);
  padding: clamp(24px, 5vw, 70px);
  overflow: hidden;
}

.room-photo-bg {
  inset: -46px;
  grid-template-columns: repeat(8, minmax(140px, 1fr));
  gap: 14px;
  padding: 18px;
  opacity: 1;
  filter: saturate(1.06) contrast(1.02);
}

.room-photo-bg::after {
  background:
    radial-gradient(circle at 70% 50%, rgba(255, 246, 250, 0.78), rgba(255, 246, 250, 0.38) 28rem, rgba(255, 226, 238, 0.74) 48rem),
    linear-gradient(90deg, rgba(255, 226, 238, 0.26), rgba(255, 246, 250, 0.78) 42%, rgba(255, 226, 238, 0.2));
}

.room-art {
  min-height: min(62vh, 560px);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.58), rgba(255, 222, 236, 0.22)),
    rgba(255, 230, 241, 0.78);
  border: 1px solid rgba(232, 63, 128, 0.22);
  border-radius: 24px;
  box-shadow: 0 22px 54px rgba(139, 24, 78, 0.16);
  backdrop-filter: blur(5px);
}

.room-message {
  padding: clamp(20px, 4vw, 42px);
  border-radius: 24px;
  background: rgba(255, 247, 251, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: 0 22px 54px rgba(139, 24, 78, 0.16);
  backdrop-filter: blur(7px);
}

.inside-photo-collage {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: minmax(180px, 1fr);
  gap: clamp(10px, 1.5vw, 18px);
  min-height: min(68vh, 640px);
  padding: clamp(10px, 1.6vw, 18px);
  border-radius: 28px;
  background: rgba(255, 247, 251, 0.52);
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: 0 24px 70px rgba(139, 24, 78, 0.2);
  backdrop-filter: blur(4px);
}

.inside-photo-collage img {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
  border: 4px solid rgba(255, 255, 255, 0.9);
  border-radius: 22px;
  box-shadow: 0 18px 42px rgba(103, 19, 57, 0.22);
}

.inside-photo-collage img:nth-child(1) {
  transform: rotate(-2deg);
}

.inside-photo-collage img:nth-child(2) {
  transform: rotate(2deg) translateY(10px);
}

.inside-photo-collage img:nth-child(3) {
  transform: rotate(1.5deg) translateY(-6px);
}

.inside-photo-collage img:nth-child(4) {
  transform: rotate(-1.5deg);
}

.room-message h2 {
  max-width: 14ch;
  color: #4a1230;
  text-shadow: 0 10px 30px rgba(232, 63, 128, 0.18);
}

.final-art {
  min-height: min(66vh, 620px);
}

.large-heart {
  background: #ff2f78;
  box-shadow: 0 0 54px rgba(255, 47, 120, 0.55);
}

.screwhim-corner {
  right: 18px;
  top: 18px;
  width: min(42%, 210px);
  height: 132px;
  opacity: 0.9;
  transform: rotate(3deg);
}

.screwhim-corner img {
  object-fit: contain;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 14px;
}

.screwhim-corner::before,
.screwhim-corner::after {
  width: 238px;
  height: 12px;
  background: rgba(226, 14, 58, 0.9);
}

@media (max-width: 980px) {
  .room-photo-bg {
    grid-template-columns: repeat(4, minmax(130px, 1fr));
  }

  .room-inside {
    grid-template-columns: 1fr;
  }

  .inside-photo-collage {
    min-height: 560px;
  }
}

@media (max-width: 820px) {
  .stage-shell {
    padding: 10px;
  }

  .start-screen,
  .stage-panel,
  .room-inside {
    min-height: calc(100vh - 20px);
    border-radius: 18px;
  }

  .start-photo-grid {
    grid-template-columns: repeat(3, minmax(140px, 1fr));
  }

  .subtext-bank,
  .puzzle-layout,
  .laser-layout {
    grid-template-columns: 1fr;
  }

  .response-options {
    grid-template-columns: 1fr;
  }

  .room-photo-bg {
    opacity: 0.72;
  }
}

@media (max-width: 520px) {
  h1 {
    font-size: clamp(2.5rem, 15vw, 4.4rem);
  }

  .start-content {
    padding: 22px;
  }

  .start-photo-grid,
  .room-photo-bg {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }

  .bank-window blockquote {
    min-height: 118px;
    font-size: clamp(1.8rem, 10vw, 3rem);
  }

  .inside-photo-collage {
    grid-template-columns: 1fr;
    grid-auto-rows: minmax(220px, 34vh);
    min-height: auto;
  }

  .screwhim-corner {
    width: 150px;
    height: 96px;
  }

  .screwhim-corner::before,
  .screwhim-corner::after {
    width: 172px;
    height: 9px;
  }
}

.hidden,
.room-inside.hidden {
  display: none !important;
}

.ending-page {
  position: relative;
  min-height: calc(100vh - clamp(24px, 4vw, 48px));
  display: grid;
  place-items: center;
  padding: clamp(20px, 5vw, 70px);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.86), rgba(255, 239, 247, 0.74)),
    rgba(255, 246, 250, 0.88);
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}

.ending-page > :not(.room-photo-bg) {
  position: relative;
  z-index: 1;
}

.ending-letter {
  width: min(980px, 100%);
  max-height: calc(100vh - 120px);
  overflow: auto;
  padding: clamp(22px, 5vw, 58px);
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 28px;
  background: rgba(255, 247, 251, 0.86);
  box-shadow: 0 28px 80px rgba(139, 24, 78, 0.24);
  backdrop-filter: blur(9px);
}

.ending-letter h1 {
  max-width: none;
  margin-bottom: 22px;
}

.ending-text {
  margin: 0;
  color: #4a1230;
  font-size: clamp(1.05rem, 1.55vw, 1.35rem);
  font-weight: 650;
  line-height: 1.72;
  white-space: pre-wrap;
}

.hidden,
.room-inside.hidden {
  display: none !important;
}
