@font-face {
  font-family: 'Lilita One';
  src: url('/assets/LilitaOne-Regular.ttf') format('truetype');
  font-display: swap;
}
:root {
  color-scheme: light;
  --paper: #f5f2e7;
  --surface: #fbf8ed;
  --ink: #29382d;
  --muted: #58654f;
  --line: #d9d9c7;
  --accent: #f2a45e;
  --accent-hover: #ffb874;
  --umber: #a75735;
  --green: #527459;
  --mono: ui-monospace, "SFMono-Regular", Consolas, monospace;
  --serif: Georgia, "Times New Roman", serif;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--paper);
  color: var(--ink);
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; }
a { color: inherit; }
:focus-visible { outline: 3px solid #16557b; outline-offset: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); }
.masthead { padding-top: env(safe-area-inset-top); }
.masthead-inner { padding: 0 max(24px, env(safe-area-inset-right)) 0 max(24px, env(safe-area-inset-left)); min-height: 62px; display: flex; justify-content: space-between; align-items: center; }
.play img { image-rendering: pixelated; object-fit: contain; }
.account-control { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 11px; font-weight: 700; text-decoration: none; }
.icon-button { display: grid; place-items: center; min-width: 40px; min-height: 40px; border: 1px solid #dddaca; border-radius: 4px; background: #f9f6e9; color: #465844; }
.icon-button:hover { background: #e9ebd9; }
.header-actions .icon-button { border-radius: 0; }
.header-actions .icon-button:hover, .account-control:hover { background: #3c5348; }
.masthead :focus-visible { outline-color: #fff5d9; }
.settings-icon { font-size: 22px; line-height: 1; }
.log-icon { display: flex; align-items: flex-end; height: 15px; gap: 2px; }
.log-icon i { width: 3px; height: 40%; background: currentColor; }
.log-icon i:nth-child(2) { height: 69%; }
.log-icon i:nth-child(3) { height: 100%; }
.shell {
  position: relative;
  isolation: isolate;
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  margin-inline: auto;
  background: #82b7c0;
}
.playfield { display: flex; flex: 1 0 auto; flex-direction: column; }
.shell:not([data-developer]) .playfield[data-view="home"] :is(.scene-top, .altimeter, .discovery) { display: none; }
.playfield[data-view="game"][data-flight-phase="ascent"] .console,
.shell:has(.playfield[data-view="game"][data-flight-phase="ascent"]) .masthead { display: none; }
.playfield[data-flight-phase="ascent"] .scene-top { padding-top: max(12px, env(safe-area-inset-top)); }
.playfield[data-flight-phase="ascent"] .discovery { top: max(52px, calc(env(safe-area-inset-top) + 48px)); }
.shell[data-preview-height] { flex: none; min-height: var(--preview-height); }
.scene { position: relative; flex: 1 0 auto; min-height: clamp(176px, 38svh, 360px); overflow: hidden; }
#world { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; display: block; image-rendering: pixelated; }
.scene-top { position: absolute; left: 0; right: 0; display: flex; justify-content: space-between; align-items: flex-start; pointer-events: none; }
.scene-top { top: 0; padding: 17px max(24px, env(safe-area-inset-right)) 17px max(24px, env(safe-area-inset-left)); }
.account-control, .header-actions .icon-button,
.biome, .telemetry, .countdown, .ascent-skip, .game-view > .rounds, .input-note:has(span:not(:empty)) { color: #fff5d9; background: #293e35; border: 1px solid #688071; box-shadow: 2px 2px #26352b35; font-family: var(--mono); }
.biome { padding: 8px 11px; text-transform: uppercase; font-size: .81rem; font-weight: 750; letter-spacing: .08em; display: flex; align-items: center; gap: 9px; }
#biome-icon { color: #efd28a; }
.telemetry { text-align: right; padding: 9px 12px 10px; min-width: 111px; }
.telemetry > span { display: block; font-size: .69rem; letter-spacing: .13em; color: #d6dfbd; margin-bottom: 3px; }
.telemetry strong { font-size: 1.56rem; line-height: 1.12; font-variant-numeric: tabular-nums; }
.telemetry small { font-size: .85rem; font-weight: 500; }
.altimeter { position: absolute; right: max(24px, env(safe-area-inset-right)); top: 36%; width: 60px; display: flex; flex-direction: column; align-items: flex-end; gap: 5px; pointer-events: none; color: #fff7e0; font: 750 .65rem var(--mono); text-shadow: 1px 1px 2px #283b33, -1px -1px 2px #283b33; }
.ruler { width: 16px; height: clamp(84px, 18vh, 181px); margin-right: 5px; position: relative; border-right: 1px solid #fff4d9b0; background-image: repeating-linear-gradient(to bottom, #fff4d9ad 0 1px, transparent 1px calc(100% / 14)); background-size: 11px auto; background-position: right; background-repeat: no-repeat; filter: drop-shadow(1px 1px 1px #283b33a6); }
#ruler-fill { position: absolute; right: 0; bottom: 0; width: 1px; height: 0%; background: #ffd479; }
#ruler-marker { position: absolute; bottom: 0%; right: -3px; width: 8px; height: 4px; background: #f6b967; box-shadow: -2px 0 #f6b967; }
.discovery { position: absolute; top: 15px; left: 50%; translate: -50% 0; padding: 8px 13px; text-align: center; text-shadow: 0 2px #273a36; color: #fff7da; font: 700 .82rem var(--mono); letter-spacing: .08em; text-transform: uppercase; pointer-events: none; }
.discovery small { display: block; margin-top: 4px; font-size: .68rem; }
.ascent-skip { position: absolute; right: max(12px, env(safe-area-inset-right)); bottom: max(14px, env(safe-area-inset-bottom)); min-height: 44px; padding: 6px 10px; }
.ascent-skip:focus-visible { outline-color: #fff5d9; }
.console { padding-inline: max(14px, env(safe-area-inset-left)) max(14px, env(safe-area-inset-right)); }
.loading, .view { width: min(100%, 54rem); margin-inline: auto; }
.loading, .results-view, .reveal {
  padding: 16px 22px;
  border: 2px solid #34483c;
  background: var(--surface);
  box-shadow: 3px 3px 0 #293e3550;
}
.loading { color: var(--muted); }
.loading button { display: block; margin-top: 12px; }
.results-view { display: flex; justify-content: space-between; align-items: center; gap: 24px; }
.home-view { width: min(100%, 23rem); padding-bottom: max(24px, env(safe-area-inset-bottom)); }
.eyebrow { margin: 0 0 7px; color: var(--muted); letter-spacing: .105em; text-transform: uppercase; font: 750 .75rem var(--mono); }
.amber-diamond { color: var(--umber); font-size: .72rem; padding-right: 4px; }
h1, h2 { font-family: var(--serif); }
h1 { margin: 0; font-size: clamp(2rem, 4.1vw, 3.25rem); line-height: 1.04; letter-spacing: -.045em; }
.results-actions { display: flex; flex-direction: column; align-items: center; min-width: 220px; gap: 8px; }
.primary { min-height: 45px; padding: 10px 18px; border: 1px solid #75472f; border-radius: 4px; box-shadow: 0 3px 0 #75472f; background: var(--accent); color: #332d25; font-weight: 780; text-align: center; }
.primary:hover { background: var(--accent-hover); }
.primary:active:not(:disabled) { translate: 0 2px; box-shadow: 0 1px 0 #75472f; }
.primary:disabled { opacity: .63; }
.play { min-height: 49px; width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; }
.plain-link { color: var(--muted); border: 0; background: transparent; padding: 6px 9px; text-decoration: underline; text-underline-offset: 3px; font-weight: 680; font-size: .88rem; min-height: 36px; }
.plain-link:hover { color: #213e31; }
.footer { display: flex; justify-content: flex-end; padding: 10px max(24px, env(safe-area-inset-right)) max(11px, env(safe-area-inset-bottom)); }
.countdown { display: flex; align-items: center; gap: 5px; padding: 3px 7px; font-size: .73rem; }
.countdown .plain-link { min-height: 32px; color: inherit; }
.footer time { font-weight: 750; font-variant-numeric: tabular-nums; }
.clock { font-weight: 700; font-size: 1rem; }
.sky-prompt {
  position: relative;
  width: min(42rem, calc(100% - 44px));
  margin-inline: auto;
  margin-bottom: clamp(190px, 12vw, 380px);
  padding: 12px 22px 15px;
  border: 2px solid #34483c;
  background: var(--surface);
  text-align: center;
  box-shadow: 4px 4px 0 #293e3550, inset 0 0 0 2px #eadabc;
}
.home-intro { width: calc(100% - 32px); margin: clamp(32px, 7svh, 78px) auto clamp(190px, 12vw, 380px); text-align: center; }
.home-title { font: 400 clamp(5.75rem, 15vw, 9.5rem)/.95 'Lilita One', var(--serif); letter-spacing: .015em; color: #fff5d9; -webkit-text-stroke: .047em #293e35; paint-order: stroke fill; text-shadow: .033em .048em #293e35; }
.home-subtitle { margin: 12px 0 0; color: #293e35; font: 800 clamp(.875rem, 2vw, 1.125rem)/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; text-shadow: 0 1px #fff5d9; }
.home-title span { display: inline-block; }
.shell[data-motion="full"] .home-title span { animation: title-wave 3.6s ease-in-out var(--wave-delay, 0s) infinite; }
.home-title span:nth-child(2) { --wave-delay: .10s; }
.home-title span:nth-child(3) { --wave-delay: .20s; }
.home-title span:nth-child(4) { --wave-delay: .30s; }
.home-title span:nth-child(5) { --wave-delay: .40s; }
@keyframes title-wave {
  0%, 22%, 100% { transform: translateY(0); }
  11% { transform: translateY(-.09em) rotate(-3deg); }
}
.settings-links { justify-content: flex-start; flex-wrap: wrap; }
.settings-links a { display: inline-grid; place-items: center; }
.sky-prompt { margin-top: clamp(76px, 13.5svh, 130px); }
.sky-prompt::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -10px;
  width: 15px;
  height: 10px;
  translate: -50%;
  background: #34483c;
  clip-path: polygon(0 0, 100% 0, 100% 30%, 80% 30%, 80% 60%, 60% 60%, 60% 100%, 40% 100%, 40% 60%, 20% 60%, 20% 30%, 0 30%);
}
.shell[data-motion="full"] .sky-prompt { animation: sky-prompt-float 5s ease-in-out infinite; }
@keyframes sky-prompt-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
.sky-prompt .eyebrow { margin-bottom: 6px; }
.sky-prompt h1 { font-size: clamp(1.25rem, 2.6vw, 2.1rem); line-height: 1.14; letter-spacing: -.027em; text-wrap: balance; }
.scene:has(.sky-prompt:not([hidden])) .discovery { visibility: hidden; }
.game-view { padding-bottom: max(14px, env(safe-area-inset-bottom)); }
.game-view > .rounds { width: max-content; margin: 0 auto 7px; padding: 4px 5px; }
.game-view form { max-width: 32rem; margin-inline: auto; }
.rounds { list-style: none; display: flex; padding: 0; margin: 0; align-items: center; gap: 6px; }
.rounds li { display: grid; place-items: center; width: 21px; height: 19px; font: 750 .68rem var(--mono); background: #eeedde; color: #61705a; border: 1px solid #d5d8c3; }
.rounds li[aria-current] { border-color: #7b5038; background: #f4d0a3; color: #533b2c; }
.rounds li[data-complete] { background: #638065; border-color: #526b54; color: #fffae9; }
#answer-form[data-keyboard-docked] { min-height: var(--estimate-space); }
#answer-form[data-keyboard-docked] .estimate-dock {
  position: fixed;
  z-index: 5;
  top: var(--estimate-bottom);
  inset-inline: max(8px, env(safe-area-inset-left)) max(8px, env(safe-area-inset-right));
  width: min(32rem, calc(100% - 30px));
  margin-inline: auto;
  translate: 0 -100%;
  padding: 8px 8px 11px;
  border: 1px solid #688071;
  border-radius: 5px;
  background: #293e35;
  box-shadow: 2px 3px 0 #26352b55;
}
.entry-line { display: flex; align-items: stretch; gap: 12px; }
.estimate { display: flex; align-items: center; flex: 1; min-width: 0; border: 1px solid #adb29a; background: #fffdf4; border-radius: 4px; }
.estimate:focus-within { outline: 2px solid #16557b; outline-offset: 2px; }
.estimate:has(input[aria-invalid="true"]) { border-color: #a63830; }
.estimate input { flex: 1; width: 0; border: 0; background: transparent; outline: none; min-height: 44px; padding: 0 10px 0 13px; color: var(--ink); }
.estimate input::placeholder { color: #687061; }
.unit { padding: 4px 11px; border-left: 1px solid #d8d9c9; color: #52614d; font: 700 .79rem var(--mono); }
.input-note:has(span:not(:empty)) { width: fit-content; margin: 7px auto 0; padding: 4px 7px; font-size: .8rem; }
#input-error { color: #ffd1bd; font-weight: 690; }
.input-note:has(#input-error:not(:empty)) #hint { display: none; }
.reveal { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 17px 32px; }
.shell[data-motion="full"] .reveal:not([hidden]) {
  animation: round-reveal .2s ease-out both;
}
@keyframes round-reveal {
  from { opacity: 0; translate: 0 14px; }
  to { opacity: 1; translate: 0 0; }
}
.rating-line { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; }
.rating-line h2 { font-size: 1.5rem; margin: 0; }
#deviation { font-size: .83rem; color: var(--muted); }
.answers { display: flex; gap: 11px 34px; flex-wrap: wrap; margin: 9px 0 0; }
.answers div { display: flex; flex-direction: column; }
.answers span { color: var(--muted); font-size: .78rem; }
.answers strong { font: 750 .96rem var(--mono); overflow-wrap: anywhere; }
.comparison { position: relative; max-width: 360px; height: 4px; margin: 12px 3px 10px; background: #d6d8c3; }
.comparison i { position: absolute; top: -3px; width: 9px; height: 10px; border: 1px solid #79472d; background: #eda862; translate: -50% 0; }
.comparison i:last-child { border-color: #425c43; background: #678d65; }
#explanation { margin: 0; color: #485a49; font-size: .93rem; }
.score-note { margin: 4px 0 0; color: var(--muted); font-size: .75rem; }
.reveal-action { display: flex; align-items: center; flex-direction: column; gap: 4px; min-width: 165px; text-align: center; }
.earned { font: 750 1.32rem var(--mono); color: #425f48; }
#meters-gained { color: var(--muted); font: 700 .87rem var(--mono); }
.reveal-action .primary { margin-top: 5px; width: 100%; }
.results-view h1 { font-family: var(--mono); font-size: clamp(2.15rem, 4vw, 3.2rem); }
#results-summary { margin: 7px 0 9px; color: var(--muted); font-size: .94rem; }
.score-list { display: flex; flex-wrap: wrap; gap: 5px; padding: 0; margin: 0; list-style: none; }
.score-list li { min-width: 34px; padding: 4px; text-align: center; font: 750 .74rem var(--mono); background: #e8ecdc; border: 1px solid #ccd6be; }
.score-list li[data-perfect] { background: #f5deaf; border-color: #dac18a; }
.results-actions .primary { width: 100%; }
.result-links { display: flex; gap: 1px; align-items: center; justify-content: center; flex-wrap: wrap; }
.personal-best { margin: 0; color: #70542f; font: 700 .83rem var(--mono); }
#share-message { margin: 0; font-size: .82rem; color: var(--muted); text-align: center; max-width: 31ch; }
#share-message:empty { display: none; }
.save-status { width: fit-content; max-width: calc(100% - 28px); margin: 9px auto 0; padding: 4px 7px; border: 1px solid #688071; background: #293e35; color: #ffd1bd; font-size: .85rem; }
dialog { width: min(505px, calc(100% - 32px)); max-height: 85vh; border: 2px solid #405846; border-radius: 6px; padding: 19px 23px 24px; background: var(--surface); color: var(--ink); box-shadow: 6px 6px 0 #26392d50; }
dialog::backdrop { background: #26372f9e; }
.dialog-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--line); padding-bottom: 11px; margin-bottom: 13px; }
.dialog-top h2 { font-size: 1.7rem; margin: 0; }
.close { font-size: 1.45rem; line-height: 1; }
.dialog-intro { font-weight: 700; }
.steps { padding-left: 22px; color: #435445; }
.steps li { padding-left: 2px; margin-bottom: 8px; }
details { background: #eeeede; border: 1px solid var(--line); padding: 10px 12px; }
summary { cursor: pointer; font-weight: 690; }
details p { margin: 9px 0 0; font-size: .92rem; }
.setting { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.setting small { display: block; color: var(--muted); }
.setting input { width: 22px; height: 22px; accent-color: var(--green); }
.setting input[role="switch"] { appearance: none; display: grid; align-items: center; flex: 0 0 44px; width: 44px; height: 26px; margin: 0; padding: 3px; border: 1px solid var(--muted); border-radius: 14px; background: #e4e7d8; cursor: pointer; }
.setting input[role="switch"]::before { content: ""; width: 18px; height: 18px; border: 1px solid var(--muted); border-radius: 50%; background: var(--surface); }
.setting input[role="switch"]:checked { justify-items: end; border-color: var(--ink); background: var(--green); }
@media (forced-colors: active) {
  .setting input[role="switch"] { appearance: auto; }
  .setting input[role="switch"]::before { content: none; }
}
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.stats div { border: 1px solid var(--line); padding: 7px 9px; }
.stats dt { color: var(--muted); font-size: .78rem; }
.stats dd { margin: 2px 0 0; font: 750 1.02rem var(--mono); }
.journal { list-style: none; padding: 0; margin: 7px 0 0; }
.journal li { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); padding: 6px 0; }
.journal span:last-child { color: var(--muted); font: 650 .76rem var(--mono); }
.journal-title { margin: 12px 0 0; font-size: 1.24rem; }
.journal-share { width: 100%; min-height: 250px; resize: vertical; background: #fffdf4; border: 1px solid var(--line); padding: 8px; }
.dev { margin: 10px 16px 15px; }
.dev-grid { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; align-items: end; }
.dev-grid label { font-size: .8rem; }
.dev-grid input:not([type="checkbox"]), .dev-grid select { display: block; max-width: 142px; }
.dev-grid button { min-height: 31px; }
@media (max-width: 640px) {
  .masthead-inner { padding: 0 12px; min-height: 62px; gap: 6px; }
  .icon-button { min-width: 34px; min-height: 38px; }
  .scene { min-height: clamp(190px, 36svh, 320px); }
  .scene-top { padding: 9px; }
  .biome { font-size: .68rem; padding: 6px; gap: 5px; }
  .telemetry { min-width: 75px; padding: 5px 7px; }
  .telemetry strong { font-size: 1.12rem; }
  .telemetry > span { font-size: .58rem; margin-bottom: 2px; }
  .altimeter { right: 9px; width: 46px; }
  .discovery { top: 55px; width: 70%; }
  .loading, .results-view, .reveal { padding: 13px 14px; }
  .results-view { align-items: stretch; flex-direction: column; gap: 12px; }
  .results-actions { width: 100%; gap: 3px; }
  .footer { padding-inline: 12px; }
  .countdown { font-size: .67rem; }
  .entry-line { gap: 7px; }
  .entry-line .primary { padding-inline: 9px; font-size: .83rem; }
  .unit { padding-inline: 6px; font-size: .69rem; }
  .sky-prompt { width: calc(100% - 32px); padding: 10px 12px 12px; }
  .sky-prompt { margin-top: 65px; }
  .sky-prompt .eyebrow { font-size: .6875rem; letter-spacing: .065em; }
  .rounds { gap: 4px; }
  .rounds li { width: 17px; height: 17px; }
  .reveal { grid-template-columns: 1fr; gap: 11px; }
  .reveal-action { display: grid; grid-template-columns: 1fr 1fr; padding-bottom: 3px; }
  .reveal-action .primary { grid-column: 1 / -1; }
  .setting { gap: 5px; }
}
@media (max-width: 343px) {
  .masthead-inner { padding-inline: 8px; }
  .header-actions .icon-button { min-width: 29px; }
}

@media (max-height: 480px) and (orientation: landscape) {
  .scene { min-height: 184px; }
  .scene-top { padding-block: 7px; }
  .altimeter { display: none; }
}
