:root {
  color-scheme: dark;
  --navy-950: #06111d;
  --navy-900: #071827;
  --navy-800: #0b1f3a;
  --gold: #f4c95d;
  --orange: #f59e0b;
  --green: #4caf7d;
  --paper: #fff3da;
  --text: #f8fafc;
  --muted: #c4d0df;
  --soft: rgba(248, 250, 252, 0.12);
  --shadow: 0 34px 90px rgba(0, 0, 0, 0.4);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
}

body {
  background:
    radial-gradient(circle at 18% 8%, rgba(244, 201, 93, 0.2), transparent 28%),
    radial-gradient(circle at 82% 16%, rgba(76, 175, 125, 0.14), transparent 32%),
    linear-gradient(145deg, #020812, var(--navy-950) 52%, #020712);
  color: var(--text);
}

button {
  border: 0;
  font: inherit;
}

.app {
  height: 100svh;
  min-height: 100svh;
  overflow: hidden;
}

.experience-shell {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(7, 24, 39, 0.42), rgba(7, 24, 39, 0.96)),
    var(--navy-900);
}

.story-header {
  position: fixed;
  z-index: 20;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 18px 10px;
  background: linear-gradient(180deg, rgba(3, 10, 20, 0.76), transparent);
  pointer-events: none;
}

.story-header strong,
.story-header span {
  display: block;
}

.story-header strong {
  font-size: 0.92rem;
  line-height: 1.1;
}

.story-header span {
  margin-top: 3px;
  color: rgba(248, 250, 252, 0.68);
  font-size: 0.74rem;
}

.chapter-progress {
  min-width: 64px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  color: rgba(248, 250, 252, 0.78);
  font-size: 0.75rem;
}

.chapter-progress i {
  width: 20px;
  height: 1px;
  background: rgba(244, 201, 93, 0.68);
}

.story-screen {
  position: relative;
  min-height: 0;
  flex: 1;
  display: grid;
  grid-template-rows: minmax(310px, 48svh) minmax(0, 1fr) auto auto;
  overflow: hidden;
  animation: sceneIn 520ms ease both;
}

@keyframes sceneIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.art-frame {
  position: relative;
  min-height: 310px;
  display: grid;
  place-items: center;
  isolation: isolate;
  background: var(--navy-950);
  overflow: hidden;
}

.art-frame img {
  display: block;
}

.scene-backdrop {
  position: absolute;
  inset: -10px;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: blur(3px) saturate(1.18) brightness(1.08);
  opacity: 0.78;
  transform: scale(1.04);
}

.scene-image {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  min-height: 310px;
  object-fit: cover;
  object-position: center;
  filter: drop-shadow(0 22px 44px rgba(0, 0, 0, 0.42));
}

.story-screen.act-2 .scene-image {
  object-position: center top;
}

.art-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(7, 24, 39, 0.08), transparent 18%, transparent 82%, rgba(7, 24, 39, 0.08)),
    radial-gradient(circle at 50% 50%, transparent 44%, rgba(2, 8, 18, 0.12) 100%);
}

.scene-backdrop.focus-opening {
  object-position: center 16%;
}

.scene-backdrop.focus-lulu-dream {
  object-position: center 20%;
}

.scene-backdrop.focus-dinner-talk {
  object-position: center 32%;
}

.scene-backdrop.focus-conflict {
  object-position: center 26%;
}

.scene-backdrop.focus-pizzeria-arrival {
  object-position: center 42%;
}

.scene-backdrop.focus-slice-discovery {
  object-position: center 48%;
}

.scene-backdrop.focus-pizzeria-alive {
  object-position: center 45%;
}

.scene-backdrop.focus-walk-home {
  object-position: center 28%;
}

.scene-backdrop.focus-reveal {
  object-position: center 52%;
}

.scene-backdrop.focus-lulu-doubt {
  object-position: center 30%;
}

.scene-backdrop.focus-real-choice {
  object-position: center 50%;
}

.scene-backdrop.focus-balance {
  object-position: center 32%;
}

.scene-backdrop.focus-tree {
  object-position: center 46%;
}

.scene-backdrop.focus-final-explanation {
  object-position: center 44%;
}

.scene-backdrop.focus-adult {
  object-position: center 26%;
}

.scene-backdrop.focus-next-home {
  object-position: center 30%;
}

.art-vignette {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(3, 10, 20, 0.18) 0%, transparent 26%, rgba(7, 24, 39, 0.28) 100%),
    radial-gradient(circle at 50% 44%, transparent 28%, rgba(2, 8, 18, 0.16) 82%);
}

