/* Moonlit indigo for the journey, warm paper for what the traveler takes home. */
@media screen {
  :root {
    --night: #11152a;
    --ink: #f8f1e7;
    --muted: #c2c5d6;
    --gold: #f2d6a4;
    --line: #dec7a748;
    --paper: #f8eedc;
  }

  .sky {
    background:
      radial-gradient(ellipse at 86% 4%, #52446b 0%, transparent 43%),
      radial-gradient(ellipse at 1% 63%, #243c55 0%, transparent 50%),
      linear-gradient(160deg, #151a32 8%, #151e36 57%, #17192d);
  }
  .sky::after {
    opacity: .58;
    background-size: 211px 257px;
  }
  .app-shell {
    max-width: 576px;
    background: linear-gradient(180deg, #171b2f20, #13182d80);
  }
  .topbar {
    height: calc(72px + env(safe-area-inset-top, 0px));
    border-color: #e6cd9b30;
  }
  .brand { color: #fff0d6; letter-spacing: .11em; }
  .brand small { letter-spacing: .28em; color: #d8ba8b; }
  .moon { text-shadow: 0 0 18px #f6d9a263; }
  .journey-actions:not([hidden]) { gap: 4px 12px; padding-top: 2px; }
  .journey-actions button, .topbar .text-button { font-size: 13px; }

  .section-title h1, .ritual h1 {
    font-size: clamp(27px, 7vw, 39px);
    line-height: 1.26;
    letter-spacing: .06em;
    text-wrap: balance;
  }
  .section-title p, .ritual .sub { font-size: 14px; color: #d0cede; }
  .eyebrow { font-size: 10px; letter-spacing: .22em; }
  .panel {
    background: linear-gradient(145deg, #34354b96, #202941b5);
    border-color: #e5c79848;
    box-shadow: 0 12px 28px #0a102641;
  }
  .primary {
    background: linear-gradient(114deg, #efd29e, #f8e6c3 48%, #ecc692);
    border-color: #ffe4b5;
    color: #33293c;
    border-radius: 13px;
    box-shadow: 0 1px 0 #fff6e09c inset, 0 8px 17px #10152b50;
  }
  .secondary {
    color: #f6e6ca;
    background: #ece1f00e;
    border-color: #d8c7ba55;
    border-radius: 13px;
  }
  button:focus-visible, input:focus-visible, summary:focus-visible, a:focus-visible {
    outline-color: #c7e4f6;
  }

  /* Entry illustrations, with the large original portrait as the focal point. */
  .hero {
    margin-bottom: 19px;
    background: radial-gradient(ellipse at 50% 58%, #d8b37b29 0%, #8c6aaf1f 42%, transparent 73%);
  }
  .hero::before {
    border-color: #efd19f62;
    box-shadow: 0 0 0 14px #efce9f06, 0 0 0 15px #edcea12a, 0 0 44px #d7a8bf26;
  }
  .hero-card {
    border-color: #f3d6a0;
    background: var(--paper);
    box-shadow: 0 13px 25px #0b102c89;
  }
  .hero-card.middle {
    box-shadow: 0 0 0 5px #f1d29d25, 0 15px 50px #130e315e;
  }
  .hero-card.left img, .hero-card.right img { object-fit: contain; }
  .hero-card span { color: #513940; font-weight: 650; }
  .hero-caption { color: #f1d6a8; font-size: 12px; }
  .welcome-meta { color: #e8d9c0; font-size: 12px; flex-wrap: wrap; gap: 8px; }
  .entry-panel label { color: #f8e9d1; font-size: 14px; }
  .key-input {
    background: #15192e;
    border-color: #dcc7a87a;
  }
  .key-input::placeholder { color: #b3aec4; }
  .entry-guidance, .intro-note { font-size: 12px; color: #c6c6d6; }

  /* The question stays on paper and the choices below stay easy to scan. */
  .progress-meta, .question-subtitle { color: #d3d5e1; font-size: 12px; }
  .progress-track, .progress-track progress { height: 5px; }
  .question-card {
    border-radius: 19px;
    background: radial-gradient(ellipse at 95% 4%, #f3d9b4 0, transparent 60%),
      linear-gradient(145deg, #fff7e9, #f6e9d5);
    color: #382c40;
    border-color: #ecd2aa;
    padding: 22px 19px;
    min-height: 138px;
  }
  .question-card::before { color: #875b38; font-size: 16px; }
  .question-card .eyebrow { color: #715338; }
  .question-card h1 { font-size: clamp(18px, 5vw, 23px); line-height: 1.62; }
  .answer-prompt { color: #e5e1eb; font-size: 14px; }
  .option {
    min-height: 47px;
    color: #f0eaf4;
    background: #282c469c;
    border-color: #d7cde043;
    font-size: 14px;
  }
  .option.selected {
    background: #493e51;
    border-color: #f2d29e;
    color: #fff1d9;
  }
  .option.na { color: #ddd6e7; }
  .review-panel .risk, .consent { font-size: 14px; }
  .question-links .text-button { font-size: 12px; }

  /* The reveal looks like a collectible card, with a bright inner border. */
  .ritual-stage {
    min-height: 322px;
    isolation: isolate;
    background: radial-gradient(ellipse at 50% 54%, #a784bd30, transparent 70%);
  }
  .orbit {
    width: min(286px,84vw);
    height: min(286px,84vw);
    border-color: #c7aec97a;
    box-shadow: 0 0 0 12px #dab8ce09, 0 0 0 13px #dbbdcb34, 0 0 54px #d3a9e435;
  }
  .mystery-card {
    width: min(214px,66vw);
    height: 286px;
    background: radial-gradient(ellipse at 50% 29%, #77638e, transparent 58%),
      linear-gradient(160deg, #343451, #232b49 62%, #1c2940);
    box-shadow: 0 0 27px #e7c18d33, 0 15px 44px #080d2390;
  }
  .mystery-card::before {
    content: "";
    position: absolute;
    inset: 8px;
    border: 1px solid #e2c29667;
    border-radius: inherit;
    pointer-events: none;
  }
  .mystery-card .question-mark { color: #ffe2a6; text-shadow: 0 0 20px #efc48755; }
  .mystery-card .card-invite { color: #f6dfb7; font-size: 12px; }
  .film-card {
    background: linear-gradient(155deg, #faefd9, #ebd8cb);
    border: 1px solid #f3d5a3;
  }

  /* Result as a keepsake, with the actual evidence one tap away. */
  .result-page { padding-top: 10px; }
  .reveal-summary {
    padding: 18px 15px 14px;
    border: 1px solid #ebca9a66;
    border-radius: 19px;
    background: radial-gradient(ellipse at 100% 0%, #785b796b, transparent 65%),
      linear-gradient(145deg, #292940, #1c2640);
    box-shadow: 0 14px 28px #10132948;
  }
  .reveal-summary h1 { color: #fff2da; letter-spacing: .025em; }
  .reveal-summary > p:last-of-type { color: #ded7e5; font-size: 14px; }
  .reveal-peek { border-color: #ecd0a75c; background: #f0d6b112; }
  .clue-map {
    background: linear-gradient(150deg, #2b304d, #202941);
    border-color: #d8bca44f;
  }
  .clue-chip { background: #1c2239; border-color: #e0c9af66; font-size: 13px; }
  .clue-chip:active { background: #4a405b; }
  .clue-avatar { box-shadow: 0 0 0 1px #efcc9d99; }
  .mini-resident, .resident-card {
    background: linear-gradient(155deg, #fff4e3, #edddc7);
    border-color: #e9c69b;
  }
  .mini-resident img { object-fit: contain; }
  .mini-resident h2, .resident-card h2 { color: #54394b; }
  .mini-resident p, .resident-card .tagline { color: #624955; }
  .clue-person .eyebrow { color: #efca9e; }
  dialog {
    background: linear-gradient(155deg, #36334e, #222b42);
    border-color: #efd5a680;
  }

  /* The journal switches from moonlight to an inset paper page. */
  .journal-cover {
    background: radial-gradient(ellipse at 83% 0%, #7e6885, transparent 63%),
      linear-gradient(141deg, #433b5b, #232943);
    padding: 23px 16px 19px;
  }
  .journal-cover h1 { font-size: clamp(22px, 6.3vw, 33px); }
  .journal-cover p { color: #f0e0c9; }
  .report-stats { padding-top: 16px; }
  .report-stats small { color: #d6cddd; font-size: 12px; }
  .report-person {
    color: #3e3043;
    background: linear-gradient(150deg, #fff4e2, #f3e5d2);
    border-color: #eecb9f;
    border-radius: 18px;
  }
  .report-avatar img { object-fit: contain; }
  .report-person .eyebrow { color: #72523e; font-size: 11px; }
  .report-person .clue-quote { background: #e5caa74f; }
  .report-evidence li, .report-boundary { font-size: 14px; }
  .report-evidence li small, .report-muted { color: #6c5056; }
  .journal-evidence > summary { color: #69434e; font-weight: 650; }
  .report-hidden { background: linear-gradient(135deg, #353250, #292b45); }
  .locked-note, .site-foot span { color: #b3afc3; }
  #notice { bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }
}

@media screen and (min-width: 760px) {
  .app-shell { border-color: #ecd7b332; }
  .reveal-summary { padding: 24px 22px 18px; }
}
@media screen and (max-width: 360px) {
  .reveal-summary { padding-inline: 12px; }
  .reveal-actions .primary, .reveal-actions .secondary { padding-inline: 8px; }
  .hero-card.left, .hero-card.right { scale: .9; }
}

/* Illustration-led cover. The existing full-resolution portrait is the page. */
@media screen {
  .town-cover {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    min-height: clamp(388px,112vw,535px);
    margin: 9px 0 15px;
    padding: 22px 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-radius: 29px 29px 17px 17px;
    border: 1px solid #f8e2b6;
    background: #faeddc;
    color: #362840;
    box-shadow: 0 14px 40px #100c25a6;
  }
  .town-cover::after {
    content: "";
    position: absolute;
    inset: 7px;
    z-index: -1;
    pointer-events: none;
    border: 1px solid #7e5a433e;
    border-radius: 23px 23px 12px 12px;
  }
  .cover-illustration {
    position: absolute;
    inset: 0;
    z-index: -2;
    background: #faeddc;
  }
  .cover-illustration img {
    position: absolute;
    width: 100%;
    height: 91%;
    bottom: 0;
    object-fit: cover;
    object-position: center 54%;
    mix-blend-mode: multiply;
  }
  .cover-illustration::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,#fcf0df 0%,#fcf0dfef 9%,#fcf0dfb0 23%,transparent 41%,transparent 67%,#23182d38 82%,#23182dd9 100%);
  }
  .cover-heading { max-width: 94%; }
  .cover-kicker {
    display: flex;
    align-items: center;
    gap: 7px;
    color: #684554;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .16em;
  }
  .cover-heading h1 {
    margin: 8px 0 0;
    font-family: var(--serif);
    font-size: clamp(34px,10vw,52px);
    font-weight: 750;
    letter-spacing: -.045em;
    line-height: 1.15;
    text-wrap: balance;
    text-shadow: 0 1px 12px #fff2dcaa;
  }
  .cover-footer {
    display: flex;
    flex-direction: column;
    gap: 7px;
    align-items: flex-start;
    color: #fff5e6;
    font-size: 12px;
    margin: 0 0 2px;
  }
  .cover-link {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    padding: 8px 15px;
    border-radius: 999px;
    border: 1px solid #eed5b2;
    color: #3b2942;
    background: #fae6c4;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    box-shadow: 0 4px 12px #201b303b;
  }
  .cover-credit {
    position: absolute;
    right: 20px;
    bottom: 21px;
    color: #fff4e4;
    font-size: 11px;
  }
  #entry-form, #resume-panel { scroll-margin-top: 16px; }

  /* The actual result illustrations arrive before the report and sharing actions. */
  .reveal-summary {
    position: relative;
    isolation: isolate;
    text-align: center;
    overflow: hidden;
    padding: 20px 16px 15px;
    background: radial-gradient(ellipse at 50% 52%,#7761746b,transparent 70%),
      linear-gradient(155deg,#332943,#1b243a 78%);
  }
  .reveal-summary::before {
    content: "";
    position: absolute;
    inset: 7px;
    z-index: -1;
    border: 1px solid #eac99a30;
    border-radius: 14px;
    pointer-events: none;
  }
  .reveal-summary .eyebrow { color: #f0c991; }
  .reveal-summary .reveal-peek { text-align: left; }
  .reveal-gallery {
    display: flex;
    gap: 7px;
    justify-content: center;
    align-items: center;
    margin: 13px auto 16px;
  }
  .reveal-portrait {
    min-width: 0;
    flex: 0 1 112px;
    display: grid;
    padding: 0;
    overflow: hidden;
    border: 1px solid #ecd09d;
    border-radius: 54px 54px 10px 10px;
    color: #573a42;
    background: #f7ebd6;
    box-shadow: 0 6px 14px #1511235c;
  }
  .reveal-portrait img {
    width: 100%;
    height: clamp(60px,20vw,102px);
    object-fit: contain;
    background: #f7ebd6;
    mix-blend-mode: multiply;
  }
  .reveal-portrait > span {
    font-family: var(--serif);
    font-weight: 670;
    font-size: clamp(11px,3.4vw,14px);
    min-height: 31px;
    display: grid;
    place-items: center;
    padding: 4px 2px;
  }
  .one-resident .reveal-portrait { flex-basis: 150px; border-radius: 75px 75px 9px 9px; }
  .one-resident .reveal-portrait img { height: clamp(93px,29vw,148px); }
  .reveal-moon {
    display: grid;
    place-items: center;
    width: 92px;
    height: 92px;
    margin: 13px auto 16px;
    border-radius: 50%;
    border: 1px solid #e7cc9966;
    background: radial-gradient(circle,#e9c7863b,#6a517628 60%,transparent);
    color: #ffdfaa;
    font-size: 51px;
    line-height: 1;
    box-shadow: 0 0 0 5px #e7cc9917;
  }
  @media (max-width: 360px) {
    .town-cover { padding-inline: 16px; }
    .cover-credit { right: 15px; font-size: 10px; }
    .reveal-summary { padding-inline: 12px; }
  }
}
