:root {
  color-scheme: light;
  --ink: #24231d;
  --muted: #575548;
  --paper: #f4f0e5;
  --cream: #faf6eb;
  --dark: #183451;
  --gold: #ffda6c;
  --line: #aaa38f;
  --red: #a52424;
  --rule: #342e25;
  --display: 'Helvetica Neue', Arial, sans-serif;
  --numbers: 'Courier New', ui-monospace, monospace;
  --sans: system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.55 var(--sans);
}

[hidden] {
  display: none!important;
}

button,input,select,textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: default;
}

a {
  color: inherit;
}

button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,canvas:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 3px;
}

.shell {
  width: min(1180px,calc(100% - 64px));
  margin-inline: auto;
}

.top {
  background: var(--paper);
}

.bar {
  min-height: 62px;
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--rule);
}

.brand {
  font: 750 .97rem/1.1 var(--display);
  color: var(--red);
  white-space: nowrap;
  text-decoration: none;
}

.bar nav, .top-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.bar nav {
  margin-inline-start: auto;
}

.bar nav button, .text-button {
  background: none;
  border: 0;
  padding: 8px;
  font-size: .85rem;
  font-weight: 680;
}

.bar nav button:hover, .text-button:hover, .brand:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  background: #e5f5fb;
  border: 1px solid #c5e6f3;
  border-radius: 50%;
  color: inherit;
  width: 42px;
  height: 42px;
  flex: none;
  font-size: 1.2rem;
}

.top-actions .icon-button {
  width: 37px;
  height: 37px;
  border: 1px solid var(--rule);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
}

.icon-button[aria-pressed=true] {
  background: var(--ink);
  color: var(--cream);
}

.hero {
  position: relative;
  isolation: isolate;
  padding: clamp(23px, 4vw, 57px) 0 0;
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 18px;
  margin-bottom: 18px;
}

.hero-copy {
  min-width: 0;
}

.eyebrow {
  margin: 0;
  font: 700 .78rem/1.1 var(--numbers);
  letter-spacing: .055em;
  text-transform: uppercase;
}

.season {
  color: var(--red);
  margin: 0 0 9px 3px;
}

.hero h1 {
  font: 750 clamp(3rem, 8.65vw, 7.6rem)/.92 var(--display);
  letter-spacing: -.062em;
  margin: 0 0 0 -.045em;
}

.hero-meta {
  padding-bottom: 2px;
}

.countdown {
  min-width: 174px;
  border-block-start: 1px solid var(--rule);
  padding-top: 6px;
  font-size: .75rem;
}

#countdown-title {
  color: var(--muted);
  margin-bottom: 6px;
}

.countdown-ticks {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
}

.countdown-ticks span {
  display: grid;
  gap: 3px;
}

.countdown-ticks b {
  font: 700 1.1rem/.95 var(--numbers);
}

.countdown-ticks small {
  font-size: .66rem;
}

.hero-feature {
  display: grid;
  grid-template-columns: minmax(0, 2.15fr) minmax(245px, 1fr);
  border: 1px solid var(--rule);
}

.island-stage {
  position: relative;
  min-height: clamp(360px, 33vw, 465px);
  background: #e7a480;
}

.hero-actions {
  position: relative;
  z-index: 2;
  display: grid;
  align-content: center;
  padding: clamp(15px, 2.6vw, 37px);
  border-inline-start: 1px solid var(--rule);
  background: var(--cream);
}

.hero-day {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: end;
  column-gap: 14px;
  row-gap: 4px;
  margin-bottom: 18px;
}

.hero-day .eyebrow {
  grid-column: 1/-1;
  color: var(--red);
  margin: 0 0 0 1px;
}

.hero-day strong {
  font: 720 clamp(3.9rem, 7vw, 6.1rem)/.83 var(--display);
  letter-spacing: -.062em;
  color: var(--red);
  margin-inline-start: -.06em;
}

#hero-day-title {
  align-self: end;
  font-size: clamp(1rem, 2vw, 1.38rem);
  font-weight: 740;
  letter-spacing: -.025em;
  line-height: 1.06;
}

.primary {
  background: var(--red);
  color: #fff9ec;
  border: 1px solid var(--red);
  border-radius: 0;
  padding: 9px 15px;
  font-weight: 770;
  min-height: 44px;
}

.primary:hover:not(:disabled) {
  background: #852020;
}

.hero .primary {
  text-align: left;
}

.hero-links {
  display: grid;
  margin-top: 5px;
}

.hero-links button {
  text-align: left;
  padding: 7px 0;
  min-height: 38px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  font-size: .87rem;
  font-weight: 700;
}

.hero-links button:hover {
  color: var(--red);
}

.advent {
  margin-top: 16px;
}

.advent h2 {
  margin: 0;
  font: 700 .82rem/1.1 var(--display);
}

