@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Oswald:wght@500;600;700&display=swap');

:root {
  --bg: #08070a;
  --panel: #111015;
  --panel-2: #17151b;
  --text: #f6f3f7;
  --muted: #aaa4ad;
  --line: rgba(255,255,255,.12);
  --blood: #d21f35;
  --blood-dark: #77101d;
  --glow: rgba(210,31,53,.36);
  --max: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 78% 8%, rgba(117,14,30,.18), transparent 31rem),
    linear-gradient(180deg, #09080b 0%, #070608 100%);
  color: var(--text);
  font-family: "DM Sans", system-ui, sans-serif;
  overflow-x: hidden;
}
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .035;
  z-index: 100;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.7'/%3E%3C/svg%3E");
}

.site-header {
  width: min(calc(100% - 32px), var(--max));
  margin: 0 auto;
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.brand {
  color: var(--text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.18);
  background: linear-gradient(145deg, #1a171e, #0a090c);
  box-shadow: inset 0 0 20px rgba(255,255,255,.03), 0 0 26px rgba(210,31,53,.12);
  font-family: "Oswald", sans-serif;
  letter-spacing: .08em;
}
.brand strong {
  display: block;
  font-family: "Oswald", sans-serif;
  letter-spacing: .09em;
  font-size: 1.02rem;
}
.brand small {
  display: block;
  color: var(--muted);
  margin-top: 2px;
  font-size: .72rem;
}
.header-actions { display: flex; gap: 8px; align-items: center; }
.icon-button, .ghost-button, .text-button, .drawer-close {
  color: var(--text);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
}
.icon-button {
  width: 42px;
  height: 42px;
}
.icon-button[aria-pressed="true"] {
  border-color: rgba(210,31,53,.7);
  box-shadow: 0 0 20px var(--glow);
}
.sound-off { display: none; }
.icon-button[aria-pressed="false"] .sound-on { display: none; }
.icon-button[aria-pressed="false"] .sound-off { display: inline; }
.ghost-button {
  min-height: 42px;
  padding: 0 17px;
  font-weight: 600;
}
.ghost-button:hover, .icon-button:hover { border-color: rgba(255,255,255,.32); }

main { overflow: hidden; }
.hero {
  width: min(calc(100% - 32px), var(--max));
  margin: 0 auto;
  min-height: 720px;
  display: grid;
  grid-template-columns: 1.04fr .96fr;
  align-items: center;
  gap: 6vw;
  padding: 72px 0;
}
.eyebrow {
  margin: 0 0 13px;
  color: #e46b7a;
  letter-spacing: .18em;
  font-size: .75rem;
  font-weight: 700;
}
.hero h1 {
  font-family: "Oswald", sans-serif;
  font-size: clamp(4.8rem, 12vw, 10rem);
  line-height: .82;
  margin: 0;
  letter-spacing: -.035em;
}
.hero h1 span {
  color: var(--blood);
  text-shadow: 0 0 42px var(--glow);
}
.lead {
  max-width: 650px;
  font-size: clamp(1.06rem, 2vw, 1.3rem);
  line-height: 1.7;
  color: #d7d1d9;
  margin: 30px 0 22px;
}
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 28px;
}
.hero-meta span {
  font-size: .77rem;
  color: var(--muted);
  padding: 8px 11px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.025);
}
.primary-button {
  border: 0;
  border-radius: 8px;
  min-height: 54px;
  padding: 0 22px;
  background: linear-gradient(180deg, #e3263d 0%, #aa1326 100%);
  color: white;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 12px 36px rgba(210,31,53,.24);
}
.primary-button:hover { filter: brightness(1.08); }
.microcopy {
  color: #7f7982;
  font-size: .75rem;
  margin-top: 12px;
}

.hero-art {
  position: relative;
  min-height: 570px;
  display: grid;
  place-items: center;
  perspective: 1200px;
}
.hero-art::before {
  content: "";
  position: absolute;
  width: 90%;
  height: 90%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(142,15,34,.18), transparent 65%);
  filter: blur(12px);
}
.door-frame {
  width: min(72vw, 340px);
  height: min(120vw, 530px);
  position: relative;
  padding: 17px;
  background: linear-gradient(90deg, #161219, #2a232d 45%, #0d0b10);
  box-shadow:
    0 45px 90px rgba(0,0,0,.78),
    inset 0 0 26px rgba(255,255,255,.025);
  transform: rotateY(-8deg) rotateX(1deg);
}
.door {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(255,255,255,.025), transparent 16%, transparent 78%, rgba(0,0,0,.32)),
    linear-gradient(180deg, #221e24, #0c0a0e);
  border: 1px solid rgba(255,255,255,.08);
}
.door::before {
  content: "";
  position: absolute;
  inset: 7% 8%;
  border: 1px solid rgba(255,255,255,.07);
  box-shadow: inset 0 0 70px rgba(0,0,0,.6);
}
.room-number {
  position: absolute;
  top: 21%;
  left: 50%;
  transform: translateX(-50%);
  font-family: "Oswald", sans-serif;
  font-size: 4.5rem;
  color: #b8aeb9;
  letter-spacing: -.04em;
  text-shadow: 0 4px 12px #000;
}
.door-light {
  position: absolute;
  left: 50%;
  top: 19%;
  width: 105px;
  height: 105px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(210,31,53,.17), transparent 67%);
  animation: pulse 4.2s ease-in-out infinite;
}
.handle {
  position: absolute;
  right: 12%;
  top: 54%;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #b7aeb9, #3a333d 52%, #161217);
  box-shadow: 0 0 0 5px rgba(0,0,0,.25);
}
.hallway-glow {
  position: absolute;
  right: -8px;
  top: 18%;
  width: 9px;
  height: 66%;
  background: linear-gradient(180deg, transparent, #b3162b 25%, #e33a4f 52%, #8b0b1d 80%, transparent);
  filter: blur(3px);
  opacity: .85;
  animation: breathe 5s ease-in-out infinite;
}
@keyframes pulse { 50% { transform: translateX(-50%) scale(1.14); opacity:.72; } }
@keyframes breathe { 50% { opacity:.35; } }

.story-shell, .result-panel {
  width: min(calc(100% - 32px), 860px);
  margin: 0 auto 90px;
}
.hidden { display: none !important; }
.story-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: .75rem;
  letter-spacing: .12em;
}
.text-button {
  padding: 8px 12px;
  font-size: .75rem;
}
.progress-track {
  height: 3px;
  background: #201d22;
  margin: 12px 0 22px;
}
.progress-track span {
  display: block;
  height: 100%;
  width: 25%;
  background: var(--blood);
  box-shadow: 0 0 15px var(--glow);
  transition: width .35s ease;
}
.story-card {
  background:
    radial-gradient(circle at 87% 13%, rgba(120,14,30,.13), transparent 18rem),
    linear-gradient(145deg, #17141a, #0e0d11);
  border: 1px solid var(--line);
  padding: clamp(28px, 6vw, 58px);
  box-shadow: 0 35px 90px rgba(0,0,0,.38);
}
.story-card h2, .result-panel h2, .section-heading h2, .premium-card h2, .manifesto h2 {
  font-family: "Oswald", sans-serif;
  font-size: clamp(2rem, 6vw, 4.2rem);
  line-height: 1.04;
  margin: 0;
}
.story-card > p:not(.eyebrow) {
  color: #d6d0d8;
  font-size: 1.08rem;
  line-height: 1.75;
  margin: 22px 0 30px;
}
.choice-list {
  display: grid;
  gap: 12px;
}
.choice-button {
  width: 100%;
  text-align: left;
  color: var(--text);
  background: rgba(255,255,255,.025);
  border: 1px solid var(--line);
  padding: 17px 18px;
  cursor: pointer;
  transition: .2s ease;
}
.choice-button:hover {
  transform: translateX(4px);
  border-color: rgba(210,31,53,.66);
  background: rgba(210,31,53,.07);
}

.result-panel {
  text-align: center;
  background:
    radial-gradient(circle at 50% 0%, rgba(160,16,37,.22), transparent 25rem),
    #111015;
  border: 1px solid var(--line);
  padding: clamp(38px, 8vw, 72px);
}
.result-panel > p:not(.eyebrow) {
  max-width: 620px;
  margin: 22px auto 30px;
  color: #d0cad2;
  line-height: 1.7;
}
.result-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin: 28px 0;
}
.result-stats > div { padding: 22px 12px; }
.result-stats > div + div { border-left: 1px solid var(--line); }
.result-stats strong {
  display: block;
  font-family: "Oswald", sans-serif;
  font-size: 1.5rem;
}
.result-stats span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: .75rem;
}
.result-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