.story-copy {
  position: relative;
  z-index: 2;
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 12px 22px 14px;
  margin-top: 0;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  width: fit-content;
  max-width: none;
  min-height: 0;
  margin: 0;
  padding: 7px 10px;
  border: 1px solid rgba(244, 201, 93, 0.28);
  border-radius: 999px;
  color: var(--gold);
  background: rgba(7, 24, 39, 0.66);
  backdrop-filter: blur(10px);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  max-width: 12ch;
  color: var(--text);
  font-size: clamp(1.88rem, 8.8vw, 4.1rem);
  line-height: 1;
  letter-spacing: 0;
  text-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
}

p {
  max-width: 35ch;
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.55;
}

.lead {
  color: rgba(248, 250, 252, 0.96);
  font-size: 1.08rem;
  line-height: 1.46;
}

blockquote {
  margin: 2px 0 0;
  padding: 15px 16px;
  border-left: 3px solid var(--gold);
  border-radius: 0 10px 10px 0;
  color: var(--paper);
  background: rgba(244, 201, 93, 0.1);
  font-size: 1.02rem;
  font-weight: 750;
  line-height: 1.5;
}

.dialogue {
  display: grid;
  gap: 9px;
  margin: 1px 0;
}

.bubble {
  width: fit-content;
  max-width: min(92%, 330px);
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 18px 18px 18px 6px;
  color: #12223a;
  background: rgba(255, 243, 218, 0.94);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.24);
  font-size: 0.96rem;
  line-height: 1.38;
}

.bubble.father {
  justify-self: end;
  border-radius: 18px 18px 6px 18px;
  background: rgba(223, 246, 234, 0.96);
}

.family-form {
  display: grid;
  gap: 12px;
  max-width: 100%;
}

.family-form label {
  display: grid;
  gap: 6px;
}

.family-form span,
.keepsake-card span,
.book-preview span {
  color: rgba(248, 250, 252, 0.58);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.family-form input {
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  padding: 0 14px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  font: inherit;
  outline: 0;
}

.family-form input:focus {
  border-color: rgba(244, 201, 93, 0.72);
  box-shadow: 0 0 0 3px rgba(244, 201, 93, 0.14);
}

.form-note {
  margin: 2px 0 0;
  color: #ffd46b;
  font-size: 0.88rem;
}

.gender-choice {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.gender-choice button {
  min-height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  color: rgba(248, 250, 252, 0.86);
  background: rgba(255, 255, 255, 0.075);
  font-weight: 850;
}

.gender-choice button.selected {
  color: #172033;
  border-color: rgba(244, 201, 93, 0.9);
  background: linear-gradient(135deg, var(--gold), var(--orange));
}

.choice-grid {
  display: grid;
  gap: 10px;
}

.choice-card {
  display: grid;
  gap: 5px;
  width: 100%;
  min-height: 78px;
  padding: 13px 14px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.075);
  text-align: left;
}

.choice-card strong {
  color: var(--paper);
  font-size: 0.98rem;
}

.choice-card span {
  color: rgba(196, 208, 223, 0.92);
  font-size: 0.88rem;
  line-height: 1.34;
}

.choice-card.selected {
  border-color: rgba(244, 201, 93, 0.76);
  background: linear-gradient(135deg, rgba(244, 201, 93, 0.2), rgba(76, 175, 125, 0.12));
}

.choice-grid.calm,
.choice-grid.money-choice,
.choice-grid.split-choice {
  margin-top: 16px;
}

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

.choice-grid.split-choice,
.choice-grid.calm {
  grid-template-columns: 1fr;
}

button.choice-card {
  font: inherit;
  cursor: pointer;
}

.choice-card.manual-value {
  min-height: 96px;
}

.choice-card.manual-value input {
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: 12px 13px;
  background: rgba(255, 255, 255, 0.92);
  color: #071828;
  font: inherit;
  outline: none;
}

.choice-card.manual-value input[type="range"] {
  padding: 0;
  accent-color: var(--gold);
  background: transparent;
}

.agreement-card p {
  margin: 8px 0 0;
}

.allowance-plan {
  display: grid;
  gap: 10px;
}

.allowance-plan div {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid rgba(255, 243, 218, 0.18);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.07);
}

.allowance-plan span {
  color: rgba(244, 201, 93, 0.86);
  font-size: 0.7rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.allowance-plan strong {
  color: var(--paper);
  font-size: 1rem;
}

.keepsake-card,
.letter-box,
.book-preview {
  display: grid;
  gap: 8px;
  padding: 15px;
  border: 1px solid rgba(255, 243, 218, 0.2);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(255, 243, 218, 0.12), rgba(255, 255, 255, 0.055)),
    rgba(255, 255, 255, 0.06);
}

