:root {
  color-scheme: light;
  --paper: #f5f4ed;
  --ink: #292f29;
  --muted: #666b60;
  --rule: #d7d7ca;
  --evergreen: #435d4a;
  --copper: #a64e2d;
  --display: "PT Serif", "Iowan Old Style", Georgia, serif;
  --sans: "DM Sans", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 0; }
.wrap { width: calc(100% - clamp(40px, 8.75vw, 144px)); max-width: 1392px; margin-inline: auto; }
.icon-library { width: 0; height: 0; position: absolute; overflow: hidden; pointer-events: none; }
.icon { width: 19px; height: 19px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
button, input { font: inherit; }
button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; cursor: pointer; color: inherit; touch-action: manipulation;
  -webkit-tap-highlight-color: transparent; font-size: 13px; font-weight: 580;
}
button:focus-visible, input:focus-visible { outline: 3px solid #337b80; outline-offset: 3px; }
button:active:enabled { transform: translateY(1px); }
button:disabled { cursor: default; }
.masthead { border-bottom: 1px solid var(--rule); }
.masthead-inner { min-height: 61px; display: flex; align-items: center; justify-content: space-between; }
.wordmark { display: flex; gap: 10px; align-items: center; font-size: 23px; font-weight: 690; letter-spacing: -1.05px; }
.brand-mark { width: 32px; height: 32px; }
.guide-link { min-height: 42px; margin-right: -6px; padding: 0 6px; background: transparent; border-radius: 5px; font-size: 13px; font-weight: 520; color: #485044; }
.guide-link .icon { width: 17px; height: 17px; }
.introduction { padding: clamp(20px, 2.9vh, 32px) 0 clamp(16px, 2.35vh, 24px); }
h1, h2 { font-family: var(--display); font-weight: 500; margin: 0; }
h1 { font-size: clamp(44px, 4.12vw, 62px); line-height: 1.06; letter-spacing: -.053em; }
h1 em { font-weight: 400; color: var(--copper); }
.introduction p { margin: 7px 0 0; color: #60665b; font-size: 14px; line-height: 1.5; letter-spacing: .005em; }
.viewer { border-radius: 13px; overflow: hidden; background: #1c2929; box-shadow: 0 2px 6px #17261a17; }
.scene {
  position: relative; width: 100%; height: clamp(320px, 46vh, 510px);
  isolation: isolate; overflow: hidden; background: #2b404c url("clearing.webp") center bottom / cover no-repeat;
}
.scene:focus-visible { outline: 3px solid #ffdc8d; outline-offset: -5px; }
.scene:focus-visible::after { content: ""; position: absolute; inset: 3px; border: 2px solid #ffdc8d; pointer-events: none; }
.scene canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; pointer-events: none; }
.fire-state, .location { position: absolute; display: inline-flex; align-items: center; pointer-events: none; }
.fire-state {
  left: 18px; top: 17px; gap: 8px;
  padding: 6px 12px 6px 10px; min-height: 27px; border-radius: 999px;
  background: #101e28bd; border: 1px solid #c5ccc249;
  color: #f7f1e2; font-size: 12px; font-weight: 550; letter-spacing: .015em;
}
.state-light { flex: none; width: 7px; height: 7px; border-radius: 100%; background: #ffa564; box-shadow: 0 0 7px #ff8e4a77; }
.fire-state.out .state-light { background: #abb9be; box-shadow: none; }
.location { right: 19px; bottom: 14px; gap: 7px; color: #d6dacdcf; font-size: 11px; font-weight: 540; letter-spacing: .045em; text-shadow: 0 1px 3px #142022; }
.location .icon { width: 17px; height: 17px; }
.transport { display: flex; align-items: center; padding: 6px 12px; gap: 7px; min-height: 53px; color: #f1f0e5; background: #25302e; border-top: 1px solid #92a09224; }
.playback { background: #ebece1; color: #29332d; min-height: 34px; min-width: 83px; padding-inline: 13px; border-radius: 6px; box-shadow: 0 1px 2px #0e171729; }
.playback .icon { width: 15px; height: 15px; }
.transport-button { min-height: 39px; padding: 0 12px; border-radius: 6px; color: #e6e8df; background: transparent; font-weight: 500; }
.transport-button .icon { width: 16px; height: 16px; }
.transport-button:disabled { color: #a6aea5; opacity: .63; }
.time { margin-left: 4px; padding-left: 17px; border-left: 1px solid #5c685c; color: #bdc5bb; font: 11.5px/17px var(--mono); letter-spacing: .045em; font-variant-numeric: tabular-nums; }
.reset { margin-left: auto; }
.transport button:focus-visible { outline-color: #e8c691; }
.controls {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(254px, .87fr);
  align-items: stretch; margin-top: 16px; padding: 19px 0 18px;
  border: 1px solid var(--rule); border-radius: 11px; background: #fbfaf4;
  box-shadow: 0 1px 2px #35392a04;
}
.setting, .fire-buttons { min-width: 0; padding-inline: clamp(16px, 1.9vw, 30px); }
.fuel-setting, .fire-buttons { border-left: 1px solid var(--rule); }
.setting-heading { display: flex; align-items: center; justify-content: space-between; min-height: 23px; margin-bottom: 4px; }
.setting label { display: inline-flex; gap: 8px; align-items: center; font-size: 15px; font-weight: 620; letter-spacing: -.02em; }
.wind-setting .icon { color: #556c5a; }
.fuel-setting .icon { color: #986143; }
.value { padding: 3px 7px; border-radius: 4px; font: 12px/16px var(--mono); font-variant-numeric: tabular-nums; min-width: 29px; text-align: center; color: #3e5546; background: #e9eee4; }
.fuel-setting .value { background: #f5e9db; color: #924a2b; }
input[type="range"] {
  display: block; appearance: none; -webkit-appearance: none; width: 100%; min-width: 0;
  height: 26px; padding: 0; margin: 0; cursor: pointer; border-radius: 5px; border: none;
  background: transparent; touch-action: pan-y;
  --accent: #536e59; --fill-start: 50%; --fill-end: 50%; --track: #dcded3;
  --range-fill: linear-gradient(to right, var(--track) var(--fill-start), var(--accent) var(--fill-start), var(--accent) var(--fill-end), var(--track) var(--fill-end));
}
#fuel { --accent: #b26039; --track: #e4dace; --fill-start: 0%; --fill-end: 60%; }
input[type="range"]::-webkit-slider-runnable-track { height: 4px; background: var(--range-fill); border-radius: 4px; }
input[type="range"]::-moz-range-track { height: 4px; background: var(--range-fill); border-radius: 4px; }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 16px; height: 16px; margin-top: -6px;
  border-radius: 50%; background: var(--accent); border: 2.5px solid #fffef7;
  box-shadow: 0 0 0 1px var(--accent), 0 1px 3px #25332422;
}
input[type="range"]::-moz-range-thumb {
  box-sizing: border-box; width: 16px; height: 16px; border-radius: 50%; background: var(--accent);
  border: 2.5px solid #fffef7; box-shadow: 0 0 0 1px var(--accent), 0 1px 3px #25332422;
}
.scale-labels { display: flex; align-items: center; justify-content: space-between; color: #656b5f; font-size: 11px; line-height: 15px; }
.fire-buttons { display: flex; flex-direction: column; justify-content: space-between; gap: 9px; }
.action-label { font-weight: 600; font-size: 14px; line-height: 20px; letter-spacing: -.015em; }
.action-row { display: flex; gap: 8px; }
.action-row button { flex: 1 1 auto; min-height: 36px; border-radius: 6px; padding: 0 clamp(11px, 1.25vw, 21px); white-space: nowrap; }
.action-row .icon { width: 16px; height: 16px; }
.ignite { background: var(--copper); color: #fffaf0; border: 1px solid #934526; box-shadow: 0 1px 2px #62331b12; }
.extinguish { background: #fbfaf4; border: 1px solid #cdcec1; color: #40473c; }
.shortcuts { display: flex; justify-content: center; align-items: center; gap: 8px; margin: 15px 0 23px; color: var(--muted); font-size: 11.5px; line-height: 1.9; }
.shortcuts .icon { width: 16px; height: 16px; color: #72796b; }
kbd { display: inline-block; font: 10.5px/16px var(--mono); min-width: 20px; padding: 0 4px; text-align: center; border: 1px solid #cccec1; border-bottom-width: 2px; border-radius: 4px; color: #525a4e; background: #faf9f2; vertical-align: 1px; }
dialog { color: var(--ink); background: #f8f7ef; border: 1px solid #c8caba; border-radius: 15px; width: min(435px, calc(100% - 32px)); max-height: 85dvh; padding: 22px 26px 26px; box-shadow: 0 20px 70px #11211c4d; }
dialog::backdrop { background: #13242088; }
.guide-top { display: flex; align-items: center; justify-content: space-between; color: var(--evergreen); }
.guide-top > .icon { width: 24px; height: 24px; }
.close-guide { width: 37px; height: 37px; border: 1px solid var(--rule); border-radius: 50%; background: transparent; }
dialog h2 { margin: 10px 0 17px; font-size: 36px; letter-spacing: -.05em; }
dl { margin: 0; }
dt { margin-top: 16px; font-size: 14px; font-weight: 650; }
dd { margin: 4px 0 0; color: #535d50; font-size: 13px; line-height: 1.55; }
@media (hover: hover) {
  .guide-link:hover, .close-guide:hover { background: #e9ebdf; }
  .playback:hover { background: #fafbf2; }
  .transport-button:hover:enabled { background: #ffffff10; }
  .ignite:hover { background: #934226; }
  .extinguish:hover { background: #eeeee4; }
}
@media (max-width: 900px) {
  .wrap { width: calc(100% - 48px); }
  .controls { grid-template-columns: 1fr 1fr auto; }
  .setting, .fire-buttons { padding-inline: 15px; }
  .action-row { gap: 6px; }
  .action-row button { padding: 0 10px; }
}
@media (max-width: 700px) {
  .wrap { width: calc(100% - 32px); }
  .masthead-inner { min-height: 53px; }
  .wordmark { gap: 8px; font-size: 21px; }
  .brand-mark { width: 29px; height: 29px; }
  .introduction { padding: 21px 0 16px; }
  h1 { font-size: 43px; }
  .introduction p { margin-top: 6px; font-size: 13px; }
  .scene { height: clamp(285px, 38vh, 365px); background-image: url("clearing-small.webp"); }
  .viewer { border-radius: 10px; }
  .fire-state { left: 12px; top: 12px; }
  .location { right: 12px; bottom: 10px; font-size: 10px; }
  .transport { padding: 4px 7px; min-height: 50px; gap: 1px; }
  .playback { min-height: 36px; min-width: 77px; }
  .transport-button { padding-inline: 9px; min-height: 40px; }
  .time { margin-left: 3px; padding-left: 10px; font-size: 10.5px; }
  .controls { grid-template-columns: 1fr 1fr; padding: 15px 0 0; margin-top: 13px; }
  .setting { padding-inline: 15px; }
  .fire-buttons { grid-column: 1 / -1; flex-direction: row; align-items: center; margin-top: 14px; padding: 11px 14px; border-left: 0; border-top: 1px solid var(--rule); }
  .action-row button { min-height: 40px; padding: 0 12px; }
  .action-label { font-size: 12px; }
  input[type="range"] { height: 32px; }
  .shortcuts { max-width: 470px; margin: 13px auto 19px; align-items: baseline; font-size: 11px; line-height: 1.9; }
  .shortcuts > .icon { position: relative; top: 4px; }
}
@media (max-width: 365px) {
  .wrap { width: calc(100% - 24px); }
  .action-row button { padding-inline: 9px; gap: 5px; }
  .action-label { font-size: 11px; }
  .setting, .fire-buttons { padding-inline: 11px; }
  .time { padding-left: 7px; font-size: 10px; }
}
@media (pointer: coarse) {
  input[type="range"] { height: 38px; }
  .playback, .transport-button, .action-row button, .guide-link { min-height: 44px; }
}
@media (forced-colors: active) {
  input[type="range"] { appearance: auto; }
  .state-light { border: 1px solid currentColor; }
  .scene:focus-visible { outline-color: Highlight; }
}