.vault-section, .premium-section, .manifesto {
  width: min(calc(100% - 32px), var(--max));
  margin: 0 auto;
}
.vault-section { padding: 90px 0 70px; }
.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}
.section-heading h2 {
  font-size: clamp(2.4rem, 7vw, 5rem);
  max-width: 760px;
}
.vault-count {
  white-space: nowrap;
  color: var(--muted);
  font-size: .78rem;
  border: 1px solid var(--line);
  padding: 8px 11px;
}
.vault-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.vault-card {
  min-height: 280px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(180deg, transparent 40%, rgba(0,0,0,.74)),
    radial-gradient(circle at 75% 15%, rgba(155,18,39,.2), transparent 12rem),
    #151219;
  border: 1px solid var(--line);
}
.vault-card:nth-child(2) {
  background:
    linear-gradient(180deg, transparent 40%, rgba(0,0,0,.74)),
    radial-gradient(circle at 35% 10%, rgba(72,74,93,.22), transparent 12rem),
    #111116;
}
.vault-card:nth-child(3) {
  background:
    linear-gradient(180deg, transparent 40%, rgba(0,0,0,.74)),
    radial-gradient(circle at 70% 15%, rgba(117,135,159,.18), transparent 12rem),
    #101216;
}
.vault-tag {
  align-self: flex-start;
  font-size: .65rem;
  letter-spacing: .14em;
  color: #e98290;
  border: 1px solid rgba(210,31,53,.3);
  padding: 6px 8px;
}
.vault-card h3 {
  font-family: "Oswald", sans-serif;
  font-size: 2rem;
  margin: auto 0 10px;
}
.vault-card p {
  color: #c6c0c8;
  line-height: 1.55;
  margin: 0 0 18px;
}
.vault-meta {
  color: #817b84;
  font-size: .72rem;
}

