html {
  --color-bg: oklch(92% 0.015 150);
  --color-text: oklch(29% 0.035 157);
  --color-muted: oklch(44% 0.028 157);
  --color-accent: oklch(42% 0.075 153);
  --color-surface: oklch(98% 0.008 140);
  --color-line: oklch(80% 0.025 150);
  --font-body: 'Figtree', sans-serif;
  --font-heading: 'Bricolage Grotesque', sans-serif;
  --space: 8px;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-synthesis: none;
  height: 100%;
  accent-color: var(--color-accent);
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 360px; height: 100%; font-size: 1rem; line-height: 1.5; overflow: hidden; }
button, summary { -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; }
button, summary { touch-action: manipulation; }
button:focus-visible, summary:focus-visible, canvas:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 5px; }
::selection { background: var(--color-accent); color: var(--color-surface); }
.experience { position: relative; isolation: isolate; height: 100%; min-height: 480px; overflow: hidden; }
#landscape { position: absolute; inset: 0; }
#landscape canvas { display: block; width: 100%; height: 100%; cursor: grab; touch-action: none; }
#landscape canvas:active { cursor: grabbing; }
#landscape canvas.orbiting { cursor: move; }
.header { position: absolute; top: 36px; left: 40px; right: 40px; display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; pointer-events: none; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand > svg { width: 30px; height: 34px; stroke: var(--color-accent); stroke-width: 1.5; }
h1 { margin: 0; font-family: var(--font-heading); font-size: 2.4rem; font-weight: 650; letter-spacing: -0.045em; line-height: 1; }
h1 span { color: var(--color-accent); }
.identity > p { margin: 12px 0 0 43px; color: var(--color-muted); font-size: .875rem; }
.header-actions { display: flex; align-items: center; gap: 16px; pointer-events: auto; padding-top: 4px; }
.new-world { display: flex; align-items: center; gap: 10px; background: var(--color-surface); border: 1px solid var(--color-line); padding: .7em 1.1em; border-radius: 7px; font-size: .8125rem; font-weight: 600; transition: background 180ms, transform 180ms; box-shadow: 0 2px 4px oklch(30% .03 150 / .03); }
.new-world svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.new-world:hover { background: oklch(95% .025 150); transform: translateY(-1px); }
.help { position: relative; }
.help > summary { list-style: none; display: grid; place-items: center; height: 28px; width: 28px; border: 1px solid var(--color-muted); border-radius: 50%; cursor: pointer; font-weight: 500; font-size: .875rem; background: rgb(255 255 255 / 30%); }
.help > summary::-webkit-details-marker { display: none; }
.help > summary:hover, .help[open] > summary { background: var(--color-surface); }
.help-panel { position: absolute; z-index: 5; top: 44px; right: 0; width: min(320px, calc(100vw - 40px)); padding: 24px; background: var(--color-surface); border: 1px solid var(--color-line); border-radius: 12px; box-shadow: 0 12px 35px oklch(25% .02 150 / .12); }
.help-panel h2 { font-family: var(--font-heading); font-size: 1.3rem; line-height: 1.2; font-weight: 600; margin: 0 0 16px; }
.help-panel p { font-size: .875rem; color: var(--color-muted); margin: 12px 0 0; }
.update-log-frame { display: block; width: 100%; height: 180px; border: 0; background: var(--color-surface); color: var(--color-text); }
.world-note { position: absolute; left: 42px; top: 43%; pointer-events: none; }
.overline { font-size: .625rem; letter-spacing: .16em; font-weight: 600; color: var(--color-muted); }
.world-note > p { font-family: var(--font-heading); font-weight: 500; font-size: 1.125rem; line-height: 1.5; margin: 14px 0 24px; }
.seed-line { display: flex; align-items: center; gap: 8px; font-size: .625rem; letter-spacing: .1em; color: var(--color-muted); font-variant-numeric: tabular-nums; }
.seed-symbol { font-size: 1rem; font-weight: 400; }
#seed { font-size: .75rem; letter-spacing: .08em; }
.compass { position: static; width: 32px; flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 5px; pointer-events: none; background: rgb(255 255 255 / 30%); border-radius: 50%; }
.compass > span { color: var(--color-muted); font-size: .625rem; font-weight: 600; }
.compass svg { width: 32px; height: 32px; fill: none; stroke: var(--color-muted); stroke-width: 1; }
.compass svg circle { stroke: var(--color-line); }
.compass-needle { fill: var(--color-accent); stroke: var(--color-accent); }
.footer { position: absolute; bottom: 30px; left: 40px; right: 40px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 20px; pointer-events: none; }
.ecosystem { display: flex; align-items: flex-start; gap: 9px; padding-bottom: 8px; }
.status-mark { width: 6px; height: 6px; background: var(--color-accent); border-radius: 50%; margin-top: 6px; flex: 0 0 auto; }
.ecosystem > div { display: flex; flex-direction: column; gap: 4px; }
#status { font-size: .75rem; font-weight: 500; }
.ecosystem small, .coordinates small { color: var(--color-muted); font-size: .625rem; }
.navigation { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.hint { margin: 0; font-size: .6875rem; color: var(--color-muted); }
.hint span { margin: 0 8px; }
.toolbar { display: flex; align-items: center; gap: 8px; padding: 7px; background: var(--color-surface); border: 1px solid oklch(85% .018 150); border-radius: 12px; box-shadow: 0 5px 20px oklch(30% .025 150 / .08), 0 1px 2px oklch(30% .025 150 / .04); pointer-events: auto; }
.tool-group { display: flex; align-items: center; gap: 4px; }
.water-controls { flex: 0 0 auto; }
.toolbar:has(.water-controls) { flex-wrap: wrap; }
.tool { display: grid; place-items: center; width: 37px; height: 36px; border: 0; background: transparent; border-radius: 6px; transition: background 160ms, color 160ms; }
.tool:hover { background: oklch(91% .025 150); }
.tool.selected { color: var(--color-surface); background: var(--color-accent); }
.tool.selected:hover { background: oklch(35% .07 153); }
.tool:disabled { cursor: default; color: var(--color-muted); background: oklch(91% .012 150); }
.tool svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.divider { width: 1px; height: 22px; background: var(--color-line); margin: 0 2px; }
#zoom { font-size: .6875rem; font-variant-numeric: tabular-nums; width: 39px; text-align: center; }
.coordinates { display: flex; flex-direction: column; gap: 2px; align-items: flex-end; padding-bottom: 8px; font-family: var(--font-body); font-variant-numeric: tabular-nums; line-height: 1.2; }
.performance-metrics { position: absolute; top: auto; right: 0; bottom: 62px; display: flex; flex-wrap: nowrap; justify-content: flex-end; gap: 2px 10px; color: var(--color-muted); font-size: .5625rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
#coordinates { font-size: .6875rem; letter-spacing: .05em; }
.identity, .world-note, .ecosystem, .hint, .coordinates, .performance-metrics { background: rgb(255 255 255 / 30%); border-radius: 6px; }
.identity, .world-note, .ecosystem, .coordinates { padding: 8px 10px; }
.hint, .performance-metrics { padding: 4px 8px; }
#coordinates i { font-style: normal; color: var(--color-muted); margin: 0 8px; }
.coordinates small { letter-spacing: .08em; font-size: .5625rem; }
.toolbar:has(#terrain-resolution-panel), .toolbar:has(#cloud-humidity-panel), .toolbar:has(#terrain-ceiling-panel), .toolbar:has(#cloud-resolution-panel), .toolbar:has(#terrain-lod-panel) { flex-wrap: wrap; }
#terrain-resolution-panel, #cloud-humidity-panel, #terrain-ceiling-panel, #cloud-resolution-panel, #terrain-lod-panel { display: flex; flex: 1 1 100%; align-items: center; gap: 12px; min-width: 0; padding: 8px 10px 6px; border-top: 1px solid var(--color-line); color: var(--color-text); pointer-events: auto; }
#terrain-resolution-panel[hidden], #cloud-humidity-panel[hidden], #terrain-ceiling-panel[hidden], #cloud-resolution-panel[hidden], #terrain-lod-panel[hidden] { display: none; }
#terrain-resolution-panel label, #cloud-humidity-panel label, #terrain-ceiling-panel label, #cloud-resolution-panel label, #terrain-lod-panel label { font-size: .75rem; font-weight: 600; white-space: nowrap; }
#terrain-resolution-panel input[type="range"], #cloud-humidity-panel input[type="range"], #terrain-ceiling-panel input[type="range"], #cloud-resolution-panel input[type="range"], #terrain-lod-panel input[type="range"] { flex: 1 1 120px; width: 100%; min-width: 80px; accent-color: var(--color-accent); cursor: pointer; }
#terrain-resolution-panel input[type="range"]:focus-visible, #cloud-humidity-panel input[type="range"]:focus-visible, #terrain-ceiling-panel input[type="range"]:focus-visible, #cloud-resolution-panel input[type="range"]:focus-visible, #terrain-lod-panel input[type="range"]:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 4px; }
#terrain-resolution-panel output, #cloud-humidity-panel output, #terrain-ceiling-panel output, #cloud-resolution-panel output, #terrain-lod-panel output { min-width: 3ch; text-align: right; font-size: .75rem; font-variant-numeric: tabular-nums; }
@media (max-width: 1100px) {
  .world-note { top: 24%; }
  .world-note > p { font-size: 1rem; }
  .compass { right: 30px; }
  .footer { left: 28px; right: 28px; gap: 12px; }
  .toolbar { gap: 4px; }
  .tool { width: 32px; }
}
@media (max-width: 760px) {
  .toolbar:has(#terrain-resolution-panel), .toolbar:has(#cloud-humidity-panel), .toolbar:has(#terrain-ceiling-panel), .toolbar:has(#cloud-resolution-panel), .toolbar:has(#terrain-lod-panel) { max-width: calc(100vw - 48px); }
  #terrain-resolution-panel, #cloud-humidity-panel, #terrain-ceiling-panel, #cloud-resolution-panel, #terrain-lod-panel { gap: 8px; padding: 8px 6px 5px; }
  .header { top: 24px; left: 24px; right: 24px; gap: 12px; }
  h1 { font-size: 2rem; }
  .brand { gap: 9px; }
  .brand > svg { width: 25px; height: 29px; }
  .identity > p { margin-left: 34px; margin-top: 10px; font-size: .75rem; }
  .header-actions { gap: 12px; padding-top: 1px; }
  .new-world { padding: .65em .8em; font-size: .75rem; gap: 7px; }
  .help > summary { width: 24px; height: 24px; }
  .world-note { left: 26px; top: 22%; }
  .world-note > p, .overline { display: none; }
  .compass { width: 40px; }
  .compass svg { width: 40px; height: 40px; }
  .footer { grid-template-columns: 1fr 1fr; grid-template-areas: 'nav nav' 'life coords'; bottom: 22px; left: 24px; right: 24px; row-gap: 26px; }
  .navigation { grid-area: nav; }
  .ecosystem { grid-area: life; padding-bottom: 0; }
  .coordinates { grid-area: coords; padding-bottom: 0; }
  .coordinates small { display: none; }
  .ecosystem small { font-size: .5625rem; }
  #coordinates { font-size: .625rem; }
  .tool { width: 34px; height: 37px; }
  .toolbar { gap: 5px; }
  .toolbar:has(.water-controls) { max-width: calc(100vw - 48px); }
  .hint { font-size: .6875rem; }
}
@media (max-height: 600px) and (min-width: 761px) {
  .header { top: 22px; }
  .world-note { top: 40%; }
  .world-note > p { display: none; }
  .world-note .seed-line { margin-top: 10px; }
  .footer { bottom: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
.toolbar:has(#rain-threshold-panel) { flex-wrap: wrap; }
#rain-threshold-panel { display: flex; flex: 1 1 100%; align-items: center; gap: 12px; min-width: 0; padding: 8px 10px 6px; border-top: 1px solid var(--color-line); color: var(--color-text); pointer-events: auto; }
#rain-threshold-panel[hidden] { display: none; }
#rain-threshold-panel label { font-size: .75rem; font-weight: 600; white-space: nowrap; }
#rain-threshold-panel input[type="range"] { flex: 1 1 120px; width: 100%; min-width: 80px; accent-color: var(--color-accent); cursor: pointer; }
#rain-threshold-panel input[type="range"]:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 4px; }
#rain-threshold-panel output { min-width: 3ch; text-align: right; font-size: .75rem; font-variant-numeric: tabular-nums; }
@media (max-width: 760px) {
  .toolbar:has(#rain-threshold-panel) { max-width: calc(100vw - 48px); }
  #rain-threshold-panel { gap: 8px; padding: 8px 6px 5px; }
}
.optimization-menu { position: relative; }
.optimization-menu > summary { list-style: none; cursor: pointer; }
.optimization-menu > summary::-webkit-details-marker { display: none; }
.optimization-menu[open] > summary { color: var(--color-surface); background: var(--color-accent); }
.optimization-menu[open] > summary:hover { background: oklch(35% .07 153); }
.optimization-panel { position: absolute; z-index: 10; right: 0; bottom: calc(100% + 12px); display: grid; gap: 10px; width: min(300px, calc(100vw - 32px)); padding: 18px; color: var(--color-text); background: var(--color-surface); border: 1px solid var(--color-line); border-radius: 12px; box-shadow: 0 12px 35px oklch(25% .02 150 / .12); pointer-events: auto; }
.optimization-panel h2 { margin: 0 0 2px; font-family: var(--font-heading); font-size: 1.05rem; line-height: 1.2; }
.optimization-panel label { font-size: .75rem; font-weight: 600; }
.optimization-panel .optimization-check { display: flex; align-items: center; gap: 8px; }
.optimization-panel input, .optimization-panel select { accent-color: var(--color-accent); font: inherit; }
.optimization-panel select { width: 100%; padding: 7px 9px; color: var(--color-text); background: var(--color-surface); border: 1px solid var(--color-line); border-radius: 6px; }
.optimization-panel p { margin: 0; color: var(--color-muted); font-size: .6875rem; }
.optimization-panel :focus-visible { outline: 2px solid var(--color-accent); outline-offset: 3px; }
@media (max-width: 760px) {
  .optimization-panel { right: -2px; }
}
.toolbar:has(#cloud-update-panel) { flex-wrap: wrap; }
#cloud-update-panel { display: flex; flex: 1 1 100%; align-items: center; gap: 12px; min-width: 0; padding: 8px 10px 6px; border-top: 1px solid var(--color-line); color: var(--color-text); pointer-events: auto; }
#cloud-update-panel[hidden] { display: none; }
#cloud-update-panel label { font-size: .75rem; font-weight: 600; white-space: nowrap; }
#cloud-update-panel input[type="range"] { flex: 1 1 120px; width: 100%; min-width: 80px; accent-color: var(--color-accent); cursor: pointer; }
#cloud-update-panel input[type="range"]:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 4px; }
#cloud-update-panel output { min-width: 5ch; text-align: right; font-size: .75rem; font-variant-numeric: tabular-nums; }
@media (max-width: 760px) {
  .toolbar:has(#cloud-update-panel) { max-width: calc(100vw - 48px); }
  #cloud-update-panel { gap: 8px; padding: 8px 6px 5px; }
}
.animal-inspector { position: absolute; z-index: 4; top: 112px; right: 32px; display: grid; gap: 10px; width: min(250px, calc(100vw - 32px)); max-height: calc(100% - 230px); overflow: auto; padding: 14px; color: var(--color-text); background: oklch(98% 0.008 140 / 50%); border: 1px solid var(--color-line); border-radius: 12px; box-shadow: 0 12px 35px oklch(25% .02 150 / .12); pointer-events: auto; }
.animal-inspector[data-selected="false"] { display: none; }
.animal-inspector-heading h2 { margin: 0; font-family: var(--font-heading); font-size: 1.15rem; line-height: 1.2; font-weight: 600; }
.animal-inspector-heading p { margin: 7px 0 0; color: var(--color-muted); font-size: .75rem; }
.animal-details { display: grid; gap: 4px; margin: 0; }
.animal-details > div { display: grid; grid-template-columns: 82px minmax(0, 1fr); gap: 8px; align-items: start; }
.animal-details dt { color: var(--color-muted); font-size: .75rem; font-weight: 600; }
.animal-details dd { margin: 0; overflow-wrap: anywhere; font-size: .75rem; }
#animal-next { justify-self: start; padding: .55em .85em; color: var(--color-surface); background: var(--color-accent); border: 1px solid var(--color-accent); border-radius: 6px; font-size: .75rem; font-weight: 600; }
#animal-next:hover { background: oklch(35% .07 153); }
@media (max-width: 760px) {
  .header { flex-wrap: wrap; }
  .header-actions { gap: 8px; }
  .compass { width: 32px; }
  .compass > span { font-size: .5rem; }
  .compass svg { width: 32px; height: 32px; }
  .animal-inspector { top: 112px; right: 16px; width: min(240px, calc(100vw - 32px)); max-height: calc(100% - 230px); padding: 12px; }
}