.keepsake-card strong,
.book-preview strong {
  color: var(--paper);
  font-size: 1.08rem;
}

.letter-box {
  border-color: rgba(244, 201, 93, 0.28);
  background:
    linear-gradient(135deg, rgba(255, 243, 218, 0.92), rgba(255, 239, 200, 0.82));
}

.letter-box p {
  color: #21304a;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.04rem;
  line-height: 1.5;
}

.book-preview {
  border-color: rgba(244, 201, 93, 0.38);
  background:
    linear-gradient(135deg, rgba(244, 201, 93, 0.18), rgba(76, 175, 125, 0.12)),
    rgba(255, 255, 255, 0.08);
}

.story-actions {
  position: relative;
  z-index: 3;
  display: grid;
  gap: 10px;
  padding: 4px 22px 16px;
}

.story-actions.solo {
  grid-template-columns: 1fr;
}

.story-actions.has-back {
  grid-template-columns: minmax(86px, 0.42fr) 1fr;
}

.primary,
.secondary {
  min-height: 46px;
  border-radius: 13px;
  cursor: pointer;
  font-weight: 850;
  transition:
    transform 180ms ease,
    filter 180ms ease,
    background 180ms ease;
}

.primary {
  color: #172033;
  background: linear-gradient(135deg, var(--gold), var(--orange));
  box-shadow: 0 18px 46px rgba(245, 158, 11, 0.22);
}

.secondary {
  color: rgba(248, 250, 252, 0.86);
  border: 1px solid rgba(248, 250, 252, 0.14);
  background: rgba(255, 255, 255, 0.07);
  font-size: 0.92rem;
}

.primary:hover,
.secondary:hover,
.primary:focus-visible,
.secondary:focus-visible {
  transform: translateY(-1px);
  filter: brightness(1.04);
  outline: 0;
}

.primary:disabled {
  cursor: default;
  filter: saturate(0.75);
  opacity: 0.78;
  transform: none;
}

.fint-note {
  position: relative;
  z-index: 2;
  padding: 0 22px 12px;
  color: rgba(248, 250, 252, 0.42);
  font-size: 0.72rem;
  text-align: center;
}

.progress-line {
  position: fixed;
  z-index: 21;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: rgba(248, 250, 252, 0.09);
}

.progress-line span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--gold));
  transition: width 360ms ease;
}

.cinema .art-vignette,
.quiet .art-vignette {
  background:
    linear-gradient(180deg, rgba(3, 10, 20, 0.14) 0%, rgba(3, 10, 20, 0.02) 42%, rgba(7, 24, 39, 0.32) 100%),
    radial-gradient(circle at 50% 40%, transparent 28%, rgba(2, 8, 18, 0.2) 84%);
}

.ending .scene-backdrop {
  object-position: center top;
}

@media (min-width: 760px) {
  .app {
    height: 100vh;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px;
    overflow: hidden;
  }

  .experience-shell {
    width: min(100%, 520px);
    height: calc(100vh - 56px);
    min-height: 0;
    overflow: hidden;
    border: 1px solid rgba(248, 250, 252, 0.14);
    border-radius: 32px;
    box-shadow: var(--shadow);
  }

  .story-header {
    position: sticky;
    inset: auto;
    padding: 18px 22px 0;
    background: transparent;
  }

  .story-screen {
    min-height: 0;
    grid-template-rows: minmax(330px, 46vh) minmax(0, 1fr) auto auto;
  }

  .art-frame,
  .scene-image {
    min-height: 330px;
  }

  .story-copy {
    min-height: 0;
    overflow-y: auto;
    gap: 10px;
    padding-inline: 28px;
    padding-bottom: 8px;
    margin-top: 0;
  }

  h1 {
    max-width: 10.5ch;
    font-size: clamp(2.1rem, 4.8vh, 3.45rem);
    line-height: 1;
  }

  p {
    font-size: 0.96rem;
    line-height: 1.48;
  }

  .lead {
    font-size: 1rem;
    line-height: 1.42;
  }

  .bubble {
    padding: 10px 13px;
    font-size: 0.94rem;
  }

  blockquote {
    padding: 12px 14px;
    font-size: 0.96rem;
  }

  .story-actions {
    padding-inline: 28px;
    padding-top: 8px;
    padding-bottom: 10px;
  }

  .primary,
  .secondary {
    min-height: 44px;
  }

  .fint-note {
    padding-inline: 28px;
    padding-bottom: 10px;
  }

  .progress-line {
    position: sticky;
  }
}