.premium-section { padding: 30px 0 95px; }
.premium-card {
  padding: clamp(30px, 7vw, 70px);
  border: 1px solid rgba(210,31,53,.38);
  background:
    radial-gradient(circle at 86% 18%, rgba(210,31,53,.23), transparent 24rem),
    linear-gradient(135deg, #19151b, #0c0b0e);
  box-shadow: 0 35px 100px rgba(0,0,0,.35);
}
.premium-card h2 { font-size: clamp(2.6rem, 7vw, 5.5rem); }
.premium-card > p:not(.eyebrow) {
  max-width: 720px;
  color: #cfc8d1;
  line-height: 1.7;
  font-size: 1.05rem;
}
.price-row {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin: 28px 0;
}
.price-row strong {
  font-family: "Oswald", sans-serif;
  font-size: 2.2rem;
}
.price-row strong span, .price-row > span {
  color: var(--muted);
  font-family: "DM Sans", sans-serif;
  font-size: .9rem;
}
.disabled-demo { opacity: .68; cursor: not-allowed; }

.manifesto {
  text-align: center;
  padding: 110px 0 130px;
}
.manifesto h2 {
  max-width: 900px;
  margin: 0 auto;
  font-size: clamp(2.8rem, 8vw, 6.7rem);
}
.manifesto > p:last-child {
  max-width: 670px;
  margin: 24px auto 0;
  color: var(--muted);
  line-height: 1.7;
}

.drawer {
  position: fixed;
  inset: 0;
  z-index: 120;
  pointer-events: none;
}
.drawer[aria-hidden="false"] { pointer-events: auto; }
.drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.7);
  opacity: 0;
  transition: .25s ease;
}
.drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(90vw, 410px);
  height: 100%;
  background: #111015;
  border-left: 1px solid var(--line);
  padding: 70px 26px 30px;
  transform: translateX(102%);
  transition: .28s ease;
}
.drawer[aria-hidden="false"] .drawer-backdrop { opacity: 1; }
.drawer[aria-hidden="false"] .drawer-panel { transform: translateX(0); }
.drawer-close {
  position: absolute;
  top: 17px;
  right: 17px;
  width: 42px;
  height: 42px;
  font-size: 1.6rem;
}
.drawer-panel h2 {
  font-family: "Oswald", sans-serif;
  font-size: 2.5rem;
  margin: 0 0 30px;
}
.profile-stat {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 17px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}
.profile-stat strong { color: var(--text); text-align: right; }
.drawer-note {
  margin-top: 28px;
  color: #8d8790;
  line-height: 1.6;
  font-size: .82rem;
}
.site-footer {
  width: min(calc(100% - 32px), var(--max));
  margin: 0 auto;
  border-top: 1px solid var(--line);
  padding: 30px 0 45px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: #736e76;
  font-size: .72rem;
}
.site-footer strong { color: #a7a0a9; letter-spacing: .09em; }

@media (max-width: 800px) {
  .site-header { min-height: 72px; }
  .brand small { display: none; }
  .ghost-button { padding: 0 13px; font-size: .82rem; }
  .hero {
    min-height: auto;
    grid-template-columns: 1fr;
    padding: 52px 0 82px;
  }
  .hero-copy { order: 2; }
  .hero-art {
    order: 1;
    min-height: 440px;
  }
  .door-frame {
    width: 245px;
    height: 390px;
  }
  .room-number { font-size: 3.5rem; }
  .vault-grid { grid-template-columns: 1fr; }
  .vault-card { min-height: 250px; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .site-footer { flex-direction: column; }
}

@media (max-width: 520px) {
  .site-header { width: min(calc(100% - 22px), var(--max)); }
  .hero, .story-shell, .result-panel, .vault-section, .premium-section, .manifesto, .site-footer {
    width: min(calc(100% - 22px), var(--max));
  }
  .brand strong { font-size: .88rem; }
  .brand-mark { width: 38px; height: 38px; }
  .header-actions .ghost-button { font-size: 0; width: 42px; padding: 0; }
  .header-actions .ghost-button::after { content: "SF"; font-size: .78rem; }
  .hero { padding-top: 36px; }
  .hero-art { min-height: 390px; }
  .door-frame { width: 215px; height: 345px; }
  .hero h1 { font-size: 5.35rem; }
  .lead { margin-top: 24px; font-size: 1rem; }
  .primary-button { width: 100%; }
  .result-actions .ghost-button { width: 100%; }
  .result-stats { grid-template-columns: 1fr; }
  .result-stats > div + div { border-left: 0; border-top: 1px solid var(--line); }
  .price-row { flex-direction: column; gap: 3px; }
}


/* v0.2: clearer header controls and longer-story reading layout */
.header-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}
.header-control {
  min-height: 42px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.025);
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
}
.header-control:hover {
  border-color: rgba(255,255,255,.34);
}
.header-control[aria-pressed="true"] {
  border-color: rgba(210,31,53,.72);
  box-shadow: 0 0 20px var(--glow);
}
.control-icon {
  font-size: .95rem;
  color: #e46b7a;
}
.story-card {
  min-height: 470px;
}
.story-card > p:not(.eyebrow) {
  white-space: pre-line;
}
.choice-button {
  line-height: 1.45;
}
.story-topline {
  position: sticky;
  top: 0;
  z-index: 4;
  padding: 10px 0;
  background: linear-gradient(180deg, rgba(8,7,10,.98), rgba(8,7,10,.92));
}

@media (max-width: 800px) {
  .site-header {
    min-height: 112px;
    padding: 14px 0;
    align-items: flex-start;
    flex-direction: column;
  }
  .header-actions {
    width: 100%;
  }
  .header-control {
    flex: 1;
    justify-content: center;
  }
  .brand small {
    display: block;
  }
}

@media (max-width: 520px) {
  .header-actions .header-control {
    width: auto;
    padding: 0 12px;
    font-size: .78rem;
  }
  .header-actions .header-control::after {
    content: none !important;
  }
  .brand strong {
    font-size: .96rem;
  }
  .story-card {
    min-height: 520px;
  }
}


/* v0.3 — explicit mobile-safe header controls */
.header-actions {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
}
.top-control {
  -webkit-appearance: none !important;
  appearance: none !important;
  min-height: 48px !important;
  padding: 7px 13px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 9px !important;
  border: 1px solid rgba(255,255,255,.15) !important;
  border-radius: 12px !important;
  background:
    linear-gradient(180deg, rgba(28,24,31,.96), rgba(12,10,14,.96)) !important;
  color: #f6f3f7 !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.035),
    0 9px 26px rgba(0,0,0,.28) !important;
  cursor: pointer !important;
}
.top-control:active {
  transform: translateY(1px);
}
.top-control[aria-pressed="true"] {
  border-color: rgba(210,31,53,.7) !important;
  background:
    radial-gradient(circle at 20% 20%, rgba(210,31,53,.16), transparent 55%),
    linear-gradient(180deg, rgba(35,25,30,.98), rgba(15,10,13,.98)) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.04),
    0 0 24px rgba(210,31,53,.22) !important;
}
.top-control-icon {
  width: 21px;
  height: 21px;
  flex: 0 0 21px;
  fill: none;
  stroke: #e46b7a;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.top-control-copy {
  display: grid;
  gap: 1px;
  text-align: left;
  white-space: nowrap;
}
.top-control-copy strong {
  font-size: .78rem;
  line-height: 1.1;
  color: #f7f3f7;
}
.top-control-copy small {
  font-size: .62rem;
  line-height: 1.1;
  color: #918a94;
}
#soundToggle[aria-pressed="true"] .sound-wave {
  opacity: 1;
}
#soundToggle[aria-pressed="false"] .sound-wave {
  opacity: .22;
}

