:root {
  color-scheme: dark;
  --ink: #f9f5f1;
  --ink-muted: #c6c2ce;
  --night: #111021;
  --night-soft: #18162b;
  --plum: #2c1935;
  --surface: rgba(33, 30, 51, 0.94);
  --surface-soft: rgba(255, 255, 255, 0.055);
  --line: rgba(255, 255, 255, 0.14);
  --gold: #f2c879;
  --gold-strong: #ffdb8f;
  --coral: #ef806f;
  --green: #75d4ad;
  --danger: #ff9b94;
  --shadow: 0 30px 80px rgba(4, 3, 12, 0.42);
  --radius-large: 32px;
  --radius-medium: 20px;
  --radius-small: 12px;
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, "Times New Roman", serif;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--night);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 5%, rgba(90, 57, 115, 0.24), transparent 34rem),
    radial-gradient(circle at 92% 90%, rgba(239, 128, 111, 0.09), transparent 32rem),
    var(--night);
}

button,
input,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

button:not(:disabled) {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 100;
  padding: 0.75rem 1rem;
  color: var(--night);
  background: var(--gold);
  border-radius: 8px;
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

:focus-visible {
  outline: 3px solid var(--gold-strong);
  outline-offset: 3px;
}

.app-shell {
  width: min(100%, 1600px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 0 4vw;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 86px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  gap: 0.7rem;
  align-items: center;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.26rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  color: var(--night);
  background: var(--gold);
  border-radius: 50%;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 1rem;
}

.text-button,
.secondary-button {
  min-height: 46px;
  padding: 0.65rem 1rem;
  color: var(--ink-muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.93rem;
  font-weight: 650;
}

.text-button:hover,
.secondary-button:hover {
  color: var(--ink);
  background: var(--surface-soft);
  border-color: rgba(255, 255, 255, 0.28);
}

main {
  min-height: calc(100vh - 158px);
}

.screen {
  width: 100%;
  padding: clamp(2.25rem, 6vw, 6rem) 0;
}

.screen:focus {
  outline: none;
}

.setup-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(500px, 0.9fr);
  gap: clamp(2.5rem, 4.5vw, 5rem);
  align-items: start;
  max-width: 1320px;
  margin: 0 auto;
}

.setup-copy {
  position: sticky;
  top: 2rem;
  min-height: 590px;
  padding: clamp(1rem, 3vw, 3rem) 0;
  background-image:
    radial-gradient(circle at 83% 27%, rgba(242, 200, 121, 0.28) 0 4px, transparent 5px),
    radial-gradient(circle at 91% 43%, rgba(239, 128, 111, 0.2) 0 7px, transparent 8px),
    radial-gradient(circle at 72% 72%, rgba(242, 200, 121, 0.12), transparent 24%),
    linear-gradient(135deg, rgba(44, 25, 53, 0.95), rgba(17, 16, 33, 0.98));
  background-repeat: no-repeat;
  background-position: center right;
  background-size: cover;
  border-radius: var(--radius-large);
}

.setup-copy > * {
  width: min(88%, 690px);
}

.eyebrow {
  margin: 0 0 1rem;
  color: var(--gold);
  font-size: 0.79rem;
  font-weight: 780;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.eyebrow span {
  margin-right: 0.45rem;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  font-family: var(--serif);
  text-wrap: balance;
}

h1 {
  max-width: 720px;
  margin-bottom: 1.5rem;
  font-size: clamp(3rem, 4.25vw, 4.65rem);
  font-weight: 500;
  letter-spacing: -0.038em;
  line-height: 1.035;
}

.person-decoration {
  display: inline-block;
  margin-left: 0.38em;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 0.72em;
  line-height: 1;
  transform: translateY(-0.05em);
}

.intro {
  max-width: 580px;
  margin-bottom: 2.3rem;
  color: var(--ink-muted);
  font-size: clamp(1.05rem, 1.45vw, 1.26rem);
  line-height: 1.65;
}

.privacy-note {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  width: min(100%, 560px);
  padding: 1rem 1.15rem;
  background: rgba(20, 19, 36, 0.78);
  border: 1px solid rgba(242, 200, 121, 0.24);
  border-radius: 16px;
  backdrop-filter: blur(10px);
}

.privacy-icon {
  display: grid;
  flex: 0 0 auto;
  width: 1.9rem;
  height: 1.9rem;
  place-items: center;
  color: var(--gold);
  border: 1px solid rgba(242, 200, 121, 0.45);
  border-radius: 50%;
}

.privacy-note p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.93rem;
  line-height: 1.55;
}

.privacy-note strong {
  color: var(--ink);
}

.setup-card,
.question-card,
.result-card {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.setup-card {
  padding: clamp(1.5rem, 3vw, 2.6rem);
  border-radius: var(--radius-large);
}

.step-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  font-weight: 760;
}

.step-count {
  padding: 0.36rem 0.7rem;
  color: var(--gold);
  background: rgba(242, 200, 121, 0.1);
  border: 1px solid rgba(242, 200, 121, 0.2);
  border-radius: 999px;
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.field-group {
  min-width: 0;
  margin-bottom: 1.4rem;
}

label,
legend {
  display: block;
  margin-bottom: 0.55rem;
  color: var(--ink);
  font-size: 0.96rem;
  font-weight: 720;
}

input,
textarea {
  width: 100%;
  color: var(--ink);
  background: rgba(10, 9, 23, 0.58);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-small);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

input {
  min-height: 54px;
  padding: 0 1rem;
}

textarea {
  min-height: 82px;
  padding: 0.9rem 1rem;
  line-height: 1.45;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: #85808f;
  opacity: 1;
}

input:hover,
textarea:hover {
  border-color: rgba(255, 255, 255, 0.29);
}

input:focus,
textarea:focus {
  background: rgba(10, 9, 23, 0.82);
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(242, 200, 121, 0.12);
  outline: 0;
}

[aria-invalid="true"] {
  border-color: var(--danger);
}

.field-hint,
.field-meta,
.fieldset-hint,
.form-footnote {
  color: #9e99a9;
  font-size: 0.79rem;
  line-height: 1.45;
}

.field-hint {
  margin: 0.45rem 0 0;
}

.field-error,
.form-summary-error {
  min-height: 1.1rem;
  margin: 0.35rem 0 0;
  color: var(--danger);
  font-size: 0.82rem;
  line-height: 1.35;
}

.form-summary-error:empty {
  display: none;
}

.compact-field {
  max-width: 220px;
}

.age-input-wrap {
  position: relative;
}

.age-input-wrap input {
  padding-right: 4.2rem;
}

.age-input-wrap > span {
  position: absolute;
  top: 50%;
  right: 1rem;
  color: #aaa5b5;
  font-size: 0.84rem;
  pointer-events: none;
  transform: translateY(-50%);
}

.memories-fieldset,
.intent-fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.memories-fieldset {
  margin-top: 2.3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}

.memories-fieldset legend {
  margin-bottom: 0.25rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.45rem;
  font-weight: 600;
}

.fieldset-hint {
  margin-bottom: 1.5rem;
}

.memory-field {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr);
  gap: 0.8rem;
}

.memory-number {
  display: grid;
  width: 2rem;
  height: 2rem;
  margin-top: 1.8rem;
  place-items: center;
  color: var(--gold);
  background: rgba(242, 200, 121, 0.08);
  border: 1px solid rgba(242, 200, 121, 0.24);
  border-radius: 50%;
  font-family: Georgia, "Times New Roman", serif;
}

.field-meta {
  display: flex;
  gap: 0.5rem;
  justify-content: space-between;
  margin-top: 0.4rem;
}

.field-meta > span:first-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.field-meta > span:last-child {
  flex: 0 0 auto;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 56px;
  padding: 0.85rem 1.2rem;
  color: #1c1520;
  background: var(--gold);
  border: 0;
  border-radius: 14px;
  box-shadow: 0 10px 26px rgba(242, 200, 121, 0.14);
  font-weight: 800;
  transition: background 160ms ease, transform 160ms ease;
}

.primary-button span:last-child {
  margin-left: auto;
  font-size: 1.3rem;
}

.primary-button:hover {
  background: var(--gold-strong);
  transform: translateY(-1px);
}

.primary-button:active {
  transform: translateY(0);
}

.form-footnote {
  margin: 0.8rem 0 0;
  text-align: center;
}

.game-frame {
  max-width: 900px;
  margin: 0 auto;
}

.game-header {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.game-header .eyebrow {
  margin-bottom: 0.3rem;
}

.question-progress {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.93rem;
}

.score-chip {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  min-height: 44px;
  padding: 0.45rem 0.65rem 0.45rem 0.95rem;
  color: var(--ink-muted);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.83rem;
}

.score-chip strong {
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  color: var(--night);
  background: var(--gold);
  border-radius: 50%;
  font-size: 0.9rem;
}

.progress-track {
  height: 4px;
  margin-bottom: 1.6rem;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.09);
  border-radius: 99px;
}

.progress-track > div {
  width: 33.333%;
  height: 100%;
  background: linear-gradient(90deg, var(--coral), var(--gold));
  border-radius: inherit;
  transition: width 320ms ease;
}

.question-card {
  min-height: 560px;
  padding: clamp(1.6rem, 4.5vw, 4.25rem);
  border-radius: var(--radius-large);
}

.question-kicker,
.mini-label {
  margin-bottom: 0.7rem;
  color: var(--coral);
  font-size: 0.77rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.question-card h2 {
  margin-bottom: 0.7rem;
  font-size: clamp(2.1rem, 5vw, 3.75rem);
  font-weight: 520;
  letter-spacing: -0.035em;
  line-height: 1.07;
}

.question-context {
  margin-bottom: 2rem;
  color: var(--ink-muted);
  font-size: 1rem;
  line-height: 1.55;
}

.options-list {
  display: grid;
  gap: 0.8rem;
}

.option-button,
.intent-option {
  display: flex;
  width: 100%;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line);
  text-align: left;
  transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

.option-button {
  gap: 0.9rem;
  align-items: center;
  min-height: 66px;
  padding: 0.8rem 1rem;
  border-radius: 16px;
}

.option-button:hover:not(:disabled),
.intent-option:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(242, 200, 121, 0.5);
  transform: translateY(-1px);
}

.option-marker,
.intent-marker {
  display: grid;
  flex: 0 0 auto;
  width: 2.25rem;
  height: 2.25rem;
  place-items: center;
  color: var(--gold);
  background: rgba(242, 200, 121, 0.08);
  border: 1px solid rgba(242, 200, 121, 0.2);
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 800;
}

.option-copy {
  font-size: 0.98rem;
  line-height: 1.45;
}

.option-button.is-correct {
  background: rgba(117, 212, 173, 0.11);
  border-color: rgba(117, 212, 173, 0.72);
}

.option-button.is-correct .option-marker {
  color: var(--night);
  background: var(--green);
  border-color: var(--green);
}

.option-button.is-wrong {
  background: rgba(255, 155, 148, 0.075);
  border-color: rgba(255, 155, 148, 0.5);
}

.option-button:disabled {
  cursor: default;
}

.reveal-panel {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  margin-top: 1rem;
  padding: 1rem 1.1rem;
  background: rgba(117, 212, 173, 0.08);
  border: 1px solid rgba(117, 212, 173, 0.25);
  border-radius: 16px;
}

.reveal-panel.is-close {
  background: rgba(242, 200, 121, 0.065);
  border-color: rgba(242, 200, 121, 0.22);
}

.reveal-icon {
  display: grid;
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  place-items: center;
  color: var(--night);
  background: var(--green);
  border-radius: 50%;
  font-weight: 900;
}

.is-close .reveal-icon {
  background: var(--gold);
}

.reveal-title {
  margin: 0 0 0.18rem;
  font-weight: 800;
}

.reveal-copy {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.next-button {
  width: min(100%, 250px);
  margin: 1rem 0 0 auto;
}

.result-card {
  position: relative;
  max-width: 980px;
  margin: 0 auto;
  padding: clamp(1.6rem, 5vw, 4.6rem);
  overflow: hidden;
  border-radius: var(--radius-large);
  text-align: center;
}

.result-card::before {
  position: absolute;
  top: -220px;
  left: 50%;
  width: 620px;
  height: 420px;
  background: radial-gradient(circle, rgba(239, 128, 111, 0.18), transparent 66%);
  content: "";
  pointer-events: none;
  transform: translateX(-50%);
}

.result-celebration {
  position: relative;
  display: flex;
  gap: 0.8rem;
  justify-content: center;
  margin-bottom: 1.25rem;
  color: var(--gold);
  font-size: 1.35rem;
}

.result-celebration span:nth-child(2) {
  color: var(--coral);
}

.result-card h2 {
  position: relative;
  max-width: 720px;
  margin: 0 auto 0.8rem;
  font-size: clamp(2.45rem, 6vw, 4.5rem);
  font-weight: 520;
  letter-spacing: -0.045em;
  line-height: 1.03;
}

.result-message {
  position: relative;
  max-width: 600px;
  margin: 0 auto 1.8rem;
  color: var(--ink-muted);
  font-size: 1.03rem;
  line-height: 1.6;
}

.score-orbit {
  position: relative;
  display: grid;
  width: 150px;
  height: 150px;
  margin: 0 auto 2.6rem;
  place-content: center;
  background: rgba(242, 200, 121, 0.08);
  border: 1px solid rgba(242, 200, 121, 0.25);
  border-radius: 50%;
  box-shadow: inset 0 0 0 10px rgba(242, 200, 121, 0.025);
}

.score-orbit strong {
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 4.15rem;
  font-weight: 500;
  line-height: 0.95;
}

.score-orbit span {
  margin-top: 0.3rem;
  color: var(--ink-muted);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.full-game-preview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px;
  gap: 1.5rem;
  align-items: center;
  margin: 0 auto 2.5rem;
  padding: clamp(1.2rem, 3vw, 2rem);
  background: linear-gradient(120deg, rgba(239, 128, 111, 0.09), rgba(242, 200, 121, 0.055));
  border: 1px solid rgba(242, 200, 121, 0.2);
  border-radius: var(--radius-medium);
  text-align: left;
}

.full-game-copy h3 {
  margin-bottom: 0.6rem;
  font-size: clamp(1.65rem, 3vw, 2.25rem);
  font-weight: 560;
  line-height: 1.12;
}

.full-game-copy > p:last-child {
  margin-bottom: 0;
  color: var(--ink-muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.price-card {
  display: flex;
  min-height: 140px;
  padding: 1rem;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(11, 10, 24, 0.52);
  border: 1px solid var(--line);
  border-radius: 16px;
  text-align: center;
}

.price-card span,
.price-card small {
  color: var(--ink-muted);
  font-size: 0.75rem;
}

.price-card strong {
  margin: 0.25rem 0;
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.2rem;
  font-weight: 560;
}

.intent-fieldset {
  max-width: 760px;
  margin: 0 auto;
  text-align: left;
}

.intent-fieldset legend {
  width: 100%;
  margin-bottom: 0.35rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.65rem, 3vw, 2.15rem);
  font-weight: 560;
  text-align: center;
  text-wrap: balance;
}

.no-break {
  white-space: nowrap;
}

.intent-fieldset > p {
  margin-bottom: 1.25rem;
  color: var(--ink-muted);
  font-size: 0.9rem;
  text-align: center;
}

.intent-options {
  display: grid;
  gap: 0.75rem;
}

.intent-option {
  gap: 0.9rem;
  align-items: center;
  min-height: 76px;
  padding: 0.85rem 1rem;
  border-radius: 16px;
}

.intent-option > span:last-child {
  display: grid;
  gap: 0.18rem;
}

.intent-option strong {
  font-size: 0.96rem;
}

.intent-option small {
  color: var(--ink-muted);
  font-size: 0.8rem;
  line-height: 1.4;
}

.intent-option.is-selected {
  background: rgba(242, 200, 121, 0.1);
  border-color: var(--gold);
}

.intent-option.is-selected .intent-marker {
  color: var(--night);
  background: var(--gold);
}

.intent-thanks {
  display: flex;
  gap: 0.85rem;
  align-items: center;
  max-width: 760px;
  margin: 1rem auto 0;
  padding: 1rem;
  background: rgba(117, 212, 173, 0.08);
  border: 1px solid rgba(117, 212, 173, 0.24);
  border-radius: 16px;
  text-align: left;
}

.intent-thanks > span {
  display: grid;
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  place-items: center;
  color: var(--night);
  background: var(--green);
  border-radius: 50%;
  font-weight: 900;
}

.intent-thanks p {
  margin: 0.15rem 0 0;
  color: var(--ink-muted);
  font-size: 0.82rem;
}

.result-card .secondary-button {
  margin-top: 1.5rem;
}

footer {
  min-height: 72px;
  padding: 1.2rem 0;
  color: #837e8c;
  border-top: 1px solid var(--line);
  font-size: 0.78rem;
  text-align: center;
}

footer p {
  margin: 0;
}

@media (max-width: 980px) {
  .setup-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .setup-copy {
    position: relative;
    top: auto;
    min-height: 430px;
    padding: 2rem;
  }

  h1 {
    max-width: 660px;
    font-size: clamp(3rem, 7.5vw, 4.5rem);
  }

  .setup-card {
    max-width: 680px;
    margin: 0 auto;
  }
}

@media (max-width: 640px) {
  .app-shell {
    padding: 0 1rem;
  }

  .topbar {
    min-height: 70px;
  }

  .brand {
    font-size: 1.05rem;
  }

  .brand-mark {
    width: 1.75rem;
    height: 1.75rem;
  }

  .text-button {
    min-height: 44px;
    padding-right: 0.8rem;
    padding-left: 0.8rem;
  }

  .screen {
    padding: 1.35rem 0 2.4rem;
  }

  .setup-layout {
    gap: 1rem;
  }

  .setup-copy {
    min-height: 430px;
    padding: 1.4rem 1.1rem;
    background-image:
      radial-gradient(circle at 82% 14%, rgba(242, 200, 121, 0.26) 0 4px, transparent 5px),
      radial-gradient(circle at 91% 27%, rgba(239, 128, 111, 0.18) 0 6px, transparent 7px),
      radial-gradient(circle at 70% 70%, rgba(242, 200, 121, 0.1), transparent 24%),
      linear-gradient(155deg, rgba(44, 25, 53, 0.94), rgba(17, 16, 33, 0.99));
    border-radius: 24px;
  }

  .setup-copy > * {
    width: 100%;
  }

  h1 {
    margin-top: 4.6rem;
    font-size: clamp(2.75rem, 13vw, 3.75rem);
    line-height: 0.99;
  }

  .intro {
    margin-bottom: 1.2rem;
    font-size: 1rem;
    line-height: 1.5;
  }

  .setup-card,
  .question-card,
  .result-card {
    padding: 1.25rem;
    border-radius: 24px;
  }

  .compact-field {
    max-width: none;
  }

  .memory-field {
    grid-template-columns: 1.8rem minmax(0, 1fr);
    gap: 0.6rem;
  }

  .memory-number {
    width: 1.8rem;
    height: 1.8rem;
  }

  .game-header {
    align-items: center;
  }

  .game-header .eyebrow {
    max-width: 240px;
    line-height: 1.35;
  }

  .question-card {
    min-height: 0;
  }

  .question-card h2 {
    font-size: 2.25rem;
  }

  .option-button {
    min-height: 64px;
    padding: 0.75rem;
  }

  .option-marker,
  .intent-marker {
    width: 2rem;
    height: 2rem;
  }

  .next-button {
    width: 100%;
  }

  .full-game-preview {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .price-card {
    min-height: 112px;
  }

  .intent-option {
    align-items: flex-start;
    min-height: 82px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
