:root {
  color-scheme: dark;
  --ink: #f6f2ed;
  --muted: #a9b2c5;
  --panel: #121d32;
  --panel-2: #19263d;
  --line: #71809e;
  --bg: #080d18;
  --accent: #ff5c76;
  --accent-dark: #b93753;
  --focus: #9be7ff;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  background:
    radial-gradient(circle at 20% 10%, rgba(72, 84, 116, 0.24), transparent 32rem),
    linear-gradient(145deg, #090d16, #111827 55%, #070b12);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
}

button { font: inherit; }

button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.prototype-shell {
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(15rem, 23rem) minmax(20rem, 27rem);
  align-items: center;
  justify-content: center;
  gap: clamp(2rem, 6vw, 7rem);
  padding: 2rem;
}

.prototype-note {
  max-width: 23rem;
  color: var(--muted);
  line-height: 1.6;
}

.prototype-note span {
  display: block;
  color: var(--ink);
  font: 700 0.82rem/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.13em;
}

.prototype-note p { margin: 0.9rem 0 0; }

.phone {
  width: min(100%, 27rem);
  height: min(90svh, 54rem);
  min-height: 40rem;
  padding: 0.75rem;
  border: 1px solid #697389;
  border-radius: 2.7rem;
  background: #03060c;
  box-shadow: var(--shadow), inset 0 0 0 3px #1e2634;
}

.safe-area {
  height: 100%;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr auto;
  border-radius: 2rem;
  background: var(--bg);
  position: relative;
}

.safe-area::before {
  content: "";
  width: 8rem;
  height: 1.35rem;
  border-radius: 0 0 0.9rem 0.9rem;
  background: #03060c;
  position: absolute;
  top: 0;
  left: 50%;
  translate: -50% 0;
  z-index: 5;
}

.game-header,
.game-footer {
  min-height: 3.6rem;
  display: grid;
  grid-template-columns: 3rem 1fr 3rem;
  align-items: center;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid rgba(113, 128, 158, 0.35);
  background: rgba(8, 13, 24, 0.94);
  z-index: 3;
}

.game-header.is-loading { visibility: hidden; }

.game-footer {
  min-height: 3.25rem;
  grid-template-columns: 1fr auto;
  border-top: 1px solid rgba(113, 128, 158, 0.35);
  border-bottom: 0;
}

.game-footer.is-collapsed { display: none; }

.brand-mini {
  text-align: center;
  font: 900 0.78rem/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.07em;
}

.brand-mini span,
.logo-title span { color: var(--accent); }

.icon-button,
.text-button {
  min-width: 2.65rem;
  min-height: 2.65rem;
  border: 0;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
}

.icon-button { font-size: 1.25rem; }

.text-button {
  min-width: auto;
  color: var(--muted);
  font: 700 0.74rem/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  text-transform: uppercase;
}

.is-hidden { visibility: hidden !important; pointer-events: none !important; }

.game {
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
  background:
    radial-gradient(circle at 85% 15%, rgba(109, 125, 158, 0.12), transparent 12rem),
    linear-gradient(rgba(255,255,255,0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.015) 1px, transparent 1px),
    var(--bg);
  background-size: auto, 16px 16px, 16px 16px, auto;
}

.screen {
  min-height: 100%;
  padding: 1.15rem 1.15rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.85rem;
  opacity: 0;
  transform: translateY(5px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.screen.is-visible { opacity: 1; transform: none; }

.screen h1 {
  margin: 0;
  text-align: center;
  font: 900 clamp(1.25rem, 4vw, 1.7rem)/1.1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.01em;
}

.eyebrow,
.level-pill {
  align-self: center;
  padding: 0.4rem 0.7rem;
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--panel);
  font: 800 0.72rem/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.level-pill { border-radius: 0.2rem; }

.scene {
  min-height: 9rem;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem;
  border: 1px solid var(--line);
  background: linear-gradient(150deg, #26334a, #101a2b);
  text-align: center;
}

.scene-grid {
  position: absolute;
  inset: 0;
  opacity: 0.18;
  background:
    linear-gradient(90deg, transparent 49%, #fff 50%, transparent 51%),
    linear-gradient(transparent 49%, #fff 50%, transparent 51%);
  background-size: 22px 22px;
}

.scene > *:not(.scene-grid) { position: relative; }

.scene--art {
  margin: 0;
  padding: 0;
  background: #0c1525;
  border-color: #8291ad;
  box-shadow: 0 0 0 3px rgba(8, 13, 24, 0.75), 0 8px 22px rgba(0, 0, 0, 0.32);
}

.scene--art img {
  width: 100%;
  height: 100%;
  min-height: inherit;
  display: block;
  object-fit: cover;
  image-rendering: auto;
}

.scene--art picture {
  width: 100%;
  height: 100%;
  min-height: inherit;
  display: block;
}

.plan-screen {
  min-height: 100%;
  overflow: hidden;
  position: relative;
  padding: 0;
  isolation: isolate;
}

.plan-scene {
  min-height: 100%;
  position: absolute;
  inset: 0;
  z-index: -2;
  border: 0;
  box-shadow: none;
}

.plan-scene .scene-caption { display: none; }

.plan-screen__overlay {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(4, 9, 19, 0.76), transparent 31%, transparent 52%, rgba(4, 9, 19, 0.9)),
    linear-gradient(90deg, rgba(4, 9, 19, 0.34), transparent 28%, transparent 72%, rgba(4, 9, 19, 0.34));
}

.plan-screen__content {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.65rem;
  padding: 0.75rem;
}

.plan-screen__content .level-pill { margin-bottom: auto; }

.plan-question {
  width: min(100%, 34rem);
  align-self: center;
  padding: 0.75rem 1rem;
  background: rgba(9, 19, 35, 0.9);
  backdrop-filter: blur(8px);
}

.plan-question h1 { font-size: clamp(0.95rem, 3.5vw, 1.3rem); }

.plan-choice-grid {
  width: min(100%, 38rem);
  align-self: center;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}

.plan-choice {
  min-height: 2.75rem;
  display: grid;
  grid-template-columns: 2.1rem 1fr;
  align-items: center;
  gap: 0.55rem;
  border: 1px solid rgba(154, 181, 224, 0.78);
  padding: 0.45rem 0.6rem;
  color: #fff;
  background: rgba(7, 16, 31, 0.88);
  box-shadow: 3px 3px 0 rgba(2, 7, 19, 0.8);
  cursor: pointer;
  text-align: left;
  font: 750 0.72rem/1.25 ui-monospace, SFMono-Regular, Menlo, monospace;
  backdrop-filter: blur(8px);
}

.plan-choice:hover,
.plan-choice.is-selected { border-color: #ff8da0; background: rgba(169, 47, 75, 0.93); }
.plan-choice__icon { color: #ff8da0; text-align: center; font-size: 1rem; }
.plan-choice.is-selected .plan-choice__icon { color: #fff; }
.plan-feedback { width: min(100%, 38rem); align-self: center; padding: 0.65rem 0.8rem; background: rgba(9, 19, 35, 0.94); }
.plan-feedback p { font-size: 0.78rem; }
.plan-screen__content > .primary-button { width: min(100%, 38rem); align-self: center; }

.scene-caption {
  position: absolute !important;
  right: 0.45rem;
  bottom: 0.4rem;
  padding: 0.28rem 0.4rem;
  color: rgba(255, 255, 255, 0.76);
  background: rgba(5, 9, 20, 0.72);
  font: 700 0.55rem/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.08em;
}

.scene strong {
  max-width: 18rem;
  font: 700 0.95rem/1.35 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.scene-label,
.scene-note {
  color: var(--muted);
  font: 700 0.62rem/1.3 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.1em;
}

.scene-note { letter-spacing: 0; }
.scene--hero { min-height: 13rem; }
.scene--large { min-height: 15rem; }
.scene--compact { min-height: 8rem; }
.scene--photo { min-height: 16rem; border: 0.65rem solid #e8e4dc; color: #111827; background: #aab2c1; transform: rotate(-1.2deg); }
.scene--photo.scene--art { padding: 0; }
.scene--proposal { min-height: 18rem; }
.scene--night { background: linear-gradient(155deg, #1a2944, #090f1d); }

.logo-title {
  font-size: clamp(2.6rem, 12vw, 4.6rem) !important;
  line-height: 0.82 !important;
  letter-spacing: -0.08em !important;
  text-shadow: 4px 4px 0 #27334a;
}

.subtitle,
.microcopy {
  margin: 0;
  text-align: center;
  color: var(--muted);
  line-height: 1.45;
}

.microcopy { font-size: 0.78rem; }

.copy { color: #e6e8ee; line-height: 1.55; }
.copy p { margin: 0; }
.copy p + p { margin-top: 0.7rem; }
.compact-copy { text-align: center; font-size: 0.92rem; }

.dialog-card,
.question-card,
.feedback {
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 1rem;
  box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.2);
}

.dialog-card h1 { margin: 0.8rem 0; }
.memory-card {
  display: grid;
  gap: 1rem;
  text-align: center;
}
.memory-card .eyebrow {
  display: block;
  width: fit-content;
  margin: 0 auto;
  line-height: 1.25;
}
.memory-card .copy { margin-top: 0.1rem; }
.question-card h1 { font-size: 1.08rem; line-height: 1.35; }

.screen-actions { display: grid; gap: 0.65rem; }

.primary-button,
.secondary-button {
  width: 100%;
  min-height: 3.2rem;
  border: 2px solid var(--line);
  padding: 0.75rem 1rem;
  color: var(--ink);
  background: var(--panel-2);
  box-shadow: 4px 4px 0 #050914;
  cursor: pointer;
  font: 800 0.82rem/1.25 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.03em;
  transition: transform 120ms ease, filter 120ms ease;
}

.primary-button { border-color: #ff8da0; background: var(--accent-dark); }
.primary-button:hover:not(:disabled), .secondary-button:hover { filter: brightness(1.15); transform: translateY(-1px); }
.primary-button:active:not(:disabled), .secondary-button:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 #050914; }
.primary-button:disabled { cursor: not-allowed; opacity: 0.34; }

.choice-list { display: grid; gap: 0.55rem; }

.choice-button {
  min-height: 3rem;
  display: grid;
  grid-template-columns: 2.3rem 1fr;
  align-items: center;
  gap: 0.7rem;
  border: 1px solid var(--line);
  padding: 0.45rem 0.65rem;
  color: var(--ink);
  background: #101a2b;
  text-align: left;
  cursor: pointer;
}

.choice-button.is-selected { border-color: var(--accent); background: #2a1b2a; }

.choice-index {
  display: grid;
  place-items: center;
  min-height: 2rem;
  border: 1px solid currentColor;
  font: 800 0.85rem/1 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.feedback { border-color: var(--accent); }
.feedback span { color: #ff9aad; font: 800 0.68rem/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0.08em; }
.feedback p { margin: 0.45rem 0 0; line-height: 1.4; }

.map-board {
  min-height: 18rem;
  position: relative;
  border: 1px solid var(--line);
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 50%, transparent 0 34%, #506078 35% 37%, transparent 38%),
    linear-gradient(135deg, #1c2a41, #27374c 50%, #101a2c);
}

.map-board::after {
  content: "MAPA ESQUEMÁTICO";
  position: absolute;
  right: 0.6rem;
  bottom: 0.5rem;
  color: rgba(255,255,255,0.35);
  font: 700 0.58rem/1 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.map-board--art {
  background-position: center;
  background-size: cover;
  box-shadow: inset 0 0 0 3px rgba(5, 9, 20, 0.46);
}

.map-pin {
  position: absolute;
  left: var(--x);
  top: var(--y);
  translate: -50% -50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  border: 0;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  font: 700 0.65rem/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  text-shadow: 0 1px 2px #000;
}

.map-pin span { width: 1.25rem; height: 1.25rem; border: 3px solid #cbd2df; border-radius: 50%; background: var(--panel); }
.map-pin.is-selected span { border-color: var(--accent); background: var(--accent); box-shadow: 0 0 0 5px rgba(255,92,118,0.18); }

.room-board { border: 1px solid var(--line); padding: 0.75rem; background: #172339; }
.room-label { display: block; margin-bottom: 0.7rem; color: var(--muted); text-align: center; font: 700 0.6rem/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0.08em; }
.treasure-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.55rem; }

.room-board--art {
  min-height: 18rem;
  position: relative;
  padding: 0;
  overflow: hidden;
  background-position: center;
  background-size: cover;
  box-shadow: inset 0 0 0 3px rgba(5, 9, 20, 0.38);
}

.room-board--art .room-label {
  position: absolute;
  top: 0.45rem;
  left: 50%;
  translate: -50% 0;
  z-index: 2;
  width: max-content;
  max-width: calc(100% - 1rem);
  padding: 0.35rem 0.5rem;
  background: rgba(5, 9, 20, 0.78);
}

.room-board--art .treasure-grid {
  position: absolute;
  inset: 0;
  display: block;
}

.treasure {
  min-height: 9rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border: 1px dashed var(--line);
  color: var(--ink);
  background: #0d1627;
  cursor: pointer;
  text-align: center;
  padding: 0.5rem;
  font-size: 0.76rem;
}

.treasure.is-found { border-style: solid; border-color: var(--accent); background: #2a1b2a; }
.treasure-icon { font: 900 2rem/1 ui-monospace, SFMono-Regular, Menlo, monospace; }
.treasure small { color: var(--muted); font: 700 0.58rem/1 ui-monospace, SFMono-Regular, Menlo, monospace; }
.treasure--hotspot {
  min-height: 0;
  width: 3.25rem;
  height: 3.25rem;
  position: absolute;
  left: var(--x);
  top: var(--y);
  translate: -50% -50%;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
  animation: none;
}
.treasure--hotspot .treasure-icon { opacity: 0; font-size: 1rem; }
.treasure--hotspot .treasure-name {
  position: absolute;
  left: 50%;
  top: calc(100% + 0.35rem);
  translate: -50% 0;
  width: max-content;
  max-width: 7rem;
  padding: 0.25rem 0.35rem;
  color: #fff;
  background: rgba(8, 17, 31, 0.88);
  font: 700 0.58rem/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
}
.treasure--hotspot .treasure-name:empty { display: none; }
.treasure--hotspot.is-hint {
  border-color: rgba(255, 255, 255, 0.85);
  background: rgba(8, 17, 31, 0.48);
  box-shadow: 0 0 0 4px rgba(242, 78, 106, 0.22);
  animation: hotspot 1.1s ease-in-out infinite alternate;
}
.treasure--hotspot.is-hint .treasure-icon { opacity: 1; }
.treasure--hotspot.is-found {
  color: #fff;
  border-color: var(--accent);
  background: rgba(169, 47, 75, 0.88);
  box-shadow: 0 0 0 3px rgba(242, 78, 106, 0.16);
  animation: none;
}
.treasure--hotspot.is-found .treasure-icon { opacity: 1; }
.hunt-status { text-align: center; color: var(--muted); font: 800 0.72rem/1 ui-monospace, SFMono-Regular, Menlo, monospace; }

.treasure-memory-screen { justify-content: center; }

.narrative-screen { justify-content: center; }
.emotional-copy { font-size: 1.02rem; text-align: center; }
.proposal-copy { text-align: center; }
.proposal-copy h1 { margin-top: 1rem; color: #fff; font-size: 1.45rem; }
.invitation-options .secondary-button { font-size: 0.68rem; line-height: 1.3; }
.invitation-screen { gap: 0.55rem; padding-top: 0.85rem; }
.invitation-screen .scene--proposal { min-height: 10.5rem; max-height: 10.5rem; }
.invitation-screen .proposal-copy { padding: 0.7rem 0.85rem; }
.invitation-screen .proposal-copy p { margin: 0; }
.invitation-screen .proposal-copy h1 { margin: 0.55rem 0 0; font-size: 1.25rem; }
.invitation-screen .invitation-options { gap: 0.4rem; }
.invitation-screen .invitation-options button { min-height: 2.55rem; padding-block: 0.55rem; }
.ending-screen--positive .eyebrow { border-color: #ff8da0; color: #fff; background: #a92f4b; }
.ending-screen--respectful .eyebrow { border-color: #70d7e8; color: #bdf5ff; }

.centered-screen { justify-content: center; }
.manual-icon { width: 3rem; height: 3rem; display: grid; place-items: center; margin: 0 auto; border: 2px solid var(--accent); color: var(--accent); font: 900 1.4rem/1 ui-monospace, SFMono-Regular, Menlo, monospace; }

.pause-screen {
  text-align: center;
  background:
    radial-gradient(circle at 50% 40%, rgba(242, 78, 106, 0.15), transparent 15rem),
    linear-gradient(#0b1322, #050914);
}
.pause-symbol {
  color: var(--accent);
  font-size: 4.5rem;
  filter: drop-shadow(0 0 18px rgba(242, 78, 106, 0.4));
  animation: pulse 1.1s ease-in-out infinite alternate;
}
.pause-card { display: grid; gap: 1rem; }
.pause-card .eyebrow { display: block; width: fit-content; margin: 0 auto; }
.pause-card p:last-child { font-size: 1.3rem; color: #fff; }

.epilogue-screen { justify-content: center; }
.epilogue-copy { display: grid; gap: 0.7rem; text-align: center; }
.epilogue-copy h1 { color: #fff; }

.celebration { display: flex; justify-content: space-around; color: var(--accent); font-size: 1.4rem; animation: bob 1.1s ease-in-out infinite alternate; }

.timeline { list-style: none; display: grid; gap: 0.6rem; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 2.7rem 1fr; align-items: center; gap: 0.7rem; border: 1px solid var(--line); padding: 0.65rem; background: var(--panel); }
.timeline li > span { display: grid; place-items: center; min-height: 2.5rem; color: var(--accent); border: 1px solid var(--accent); font: 900 0.82rem/1 ui-monospace, SFMono-Regular, Menlo, monospace; }
.timeline strong, .timeline small { display: block; }
.timeline strong { font-size: 0.88rem; }
.timeline small { margin-top: 0.25rem; color: var(--muted); }

.hearts { display: flex; gap: 0.3rem; }
.heart { color: #4d596e; font-size: 1.18rem; }
.heart.is-full { color: var(--accent); filter: drop-shadow(0 0 4px rgba(255,92,118,0.4)); }

.loading-screen { align-items: center; justify-content: center; text-align: center; }
.loading-screen p { color: var(--muted); }
.loading-heart { color: var(--accent); font-size: 4rem; animation: pulse 700ms ease-in-out infinite alternate; }
.loading-bar { width: min(14rem, 80%); height: 0.65rem; border: 1px solid var(--line); padding: 2px; }
.loading-bar span { display: block; width: 100%; height: 100%; background: var(--accent); transform-origin: left; animation: load 1s ease-out both; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  translate: -50% 1rem;
  z-index: 10;
  padding: 0.75rem 1rem;
  border: 1px solid #ff8da0;
  background: #381a28;
  color: #fff;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  font: 800 0.72rem/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.05em;
  transition: opacity 160ms ease, translate 160ms ease;
}

.toast.is-visible { opacity: 1; translate: -50% 0; }

@keyframes pulse { to { transform: scale(1.15); } }
@keyframes load { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes bob { to { transform: translateY(-0.25rem); } }
@keyframes hotspot { to { box-shadow: 0 0 0 8px rgba(242, 78, 106, 0.1), 0 3px 8px rgba(0, 0, 0, 0.45); } }

.is-embedded .prototype-shell {
  min-height: 100svh;
  display: block;
  padding: 0;
}

.is-embedded .prototype-note { display: none; }

.is-embedded .phone {
  width: 100%;
  height: 100svh;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.is-embedded .safe-area { border-radius: 0; }
.is-embedded .safe-area::before { display: none; }

@media (min-width: 761px) {
  .prototype-shell {
    grid-template-columns: minmax(42rem, 78rem);
    gap: 1.25rem;
    padding: 1.5rem 2rem;
  }

  .prototype-note {
    max-width: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
  }

  .prototype-note p { max-width: 42rem; margin: 0; text-align: right; }

  .phone {
    width: min(100%, 78rem);
    height: min(82svh, 50rem);
    min-height: 38rem;
    padding: 0.55rem;
    border-radius: 1.25rem;
  }

  .safe-area { border-radius: 0.8rem; }
  .safe-area::before { display: none; }

  .screen:not(.plan-screen):not(.loading-screen) {
    width: min(100%, 64rem);
    margin-inline: auto;
    padding-inline: clamp(1.25rem, 4vw, 3.5rem);
  }

  .cover-screen {
    display: grid;
    grid-template-columns: minmax(15rem, 0.72fr) minmax(24rem, 1.28fr);
    grid-template-rows: auto auto auto 1fr auto auto;
    align-items: center;
    column-gap: clamp(1.5rem, 4vw, 3.5rem);
  }

  .cover-screen .eyebrow,
  .cover-screen .logo-title,
  .cover-screen .subtitle,
  .cover-screen .screen-actions,
  .cover-screen .microcopy { grid-column: 1; }
  .cover-screen .eyebrow { justify-self: start; }
  .cover-screen .logo-title,
  .cover-screen .subtitle,
  .cover-screen .microcopy { text-align: left; }
  .cover-screen .scene--hero { grid-column: 2; grid-row: 1 / 7; height: min(58svh, 34rem); }

  .intro-screen,
  .memory-screen,
  .question-screen,
  .invitation-screen,
  .ending-screen {
    max-width: 54rem;
  }

  .scene--hero,
  .scene--large,
  .scene--photo,
  .scene--proposal { max-height: 28rem; }

  .plan-screen__content { padding: 0.75rem 1rem; }
  .plan-question { margin-top: auto; }
  .plan-choice { min-height: 2.8rem; font-size: 0.74rem; }
  .plan-screen__content .level-pill { position: absolute; top: 0.75rem; left: 50%; translate: -50% 0; }
  .plan-feedback { padding: 0.45rem 0.65rem; }
  .plan-feedback p { margin-top: 0.3rem; font-size: 0.72rem; }
  .plan-screen__content > .primary-button { min-height: 2.75rem; padding-block: 0.5rem; }
}

@media (max-width: 760px) {
  body { background: var(--bg); }
  .prototype-shell { display: block; min-height: 100svh; padding: 0; }
  .prototype-note { display: none; }
  .phone { width: 100%; height: 100svh; min-height: 0; padding: 0; border: 0; border-radius: 0; box-shadow: none; }
  .safe-area { border-radius: 0; padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
  .safe-area::before { display: none; }
  .screen { padding-inline: 1rem; }
}

@media (max-height: 740px) and (min-width: 761px) {
  .phone { height: 96svh; min-height: 34rem; }
  .scene--hero, .scene--large, .scene--proposal { min-height: 11rem; }
  .screen { gap: 0.65rem; }
}

/* Standalone demo shell: full browser on desktop, device preview only in mobile mode. */
.demo-toolbar {
  height: 4.25rem;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  padding: 0 1.25rem;
  border-bottom: 1px solid rgba(113, 128, 158, 0.35);
  background: #070c16;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.34);
  position: relative;
  z-index: 20;
}

.demo-toolbar__back {
  width: fit-content;
  color: #c5cfdf;
  text-decoration: none;
  font: 800 0.68rem/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.06em;
}

.demo-toolbar__back:hover { color: #fff; }

.demo-toolbar__brand {
  color: #fff;
  font: 900 0.78rem/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.08em;
}

.demo-toolbar__brand span { color: var(--accent); }

.demo-toolbar__modes {
  justify-self: end;
  display: flex;
  gap: 0.3rem;
  padding: 0.3rem;
  border: 1px solid rgba(113, 128, 158, 0.45);
  background: #0d1627;
}

.demo-toolbar__modes button {
  min-height: 2.15rem;
  border: 1px solid transparent;
  padding: 0 0.75rem;
  color: #8f9cb1;
  background: transparent;
  cursor: pointer;
  font: 800 0.62rem/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.05em;
}

.demo-toolbar__modes button[aria-pressed="true"] {
  border-color: var(--focus);
  color: #fff;
  background: #17263d;
}

body:not(.is-embedded) {
  height: 100svh;
  overflow: hidden;
}

body:not(.is-embedded) .prototype-shell {
  width: 100%;
  height: calc(100svh - 4.25rem);
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr;
  place-items: center;
  gap: 0;
  padding: 0;
}

body.mode-desktop:not(.is-embedded) .phone {
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: var(--bg);
  box-shadow: none;
}

body.mode-desktop:not(.is-embedded) .safe-area { border-radius: 0; }
body.mode-desktop:not(.is-embedded) .safe-area::before { display: none; }

@media (min-width: 761px) {
  body.mode-desktop:not(.is-embedded) .cover-screen {
    width: 100% !important;
    max-width: none !important;
    min-height: 100%;
    margin: 0;
    overflow: hidden;
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 1rem;
    padding: clamp(2rem, 5vw, 5rem) clamp(2rem, 7vw, 7rem);
  }

  body.mode-desktop:not(.is-embedded) .cover-screen::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(90deg, rgba(3, 8, 17, 0.94) 0%, rgba(3, 8, 17, 0.78) 32%, rgba(3, 8, 17, 0.18) 62%, transparent 100%);
  }

  body.mode-desktop:not(.is-embedded) .cover-screen .scene--hero {
    width: 100%;
    height: 100%;
    max-height: none;
    min-height: 100%;
    position: absolute;
    inset: 0;
    z-index: -2;
    border: 0;
    box-shadow: none;
  }

  body.mode-desktop:not(.is-embedded) .cover-screen .scene-caption { display: none; }
  body.mode-desktop:not(.is-embedded) .cover-screen .eyebrow { align-self: flex-start; }
  body.mode-desktop:not(.is-embedded) .cover-screen .logo-title { font-size: clamp(4rem, 8vw, 7rem) !important; }
  body.mode-desktop:not(.is-embedded) .cover-screen .logo-title,
  body.mode-desktop:not(.is-embedded) .cover-screen .subtitle,
  body.mode-desktop:not(.is-embedded) .cover-screen .microcopy { max-width: 30rem; text-align: left; }
  body.mode-desktop:not(.is-embedded) .cover-screen .screen-actions { width: min(24rem, 100%); }

  body.mode-desktop:not(.is-embedded) .intro-screen,
  body.mode-desktop:not(.is-embedded) .memory-screen {
    width: min(100%, 76rem);
    max-width: none;
    min-height: 100%;
    display: grid;
    grid-template-columns: minmax(28rem, 1.25fr) minmax(18rem, 0.75fr);
    grid-template-rows: auto auto 1fr auto;
    grid-template-areas:
      "scene level"
      "scene title"
      "scene copy"
      "scene action";
    align-items: center;
    gap: 0.8rem 1.5rem;
    padding-block: 1.25rem;
  }

  body.mode-desktop:not(.is-embedded) .intro-screen .level-pill,
  body.mode-desktop:not(.is-embedded) .memory-screen .level-pill { grid-area: level; }
  body.mode-desktop:not(.is-embedded) .intro-screen > h1 { grid-area: title; }
  body.mode-desktop:not(.is-embedded) .intro-screen .scene,
  body.mode-desktop:not(.is-embedded) .memory-screen .scene {
    grid-area: scene;
    width: 100%;
    height: min(66svh, 34rem);
    min-height: 22rem;
    max-height: 34rem;
  }
  body.mode-desktop:not(.is-embedded) .intro-screen .dialog-card,
  body.mode-desktop:not(.is-embedded) .memory-screen .dialog-card { grid-area: copy; }
  body.mode-desktop:not(.is-embedded) .intro-screen > .primary-button,
  body.mode-desktop:not(.is-embedded) .memory-screen > .primary-button { grid-area: action; }

  body.mode-desktop:not(.is-embedded) .question-screen {
    width: min(100%, 76rem);
    max-width: none;
    min-height: 100%;
    display: grid;
    grid-template-columns: minmax(26rem, 1fr) minmax(24rem, 1fr);
    grid-template-rows: auto auto 1fr auto auto;
    grid-template-areas:
      "scene level"
      "scene question"
      "scene choices"
      "scene feedback"
      "scene action";
    align-items: center;
    gap: 0.55rem 1.25rem;
    padding-block: 1rem;
  }

  body.mode-desktop:not(.is-embedded) .question-screen .level-pill { grid-area: level; }
  body.mode-desktop:not(.is-embedded) .question-screen .scene {
    grid-area: scene;
    width: 100%;
    height: min(66svh, 34rem);
    min-height: 22rem;
    max-height: 34rem;
  }
  body.mode-desktop:not(.is-embedded) .question-screen .question-card { grid-area: question; }
  body.mode-desktop:not(.is-embedded) .question-screen .choice-list { grid-area: choices; gap: 0.4rem; }
  body.mode-desktop:not(.is-embedded) .question-screen .feedback { grid-area: feedback; padding: 0.65rem 0.8rem; }
  body.mode-desktop:not(.is-embedded) .question-screen > .primary-button { grid-area: action; }
  body.mode-desktop:not(.is-embedded) .question-screen .choice-button { min-height: 2.65rem; }

  body.mode-desktop:not(.is-embedded) .invitation-screen,
  body.mode-desktop:not(.is-embedded) .ending-screen {
    width: min(100%, 76rem);
    max-width: none;
    min-height: 100%;
    display: grid;
    grid-template-columns: minmax(28rem, 1.2fr) minmax(20rem, 0.8fr);
    grid-template-rows: auto 1fr auto;
    grid-template-areas:
      "scene label"
      "scene copy"
      "scene actions";
    align-items: center;
    gap: 0.8rem 1.5rem;
    padding-block: 1.25rem;
  }
  body.mode-desktop:not(.is-embedded) .invitation-screen .level-pill,
  body.mode-desktop:not(.is-embedded) .ending-screen .eyebrow { grid-area: label; }
  body.mode-desktop:not(.is-embedded) .invitation-screen .scene,
  body.mode-desktop:not(.is-embedded) .ending-screen .scene {
    grid-area: scene;
    width: 100%;
    height: min(66svh, 34rem);
    min-height: 22rem;
    max-height: 34rem;
  }
  body.mode-desktop:not(.is-embedded) .invitation-screen .proposal-copy,
  body.mode-desktop:not(.is-embedded) .ending-screen .epilogue-copy { grid-area: copy; }
  body.mode-desktop:not(.is-embedded) .invitation-screen .screen-actions,
  body.mode-desktop:not(.is-embedded) .ending-screen > .secondary-button { grid-area: actions; }
}

body.mode-mobile:not(.is-embedded) .prototype-shell {
  padding: 0.75rem;
  background:
    radial-gradient(circle at 50% 42%, rgba(58, 91, 151, 0.22), transparent 27rem),
    #0a101c;
}

body.mode-mobile:not(.is-embedded) .phone {
  width: min(27rem, calc(100vw - 1.5rem));
  height: min(calc(100svh - 5.75rem), 54rem);
  min-height: 0;
  padding: 0.7rem;
  border: 1px solid #697389;
  border-radius: 2.7rem;
  background: #03060c;
  box-shadow: var(--shadow), inset 0 0 0 3px #1e2634;
}

body.mode-mobile:not(.is-embedded) .safe-area { border-radius: 2rem; }
body.mode-mobile:not(.is-embedded) .safe-area::before { display: block; }

body.mode-mobile:not(.is-embedded) .screen:not(.plan-screen):not(.loading-screen) {
  width: 100%;
  max-width: none;
  margin-inline: 0;
  padding: 1.15rem 1.15rem 1.5rem;
}

body.mode-mobile:not(.is-embedded) .cover-screen {
  display: flex;
  flex-direction: column;
  grid-template-columns: none;
  grid-template-rows: none;
  align-items: stretch;
  gap: 0.6rem;
  padding: 0.85rem 1rem 1rem;
}

body.mode-mobile:not(.is-embedded) .cover-screen .eyebrow { align-self: center; }
body.mode-mobile:not(.is-embedded) .cover-screen .logo-title,
body.mode-mobile:not(.is-embedded) .cover-screen .subtitle,
body.mode-mobile:not(.is-embedded) .cover-screen .microcopy { text-align: center; }
body.mode-mobile:not(.is-embedded) .cover-screen .logo-title { font-size: 3.45rem !important; }
body.mode-mobile:not(.is-embedded) .cover-screen .scene--hero {
  width: auto;
  height: 12.5rem;
  min-height: 12.5rem;
  max-height: 12.5rem;
  flex: 0 0 12.5rem;
  position: relative;
  inset: auto;
  border: 1px solid var(--line);
  box-shadow: 0 0 0 3px rgba(8, 13, 24, 0.75), 0 8px 22px rgba(0, 0, 0, 0.32);
}
body.mode-mobile:not(.is-embedded) .cover-screen .screen-actions { gap: 0.45rem; }
body.mode-mobile:not(.is-embedded) .cover-screen .microcopy { display: none; }
body.mode-mobile:not(.is-embedded) .cover-screen .primary-button,
body.mode-mobile:not(.is-embedded) .cover-screen .secondary-button { min-height: 2.8rem; padding-block: 0.55rem; }

.is-embedded .demo-toolbar { display: none; }

@media (max-width: 620px) {
  .demo-toolbar {
    height: 3.75rem;
    grid-template-columns: auto 1fr;
    padding: 0 0.65rem;
  }

  .demo-toolbar__brand { display: none; }
  .demo-toolbar__back { font-size: 0; }
  .demo-toolbar__back::after { content: "← VOLVER"; font-size: 0.62rem; }
  .demo-toolbar__modes button { min-height: 2rem; padding-inline: 0.55rem; font-size: 0.56rem; }
  body:not(.is-embedded) .prototype-shell { height: calc(100svh - 3.75rem); }
  body.mode-mobile:not(.is-embedded) .phone { height: calc(100svh - 4.25rem); border-radius: 2rem; }
  body.mode-mobile:not(.is-embedded) .safe-area { border-radius: 1.4rem; }
}

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