/* Richer story presentation */
.story-card {
  min-height: 560px;
  background:
    radial-gradient(circle at 86% 10%, rgba(123,14,31,.17), transparent 22rem),
    radial-gradient(circle at 12% 85%, rgba(55,45,61,.12), transparent 25rem),
    linear-gradient(145deg, #17141a, #0d0c10);
}
.story-card > p:not(.eyebrow) {
  white-space: pre-line;
  font-size: clamp(1.02rem, 2.3vw, 1.15rem);
  line-height: 1.84;
  letter-spacing: .003em;
  color: #d9d3db;
  text-wrap: pretty;
}
.choice-button {
  border-radius: 8px;
  padding: 18px 19px;
  line-height: 1.5;
}
.choice-button::before {
  content: "›";
  color: #e46b7a;
  margin-right: 9px;
}
.progress-track {
  height: 4px;
}

@media (max-width: 800px) {
  .site-header {
    align-items: stretch !important;
  }
  .header-actions {
    width: 100% !important;
  }
  .top-control {
    flex: 1 1 0 !important;
    justify-content: flex-start !important;
  }
}
@media (max-width: 520px) {
  .top-control {
    min-width: 0 !important;
    padding: 7px 9px !important;
  }
  .top-control-copy strong {
    font-size: .72rem;
  }
  .top-control-copy small {
    font-size: .56rem;
  }
  .top-control-icon {
    width: 18px;
    height: 18px;
    flex-basis: 18px;
  }
  .story-card {
    min-height: 640px;
    padding: 30px 22px;
  }
}


/* ================================================================
   v0.4 — Cinematic Story Pass
   ================================================================ */

.story-shell {
  position: relative;
}

.story-card {
  overflow: hidden;
  padding: 0 !important;
  min-height: 0 !important;
}

.story-copy {
  padding: clamp(30px, 6vw, 58px);
}

.scene-visual {
  position: relative;
  height: clamp(210px, 42vw, 370px);
  overflow: hidden;
  border-bottom: 1px solid rgba(255,255,255,.09);
  background:
    radial-gradient(circle at 68% 32%, rgba(157,20,42,.25), transparent 30%),
    linear-gradient(155deg, #17131a, #08070a 72%);
  isolation: isolate;
}

.scene-visual::before,
.scene-visual::after,
.scene-visual-prop::before,
.scene-visual-prop::after {
  content: "";
  position: absolute;
}

.scene-visual::after {
  inset: 0;
  z-index: 8;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(0,0,0,.08), rgba(0,0,0,.58)),
    radial-gradient(circle at 50% 45%, transparent 0 25%, rgba(0,0,0,.45) 82%);
}

.scene-visual-grain {
  position: absolute;
  inset: 0;
  z-index: 9;
  opacity: .11;
  mix-blend-mode: screen;
  background-image:
    repeating-radial-gradient(circle at 30% 20%, rgba(255,255,255,.1) 0 1px, transparent 1px 4px);
  animation: visual-grain .32s steps(2) infinite;
}

.scene-visual-text {
  position: absolute;
  left: 18px;
  bottom: 15px;
  z-index: 12;
  color: rgba(255,255,255,.76);
  font-family: "Oswald", sans-serif;
  letter-spacing: .16em;
  font-size: .72rem;
  text-shadow: 0 2px 10px #000;
}

.scene-visual-prop {
  position: absolute;
  inset: 0;
  z-index: 4;
}

.scene-visual.is-entering {
  animation: scene-flicker .68s ease;
}

@keyframes visual-grain {
  0% { transform: translate(0,0); }
  50% { transform: translate(1px,-1px); }
  100% { transform: translate(-1px,1px); }
}

@keyframes scene-flicker {
  0% { opacity: .2; filter: brightness(.5); }
  18% { opacity: 1; filter: brightness(1.3); }
  28% { opacity: .55; filter: brightness(.75); }
  42% { opacity: 1; filter: brightness(1.08); }
  100% { opacity: 1; filter: none; }
}

/* Motel room / door */
.scene-visual[data-scene="room"] {
  background:
    radial-gradient(circle at 74% 48%, rgba(203,28,52,.24), transparent 19%),
    linear-gradient(90deg, #08070a 0 16%, #171319 16% 84%, #070609 84%);
}
.scene-visual[data-scene="room"] .scene-visual-prop::before {
  width: 31%;
  height: 78%;
  left: 34.5%;
  top: 11%;
  border: 10px solid #252029;
  background:
    radial-gradient(circle at 82% 52%, #9a8e9c 0 3px, #302a32 4px 8px, transparent 9px),
    linear-gradient(180deg, #171319, #09080b);
  box-shadow: 24px 0 27px rgba(185,20,43,.22), 0 30px 55px #000;
}
.scene-visual[data-scene="room"] .scene-visual-prop::after {
  content: "13";
  left: 45%;
  top: 28%;
  color: #c7bac8;
  font: 700 clamp(2.2rem, 7vw, 4.2rem)/1 "Oswald", sans-serif;
  text-shadow: 0 0 20px rgba(210,31,53,.35);
}

/* Telephone */
.scene-visual[data-scene="phone"] {
  background:
    radial-gradient(circle at 50% 74%, rgba(198,24,47,.18), transparent 34%),
    linear-gradient(180deg, #121016, #070609);
}
.scene-visual[data-scene="phone"] .scene-visual-prop::before {
  width: 35%;
  height: 24%;
  left: 32.5%;
  top: 45%;
  border-radius: 48% 48% 17% 17%;
  background: linear-gradient(180deg, #514752, #171318);
  box-shadow: 0 25px 50px #000, inset 0 2px 0 rgba(255,255,255,.14);
}
.scene-visual[data-scene="phone"] .scene-visual-prop::after {
  width: 45%;
  height: 12%;
  left: 27.5%;
  top: 35%;
  border-radius: 999px;
  border: 8px solid #393039;
  background: #0a090b;
  transform: rotate(-3deg);
  box-shadow: 0 8px 22px #000;
  animation: receiver-tremble 3.8s ease-in-out infinite;
}
@keyframes receiver-tremble {
  0%, 86%, 100% { transform: rotate(-3deg) translateX(0); }
  89% { transform: rotate(-2deg) translateX(2px); }
  92% { transform: rotate(-4deg) translateX(-2px); }
  95% { transform: rotate(-3deg) translateX(1px); }
}

/* Mirror */
.scene-visual[data-scene="mirror"],
.scene-visual[data-scene="glass"] {
  background:
    radial-gradient(circle at 52% 40%, rgba(177,198,211,.14), transparent 31%),
    linear-gradient(135deg, #16171b, #07080a);
}
.scene-visual[data-scene="mirror"] .scene-visual-prop::before,
.scene-visual[data-scene="glass"] .scene-visual-prop::before {
  width: 39%;
  height: 76%;
  left: 30.5%;
  top: 10%;
  border: 10px solid #27252b;
  background:
    linear-gradient(110deg, rgba(255,255,255,.14), transparent 22% 58%, rgba(255,255,255,.05)),
    linear-gradient(180deg, #32333a, #111217);
  box-shadow: 0 30px 65px #000;
}
.scene-visual[data-scene="mirror"] .scene-visual-prop::after {
  width: 19%;
  height: 40%;
  left: 40.5%;
  top: 31%;
  border-radius: 45% 45% 38% 38%;
  background: rgba(9,8,11,.8);
  filter: blur(2px);
  animation: mirror-press 4s ease-in-out infinite;
}
@keyframes mirror-press {
  50% { transform: scale(1.06); opacity: .72; }
}
.scene-visual[data-scene="glass"] {
  background:
    repeating-conic-gradient(from 8deg at 50% 48%, rgba(255,255,255,.11) 0 1deg, transparent 1deg 17deg),
    radial-gradient(circle, rgba(186,208,220,.15), transparent 48%),
    #0b0b0f;
}

/* Door / visitor */
.scene-visual[data-scene="door"] {
  background:
    linear-gradient(90deg, #0a090c, #19161c 38% 62%, #09080b);
}
.scene-visual[data-scene="door"] .scene-visual-prop::before {
  width: 42%;
  height: 92%;
  left: 29%;
  top: 8%;
  background: linear-gradient(180deg, #1d191f, #09080b);
  border-left: 8px solid #2b252d;
  border-right: 8px solid #141116;
  box-shadow: inset 0 0 75px #000, 0 0 40px #000;
}
.scene-visual[data-scene="door"] .scene-visual-prop::after {
  width: 2px;
  height: 73%;
  left: 29%;
  top: 18%;
  background: #d51d38;
  box-shadow: 0 0 18px #e2233f;
  animation: door-seam 3.5s ease-in-out infinite;
}
@keyframes door-seam {
  50% { opacity: .3; box-shadow: 0 0 5px #d51d38; }
}

/* Hallway */
.scene-visual[data-scene="hallway"] {
  background:
    linear-gradient(90deg, rgba(0,0,0,.75), transparent 31% 69%, rgba(0,0,0,.78)),
    repeating-linear-gradient(90deg, #131016 0 10%, #29232b 10% 12%, #0b090d 12% 22%),
    linear-gradient(180deg, #17141a, #070609);
  perspective: 500px;
}
.scene-visual[data-scene="hallway"] .scene-visual-prop::before {
  width: 18%;
  height: 74%;
  left: 41%;
  top: 10%;
  clip-path: polygon(28% 0, 72% 0, 100% 100%, 0 100%);
  background: linear-gradient(180deg, rgba(191,25,48,.3), rgba(0,0,0,.1));
  filter: blur(7px);
}
.scene-visual[data-scene="hallway"] .scene-visual-prop::after {
  content: "13   13   13   13";
  left: 4%;
  right: 4%;
  top: 42%;
  color: rgba(220,211,222,.42);
  font: 600 clamp(1rem, 4vw, 2rem)/1 "Oswald", sans-serif;
  letter-spacing: 1.2em;
  white-space: nowrap;
  overflow: hidden;
}

/* Ledger */
.scene-visual[data-scene="ledger"] {
  background:
    radial-gradient(ellipse at 50% 55%, rgba(167,20,39,.18), transparent 45%),
    linear-gradient(180deg, #171218, #080709);
}
.scene-visual[data-scene="ledger"] .scene-visual-prop::before {
  width: 54%;
  height: 58%;
  left: 23%;
  top: 24%;
  border-radius: 4px 10px 10px 4px;
  background:
    repeating-linear-gradient(180deg, transparent 0 18px, rgba(95,22,34,.34) 19px 20px),
    linear-gradient(90deg, #d2c1aa 0 48%, #9b8977 49% 51%, #c7b59f 52%);
  transform: rotate(-4deg);
  box-shadow: 0 30px 55px #000;
}
.scene-visual[data-scene="ledger"] .scene-visual-prop::after {
  content: "YOUR NAME";
  left: 34%;
  top: 43%;
  color: #7f0d20;
  font: 700 clamp(.8rem, 3vw, 1.5rem)/1 "Oswald", sans-serif;
  letter-spacing: .12em;
  transform: rotate(-4deg);
}

/* Stairs / below bed */
.scene-visual[data-scene="stairs"] {
  background:
    linear-gradient(180deg, rgba(136,12,31,.25), transparent 32%),
    repeating-linear-gradient(165deg, #070609 0 18px, #1a161c 19px 32px);
}
.scene-visual[data-scene="stairs"] .scene-visual-prop::before {
  width: 14%;
  height: 67%;
  left: 43%;
  top: 22%;
  border-radius: 48% 48% 25% 25%;
  background: linear-gradient(180deg, #1d1920, #040305);
  box-shadow: 0 0 50px #000;
  animation: stair-figure 5s ease-in-out infinite;
}
@keyframes stair-figure {
  50% { transform: translateY(-11px); }
}

/* Motel office */
.scene-visual[data-scene="office"] {
  background:
    repeating-linear-gradient(90deg, transparent 0 45px, rgba(185,162,126,.12) 46px 48px),
    linear-gradient(180deg, #1d171b, #080709);
}
.scene-visual[data-scene="office"] .scene-visual-prop::before {
  width: 68%;
  height: 36%;
  left: 16%;
  bottom: 0;
  background: linear-gradient(180deg, #32242a, #120e12);
  box-shadow: 0 -10px 40px rgba(0,0,0,.7);
}
.scene-visual[data-scene="office"] .scene-visual-prop::after {
  content: "13  13  13  13  13";
  left: 19%;
  top: 17%;
  color: rgba(213,187,149,.52);
  font: 500 clamp(.8rem, 3vw, 1.4rem)/1 "Oswald", sans-serif;
  letter-spacing: .8em;
}

/* Fire / origin */
.scene-visual[data-scene="fire"] {
  background:
    radial-gradient(ellipse at 50% 100%, #dc2c20 0, #71101a 25%, transparent 63%),
    linear-gradient(180deg, #171014, #050405);
}
.scene-visual[data-scene="fire"] .scene-visual-prop::before {
  inset: 0;
  background:
    radial-gradient(ellipse at 24% 100%, rgba(255,120,40,.75), transparent 26%),
    radial-gradient(ellipse at 55% 100%, rgba(255,65,30,.66), transparent 32%),
    radial-gradient(ellipse at 78% 100%, rgba(241,135,44,.55), transparent 22%);
  filter: blur(9px);
  animation: fire-breathe 1.6s ease-in-out infinite alternate;
}
@keyframes fire-breathe {
  to { transform: scaleY(1.08) translateY(-5px); filter: blur(13px); }
}

/* Room zero / blueprint */
.scene-visual[data-scene="zero"] {
  background:
    linear-gradient(rgba(98,136,167,.14) 1px, transparent 1px),
    linear-gradient(90deg, rgba(98,136,167,.14) 1px, transparent 1px),
    radial-gradient(circle at 50% 50%, #14202b, #06080b 70%);
  background-size: 24px 24px, 24px 24px, auto;
}
.scene-visual[data-scene="zero"] .scene-visual-prop::after {
  content: "0";
  left: 46%;
  top: 28%;
  color: rgba(191,220,239,.58);
  font: 700 clamp(4rem, 13vw, 8rem)/1 "Oswald", sans-serif;
  text-shadow: 0 0 28px rgba(108,164,204,.25);
}

/* Television */
.scene-visual[data-scene="television"] {
  background: linear-gradient(180deg, #171419, #070609);
}
.scene-visual[data-scene="television"] .scene-visual-prop::before {
  width: 52%;
  height: 61%;
  left: 24%;
  top: 18%;
  border: 14px solid #29242b;
  border-radius: 14px;
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,.08) 0 1px, transparent 1px 4px),
    radial-gradient(circle, rgba(206,211,218,.18), #050507 75%);
  box-shadow: 0 28px 55px #000, inset 0 0 45px #000;
  animation: tv-static .17s steps(2) infinite;
}
@keyframes tv-static {
  50% { filter: brightness(1.35); transform: translateX(1px); }
}

/* Exit */
.scene-visual[data-scene="exit"] {
  background:
    linear-gradient(90deg, rgba(0,0,0,.82), transparent 42% 58%, rgba(0,0,0,.82)),
    linear-gradient(180deg, #17131a, #060507);
}
.scene-visual[data-scene="exit"] .scene-visual-prop::after {
  content: "EXIT";
  left: 37%;
  top: 36%;
  color: #ef2a45;
  font: 700 clamp(2.4rem, 9vw, 5.5rem)/1 "Oswald", sans-serif;
  letter-spacing: .08em;
  text-shadow: 0 0 12px #d4132d, 0 0 42px rgba(211,19,45,.72);
  animation: exit-flicker 3.2s steps(1) infinite;
}
@keyframes exit-flicker {
  0%, 8%, 12%, 62%, 68%, 100% { opacity: 1; }
  9%, 11%, 63%, 67% { opacity: .2; }
}

/* Choice transition */
.choice-transition {
  position: fixed;
  inset: 0;
  z-index: 160;
  display: grid;
  place-items: center;
  padding: 28px;
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(circle, rgba(126,12,29,.28), transparent 42%),
    rgba(3,2,4,.91);
  transition: opacity .22s ease;
}
.choice-transition span {
  max-width: 620px;
  text-align: center;
  color: #f4eef5;
  font-family: "Oswald", sans-serif;
  font-size: clamp(1.45rem, 5vw, 2.8rem);
  line-height: 1.25;
  letter-spacing: .025em;
  transform: translateY(12px);
  opacity: 0;
  transition: .28s ease .08s;
}
.choice-transition.is-active {
  opacity: 1;
}
.choice-transition.is-active span {
  opacity: 1;
  transform: translateY(0);
}

/* Result path */
.result-path {
  max-width: 640px;
  margin: -10px auto 30px !important;
  padding: 15px 18px;
  border-left: 2px solid rgba(210,31,53,.65);
  background: rgba(255,255,255,.025);
  color: #aaa3ac !important;
  font-size: .88rem;
  line-height: 1.6 !important;
  text-align: left;
}

/* Better story rhythm */
.story-card h2 {
  text-wrap: balance;
}
.story-card > .story-copy > p:not(.eyebrow) {
  margin-bottom: 34px;
}
.choice-list {
  opacity: 1;
  transform: translateY(0);
}
.choice-list.is-revealing {
  animation: reveal-choices .48s ease;
}
@keyframes reveal-choices {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.top-control {
  border-radius: 10px !important;
}
.top-control-copy strong {
  letter-spacing: .01em;
}

@media (max-width: 520px) {
  .scene-visual {
    height: 225px;
  }
  .story-copy {
    padding: 30px 21px 34px;
  }
  .scene-visual-text {
    left: 13px;
    bottom: 11px;
  }
  .top-control-copy small {
    display: none;
  }
  .top-control {
    justify-content: center !important;
  }
}


/* ================================================================
   v0.5 — Mobile Reading Layout
   ================================================================ */

/* Remove the oversized prose rules inherited from earlier versions. */
.story-copy {
  padding: clamp(26px, 5vw, 48px) !important;
  background: #111015;
}

.story-card h2 {
  max-width: 760px;
  margin: 0 0 23px !important;
  font-size: clamp(2rem, 5.4vw, 3.55rem) !important;
  line-height: 1.08 !important;
  letter-spacing: -.018em !important;
  text-wrap: balance;
}

/* Real paragraphs instead of one long text block. */
.story-prose {
  max-width: 720px;
  color: #ddd7df;
  font-size: clamp(1rem, 1.75vw, 1.08rem);
  line-height: 1.72;
  letter-spacing: 0;
  text-wrap: pretty;
}

.story-prose p {
  margin: 0;
}

.story-prose p + p {
  margin-top: 1.08em;
}

/* The first paragraph opens the scene without becoming giant. */
.story-prose p:first-child {
  color: #f0ebf1;
  font-size: 1.035em;
}

/* Choices are clearly separated from the prose. */
.choice-list {
  max-width: 720px;
  margin-top: 30px;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,.1);
  gap: 11px !important;
}

.choice-button {
  min-height: 58px;
  padding: 15px 17px !important;
  border-radius: 7px !important;
  font-size: .98rem;
  line-height: 1.42 !important;
  background: #161419 !important;
}

.choice-button::before {
  display: inline-block;
  width: 12px;
  margin-right: 7px !important;
}

/* Quieter label so the headline and prose do the work. */
.story-copy > .eyebrow {
  margin-bottom: 11px;
  font-size: .7rem;
}

/* The visual supports the story rather than dominating it. */
.scene-visual {
  height: clamp(175px, 32vw, 290px) !important;
}

/* Prevent previous min-height rules from creating long empty areas. */
.story-card,
.story-card .story-copy {
  min-height: 0 !important;
}

/* On phones, use normal book-like sizing and comfortable margins. */
@media (max-width: 600px) {
  .story-shell {
    width: calc(100% - 20px) !important;
    margin-bottom: 70px;
  }

  .story-card {
    border-radius: 0;
  }

  .scene-visual {
    height: 178px !important;
  }

  .story-copy {
    padding: 27px 19px 30px !important;
  }

  .story-card h2 {
    max-width: 100%;
    margin-bottom: 20px !important;
    font-size: clamp(2rem, 9.2vw, 2.65rem) !important;
    line-height: 1.06 !important;
  }

  .story-prose {
    font-size: 1rem !important;
    line-height: 1.68 !important;
  }

  .story-prose p + p {
    margin-top: 1.05em;
  }

  .choice-list {
    margin-top: 26px;
    padding-top: 21px;
  }

  .choice-button {
    min-height: 56px;
    padding: 14px 15px !important;
    font-size: .95rem;
  }

  .scene-visual-text {
    font-size: .64rem;
  }
}

/* Very narrow phones receive a little more breathing room. */
@media (max-width: 380px) {
  .story-copy {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  .story-card h2 {
    font-size: 2rem !important;
  }

  .story-prose {
    font-size: .97rem !important;
  }
}


/* v0.6 — Event-based sound only */
#soundToggle .top-control-copy strong {
  white-space: normal;
  line-height: 1.05;
}

@media (max-width: 520px) {
  #soundToggle .top-control-copy strong {
    max-width: 66px;
    text-align: left;
  }

  #soundToggle,
  #profileButton {
    min-height: 50px !important;
  }
}


/* ================================================================
   v0.7 — Reading-Only Suspense Experience
   ================================================================ */

/* With sound removed, keep the remaining header action compact. */
.header-actions {
  margin-left: auto;
}

.choice-transition {
  overflow-y: auto;
}

.choice-transition-card {
  width: min(100%, 620px);
  display: grid;
  justify-items: center;
  gap: 27px;
  padding: clamp(30px, 8vw, 58px) clamp(22px, 7vw, 48px);
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 10px;
  background:
    radial-gradient(circle at 50% 0%, rgba(144,16,35,.2), transparent 65%),
    linear-gradient(180deg, rgba(22,17,23,.98), rgba(8,7,10,.99));
  box-shadow: 0 35px 100px rgba(0,0,0,.72);
}

.choice-transition-card span {
  max-width: 520px;
  text-align: center;
  color: #f4eef5;
  font-family: "Oswald", sans-serif;
  font-size: clamp(1.65rem, 6vw, 3.1rem);
  line-height: 1.22;
  letter-spacing: .015em;
  text-wrap: balance;
}

#choiceTransitionContinue {
  min-width: 160px;
  min-height: 50px;
  padding: 0 24px;
  border: 1px solid rgba(210,31,53,.65);
  border-radius: 7px;
  background: linear-gradient(180deg, #c91d34, #8f1021);
  color: #fff;
  font: 700 .92rem/1 "DM Sans", sans-serif;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(178,18,41,.2);
}

#choiceTransitionContinue:active {
  transform: translateY(1px);
}

/* Override the old automatic span entrance rules. */
.choice-transition span {
  opacity: 1 !important;
  transform: none !important;
}

@media (max-width: 520px) {
  .choice-transition {
    padding: 18px;
  }

  .choice-transition-card {
    gap: 24px;
    padding: 36px 20px;
  }

  .choice-transition-card span {
    font-size: clamp(1.75rem, 8vw, 2.45rem);
  }

  #choiceTransitionContinue {
    width: 100%;
  }
}


/* ================================================================
   v0.8 — Continue Button Interaction Fix
   ================================================================ */

.choice-transition.is-active {
  pointer-events: auto !important;
}

.choice-transition-card,
#choiceTransitionContinue {
  pointer-events: auto !important;
}

#choiceTransitionContinue {
  position: relative;
  z-index: 2;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}


/* ================================================================
   v0.9 — Premium Header + Interlude Redesign
   ================================================================ */

/* --- Slimmer, cleaner top layout --- */
.site-header {
  width: min(calc(100% - 22px), var(--max)) !important;
  min-height: auto !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px 0 12px;
  border-bottom: 1px solid rgba(255,255,255,.09) !important;
}

.brand {
  min-width: 0;
  gap: 10px !important;
}

.brand-copy {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.brand-mark {
  width: 40px !important;
  height: 40px !important;
  box-shadow:
    inset 0 0 18px rgba(255,255,255,.025),
    0 0 18px rgba(210,31,53,.1) !important;
}

.brand strong {
  font-size: .94rem !important;
  letter-spacing: .075em !important;
  line-height: 1;
}

.brand small {
  font-size: .67rem !important;
  line-height: 1.15;
  color: #9a949d !important;
}

.header-actions {
  margin-left: 0 !important;
  justify-self: end;
}

#profileButton.top-control {
  min-height: 40px !important;
  padding: 0 13px !important;
  gap: 8px !important;
  border-radius: 999px !important;
  border-color: rgba(255,255,255,.12) !important;
  background:
    linear-gradient(180deg, rgba(24,20,28,.92), rgba(11,10,14,.92)) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.03),
    0 8px 18px rgba(0,0,0,.18) !important;
}

#profileButton .top-control-icon {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  stroke-width: 1.8;
}

#profileButton .top-control-copy {
  gap: 0;
}

#profileButton .top-control-copy strong {
  font-size: .75rem !important;
  letter-spacing: .015em;
}

#profileButton .top-control-copy small {
  font-size: .57rem !important;
  color: #8c8690 !important;
}

/* Pull the hero up a bit so the page opens with more impact. */
.hero {
  padding-top: 30px !important;
}

.hero-art {
  min-height: 500px !important;
}

/* --- Premium interlude instead of warning-pop-up feel --- */
.choice-transition {
  background:
    radial-gradient(circle at 50% 46%, rgba(118,14,31,.14), transparent 38%),
    rgba(4,3,7,.68) !important;
  backdrop-filter: blur(6px);
}

.choice-transition-card {
  width: min(100%, 560px) !important;
  gap: 16px !important;
  padding: clamp(22px, 5vw, 34px) clamp(20px, 5vw, 30px) 20px !important;
  border: 1px solid rgba(255,255,255,.09) !important;
  border-top: 2px solid rgba(210,31,53,.46) !important;
  border-radius: 18px !important;
  background:
    linear-gradient(180deg, rgba(20,16,24,.92), rgba(9,8,11,.9)) !important;
  box-shadow:
    0 28px 60px rgba(0,0,0,.42),
    inset 0 1px 0 rgba(255,255,255,.025) !important;
}

.choice-transition-card span {
  max-width: 460px !important;
  color: #f4eef5;
  font-size: clamp(1.6rem, 5.5vw, 2.45rem) !important;
  line-height: 1.14 !important;
  letter-spacing: .01em !important;
}

#choiceTransitionContinue {
  min-width: 0 !important;
  min-height: 42px !important;
  padding: 0 18px !important;
  border-radius: 999px !important;
  border: 1px solid rgba(255,255,255,.16) !important;
  background: rgba(255,255,255,.04) !important;
  color: #f5f1f4 !important;
  font: 700 .82rem/1 "DM Sans", sans-serif !important;
  box-shadow: none !important;
}

#choiceTransitionContinue:hover,
#choiceTransitionContinue:focus-visible {
  border-color: rgba(210,31,53,.56) !important;
  background: rgba(210,31,53,.08) !important;
  outline: none;
}

#choiceTransitionContinue:active {
  transform: translateY(1px);
}

/* Mobile polish */
@media (max-width: 700px) {
  .hero {
    padding-top: 22px !important;
  }

  .hero-art {
    min-height: 390px !important;
  }
}

@media (max-width: 520px) {
  .site-header {
    width: min(calc(100% - 18px), var(--max)) !important;
    gap: 10px;
    padding-top: 12px;
    padding-bottom: 10px;
  }

  .brand {
    gap: 9px !important;
  }

  .brand-mark {
    width: 38px !important;
    height: 38px !important;
  }

  .brand strong {
    font-size: .84rem !important;
  }

  .brand small {
    font-size: .6rem !important;
  }

  #profileButton.top-control {
    min-height: 38px !important;
    padding: 0 12px !important;
  }

  #profileButton .top-control-copy small {
    display: none !important;
  }

  #profileButton .top-control-copy strong {
    font-size: 0 !important;
  }

  #profileButton .top-control-copy strong::after {
    content: "File";
    font-size: .74rem;
  }

  .hero {
    padding-top: 18px !important;
  }

  .hero-art {
    min-height: 330px !important;
  }

  .door-frame {
    width: 198px !important;
    height: 312px !important;
  }

  .hero h1 {
    font-size: 4.95rem !important;
  }

  .choice-transition {
    padding: 16px !important;
  }

  .choice-transition-card {
    gap: 14px !important;
    padding: 20px 18px 18px !important;
    border-radius: 16px !important;
  }

  .choice-transition-card span {
    font-size: clamp(1.5rem, 8vw, 2.05rem) !important;
  }

  #choiceTransitionContinue {
    width: auto !important;
    min-width: 150px !important;
  }
}


/* ================================================================
   v0.10 — Reliable Choices + 7-Second Automatic Interlude
   ================================================================ */

/* Hidden transition must never intercept taps. */
.choice-transition {
  visibility: hidden;
  pointer-events: none !important;
}

.choice-transition.is-active {
  visibility: visible;
  pointer-events: auto !important;
}

/* Replace the old button area with a restrained timer. */
.transition-timer {
  width: min(100%, 360px);
  height: 3px;
  margin-top: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,.09);
}

.transition-timer span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #8c1021, #d9223b);
  box-shadow: 0 0 16px rgba(210,31,53,.38);
}

.choice-transition.is-active .transition-timer span {
  animation: transition-seven-seconds 7s linear forwards;
}

.transition-timer-label {
  color: #8f8992;
  font-size: .67rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

@keyframes transition-seven-seconds {
  from { width: 0; }
  to { width: 100%; }
}

/* The choice layer always sits above decorative story effects. */
.story-copy,
.choice-list,
.choice-button {
  position: relative;
  z-index: 20;
}

.choice-list {
  pointer-events: auto !important;
}

.choice-button {
  width: 100%;
  pointer-events: auto !important;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(210,31,53,.12);
  user-select: none;
}

.choice-button:active {
  border-color: rgba(210,31,53,.72) !important;
  background: rgba(210,31,53,.09) !important;
  transform: translateX(2px);
}

.choice-button[disabled] {
  cursor: default;
  opacity: .58;
  pointer-events: none !important;
}

/* Remove styling from the old Continue control if cached CSS remains. */
#choiceTransitionContinue {
  display: none !important;
}

@media (max-width: 520px) {
  .transition-timer {
    width: min(92%, 330px);
  }

  .transition-timer-label {
    font-size: .62rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .choice-transition.is-active .transition-timer span {
    animation-timing-function: linear;
  }
}
