:root {
  color-scheme: dark;
  --ink: #f4efe6;
  --muted: #b7b0a3;
  --brass: #ffd98a;
  --line: rgba(255, 246, 228, .15);
  --panel: rgba(21, 19, 17, .64);
  --gutter: 18px;
  --serif: 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-synthesis: none;
  color: var(--ink);
  background: #0d0c0b;
}
* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; overscroll-behavior: none; }
body { min-height: 100svh; -webkit-font-smoothing: antialiased; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button { border: 0; background: none; color: inherit; font: inherit; cursor: pointer; touch-action: manipulation; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; }
[hidden] { display: none !important; }
#world { position: fixed; inset: 0; touch-action: none; cursor: grab; }
#world canvas { display: block; width: 100%; height: 100%; }
.vignette { position: fixed; inset: 0; pointer-events: none; background: radial-gradient(ellipse at 50% 48%, transparent 40%, rgba(9, 8, 7, .3) 100%); }
.grain { position: fixed; inset: 0; pointer-events: none; opacity: .025; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Cpath fill='%23fff' filter='url(%23n)' opacity='.75' d='M0 0h180v180H0z'/%3E%3C/svg%3E"); }
header, .intro, .season-display, .climate, .bottom-panel { transition: opacity .3s; }
header, .season-display, .climate, .toolbar {
  background: linear-gradient(180deg, #fffaf00d, #fffaf002 42%, #0000000c), var(--panel);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px #fffaf012, 0 8px 28px -12px #0009;
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  backdrop-filter: blur(16px) saturate(1.3);
}
.intro { position: fixed; top: calc(var(--gutter) + env(safe-area-inset-top, 0px) + 9px); left: calc(var(--gutter) + env(safe-area-inset-left, 0px) + 2px); pointer-events: none; }
.intro h1 { margin: 0; color: #f4efe6cf; font: 400 17px/1 var(--serif); letter-spacing: .12em; text-shadow: 0 1px 8px #0007; }
header { position: fixed; top: calc(var(--gutter) + env(safe-area-inset-top, 0px)); right: calc(var(--gutter) + env(safe-area-inset-right, 0px) + 46px); display: flex; align-items: center; gap: 0; padding: 3px; border-radius: 24px; z-index: 3; }
.text-button, .icon-button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; color: #cec5b4; font-size: 11px; }
header button { width: 34px; height: 34px; padding: 0; border-radius: 50%; }
header button:hover, footer button:hover { color: var(--brass); background: #fffaf014; }
header .text-button span, footer .text-button span, #pause-label, .tool > span, .seasons button > span, .sun-slider-label {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.icon-button { font: italic 22px/1 var(--serif); }
.small-icon { display: block; width: 17px; height: 17px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.season-display { position: fixed; left: calc(var(--gutter) + env(safe-area-inset-left, 0px)); bottom: calc(var(--gutter) + env(safe-area-inset-bottom, 0px)); width: 184px; padding: 8px 10px 7px; border-radius: 17px; z-index: 2; }
.time-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
#pause { width: 28px; height: 28px; padding: 0; flex: 0 0 auto; border-radius: 50%; background: #fffaf00e; box-shadow: inset 0 0 0 1px #fffaf018; color: #e9d3a5; }
#pause .small-icon { width: 13px; height: 13px; }
#pause:hover { background: #ffd98a1a; }
#pause[aria-pressed='true'] { color: #f4efe6a6; }
#clock-label { display: block; min-width: 0; color: #e8dfce; font: 400 10px/1.4 ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; letter-spacing: .015em; font-variant-numeric: tabular-nums; white-space: nowrap; }
#daylight { display: block; appearance: none; -webkit-appearance: none; width: 100%; height: 26px; margin: 3px 0 0; background: transparent; accent-color: var(--brass); cursor: ew-resize; touch-action: pan-y; }
#daylight::-webkit-slider-runnable-track { height: 2px; border-radius: 2px; background: linear-gradient(90deg, #a7bad673, #efce918f 52%, #b394bf73); }
#daylight::-moz-range-track { height: 2px; border-radius: 2px; background: linear-gradient(90deg, #a7bad673, #efce918f 52%, #b394bf73); }
#daylight::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; margin-top: -5px; border: 1px solid #fff1c68a; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff8df, #ffd98a 50%, #c18a43); box-shadow: 0 0 10px #ffcf7845; }
#daylight::-moz-range-thumb { width: 11px; height: 11px; border: 1px solid #fff1c68a; border-radius: 50%; background: #ffd98a; box-shadow: 0 0 10px #ffcf7845; }
.sun-range-labels { display: flex; justify-content: space-between; margin-top: -2px; color: #b8ad98; font-size: 6px; letter-spacing: .13em; }
.climate { position: fixed; right: calc(var(--gutter) + env(safe-area-inset-right, 0px)); bottom: calc(var(--gutter) + env(safe-area-inset-bottom, 0px)); display: flex; align-items: center; gap: 10px; width: 190px; padding: 10px; border-radius: 18px; z-index: 2; }
.climate-readings { min-width: 0; flex: 1; pointer-events: none; }
.climate-title, .reading-icon, .moisture-label, .meter, #ecosystem-note { display: none; }
.reading { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; margin: 8px 0; color: #b2a998; font-size: 7px; letter-spacing: .02em; }
.reading:first-of-type { margin-top: 0; }
.reading:last-of-type { margin-bottom: 0; }
.reading strong { color: #e5dccb; font-size: 11px; font-weight: 400; line-height: 1.2; white-space: nowrap; font-variant-numeric: tabular-nums; }
#temperature { color: var(--ink); font: 400 19px/1.05 var(--serif); }
.reading strong span { font-size: 8px; margin-left: 1px; }
.seasons { position: relative; width: 96px; height: 96px; flex: 0 0 96px; isolation: isolate; border-radius: 50%; background: radial-gradient(circle at 50% 38%, #fffaf009, #0003 72%); box-shadow: inset 0 0 0 1px #ffd98a35, inset 0 2px 7px #0005; }
.seasons::before { content: ''; position: absolute; inset: 3px; border-radius: 50%; pointer-events: none; background: conic-gradient(#f2b4c8, #a9d67f 50deg, #e8c45c 110deg, #e47c36 180deg, #b0704a 220deg, #bcd6ee 275deg, #e6eef7 320deg, #f2b4c8); opacity: .55; -webkit-mask: radial-gradient(closest-side, transparent calc(100% - 5px), #000 calc(100% - 4px)); mask: radial-gradient(closest-side, transparent calc(100% - 5px), #000 calc(100% - 4px)); }
.seasons button { position: absolute; display: grid; place-items: center; width: 28px; height: 28px; padding: 6px; border-radius: 50%; color: #c4bba9; z-index: 1; transition: background .2s, color .2s; }
.seasons button[data-season='spring'] { top: 1px; left: 34px; color: #e3aebe; }
.seasons button[data-season='summer'] { top: 34px; right: 1px; color: #e8c780; }
.seasons button[data-season='autumn'] { bottom: 1px; left: 34px; color: #d79360; }
.seasons button[data-season='winter'] { top: 34px; left: 1px; color: #c1d6e9; }
.seasons button:hover { background: #fffaf00e; }
.seasons button.selected { background: #ffe1a81c; box-shadow: inset 0 0 0 1px #ffd98a55, 0 0 11px #ffd98a22; }
.seasons svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
#season-label { position: absolute; inset: 32px 22px; display: grid; place-items: center; text-align: center; pointer-events: none; color: #eee4cf; font: 400 10px/1.15 var(--serif); }
.scene-caption { display: none; }
.gesture-hint { position: fixed; top: calc(var(--gutter) + env(safe-area-inset-top, 0px) + 57px); left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 5px; padding: 6px 11px; border: 1px solid #fff1da16; border-radius: 30px; background: #1916107a; color: #ddd0b4; font: 400 12px/1.25 var(--serif); white-space: nowrap; pointer-events: none; transition: opacity 1s; }
.hint-icon { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.1; stroke-linecap: round; stroke-linejoin: round; }
.bottom-panel { position: fixed; left: 50%; bottom: calc(var(--gutter) + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; max-width: calc(100vw - 24px); z-index: 2; }
.toolbar { display: flex; gap: 0; padding: 4px; border-radius: 18px; }
.tool { position: relative; display: grid; place-items: center; width: 46px; height: 46px; padding: 12px; border: 1px solid transparent; border-radius: 14px; color: #d1c8b6; transition: background .2s, color .2s, box-shadow .2s; }
.tool:hover { color: #f5e9cf; background: #fffaf009; }
.tool.active { color: var(--brass); border-color: #ffd98a4a; background: radial-gradient(120% 100% at 50% 0%, #ffd98a30, #ffd98a0c 60%, #ffd98a06); box-shadow: inset 0 1px #fff0d223, 0 0 16px -6px #ffd98a4d; }
.tool svg { display: block; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.tool kbd { display: none; }
.tool-context { display: flex; align-items: center; justify-content: center; gap: 9px; max-width: min(430px, calc(100vw - 32px)); margin-bottom: 9px; pointer-events: none; text-shadow: 0 1px 7px #000; }
#tool-name { color: #e4c992; font: 400 11px/1.3 var(--serif); white-space: nowrap; }
#tool-description { max-width: 265px; overflow: hidden; text-overflow: ellipsis; color: #bdb29d; font-size: 9px; line-height: 1.3; white-space: nowrap; }
footer { position: fixed; top: calc(var(--gutter) + env(safe-area-inset-top, 0px) + 3px); right: calc(var(--gutter) + env(safe-area-inset-right, 0px)); z-index: 4; }
footer .text-button { width: 34px; height: 34px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: #17141175; color: #c7bba4; }
#toast { position: fixed; left: 50%; top: calc(var(--gutter) + env(safe-area-inset-top, 0px) + 98px); transform: translate(-50%, -6px); width: max-content; max-width: calc(100vw - 32px); border: 1px solid var(--line); border-radius: 30px; background: #211c16ed; -webkit-backdrop-filter: blur(15px); backdrop-filter: blur(15px); padding: 9px 14px; color: #efd9ab; font-size: 11px; line-height: 1.4; text-align: center; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 8; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#cursor { position: fixed; display: none; width: 34px; height: 34px; border: 1px solid #eac58260; border-radius: 50%; pointer-events: none; transform: translate(-50%, -50%); box-shadow: 0 0 25px #ffd08515; }
#fallback-notice { position: fixed; left: 50%; top: calc(var(--gutter) + env(safe-area-inset-top, 0px) + 38px); transform: translateX(-50%); max-width: calc(100vw - 30px); color: #c2b59b; font-size: 8px; letter-spacing: .025em; white-space: nowrap; pointer-events: none; }
.quiet header, .quiet .intro, .quiet .season-display, .quiet .climate, .quiet .scene-caption, .quiet .gesture-hint, .quiet .bottom-panel, .quiet footer > span { opacity: 0; pointer-events: none; }
.quiet footer .text-button { opacity: .6; }
.quiet footer .text-button:hover, .quiet footer .text-button:focus-visible { opacity: 1; }
.play-symbol { display: none; }
#pause[aria-pressed='true'] .pause-symbol { display: none; }
#pause[aria-pressed='true'] .play-symbol { display: block; }
dialog { width: 430px; max-width: calc(100vw - 32px); max-height: calc(100svh - 32px); overflow: auto; border: 1px solid #b99b6145; border-radius: 20px; padding: 32px; color: var(--ink); background: linear-gradient(135deg, #2b2820, #171512); box-shadow: 0 35px 120px #0009; }
dialog::backdrop { background: #070908a8; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.eyebrow { display: flex; align-items: center; gap: 9px; color: #c9bda6; font-size: 9px; letter-spacing: .15em; }
dialog h2 { margin: 18px 0; font: 400 32px/1.15 var(--serif); }
dialog > p:not(.eyebrow) { color: #c2b7a3; font-size: 12px; line-height: 1.7; }
.dialog-close { position: absolute; top: 8px; right: 9px; width: 36px; height: 36px; color: #d3c4a8; font-size: 25px; }
.instruction { display: flex; flex-direction: column; gap: 5px; margin: 19px 0; }
.instruction strong { color: #e8cf9f; font-size: 12px; font-weight: 500; }
.instruction span { color: #c2b7a3; font-size: 11px; line-height: 1.6; }
.keyboard-note { border-top: 1px solid var(--line); padding-top: 17px; font-size: 9px !important; }
.primary-button { display: flex; justify-content: space-between; align-items: center; width: 100%; margin-top: 10px; padding: 13px 16px; border-radius: 8px; background: #d5b270; color: #231d13; font-size: 12px; }
.primary-button:hover { background: #e6c68a; }
@media (max-width: 900px) {
  :root { --gutter: 12px; }
  .season-display, .climate { bottom: calc(78px + env(safe-area-inset-bottom, 0px)); }
  .season-display { width: 174px; }
  .climate { width: 176px; gap: 7px; padding: 9px; }
  .tool-context { display: none; }
}
@media (max-width: 500px) {
  .intro { top: calc(var(--gutter) + env(safe-area-inset-top, 0px) + 10px); }
  .intro h1 { font-size: 17px; letter-spacing: .075em; }
  header { right: calc(var(--gutter) + env(safe-area-inset-right, 0px) + 42px); padding: 2px; }
  header button { width: 30px; height: 34px; }
  .season-display { width: calc((100vw - 36px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)) / 2); max-width: 184px; padding: 8px; }
  .climate { width: calc((100vw - 36px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)) / 2); max-width: 184px; padding: 8px; gap: 5px; }
  .reading { margin: 6px 0; font-size: 8px; }
  .reading strong { font-size: 11px; }
  #temperature { font-size: 18px; }
  .time-head { gap: 5px; }
  #pause { width: 26px; height: 26px; }
  #clock-label { font-size: 9px; letter-spacing: 0; }
  .bottom-panel { width: calc(100vw - 24px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)); }
  .toolbar { width: 100%; }
  .tool { width: auto; min-width: 0; flex: 1 1 0; padding: 10px 5px; }
  .gesture-hint { top: calc(var(--gutter) + env(safe-area-inset-top, 0px) + 56px); font-size: 11px; }
  dialog { padding: 26px; }
}
@media (max-width: 359px) {
  .intro h1 { font-size: 15px; letter-spacing: .04em; }
  header button { width: 27px; }
  .climate { gap: 3px; padding: 7px; }
  .seasons { width: 88px; height: 88px; flex-basis: 88px; }
  .seasons button[data-season='spring'], .seasons button[data-season='autumn'] { left: 30px; }
  .seasons button[data-season='summer'], .seasons button[data-season='winter'] { top: 30px; }
  #season-label { inset: 29px 21px; font-size: 9px; }
  #clock-label { white-space: normal; max-width: 88px; font-size: 8px; }
  #pause { width: 24px; height: 24px; }
}
@media (max-height: 520px) and (min-width: 600px) {
  :root { --gutter: 10px; }
  .season-display, .climate { bottom: calc(var(--gutter) + env(safe-area-inset-bottom, 0px)); }
  .season-display { width: 158px; }
  .climate { width: 154px; gap: 4px; padding: 7px; }
  .seasons { width: 88px; height: 88px; flex-basis: 88px; }
  .seasons button[data-season='spring'], .seasons button[data-season='autumn'] { left: 30px; }
  .seasons button[data-season='summer'], .seasons button[data-season='winter'] { top: 30px; }
  #season-label { inset: 29px 21px; font-size: 9px; }
  #clock-label { font-size: 8px; }
  .tool { width: clamp(28px, calc((100vw - 350px) / 8), 36px); height: 40px; padding: 8px; }
  .gesture-hint { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

.quality-setting { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.quality-setting label { color: #e8cf9f; font-size: 12px; }
.quality-setting select { max-width: 170px; border: 1px solid var(--line); border-radius: 7px; padding: 7px 25px 7px 9px; font: inherit; font-size: 11px; color: #eee4cf; background: #1b1813; }
.quality-setting select:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; }
.quality-setting p { grid-column: 1 / -1; margin: 0; color: #c2b7a3; font-size: 10px; line-height: 1.5; }

.wildlife-view{position:fixed;right:calc(var(--gutter) + env(safe-area-inset-right,0px));top:calc(var(--gutter) + env(safe-area-inset-top,0px) + 48px);display:flex;align-items:center;gap:7px;pointer-events:auto}.wildlife-view details{position:relative}.wildlife-view summary{list-style:none;cursor:pointer;padding:8px 11px;border-radius:9px;border:1px solid #ab95604d;background:#191a17d9;color:#d5ccbb;font-size:12px}.wildlife-view summary::-webkit-details-marker{display:none}.wildlife-view summary:focus-visible,.wildlife-view select:focus-visible{outline:2px solid #e6ca83;outline-offset:3px}.wildlife-panel{position:absolute;right:0;top:39px;width:250px;padding:14px;border-radius:12px;border:1px solid #ab956055;background:#20211df5;box-shadow:0 9px 30px #0006}.wildlife-panel label{display:block;margin-bottom:8px;font-size:12px;color:#dfd7c6}.wildlife-panel select{width:100%;background:#121711;color:#ece5d7;border:1px solid #8f856b66;border-radius:7px;padding:9px;font:inherit;font-size:12px}.wildlife-panel p{margin:10px 0 0;color:#b9b7a5;font-size:11px;line-height:1.5}.wildlife-view #wildlife-overview{width:auto;height:32px;padding:0 10px;border-radius:7px;white-space:nowrap;font-size:11px}.wildlife-view [hidden]{display:none!important}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.quiet .wildlife-view{opacity:0;pointer-events:none}.wildlife-label-short{display:none}#wildlife-visibility{position:absolute;right:0;top:36px;width:230px;margin:0;padding:9px 12px;border-radius:9px;background:#22241eea;color:#e3dac6;font-size:11px;line-height:1.4;pointer-events:none}@media(max-width:600px){.wildlife-label-long{display:none}.wildlife-label-short{display:inline}.wildlife-view summary{font-size:11px;padding:7px 10px}.wildlife-view{top:calc(var(--gutter) + env(safe-area-inset-top,0px) + 44px)}.wildlife-panel{width:min(250px,calc(100vw - 32px))}}

.wildlife-focused #gesture-hint{opacity:0;visibility:hidden;pointer-events:none}.wildlife-view details[open]~#wildlife-visibility{display:none}

/* Explicit terrain material opt-in and companion environment navigation. */
.terrain-material-setting select:disabled { opacity: .55; cursor: not-allowed; }
.terrarium-preview-link a { display: inline-block; color: #e8cf9f; font-size: 12px; text-underline-offset: 3px; }
.terrarium-preview-link a:focus-visible { outline: 2px solid var(--brass); outline-offset: 4px; }