.advent-candles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
  list-style: none;
  margin: 7px 0 0;
  padding: 0;
}

.advent-candle {
  display: grid;
  justify-items: center;
  gap: 4px;
  color: var(--muted);
  font: 700 .72rem/1.1 var(--numbers);
  white-space: nowrap;
}

.candle-drawing {
  display: grid;
  justify-items: center;
  align-content: end;
  height: 55px;
}

.candle-wax {
  position: relative;
  width: 13px;
  height: 33px;
  border-radius: 1px 1px 0 0;
  background: #af9aa5;
}

.candle-wax::before {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 6px;
  width: 1px;
  height: 4px;
  background: #503643;
}

.candle-wax::after {
  content: "";
  position: absolute;
  left: -4px;
  right: -4px;
  bottom: 0;
  height: 2px;
  background: #503643;
}

.candle-flame {
  width: 12px;
  height: 15px;
  margin-bottom: 3px;
  border: 1px solid #b8472d;
  border-radius: 75% 25% 65% 60%;
  background: #f6b743;
  transform: rotate(-8deg);
  visibility: hidden;
}

.advent-candle.is-lit { color: var(--red); }
.advent-candle.is-lit .candle-wax { background: #694056; }
.advent-candle.is-lit .candle-flame { visibility: visible; }

.landmarks {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.landmark {
  pointer-events: auto;
  position: absolute;
  left: calc(var(--x) + var(--pin-x,0px));
  top: calc(var(--y) + var(--pin-y,0px));
  transform: translate(-50%,-100%);
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 4px 8px;
  border: 1px solid var(--rule);
  background: var(--cream);
  color: var(--ink);
  font-size: .77rem;
  font-weight: 720;
  white-space: nowrap;
}

.landmark strong {
  color: var(--red);
  font: 700 .84rem/1 var(--numbers);
}

.landmark:hover, .landmark.is-today {
  background: var(--red);
  color: #fff9ec;
}

.landmark:hover strong, .landmark.is-today strong {
  color: inherit;
}

.landmark.is-later:not(:hover) {
  background: #e6ddcd;
  color: #544c40;
}

.calendar-shell {
  padding-top: 13px;
}

.scene-layer, #snow {
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
  pointer-events: none;
}

#snow {
  z-index: 2;
}

.preview-strip {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 16px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: .82rem;
}

.preview-strip>span {
  font-weight: 800;
  letter-spacing: .1em;
}

.preview-strip label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.preview-strip select {
  background: var(--cream);
  border-color: var(--line);
  border-radius: 0;
}

select,input,textarea {
  background: #f7fcff;
  border: 1px solid #b7d6e5;
  border-radius: 7px;
  padding: 8px 9px;
  max-width: 100%;
}

.paper {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 24px;
}

.login {
  margin: 30px auto 0;
  max-width: 580px;
}

.login h2,.cal h2,dialog h2 {
  margin: 0;
  font: 850 clamp(2rem,4.1vw,3rem)/1.05 var(--display);
  letter-spacing: -.045em;
}

.login form label {
  display: block;
  font-weight: 700;
}

.formrow {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.formrow input {
  min-width: 0;
  flex: 1;
}

.cal {
  margin-top: 40px;
}

.cal-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 9px;
  margin-bottom: 12px;
}

.cal-head > p {
  color: var(--muted);
  font: 700 .8rem/1.2 var(--numbers);
  white-space: nowrap;
  margin: 0;
}

.doors {
  display: grid;
  grid-template-columns: repeat(6,minmax(0,1fr));
  border-top: 1px solid var(--rule);
  border-inline-start: 1px solid var(--rule);
}

.door {
  appearance: none;
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  align-content: space-between;
  gap: 8px;
  text-align: left;
  border: 0;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 12px 14px;
  min-height: clamp(93px, 10vw, 133px);
  background: var(--cream);
  color: var(--ink);
}

.door:focus-visible {
  z-index: 2;
  outline-offset: -4px;
}

.door strong {
  font: 720 clamp(1.8rem, 4vw, 3.6rem)/.85 var(--display);
  letter-spacing: -.045em;
}

.door span {
  font-size: .87rem;
  font-weight: 690;
  line-height: 1.22;
  grid-column: 1/-1;
  overflow-wrap: anywhere;
}

.door i {
  align-self: start;
  font-style: normal;
  font-size: .94rem;
}

