@font-face { font-family: 'Newsreader'; src: url('/v3/fonts/newsreader.woff2') format('woff2'); font-style: normal; font-weight: 200 800; font-display: swap; }
@font-face { font-family: 'Newsreader'; src: url('/v3/fonts/newsreader-italic.woff2') format('woff2'); font-style: italic; font-weight: 200 800; font-display: swap; }
@font-face { font-family: 'Source Sans 3'; src: url('/v3/fonts/sourcesans.woff2') format('woff2'); font-weight: 200 900; font-display: swap; }
:root { --ink: #f3e8d2; --ink2: rgba(243,232,210,0.74); --ink3: rgba(243,232,210,0.46); --line: rgba(255,226,186,0.16); --amber: #ffc477;
  --sl: env(safe-area-inset-left, 0px); --sr: env(safe-area-inset-right, 0px); --st: env(safe-area-inset-top, 0px); --sb: env(safe-area-inset-bottom, 0px); --pad: 18px; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0b0d24; color: var(--ink); }
body { font-family: 'Source Sans 3', system-ui, sans-serif; -webkit-font-smoothing: antialiased; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; overscroll-behavior: none; }
#c { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
button { font: inherit; color: var(--ink); background: rgba(14,14,36,0.72); border: 1px solid var(--line); border-radius: 12px; padding: 9px 16px; cursor: pointer; transition: background .25s, border-color .25s, opacity .25s; touch-action: manipulation; }
button:hover { background: rgba(40,36,70,0.72); border-color: rgba(255,226,186,0.3); }
button.primary { background: linear-gradient(180deg, rgba(255,196,119,0.24), rgba(255,160,90,0.14)); border-color: rgba(255,200,140,0.45); }
button.icon { width: 42px; height: 42px; padding: 0; display: grid; place-items: center; flex: none; }
button svg { width: 22px; height: 22px; fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.sound { position: fixed; top: 14px; right: calc(14px + var(--sr)); z-index: 5; }
.layer { position: fixed; inset: 0; opacity: 0; pointer-events: none; transition: opacity .9s ease; }
.layer.show { opacity: 1; }
.layer.show > * { pointer-events: auto; }
.btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

#title { display: flex; justify-content: center; }
.titleBlock { margin-top: 9vh; text-align: center; height: max-content; }
h1 { font-family: 'Newsreader', serif; font-weight: 300; font-size: clamp(52px, 9.5vw, 120px); letter-spacing: 0.03em; margin: 0; color: #fbefd9; text-shadow: 0 0 40px rgba(255,190,130,0.25); }
.sub { font-family: 'Newsreader', serif; font-style: italic; font-size: clamp(16px, 2vw, 21px); color: var(--ink2); margin: 2px 0 26px; }

.corner { position: absolute; top: 18px; left: calc(20px + var(--sl)); height: max-content; }
.brand { font-family: 'Newsreader', serif; font-style: italic; font-size: 22px; color: var(--ink2); }
.cornerR { position: absolute; top: 14px; right: calc(66px + var(--sr)); height: max-content; }
#townHint { position: absolute; left: 0; right: 0; bottom: 18px; margin: 0; text-align: center; font-family: 'Newsreader', serif; font-style: italic; font-size: 17px; color: var(--ink2); pointer-events: none !important; height: max-content; top: auto; }

#pz .top { position: absolute; top: 14px; left: calc(14px + var(--sl)); display: flex; gap: 10px; align-items: flex-start; max-width: min(560px, 62vw); height: max-content; }
#pz .card { background: rgba(8,8,26,0.8); border: 1px solid var(--line); border-radius: 16px; padding: 10px 14px 11px; }
#pz h2 { margin: 0 0 3px; font-family: 'Newsreader', serif; font-weight: 400; font-size: 23px; display: flex; gap: 9px; align-items: baseline; }
#pzNum { color: var(--ink3); font-size: 16px; } #pzTitle { font-style: italic; }
#pzGoal { margin: 0; font-size: 15.5px; line-height: 1.4; color: var(--ink2); }
#pzHint { margin: 6px 0 0; font-family: 'Newsreader', serif; font-style: italic; font-size: 16px; color: #ffd9a6; display: none; }
#pzHint.on { display: block; }
#pz .ctrls { position: absolute; right: calc(14px + var(--sr)); bottom: 14px; display: flex; gap: 8px; height: max-content; left: auto; top: auto; }
#msg { position: absolute; left: 0; right: 0; bottom: 20px; margin: 0 auto; width: max-content; max-width: 56vw; text-align: center; font-family: 'Newsreader', serif; font-style: italic; font-size: 18px; color: var(--ink); text-shadow: 0 1px 12px rgba(0,0,20,0.9); pointer-events: none !important; height: max-content; top: auto; }

#list { display: flex; align-items: center; justify-content: center; background: rgba(5,6,20,0.35); }
.panel { width: min(520px, 92vw); max-height: 92vh; overflow: auto; background: rgba(8,8,26,0.9); border: 1px solid var(--line); border-radius: 20px; padding: 22px 24px 18px; height: max-content; }
.kicker { margin: 0 0 12px; letter-spacing: .18em; text-transform: uppercase; font-size: 12px; color: var(--ink3); }
#evList { list-style: none; margin: 0 0 16px; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; }
#evList button { width: 100%; text-align: left; display: flex; align-items: center; gap: 10px; padding: 8px 11px; background: rgba(255,255,255,0.03); border-color: transparent; }
#evList button:disabled { opacity: .35; cursor: default; }
#evList .n { font-family: 'Newsreader', serif; color: var(--ink3); width: 26px; flex: none; white-space: nowrap; }
#evList .dot { width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,0.12); margin-left: auto; flex: none; }
#evList .solved .dot { background: var(--amber); box-shadow: 0 0 10px rgba(255,190,110,0.9); }

#done { top: auto; bottom: 6vh; left: 50%; right: auto; transform: translateX(-50%); width: min(560px, 90vw); text-align: center; padding: 16px 24px; background: rgba(8,8,26,0.82); border: 1px solid var(--line); border-radius: 20px; height: max-content; }
#doneText { font-family: 'Newsreader', serif; font-style: italic; font-size: 25px; margin: 0 0 2px; color: #ffe6bd; }
#doneWake { font-family: 'Newsreader', serif; font-style: italic; font-size: 16px; margin: 0 0 12px; color: var(--ink2); }
button.back { display: flex; align-items: center; gap: 2px; padding: 0 12px 0 6px; height: 42px; flex: none; }
button.back span { font-size: 14px; }

@media (max-height: 520px) {
  :root { --pad: 10px; }
  .titleBlock { margin-top: 4vh; } h1 { font-size: 58px; } .sub { margin-bottom: 12px; font-size: 15px; }
  button { padding: 6px 12px; font-size: 14px; } button.icon { width: 36px; height: 36px; }
  .sound { top: 8px; right: calc(8px + var(--sr)); }
  .corner { top: 10px; } .brand { font-size: 18px; } .cornerR { top: 8px; right: calc(52px + var(--sr)); }
  #townHint { font-size: 14px; bottom: 8px; }
  #pz .top { top: 8px; left: calc(8px + var(--sl)); max-width: 58vw; gap: 6px; }
  #pz .card { padding: 6px 10px 7px; border-radius: 12px; }
  #pz h2 { font-size: 17px; } #pzNum { font-size: 13px; }
  #pzGoal { font-size: 12.5px; line-height: 1.3; } #pzHint { font-size: 13px; margin-top: 3px; }
  #pz .ctrls { right: calc(8px + var(--sr)); bottom: 8px; gap: 6px; }
  #msg { font-size: 14px; bottom: 10px; max-width: 50vw; }
  #done { bottom: 3vh; padding: 8px 12px; width: min(400px, 52vw); left: 42%; } #doneText { font-size: 16px; } #doneWake { font-size: 12.5px; margin-bottom: 6px; }
  button.back { height: 36px; padding: 0 9px 0 4px; } button.back span { font-size: 12.5px; }
  .panel { padding: 12px 16px; } #evList button { padding: 5px 8px; font-size: 13px; }
}

button.quiet { background: transparent; color: var(--ink3); border-color: transparent; font-size: 13px; }
#confirm { display: none; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); text-align: center; }
#confirm.on { display: block; }
#confirm p { font-family: 'Newsreader', serif; font-style: italic; font-size: 17px; margin: 0 0 10px; }
#pzHow { margin: 6px 0 0; font-size: 13.5px; font-style: italic; font-family: 'Newsreader', serif; color: #f0c98a; opacity: .85; }
@media (max-height: 500px) { #pzHow { font-size: 11.5px; margin-top: 3px; } }

.corner { display: flex; flex-direction: column; gap: 0; }
.kick { letter-spacing: .18em; text-transform: uppercase; font-size: 11px; color: var(--ink3); }
.nightNav { position: absolute; left: calc(20px + var(--sl)); right: calc(20px + var(--sr)); bottom: 46px; display: flex; justify-content: space-between; height: max-content; top: auto; pointer-events: none !important; }
.nightNav button { pointer-events: auto; }
.nightNav button[hidden] { display: inline-block; visibility: hidden; }
#bNextNight { margin-left: auto; }
#phaseDots { display: inline-flex; gap: 5px; margin-left: 6px; align-self: center; }
#phaseDots i { width: 8px; height: 8px; border-radius: 50%; border: 1px solid rgba(255,226,186,0.5); display: block; }
#phaseDots i.on { background: var(--amber); border-color: var(--amber); }
#phaseDots i.cur { border-color: #ffe6bd; box-shadow: 0 0 6px rgba(255,200,140,0.7); }
#intro { display: flex; align-items: center; justify-content: center; background: rgba(5,6,20,0.3); }
.introCard { text-align: center; width: min(480px, 88vw); }
.introCard h2 { font-family: 'Newsreader', serif; font-style: italic; font-weight: 400; font-size: 34px; margin: 2px 0 8px; }
.introCard p#introText { font-family: 'Newsreader', serif; font-size: 18px; line-height: 1.45; color: var(--ink2); margin: 0 0 16px; }
#evList li.nh { grid-column: 1 / -1; font-family: 'Newsreader', serif; font-style: italic; font-size: 16px; color: var(--ink2); margin: 8px 0 2px; }
#evList li.boss button span:nth-child(2) { font-style: italic; color: #ffe0b0; }
@media (max-height: 520px) {
  .nightNav { bottom: 30px; }
  .introCard h2 { font-size: 24px; } .introCard p#introText { font-size: 14px; margin-bottom: 8px; }
  .kick { font-size: 9.5px; }
}
.dedication { font-family: 'Newsreader', serif; font-style: italic; font-size: 15px; color: var(--ink3); margin: 0 0 -4px; letter-spacing: .02em; }
@media (max-height: 520px) { .dedication { font-size: 12px; margin: 0 0 6px; } }

#truth { display: flex; flex-wrap: wrap; gap: 5px; margin: 6px 0 0; }
#truth:empty { display: none; }
#truth .row { display: inline-flex; align-items: center; gap: 3px; padding: 3px 7px; border-radius: 9px; border: 1px solid var(--line); background: rgba(10,10,28,0.5); font-size: 12px; }
#truth .row.cur { border-color: rgba(255,226,186,0.6); }
#truth .row.ok { background: rgba(70,50,30,0.5); border-color: rgba(255,200,130,0.55); }
#truth b { font-family: 'Newsreader', serif; font-style: italic; font-weight: 600; color: var(--ink2); }
#truth i { width: 8px; height: 8px; border-radius: 50%; border: 1px solid rgba(255,226,186,0.45); display: inline-block; margin-right: 3px; }
#truth i.on { background: var(--amber); border-color: var(--amber); }
#truth i.lamp { border-radius: 2px; }
#truth em { font-style: normal; color: var(--ink3); margin: 0 2px; }
@media (max-height: 520px) { #truth .row { padding: 1px 5px; font-size: 10px; } #truth { margin-top: 3px; } }
.kick.lit { color: #ffd9a6; }
@keyframes softPulse { 0%, 100% { box-shadow: 0 0 0 rgba(255,200,140,0); } 50% { box-shadow: 0 0 18px rgba(255,200,140,0.45); } }
button.pulse { animation: softPulse 3.6s ease-in-out infinite; border-color: rgba(255,210,150,0.6); }

.journeyBtn { display: inline-flex; align-items: center; gap: 7px; border-color: rgba(255,210,150,0.55); background: rgba(40,30,30,0.55); }
.journeyBtn svg { width: 18px; height: 18px; }
.prog { font-size: 12.5px; color: #ffd9a6; margin-top: 2px; }
.jBack { position: absolute; left: 0; right: 0; bottom: 22px; display: flex; justify-content: center; height: max-content; top: auto; }
#bEvenings[hidden] { display: none; }
@media (max-height: 520px) { .prog { font-size: 11px; } .jBack { bottom: 10px; } }

#pzCard h2 { cursor: pointer; }
#pzCard.folded #pzGoal, #pzCard.folded #pzHow, #pzCard.folded #pzHint { display: none; }
#pzCard.folded h2::after { content: 'tap to read'; font-family: 'Source Sans 3', sans-serif; font-size: 11px; color: var(--ink3); margin-left: 8px; align-self: center; }
@media (max-height: 520px) { #truth .row { font-size: 11.5px; padding: 2px 6px; } #truth i { width: 9px; height: 9px; } }
/* (12-19) three levers make eight cases: on a short screen their chips are smaller and sit four or five to a line */
/* the mine's cards on a short screen leave out the reminder line under the chips (the desk and a portrait phone still show it) */
@media (max-height: 520px) { #pzCard.mine #pzHow { display: none; } }
@media (max-height: 520px) { #truth.n8 { gap: 3px; } #truth.n8 .row { font-size: 10px; padding: 1px 4px; gap: 2px; } #truth.n8 i { width: 7px; height: 7px; margin-right: 1px; } #truth.n8 em { margin: 0 1px; } }
/* the start-over question floats in the middle of the screen, never below the fold */
#confirm.on { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 50; width: min(380px, 88vw);
  background: #14163a; border: 1px solid var(--line); border-radius: 16px; padding: 22px 20px 18px; margin: 0; box-shadow: 0 30px 80px rgba(0,0,0,.6); }
#confirm.on::before { content: ""; position: fixed; inset: -100vmax; background: rgba(5,6,20,.55); z-index: -1; }

.titleQuiet { display: block; margin: 14px auto 0; font-size: 13px; color: var(--ink3); text-decoration: underline; text-underline-offset: 3px; }
.titleQuiet[hidden] { display: none; }
#confirm { pointer-events: auto; }

.jZoom { position: absolute; right: calc(22px + var(--sr)); bottom: 22px; display: flex; gap: 6px; align-items: center; height: max-content; top: auto; left: auto; }
.jZoom button.icon { width: 38px; height: 38px; font-size: 20px; line-height: 1; }
.jZoom button.soft { font-size: 13px; padding: 8px 12px; }
@media (max-height: 520px) { .jZoom { bottom: 10px; right: calc(10px + var(--sr)); } .jZoom button.icon { width: 34px; height: 34px; } }

/* narrow phones: the zoom controls sit above Back, never on top of it */
@media (max-width: 600px) { .jZoom { bottom: calc(80px + var(--sb)); right: calc(14px + var(--sr)); } }

/* ---- title screen refinement (11-29): dedication sits clear above the wordmark, a soft dusk
   veil quiets the scene behind the type, and "Start over" moves up into the empty sky corner */
.titleBlock { position: relative; padding: 0 4vw; }
.titleBlock::before { content: ''; position: absolute; left: 50%; top: 46%; width: 128%; height: 170%; transform: translate(-50%, -50%); z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side, rgba(10,10,32,0.55), rgba(10,10,32,0.32) 55%, rgba(10,10,32,0) 100%); }
h1 { line-height: 1; }
.dedication { font-size: clamp(14px, 1.45vw, 19px); letter-spacing: .14em; color: var(--ink2); margin: 0 0 clamp(14px, 2.2vw, 30px); text-shadow: 0 1px 10px rgba(0,0,20,0.8); }
.titleBlock .sub { margin-top: clamp(8px, 1.4vw, 18px); text-shadow: 0 1px 12px rgba(0,0,20,0.85); }
h1 { text-shadow: 0 0 40px rgba(255,190,130,0.22), 0 2px 18px rgba(0,0,24,0.55); }
.titleQuiet { position: fixed; left: calc(18px + env(safe-area-inset-left, 0px)); top: calc(18px + var(--st)); margin: 0; padding: 8px 10px; text-decoration: none; letter-spacing: .04em; color: var(--ink3); }
.titleQuiet:hover { color: var(--ink2); text-decoration: underline; }
@media (max-height: 520px) { .dedication { font-size: 12.5px; margin-bottom: 10px; } .titleBlock .sub { margin-top: 6px; } .titleQuiet { top: 10px; left: calc(10px + env(safe-area-inset-left, 0px)); } }
/* options live on the right: "Start over" sits just left of the sound button */
.titleQuiet { left: auto; right: calc(14px + var(--sr) + 56px); top: 14px; height: 44px; display: flex; align-items: center; padding: 0 10px; }
.titleQuiet[hidden] { display: none; }
@media (max-height: 520px) { .titleQuiet { left: auto; right: calc(8px + var(--sr) + 52px); top: 8px; } }

/* the short "Map" label is only for portrait phones */
button.back .short { display: none; }
#safeProbe { position: fixed; left: 0; top: 0; width: 0; height: 0; padding: var(--st) 0 var(--sb) 0; visibility: hidden; pointer-events: none; }
/* landscape and desktop: keep clear of a notch at the top too (0 on most screens) */
.sound { top: calc(14px + var(--st)); }
#pz .top { top: calc(14px + var(--st)); }
.jBack { bottom: calc(22px + var(--sb)); }
.jZoom { bottom: calc(22px + var(--sb)); }
@media (max-height: 520px) { .sound { top: calc(8px + var(--st)); } #pz .top { top: calc(8px + var(--st)); } .jBack { bottom: calc(10px + var(--sb)); } .jZoom { bottom: calc(10px + var(--sb)); } }
@media (max-width: 600px) { .jZoom { bottom: calc(80px + var(--sb)); } }

/* ---- portrait phones (12-01): a slim top bar (Map, the evening's title, sound), the card as a full-width
   strip under it, Undo / Reset / Hint across the thumb zone, the done card as a bottom sheet.
   The puzzle camera frames the pieces into the space left between them (main.js viewCam). */
@media (orientation: portrait) and (max-width: 639px) {
  .sound { top: calc(10px + var(--st)); right: calc(10px + var(--sr)); width: 44px; height: 44px; }
  button.back .long { display: none; } button.back .short { display: inline; }
  button.back { height: 44px; padding: 0 14px 0 6px; } button.back span { font-size: 15px; }
  #pz .top { top: calc(10px + var(--st)); left: calc(10px + var(--sl)); right: calc(10px + var(--sr)); max-width: none;
    display: grid; grid-template-columns: auto minmax(0, 1fr) 44px; gap: 8px; align-items: stretch; }
  #pzCard { display: contents; }
  #pz h2 { grid-column: 2; margin: 0; min-width: 0; height: 44px; padding: 0 12px; border-radius: 12px; background: rgba(8,8,26,0.8); border: 1px solid var(--line);
    font-size: 20px; white-space: nowrap; align-items: center; gap: 8px; }
  #pzNum { font-size: 15px; flex: none; }
  #pzTitle { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  #phaseDots { margin-left: 0; flex: none; gap: 4px; }
  #pzCard h2::after, #pzCard.folded h2::after { content: ''; flex: none; margin-left: auto; width: 7px; height: 7px; border-right: 1.5px solid var(--ink3); border-bottom: 1.5px solid var(--ink3);
    transform: translateY(-2px) rotate(225deg); align-self: center; font-size: 0; }
  #pzCard.folded h2::after { transform: translateY(-3px) rotate(45deg); }
  #pz .cardBody { grid-column: 1 / -1; background: rgba(8,8,26,0.8); border: 1px solid var(--line); border-radius: 14px; padding: 9px 14px 10px; cursor: pointer; }
  #pzCard.folded .cardBody { display: none; }
  #pzCard.folded.chips .cardBody { display: block; padding: 6px 10px; }
  #pzCard.folded.chips #truth { margin-top: 0; }
  #pzGoal { font-size: 16px; line-height: 1.38; }
  #pzHow { font-size: 14.5px; line-height: 1.3; margin-top: 5px; }
  #pzHint { font-size: 15.5px; margin-top: 5px; }
  #truth .row { font-size: 12px; padding: 3px 7px; }
  #pz .ctrls { left: calc(10px + var(--sl)); right: calc(10px + var(--sr)); bottom: calc(10px + var(--sb)); justify-content: center; gap: 8px; transition: opacity .5s; }
  #pz .ctrls button { flex: 1 1 0; max-width: 140px; height: 48px; font-size: 16px; }
  #pz.doneOn .ctrls { opacity: 0; pointer-events: none !important; }
  #pz.doneOn #msg { opacity: 0; }
  #msg { bottom: calc(68px + var(--sb)); max-width: calc(100vw - 32px); font-size: 16px; line-height: 1.3; }
  #done { left: calc(10px + var(--sl)); right: calc(10px + var(--sr)); width: auto; transform: none; bottom: calc(10px + var(--sb)); padding: 12px 14px 12px; border-radius: 18px; background: rgba(8,8,26,0.85); }
  #doneText { font-size: 21px; line-height: 1.2; }
  #doneWake { font-size: 15px; line-height: 1.35; margin: 4px 0 10px; }
  #done .btns { flex-wrap: nowrap; gap: 8px; }
  #done .btns button { flex: 1 1 0; min-height: 46px; padding: 6px 10px; line-height: 1.15; }
  /* the per-Night map: the place's name top left, Journey / Evenings in the thumb zone */
  .corner { top: calc(14px + var(--st)); left: calc(16px + var(--sl)); }
  .cornerR { top: auto; right: calc(10px + var(--sr)); left: calc(10px + var(--sl)); bottom: calc(12px + var(--sb)); display: flex; justify-content: center; gap: 10px; }
  .cornerR button { flex: 1 1 0; max-width: 170px; height: 48px; justify-content: center; font-size: 16px; }
  #townHint { bottom: calc(72px + var(--sb)); padding: 0 18px; font-size: 15.5px; line-height: 1.3; }
  /* title */
  .titleBlock { margin-top: calc(11vh + var(--st)); }
  .titleQuiet { top: calc(10px + var(--st)); right: calc(10px + var(--sr) + 52px); }
  #title .btns button { min-width: 120px; height: 48px; font-size: 17px; }
  /* journey */
  .jBack { bottom: calc(16px + var(--sb)); }
  .jBack button { height: 46px; max-width: calc(100vw - 32px); }
  .jZoom { bottom: calc(76px + var(--sb)); right: calc(12px + var(--sr)); }
  .jZoom button.icon { width: 44px; height: 44px; } .jZoom button.soft { height: 44px; font-size: 14px; }
  #list .panel { max-height: calc(100vh - 32px - var(--st) - var(--sb)); }
  #evList { grid-template-columns: 1fr; }
  /* a boss carries "Night n" and its phase dots: a touch smaller so the title still fits on one line */
  #pzCard.boss h2 { font-size: 18px; gap: 6px; padding: 0 10px; }
  #pzCard.boss #pzNum { font-size: 13px; }
  #pzCard.boss #phaseDots i { width: 7px; height: 7px; }
  #evList button { min-height: 44px; }
}
/* ?debug&insets: fake a notch and a home bar for screenshots */
html.fakeInsets body::before, html.fakeInsets body::after { content: ''; position: fixed; left: 0; right: 0; z-index: 99; pointer-events: none; background: rgba(0,0,0,0.55); }
html.fakeInsets body::before { top: 0; height: var(--st); }
html.fakeInsets body::after { bottom: 0; height: var(--sb); }

/* a finished evening says so beside its title: a small warm 'Lit' tag */
#pzLit { flex: none; align-self: center; margin-left: 10px; padding: 2px 8px 2px 18px; border-radius: 999px; font-family: 'Source Sans 3', sans-serif; font-style: normal; font-weight: 600; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: #ffd9a0; background: rgba(255,200,130,0.12) radial-gradient(circle at 9px 50%, #ffe2b0 0 3px, rgba(255,200,130,0.5) 4px, transparent 7px); border: 1px solid rgba(255,214,160,0.35); line-height: 1.4; }
#pzLit[hidden] { display: none; }

/* share, on the title screen, with the other options on the right: share sits just left of sound */
.shareBtn { position: fixed; top: calc(14px + var(--st)); right: calc(14px + var(--sr) + 52px); z-index: 5; }
.titleQuiet { right: calc(14px + var(--sr) + 104px); }
#shareNote { position: fixed; top: calc(64px + var(--st)); right: calc(14px + var(--sr)); margin: 0; font-family: 'Newsreader', serif; font-style: italic; font-size: 15px; color: var(--ink2); opacity: 0; transition: opacity .6s; pointer-events: none; z-index: 5; }
#shareNote.on { opacity: 1; }
@media (max-height: 520px) { .shareBtn { top: calc(8px + var(--st)); right: calc(8px + var(--sr) + 44px); } .titleQuiet { right: calc(8px + var(--sr) + 88px); } }
@media (orientation: portrait) and (max-width: 639px) { .shareBtn { top: calc(10px + var(--st)); right: calc(10px + var(--sr) + 52px); width: 44px; height: 44px; } .titleQuiet { right: calc(10px + var(--sr) + 104px); } #shareNote { top: calc(62px + var(--st)); } }

/* share lives in the title's main row now, right beside Journey; Start over goes back beside sound */
.shareBtn, .shareBtn:hover { position: static; top: auto; right: auto; width: auto; height: auto; display: inline-flex; align-items: center; gap: 8px; }
.shareBtn svg { width: 18px; height: 18px; }
#title .btns .shareBtn { justify-content: center; }
.titleQuiet { right: calc(14px + var(--sr) + 56px); }
#shareNote { position: static; top: auto; right: auto; margin: 12px 0 0; text-align: center; }
@media (max-height: 520px) { .titleQuiet { right: calc(8px + var(--sr) + 52px); } #shareNote { margin-top: 6px; } }
@media (orientation: portrait) and (max-width: 639px) { .shareBtn { width: auto; height: 48px; } .titleQuiet { right: calc(10px + var(--sr) + 52px); } #title .btns { flex-wrap: wrap; } }

/* share opens a small panel: the link itself, Copy link, and the phone's share sheet where there is one */
#sharePanel { margin: 14px auto 0; padding: 12px 14px; max-width: 360px; border: 1px solid var(--line); border-radius: 14px; background: rgba(12,12,34,0.72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
#sharePanel[hidden] { display: none; }
#shareUrl { display: block; margin: 0 0 10px; font-family: 'Source Sans 3', sans-serif; font-size: 14px; color: var(--ink2); user-select: all; -webkit-user-select: all; word-break: break-all; }
#sharePanel .btns button { min-width: 120px; }
@media (orientation: portrait) and (max-width: 639px) { #sharePanel .btns button { height: 46px; } }

/* portrait phones: the title at the top, the lighthouse in the middle, and the buttons resting on the water below */
@media (orientation: portrait) and (max-width: 639px) {
  #title .titleBlock > .btns { position: fixed; left: 16px; right: 16px; bottom: calc(26px + var(--sb)); margin: 0; }
  #sharePanel { position: fixed; left: 16px; right: 16px; bottom: calc(150px + var(--sb)); margin: 0 auto; }
  #shareNote { position: fixed; left: 0; right: 0; bottom: calc(8px + var(--sb)); margin: 0; }
}

/* portrait phones: one clear main button (Begin / Continue), with Journey and Share side by side beneath it */
@media (orientation: portrait) and (max-width: 639px) {
  #title .titleBlock > .btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; left: max(20px, calc(50% - 170px)); right: max(20px, calc(50% - 170px)); }
  #title .titleBlock > .btns #bBegin { grid-column: 1 / -1; height: 58px; font-size: 19px; letter-spacing: .02em; min-width: 0; }
  #title .titleBlock > .btns #bEvenings, #title .titleBlock > .btns #bShare, #title .titleBlock > .btns #bStory { min-width: 0; height: 46px; font-size: 16px; }
  #sharePanel { bottom: calc(146px + var(--sb)); }
}

/* portrait phones, balanced: a lantern-like Continue pill floating in the middle of the bay,
   Journey and Share as small quiet pills beneath it */
@media (orientation: portrait) and (max-width: 639px) {
  #title .titleBlock > .btns { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 12px 10px; left: 0; right: 0; bottom: calc(11.5vh + var(--sb) * 0.5); }
  #title .titleBlock > .btns #bBegin { flex: 0 0 100%; max-width: 230px; height: 56px; border-radius: 999px; font-size: 19px; letter-spacing: .03em;
    box-shadow: 0 0 0 1px rgba(255,214,160,0.35), 0 0 28px rgba(255,190,120,0.28), 0 8px 24px rgba(0,0,20,0.45); }
  #title .titleBlock > .btns #bEvenings, #title .titleBlock > .btns #bShare, #title .titleBlock > .btns #bStory { flex: 0 0 auto; height: 40px; padding: 0 18px; border-radius: 999px; font-size: 15px; background: rgba(16,16,40,0.4); color: var(--ink2); }
  #title .titleBlock > .btns #bShare svg { width: 15px; height: 15px; }
  #sharePanel { bottom: calc(11.5vh + var(--sb) * 0.5 + 124px); }
  #shareNote { bottom: calc(11.5vh + var(--sb) * 0.5 - 30px); }
}
@media (orientation: portrait) and (max-width: 639px) {
  #title .titleBlock > .btns { display: grid; grid-template-columns: auto auto; justify-content: center; gap: 14px 10px; }
  #title .titleBlock > .btns #bBegin { grid-column: 1 / -1; justify-self: center; width: 230px; max-width: none; flex: none; }
}

@media (orientation: portrait) and (max-width: 639px) {
  #title .titleBlock > .btns { bottom: var(--tbot, calc(11.5vh + var(--sb) * 0.5)); }
  #sharePanel { bottom: calc(var(--tbot, 11.5vh) + 124px); }
  #shareNote { bottom: calc(var(--tbot, 11.5vh) - 30px); }
}

/* desktop and landscape match the phone: a rounded Continue pill on top, Journey and Share as small pills beneath,
   in the same spot under the title as before */
@media not all and (orientation: portrait) and (max-width: 639px) {
  #title .titleBlock > .btns { display: grid; grid-template-columns: auto auto; justify-content: center; gap: 12px 10px; }
  #title .titleBlock > .btns #bBegin { grid-column: 1 / -1; justify-self: center; width: 230px; height: 52px; border-radius: 999px; font-size: 18px; letter-spacing: .03em;
    box-shadow: 0 0 0 1px rgba(255,214,160,0.35), 0 0 28px rgba(255,190,120,0.28), 0 8px 24px rgba(0,0,20,0.45); }
  #title .titleBlock > .btns #bEvenings, #title .titleBlock > .btns #bShare, #title .titleBlock > .btns #bStory { height: 38px; padding: 0 18px; border-radius: 999px; font-size: 15px; background: rgba(16,16,40,0.4); color: var(--ink2); display: inline-flex; align-items: center; justify-content: center; }
  #title .titleBlock > .btns #bShare svg { width: 15px; height: 15px; }
}
@media (max-height: 520px) and (orientation: landscape) {
  #title .titleBlock > .btns { gap: 8px 10px; }
  #title .titleBlock > .btns #bBegin { height: 44px; width: 200px; font-size: 16px; }
  #title .titleBlock > .btns #bEvenings, #title .titleBlock > .btns #bShare, #title .titleBlock > .btns #bStory { height: 34px; font-size: 14px; }
}

/* the Observatory: what's your star sign? (twelve signs and Skip; shown once when the Observatory opens) */
#signPick { display: flex; align-items: center; justify-content: center; background: rgba(5,6,20,0.42); z-index: 20; }
.signCard { text-align: center; width: min(560px, 92vw); }
.signCard h2 { font-family: 'Newsreader', serif; font-style: italic; font-weight: 400; font-size: 32px; margin: 0 0 4px; }
.signSub { font-family: 'Newsreader', serif; font-size: 16px; color: var(--ink2); margin: 0 0 14px; }
.signGrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 0 0 14px; }
.signGrid button { padding: 8px 6px 7px; line-height: 1.15; min-height: 46px; }
.signGrid button b { display: block; font-weight: 600; font-size: 15px; }
.signGrid button span { display: block; font-family: 'Newsreader', serif; font-style: italic; font-size: 13px; color: var(--ink3); }
.signGrid button.cur { border-color: rgba(255,200,140,0.55); background: rgba(255,190,120,0.14); }
#pzSign { margin: 6px 0 0; }
button.linkish { background: none; border: none; padding: 0; color: #ffd9a6; font-family: 'Newsreader', serif; font-style: italic; font-size: 15px; text-decoration: underline; text-decoration-color: rgba(255,217,166,0.4); text-underline-offset: 3px; border-radius: 0; }
button.linkish:hover { background: none; color: #ffe8c8; }
@media (max-height: 520px) {
  .signCard { padding: 12px 16px 10px; width: min(640px, 92vw); } .signCard h2 { font-size: 22px; } .signSub { font-size: 13px; margin-bottom: 8px; } .signCard .kicker { margin-bottom: 4px; }
  .signGrid { grid-template-columns: repeat(6, 1fr); gap: 5px; margin-bottom: 8px; } .signGrid button { min-height: 44px; padding: 5px 3px; } .signGrid button b { font-size: 13.5px; } .signGrid button span { font-size: 11px; }
}
@media (orientation: portrait) and (max-width: 639px) {
  .signGrid { grid-template-columns: repeat(3, 1fr); gap: 6px; } .signCard h2 { font-size: 26px; } .signGrid button b { font-size: 14px; } .signGrid button span { font-size: 12px; }
}
#signPick.show { pointer-events: auto; }

/* Orbit: the ascent, storybook pages and the end of Part 1 (12-06) */
#ascent { z-index: 30; background: #03040c; }
#ascentCv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.ascentSkip, .pageSkip { position: fixed; right: calc(16px + var(--sr)); top: calc(14px + var(--st)); z-index: 2; opacity: .8; }
button.pageSkip { background: rgba(12,12,32,0.96); border-color: var(--line); color: var(--ink2); opacity: 1; } /* solid, so the buttons under the page never show through it */
#page { z-index: 28; display: flex; align-items: center; justify-content: center; background: rgba(3,4,14,0.96); cursor: pointer; }
.pageCard { width: min(880px, 92vw); display: flex; flex-direction: column; align-items: center; }
#pageCv { width: 100%; aspect-ratio: 16 / 9; max-height: 62vh; border-radius: 14px; display: block; background: #0b0c22; box-sizing: border-box; border: 1px solid rgba(255,226,186,0.3); box-shadow: 0 0 0 5px rgba(10,10,28,0.9), 0 0 0 6px rgba(255,226,186,0.12), 0 14px 44px rgba(0,0,0,0.55); }
#pageLines { margin: 18px 8px 4px; text-align: center; font-family: 'Newsreader', serif; font-style: italic; font-size: 22px; line-height: 1.45; color: #fbefd9; }
#pageLines span { display: block; }
#pageTap { margin: 6px 0 0; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink3); }
#endCard { z-index: 26; display: flex; align-items: center; justify-content: center; background: rgba(3,4,14,0.5); }
.endPanel { text-align: center; width: min(460px, 88vw); }
.endPanel h2 { font-family: 'Newsreader', serif; font-style: italic; font-weight: 400; font-size: 36px; margin: 2px 0 6px; color: #ffe6bd; }
.endSub { font-family: 'Newsreader', serif; font-size: 18px; line-height: 1.45; color: var(--ink2); margin: 0 0 16px; }
@media (max-height: 520px) { #pageCv { max-height: 58vh; width: auto; height: 58vh; } #pageLines { font-size: 16px; margin-top: 10px; } .endPanel h2 { font-size: 26px; } .endSub { font-size: 14px; margin-bottom: 8px; } }
@media (orientation: portrait) and (max-width: 639px) { #pageCv { aspect-ratio: 4 / 5; max-height: 58vh; } #pageLines { font-size: 18px; } }

/* San Francisco (12-07): a storybook line on the solved card, and the paper crane's name */
#doneStory { font-family: 'Newsreader', serif; font-style: italic; font-size: 15px; line-height: 1.4; margin: -6px 0 12px; color: #ffd9a6; opacity: .92; }
#doneStory:empty { display: none; }
#friendPick { display: flex; align-items: center; justify-content: center; background: rgba(5,6,20,0.48); z-index: 22; }
#friendPick.show { pointer-events: auto; }
.friendCard { text-align: center; width: min(460px, 92vw); background: rgba(10,10,30,0.94); }
.friendCard h2 { font-family: 'Newsreader', serif; font-style: italic; font-weight: 400; font-size: 30px; margin: 0 0 4px; }
#friendCv { display: block; width: 100%; height: 130px; margin: -4px 0 8px; border-radius: 12px; }
#friendIn { font: inherit; font-family: 'Newsreader', serif; font-style: italic; font-size: 19px; color: var(--ink); background: rgba(16,16,40,0.6); border: 1px solid rgba(255,200,140,0.35); border-radius: 12px; padding: 10px 14px; width: min(300px, 100%); box-sizing: border-box; text-align: center; margin: 0 0 14px; outline: none; }
#friendIn:focus { border-color: rgba(255,210,150,0.7); }
#friendIn::placeholder { color: var(--ink3); }
.friendCard .btns { justify-content: center; }
.friendRow { margin: -4px 0 8px; font-family: 'Newsreader', serif; font-style: italic; font-size: 15px; color: var(--ink2); }
.friendRow b { font-weight: 600; color: var(--ink); }
@media (max-height: 520px) { .friendCard { padding: 10px 16px 10px; } .friendCard h2 { font-size: 22px; } #friendCv { height: 74px; margin-bottom: 4px; } .friendCard .signSub { font-size: 13px; margin-bottom: 8px; } #friendIn { padding: 7px 12px; font-size: 17px; margin-bottom: 8px; } .friendCard .kicker { margin-bottom: 4px; } #doneStory { font-size: 12px; margin: -4px 0 6px; } }
@media (orientation: portrait) and (max-width: 639px) { .friendCard h2 { font-size: 25px; } #doneStory { font-size: 14px; margin: -6px 0 10px; } }
/* story pages: a storybook plate. Square corners, a warm paper mat, and four folded paper photo corners (origami, like the boat) */
.pageFrame { position: relative; line-height: 0; padding: 11px; background: linear-gradient(160deg, #6f6658, #5e5649 60%, #534c42); box-shadow: 0 1px 0 rgba(255,235,205,0.18) inset, 0 16px 46px rgba(0,0,0,0.6); }
#pageCv { border-radius: 0; border: 0; box-shadow: 0 0 0 1px rgba(20,16,12,0.5); width: min(858px, calc(92vw - 22px), calc((62vh - 22px) * 16 / 9)); max-height: none; height: auto; }
.pageFrame .pc { position: absolute; width: 30px; height: 30px; pointer-events: none; }
.pageFrame .pc::before { content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, #9a8e79 0 48%, #6d6455 52% 100%); clip-path: polygon(0 0, 100% 0, 0 100%); filter: drop-shadow(1px 1px 1px rgba(0,0,0,0.35)); }
.pageFrame .pc.tl { left: 5px; top: 5px; }
.pageFrame .pc.tr { right: 5px; top: 5px; transform: scaleX(-1); }
.pageFrame .pc.bl { left: 5px; bottom: 5px; transform: scaleY(-1); }
.pageFrame .pc.br { right: 5px; bottom: 5px; transform: scale(-1, -1); }
@media (max-height: 520px) { #pageCv { width: min(calc(92vw - 22px), calc((58vh - 22px) * 16 / 9)); height: auto; } }
@media (orientation: portrait) and (max-width: 639px) { .pageFrame { padding: 8px; } #pageCv { width: min(calc(92vw - 16px), calc((58vh - 16px) * 4 / 5)); } .pageFrame .pc { width: 22px; height: 22px; } .pageFrame .pc.tl, .pageFrame .pc.bl { left: 3px; } .pageFrame .pc.tr, .pageFrame .pc.br { right: 3px; } .pageFrame .pc.tl, .pageFrame .pc.tr { top: 3px; } .pageFrame .pc.bl, .pageFrame .pc.br { bottom: 3px; } }
#evList .nh button.storyAgain { display: inline; width: auto; margin-left: 12px; padding: 0; background: none; border: none; font-size: 14px; letter-spacing: 0; text-transform: none; vertical-align: baseline; }

/* the storybook: every chapter (place) whose pages you have seen, to read again */
#book { display: flex; align-items: center; justify-content: center; background: rgba(5,6,20,0.55); z-index: 24; }
#book.show { pointer-events: auto; }
.bookPanel { text-align: center; width: min(460px, 92vw); background: rgba(8,8,26,0.94); }
#bookList { list-style: none; margin: 14px 0 6px; padding: 0; display: flex; flex-direction: column; gap: 8px; text-align: left; }
#bookList button { width: 100%; display: flex; align-items: baseline; gap: 12px; padding: 11px 14px; }
#bookList .ch { color: var(--ink2); font-size: 13px; letter-spacing: .06em; text-transform: uppercase; flex: none; min-width: 74px; }
#bookList .pl { font-family: 'Newsreader', serif; font-style: italic; font-size: 18px; }
.bookEmpty { color: var(--ink2); font-style: italic; }
/* title buttons, all sizes: Continue on its own line, then Journey, Story and Share in one centred row */
#title .titleBlock > .btns { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; }
#title .titleBlock > .btns::before { content: ''; flex: 0 0 100%; height: 0; order: 1; }
#title .titleBlock > .btns #bBegin { order: 0; flex: 0 0 auto; margin: 0 auto; }
#title .titleBlock > .btns #bEvenings, #title .titleBlock > .btns #bStory, #title .titleBlock > .btns #bShare { order: 2; flex: 0 0 auto; }
#bStory[hidden] { display: none; }
/* every action button is a pill, like the title's Continue / Map / Story / Share (list rows and sign tiles stay soft rectangles) */
button:not(.linkish) { border-radius: 999px; padding-left: 18px; padding-right: 18px; }
#evList button, .signGrid button, #bookList button, #zoomBtns button { border-radius: 12px; }
#evList button { padding-left: 11px; padding-right: 11px; }

.bookMore { color: #e9c99a; font-family: 'Newsreader', serif; font-style: italic; font-size: 16px; margin: 6px 0 2px; }
.bookMore[hidden], .bookEmpty[hidden] { display: none; }

/* round icon buttons keep their icon centred (the pill padding does not apply), and a soft speaker */
button.icon { padding: 0; border-radius: 50%; }
#bSound svg { width: 20px; height: 20px; stroke-width: 1.7; }
#bSound svg .spk { fill: rgba(255,236,210,0.16); }