.door i::before { content: "↗"; }
.door.opened i::before { content: "✓"; }
.door.locked i::before { content: "·"; }
.door.locked { background: #ece7da; color: #5b5549; }
.door.locked span { font-weight: 500; }
.door.now { background: var(--red); color: #fff8e9; }
.door:not(.now):hover { background: #f1d1b9; color: var(--ink); }

.footer {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  margin-block: 26px 35px;
  font-size: .875rem;
}

.status,.error {
  color: #8b3a2d;
}

.status:empty,.error:empty {
  display: none;
}

dialog {
  background: var(--cream);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 1px;
  width: min(760px,calc(100% - 24px));
  max-height: calc(100dvh - 24px);
  padding: clamp(17px,4vw,34px);
  box-shadow: 0 22px 52px #211b2954;
  overscroll-behavior: contain;
}

dialog::backdrop {
  background: #25211d99;
}

dialog>h2 {
  margin: 0 0 15px;
}

.dialog-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 6px;
}

.dialog-bar .eyebrow {
  margin: 0;
  color: var(--red);
}

dialog:not([data-scene^="map"]) .close {
  color: var(--ink);
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 0;
}

.close {
  border-color: #c2dce8;
}

.stack {
  display: grid;
  gap: 11px;
}

.stack>* {
  margin: 0;
}

.option,.secondary {
  border: 1px solid #c2dce8;
  background: #f5fbfe;
  padding: 10px 13px;
  border-radius: 8px;
  text-align: left;
  min-height: 44px;
}

.option:hover,.secondary:hover {
  border-color: #608caa;
  background: #e6f4fa;
}

.game-message {
  min-height: 1.55em;
  color: #2f657c;
  font-weight: 650;
}

.fine {
  font-size: .875rem;
  color: var(--muted);
}

.medallion {
  position: relative;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  border: 2px solid #233b32;
  font-size: 1.25rem;
}

.avatar-preview {
  width: 185px;
  height: 185px;
  font-size: 3.5rem;
  margin: 6px auto;
}

.tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tools button {
  font-size: .875rem;
  min-height: 39px;
  padding: 6px 9px;
}

.tools button[aria-pressed=true] {
  background: #215892;
  color: #fff6e0;
}

.spot-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.spot-scene {
  position: relative;
  aspect-ratio: 3/2;
  background: #b4dced;
  border-radius: 10px;
}

.spot-scene canvas {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: inherit;
}

.spot-scene button {
  display: grid;
  place-items: center;
  position: absolute;
  transform: translate(-50%,-50%);
  width: clamp(30px,6vw,48px);
  height: clamp(30px,6vw,48px);
  border-radius: 50%;
  border: 2px solid transparent;
  background: none;
  font-size: clamp(1rem,3vw,1.8rem);
  padding: 0;
  line-height: 1;
  box-shadow: none;
}

.spot-scene button:hover, .spot-scene button:focus-visible {
  border-color: #23568c;
  background: transparent;
}

.spot-scene button.found {
  border: 3px solid #154773;
  background: #a9ecda40;
}

.memory {
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 8px;
  padding: 10px;
  background: #ebe3d3;
  border: 1px solid var(--line);
}

.memory button {
  min-height: 56px;
  aspect-ratio: 1.3;
  background: #4b6261;
  color: #fff6e5;
  border: 1px solid #344846;
  border-radius: 2px;
  font-size: 1.7rem;
}

.memory button.visible {
  background: #ffebaa;
  color: #173554;
}

.letters {
  letter-spacing: .3em;
  font: 700 clamp(1.45rem,6vw,2.6rem) var(--display);
  color: #824531;
}

.art-board {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 9px;
  background: #153530;
  touch-action: none;
}

.art-gallery {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 10px;
}

.art-gallery figure {
  margin: 0;
}

.art-gallery img,.photo {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 7px;
}

.album-grid {
  display: grid;
  grid-template-columns: repeat(7,minmax(0,1fr));
  gap: 6px;
}

.album-grid button {
  padding: 5px;
  text-align: center;
  font-size: clamp(1rem,4vw,1.75rem);
  letter-spacing: 0;
}

.album-grid button:disabled {
  opacity: .58;
}

.logic-grid {
  display: grid;
  grid-template-columns: repeat(3,45px);
  gap: 3px;
  font-size: 1.45rem;
  text-align: center;
}

.logic-grid span {
  background: #ebdfc6;
  border-radius: 5px;
}

.finale {
  position: relative;
  overflow: hidden;
  background: #24598b;
  color: #fff5dd;
  padding: 14px 20px;
  border-radius: 9px;
}

.finale h3 {
  width: max-content;
  max-width: 100%;
  font: 900 clamp(2.5rem,9vw,4.2rem)/1.12 var(--display);
  color: #ffd972;
  margin: 4px 0;
}

.choice-list {
  display: grid;
  gap: 7px;
}

.finale canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.memory canvas {
  display: block;
  max-width: 52px;
  width: 100%;
  margin: auto;
}

.art-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.score-session {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.spot-caption {
  display: grid;
  grid-template-columns: 1fr 1fr;
  text-align: center;
}

@media(max-width:760px) {
  .shell { width: calc(100% - 32px); }
  .bar { min-height: 53px; gap: 4px; }
  .bar nav, .top-actions { gap: 3px; }
  .bar nav button { padding-inline: 5px; }
  .cal { margin-top: 27px; }
  .doors { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .door { min-height: 97px; padding: 9px; }
  .door span { font-size: .78rem; }
  .preview-strip { gap: 5px 10px; }
  .preview-strip select { padding: 3px 6px; }
  .spot-scene button { width: 30px; height: 30px; font-size: 1.05rem; }
}

@media(max-width:365px) {
  .cal-head { flex-wrap: wrap; }
  .album-grid { grid-template-columns: repeat(5,minmax(0,1fr)); }
}

@media(prefers-reduced-motion:reduce) {
  #snow {
    display: none;
  }
}

.letters {
  font-family: ui-monospace, monospace;
  white-space: pre;
  overflow-wrap: anywhere;
  letter-spacing: .12em;
  background: #e2f3fb;
  border-radius: 9px;
  padding: 14px;
  margin: 0;
  text-align: center;
  font-size: clamp(1rem,4vw,1.75rem);
  letter-spacing: 0;
}

.album-grid button[aria-pressed=true] {
  background: #215892;
  color: #fff6e0;
}

.photo {
  max-height: 65vh;
  object-fit: contain;
}

.avatar-preview {
  white-space: nowrap;
}

.medallion canvas {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
}

.avatar-badge {
  position: absolute;
  right: -2px;
  bottom: -2px;
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  background: #24483d;
  color: #fff3cc;
  border: 1px solid var(--cream);
  border-radius: 50%;
  font-size: .62rem;
}

.avatar-preview .avatar-badge {
  width: 38px;
  height: 38px;
  border-width: 2px;
  font-size: 1.35rem;
}

.cal {
  scroll-margin-top: 20px;
}

.primary:disabled {
  background: #e2eaf0;
  color: #50697c;
}

@media (max-width: 960px) {
  .hero-feature { grid-template-columns: minmax(0, 1.7fr) minmax(235px, 1fr); }
  .island-stage { min-height: 330px; }
}

@media (max-width: 680px) {
  .hero-inner { flex-wrap: wrap; row-gap: 12px; margin-bottom: 10px; }
  .hero h1 { font-size: clamp(2.52rem, 12.6vw, 5rem); }
  .hero-meta { width: 100%; }
  .countdown { border: 0; padding: 0; display: flex; align-items: baseline; gap: 12px; }
  #countdown-title { margin: 0; }
  .countdown-ticks { gap: 9px; }
  .countdown-ticks span { display: flex; align-items: baseline; }
  .countdown-ticks b { font-size: .82rem; }
  .hero-feature { grid-template-columns: 1fr; }
  .island-stage { min-height: clamp(220px, 65vw, 345px); }
  .hero-actions { padding: 13px; border-inline-start: 0; border-top: 1px solid var(--rule); }
  .hero-day { grid-template-columns: auto 1fr; gap: 4px 9px; margin-bottom: 11px; }
  .hero-day strong { font-size: 3.05rem; }
  .hero-links button { font-size: .77rem; }
}

@media (max-width: 540px) {
  .landmark { justify-content: center; width: 36px; min-height: 36px; padding: 0; }
  .landmark span { display: none; }
  .landmark[data-visit="22"] { --pin-x: 10px; --pin-y: 7px; }
  .bar { flex-wrap: wrap; padding-top: 7px; }
  .bar nav { order: 3; flex-basis: 100%; margin: 0; gap: 11px; }
  .bar nav button { padding-inline: 0; }
  .doors { grid-template-columns: repeat(3,minmax(0,1fr)); }
}

dialog[data-scene="art"], dialog[data-scene="spot"], dialog[data-scene="avatar"] {
  width: min(1010px,calc(100% - 24px));
}

.score-session {
  align-items: center;
  border: 1px solid #bad2eb;
  border-radius: 8px;
  background: #dcecff;
  color: #24466f;
  padding: 8px 12px;
}

.score-session strong {
  font-variant-numeric: tabular-nums;
}

dialog[data-scene="spot"] .score-session {
  background: #f8e8cc;
  border-color: #e9cda1;
}

.portrait-stage {
  position: relative;
  min-height: 235px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid #abc8e0;
  border-radius: 13px;
  background: #a4e2ef;
}

.portrait-stage > canvas {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.portrait-stage .avatar-preview {
  position: relative;
  width: 158px;
  height: 158px;
  margin: 18px;
  border-color: #45668d;
  box-shadow: 0 4px 0 #38568877;
}

.portrait-controls {
  display: grid;
  gap: 8px 12px;
  grid-template-columns: 2fr 1fr;
}

.portrait-controls fieldset {
  min-width: 0;
  margin: 0;
  padding: 6px 0 0;
  border: 0;
}

.portrait-controls fieldset:first-child {
  grid-column: 1/-1;
}

.portrait-controls legend {
  padding: 0;
  font-weight: 770;
}

.portrait-choices {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.portrait-option {
  display: grid;
  place-items: center;
  background: #fff;
  border: 1px solid #c8badc;
  border-radius: 8px;
  min-width: 43px;
  min-height: 43px;
  padding: 3px;
}

.portrait-option canvas {
  display: block;
  width: 43px;
  height: 43px;
}

.portrait-option[aria-pressed="true"] {
  border-color: #59459b;
  background: #dfd4f4;
  box-shadow: 0 0 0 1px #59459b;
}

.paint-dot {
  display: inline-block;
  width: 23px;
  height: 23px;
  border: 1px solid #56718c;
  border-radius: 50%;
}

.palette button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.art-stage {
  display: grid;
  grid-template-columns: minmax(0,1fr) 205px;
  gap: 10px;
  align-items: start;
}

.art-toolbox {
  background: #e1d8f2;
  border: 1px solid #c8badd;
  border-radius: 10px;
  padding: 10px;
  display: grid;
  gap: 10px;
}

@media (max-width: 665px) {
  .art-stage, .portrait-controls {
    grid-template-columns: 1fr;
  }

  .portrait-stage {
    min-height: 192px;
  }

  .portrait-stage .avatar-preview {
    width: 129px;
    height: 129px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .door:hover {
    transform: none;
  }
}

.quiz-heading {
  background: #ece5d5;
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 15px;
}

.quiz-heading h3 {
  margin: 8px 0 0;
  font: 800 clamp(1.08rem,3.1vw,1.48rem)/1.3 var(--display);
}

.quiz-heading progress {
  display: block;
  width: 100%;
  height: 6px;
  margin-top: 5px;
  accent-color: var(--red);
}

.choice-list .option {
  display: flex;
  gap: 10px;
  align-items: center;
  background: #fcf9ef;
  border-color: var(--line);
  border-radius: 0;
}

.choice-letter {
  flex: none;
  width: 27px;
  min-height: 27px;
  display: grid;
  place-items: center;
  color: var(--red);
  background: transparent;
  border: 1px solid var(--line);
  font-family: var(--numbers);
  font-weight: 800;
}

.choice-list .option.is-correct {
  background: #e3f2e9;
  border-color: #6eaa8f;
}

.choice-list .option.is-incorrect {
  background: #f9e4df;
  border-color: #ca8986;
}

.quiz-total {
  border: 1px solid #b9d5c2;
  background: #e6f0e6;
  border-radius: 10px;
  text-align: center;
  padding: 18px;
  font-weight: 800;
}

.daily-poem {
  border: 1px solid var(--line);
  background: #f1ebdc;
  padding: clamp(18px, 5vw, 32px);
}

.daily-poem p {
  margin: 0;
  white-space: pre-line;
  line-height: 1.75;
}

.daily-poem.finale {
  background: #24598b;
  border-color: #24598b;
}

.fortune-note, .day-challenge {
  padding: clamp(16px, 4vw, 32px);
  border: 1px solid var(--line);
  background: #eee7d7;
}

.fortune-note blockquote {
  margin: 0;
  color: var(--ink);
  font: 700 clamp(1.35rem, 3vw, 2rem)/1.22 var(--display);
  letter-spacing: -.025em;
}

.fortune-note p {
  margin: 12px 0 0;
  font-size: 1.1rem;
}

.fortune-note figcaption {
  margin-top: 12px;
  font-size: .79rem;
  color: var(--muted);
}

.directory-grid {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  border-top: 1px solid var(--line);
  border-inline-start: 1px solid var(--line);
}

.directory-entry {
  display: flex;
  gap: 8px;
  align-items: center;
  min-height: 48px;
  padding: 5px 7px 5px 5px;
  text-align: left;
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--cream);
  color: var(--ink);
  font-size: .875rem;
  line-height: 1.18;
  font-weight: 700;
}

.directory-entry strong {
  flex: none;
  display: grid;
  place-items: center;
  width: 27px;
  height: 29px;
  font-family: var(--numbers);
  color: var(--red);
}

.directory-entry.is-locked {
  background: #ece7da;
  color: var(--muted);
}

.directory-entry:hover {
  background: #f1d1b9;
}

.directory-mark {
  margin-left: auto;
  color: #26795a;
}

@media (max-width: 360px) {
  .directory-entry {
    font-size: .79rem;
  }

  .directory-entry strong {
    width: 22px;
  }
}

dialog[data-scene="map"], dialog[data-scene="map-board"] {
  --atlas-ink: #19302d;
  --atlas-muted: #4e625d;
  --atlas-paper: #fffdf7;
  --atlas-line: #c6cbb8;
  --atlas-red: #9d392e;
  --atlas-head: Georgia, 'Times New Roman', serif;
  width: min(1190px, calc(100% - 30px));
  padding: clamp(16px, 3vw, 29px);
  color: var(--atlas-ink);
  background: #f4f1e6;
  border: 1px solid #e6dfc8;
}

dialog[data-scene="map-board"] { width: min(650px, calc(100% - 30px)); }

dialog:is([data-scene="map"], [data-scene="map-board"]) > h2 {
  color: var(--atlas-ink);
  font: 700 clamp(2rem, 5vw, 3.15rem)/.97 var(--atlas-head);
  letter-spacing: -.065em;
  margin: 0 0 16px;
}

dialog:is([data-scene="map"], [data-scene="map-board"]) .dialog-bar {
  border-bottom: 1px solid var(--atlas-line);
  margin-bottom: 10px;
  padding-bottom: 5px;
}

dialog:is([data-scene="map"], [data-scene="map-board"]) .dialog-bar .eyebrow,
.atlas-kicker {
  color: var(--atlas-red);
  font-size: .69rem;
  letter-spacing: .16em;
  font-weight: 800;
}

dialog:is([data-scene="map"], [data-scene="map-board"]) .close {
  color: var(--atlas-ink);
  border-color: var(--atlas-line);
  background: transparent;
}

.atlas-intro {
  display: grid;
  grid-template-columns: minmax(260px, .82fr) 1.55fr;
  border: 1px solid var(--atlas-line);
  border-radius: 13px;
  overflow: hidden;
  background: var(--atlas-paper);
}

.atlas-intro-copy {
  padding: clamp(22px, 4vw, 48px);
}

.atlas-intro h3 {
  font: 700 clamp(2rem, 4.9vw, 4.3rem)/.92 var(--atlas-head);
  letter-spacing: -.075em;
  margin: 0 0 17px;
}

.atlas-intro p {
  color: var(--atlas-muted);
  max-width: 38ch;
  margin: 0 0 14px;
  line-height: 1.5;
}

.atlas-intro .atlas-intro-note {
  font-size: .83rem;
}

.atlas-intro p:empty {
  display: none;
}

.atlas-intro-actions, .atlas-result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.atlas-facts {
  display: flex;
  gap: 26px;
  margin: 16px 0;
  padding: 12px 0;
  border-top: 1px solid var(--atlas-line);
  border-bottom: 1px solid var(--atlas-line);
}

.atlas-facts > div { display: grid; }
.atlas-facts > div + div { border-left: 1px solid var(--atlas-line); padding-left: 26px; }

.atlas-facts strong {
  font: 700 1.95rem/.9 var(--atlas-head);
  letter-spacing: -.045em;
  color: var(--atlas-red);
}

.atlas-facts span {
  margin-top: 4px;
  font-size: .78rem;
  color: var(--atlas-muted);
}

.atlas-canvas {
  position: relative;
  min-width: 0;
  overflow: hidden;
  background: #cbddda;
}

.atlas-canvas canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.atlas-canvas canvas:focus-visible {
  outline: 2px solid var(--atlas-red);
  outline-offset: -3px;
}

.atlas-game-map canvas { cursor: crosshair; }
.atlas-canvas canvas.dragging { cursor: grabbing; }

.atlas-intro-map {
  min-height: 330px;
  border-inline-start: 1px solid var(--atlas-line);
}

.atlas-intro-map::after {
  content: "";
  position: absolute;
  inset: 13px;
  border: 1px solid #375c624a;
  pointer-events: none;
}

.atlas-game {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(252px, 27%, 310px);
  gap: 14px;
  align-items: stretch;
}

.atlas-map-side { display: grid; grid-area: 1 / 1; gap: 8px; min-width: 0; }

.atlas-sidebar {
  display: grid;
  grid-area: 1 / 2;
  grid-template-rows: auto auto 1fr;
  background: var(--atlas-paper);
  border: 1px solid var(--atlas-line);
  border-radius: 13px;
  padding: 18px;
  gap: 16px;
  min-width: 0;
}

.atlas-hud {
  display: grid;
  gap: 16px;
}

.atlas-prompt h3 {
  font: 700 clamp(1.85rem, 3.4vw, 2.75rem)/.94 var(--atlas-head);
  margin: 5px 0 0;
  letter-spacing: -.06em;
}

.atlas-time-display {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 5px;
  align-items: center;
  background: #edf0e5;
  padding: 8px 11px;
  border: 1px solid var(--atlas-line);
  border-radius: 7px;
}

.atlas-time-display .atlas-kicker { color: var(--atlas-muted); white-space: nowrap; }

.atlas-timer {
  font-size: 1.34rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.045em;
  color: var(--atlas-ink);
  line-height: 1;
}

.atlas-timer.is-low { color: var(--atlas-red); }

.atlas-time-display progress {
  width: 100%;
  grid-column: 1 / -1;
  height: 4px;
  appearance: none;
  color: var(--atlas-red);
  accent-color: var(--atlas-red);
  border: 0;
}

.atlas-time-display progress::-webkit-progress-bar { background: #d8ded0; border-radius: 4px; }
.atlas-time-display progress::-webkit-progress-value { background: var(--atlas-red); border-radius: 4px; }
.atlas-time-display progress::-moz-progress-bar { background: var(--atlas-red); border-radius: 4px; }

.atlas-game-map, .atlas-review-map {
  height: clamp(300px, 53dvh, 550px);
  border: 1px solid var(--atlas-line);
  border-radius: 13px;
}

.atlas-zoom {
  display: grid;
  gap: 4px;
  position: absolute;
  right: 8px;
  bottom: 8px;
}

.atlas-control, .atlas-region, .atlas-step, .atlas-review-entry {
  border: 1px solid var(--atlas-line);
  color: var(--atlas-ink);
  background: var(--atlas-paper);
  border-radius: 7px;
  font-weight: 750;
}

.atlas-control { padding: 6px 10px; min-height: 40px; line-height: 1.2; }

.atlas-control:hover, .atlas-region:hover, .atlas-step:hover:not(:disabled),
.atlas-review-entry:hover, .atlas-review-entry[aria-pressed="true"] {
  background: #e4e8d8;
}

.atlas-zoom button {
  width: 38px;
  min-height: 37px;
  font-size: 1.15rem;
  padding: 0;
  box-shadow: 0 2px 6px #3157572b;
}

.atlas-north {
  position: absolute;
  top: 8px;
  left: 8px;
  color: #294c50;
  font-size: .73rem;
  font-weight: 800;
  text-align: center;
  line-height: 1;
  padding: 5px 6px;
  pointer-events: none;
}

.atlas-north::before {
  content: "";
  display: block;
  margin: 0 auto 4px;
  border: 5px solid transparent;
  border-top: 0;
  border-bottom: 11px solid #294c50;
}

.atlas-regions { display: flex; flex-wrap: wrap; gap: 4px; }
.atlas-region { padding: 4px 8px; min-height: 33px; font-size: .75rem; }

.atlas-action {
  padding: 8px 13px;
  min-height: 42px;
  border: 1px solid #813027;
  border-radius: 7px;
  background: var(--atlas-red);
  color: #fffdf7;
  font-weight: 800;
  line-height: 1.16;
}

.atlas-action:hover:not(:disabled) { background: #842d25; }
.atlas-action:disabled { background: #e2e5d8; border-color: var(--atlas-line); color: #4c6157; }

.atlas-footer { display: grid; gap: 9px; align-content: end; }
.atlas-status, .atlas-credit { margin: 0; color: var(--atlas-muted); font-size: .8rem; line-height: 1.35; }
.atlas-credit { font-size: .69rem; }

.atlas-steps {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 4px;
}

.atlas-step { min-height: 31px; padding: 0; font-size: .76rem; }
.atlas-step.is-done { background: #dceada; border-color: #a5bda3; color: #2f5845; }
.atlas-step[aria-current="step"] { border-color: var(--atlas-red); background: #f4ded1; color: #84362c; }
.atlas-step:disabled { opacity: .66; }

.atlas-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  border: 1px solid var(--atlas-line);
  border-radius: 12px;
  background: var(--atlas-paper);
}

.atlas-result-score { margin: 2px 0; font: 700 clamp(1.7rem, 5vw, 2.8rem)/1.08 var(--atlas-head); }
.atlas-result-time { margin: 0; color: var(--atlas-muted); font-size: .86rem; }
.atlas-review { display: grid; grid-template-columns: minmax(0, 1fr) minmax(190px, .32fr); gap: 9px; }
.atlas-review-answers { min-width: 0; }
.atlas-review-answers h3 { margin: 0 0 7px; font-size: .96rem; }
.atlas-review-list { padding: 0; margin: 0; list-style: none; }

.atlas-review-entry {
  display: grid;
  grid-template-columns: 16px 1fr;
  align-items: center;
  column-gap: 8px;
  text-align: start;
  width: 100%;
  padding: 8px;
  margin: 0 0 4px;
}

.atlas-review-entry small { color: var(--atlas-muted); grid-column: 2; font-size: .73rem; }
.atlas-review-entry.is-correct { border-color: #739a79; }
.atlas-correct { color: #27573a; }
.atlas-wrong { color: var(--atlas-red); }
.atlas-review-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .77rem; }
.atlas-review-legend span { display: inline-flex; align-items: center; gap: 5px; }
.atlas-review-legend span::before { content: ""; width: 10px; height: 10px; background: var(--legend); }
.legend-right { --legend: #24734d; }
.legend-missed { --legend: #e48a38; }
.legend-wrong { --legend: #b0455c; }

.atlas-board-rule { margin: 0; color: var(--atlas-muted); font-size: .89rem; }
.atlas-back { justify-self: start; }
.atlas-board-empty { padding: 18px; border: 1px solid var(--atlas-line); border-radius: 9px; background: var(--atlas-paper); }
.atlas-board-empty h3 { margin: 0; font: 700 1.45rem/1.1 var(--atlas-head); }
.atlas-board-empty p { margin: 7px 0 0; color: var(--atlas-muted); }

.atlas-board-table {
  width: 100%;
  border-spacing: 0;
  overflow: hidden;
  border: 1px solid var(--atlas-line);
  border-radius: 9px;
  background: var(--atlas-paper);
  font-variant-numeric: tabular-nums;
}

.atlas-board-table th, .atlas-board-table td { text-align: left; padding: 8px 10px; }
.atlas-board-table th { color: var(--atlas-muted); font-size: .74rem; background: #ebece0; }
.atlas-board-table td { border-top: 1px solid var(--atlas-line); white-space: nowrap; }
.atlas-board-table td:nth-last-child(-n+2) { text-align: right; }
.atlas-board-table th:nth-last-child(-n+2) { text-align: right; }
.atlas-board-own { background: #eef2e6; }
.atlas-board-player { display: flex; gap: 5px; align-items: center; flex-wrap: wrap; }
.atlas-board-player .medallion { flex: none; }
.atlas-board-player small { color: var(--atlas-muted); margin-inline-start: 3px; font-size: .68rem; }
.atlas-rank, .atlas-first { display: inline-grid; place-items: center; min-width: 22px; }
.atlas-first { background: #ebddae; border-radius: 4px; color: #533812; }

@media (max-width: 720px) {
  dialog:is([data-scene="map"], [data-scene="map-board"]) {
    width: calc(100% - 12px);
    max-height: calc(100dvh - 12px);
    padding: 12px;
    border-radius: 11px;
  }

  .atlas-intro, .atlas-review { grid-template-columns: 1fr; }
  .atlas-intro-map { min-height: 168px; grid-row: 1; border-inline: 0; border-bottom: 1px solid var(--atlas-line); }
  .atlas-intro-copy { padding: 16px; }

  .atlas-game, .atlas-sidebar, .atlas-game .atlas-map-side { display: contents; }
  dialog[data-scene="map"] .stack:has(.atlas-game) { gap: 8px; }
  .atlas-hud {
    order: -3;
    grid-template-columns: minmax(0, 1fr) max-content;
    align-items: center;
    gap: 6px;
    padding: 7px 0 2px;
  }
  .atlas-prompt h3 { font-size: clamp(1.38rem, 6.4vw, 1.9rem); }
  .atlas-time-display { padding: 7px; gap: 4px; }
  .atlas-time-display .atlas-kicker { font-size: .56rem; letter-spacing: .1em; }
  .atlas-timer { font-size: 1rem; }
  .atlas-game-map { order: -2; height: clamp(215px, 29dvh, 285px); }
  .atlas-game .atlas-map-side .atlas-regions { order: -1; }
  .atlas-footer { grid-template-columns: 1fr auto; align-items: center; }
  .atlas-steps { margin-top: 3px; }
  .atlas-region { padding-inline: 6px; font-size: .69rem; min-height: 31px; }
  .atlas-review-map { height: 195px; }
  .atlas-review-list { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
  .atlas-summary { align-items: flex-start; flex-direction: column; }
  .atlas-board-table th, .atlas-board-table td { padding: 7px 6px; }
}

.tools-link {
  color: var(--muted);
  font-size: .8rem;
  text-underline-offset: 3px;
}

.account-form {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  background: var(--paper);
  padding: 15px;
}

.account-form > label:first-child {
  font-weight: 700;
}

.account-form input:not([type="checkbox"]), .account-recovery {
  width: 100%;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 0;
}

.account-recovery {
  font: 650 clamp(.79rem, 3.7vw, 1rem)/1.4 var(--numbers);
}

.board-account {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: .87rem;
}

.share-choice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 7px;
  font-size: .87rem;
}

.share-choice input {
  accent-color: var(--red);
  margin-top: .35em;
}

dialog[data-scene="account"] .secondary {
  border-color: var(--line);
  background: var(--cream);
  border-radius: 0;
}

dialog[data-scene="account"] .secondary:hover {
  background: #f1d1b9;
}

.account-form .game-message, .board-account p {
  margin: 0;
}

.account-form .game-message:empty {
  display: none;
}

.board-account {
  justify-content: space-between;
  padding: 9px 11px;
  border: 1px solid var(--atlas-line);
  background: var(--atlas-paper);
  border-radius: 7px;
}
