:root {
  color-scheme: dark;
  font-family: "Noto Serif SC", "Songti SC", Georgia, serif;
  color: #eef2e9;
  background: #17251f;
  --glass: rgba(17, 29, 24, .8);
  --glass-strong: rgba(20, 34, 28, .92);
  --line: rgba(235, 241, 226, .16);
  --line-strong: rgba(220, 231, 201, .27);
  --accent: #d0d9a8;
  --muted: rgba(239, 244, 233, .72);
  --radius: 14px;
  --shadow: 0 24px 70px rgba(6, 13, 10, .34), inset 0 1px rgba(255, 255, 255, .035);
}
* { box-sizing: border-box; }
html, body, #world { width: 100%; height: 100%; margin: 0; overflow: hidden; }
button { font: inherit; color: inherit; transition: border-color .22s, background-color .22s, opacity .22s, transform .22s; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
button:active { transform: translateY(1px); }
#world { position: relative; background: #1b3029; cursor: grab; }
#world.selecting { cursor: crosshair; }
#world.dragging { cursor: grabbing; }
canvas { width: 100%; height: 100%; display: block; touch-action: none; }
#weather-canvas { position: absolute; inset: 0; pointer-events: none; }
.grain { position: absolute; inset: 0; pointer-events: none; opacity: .13; 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%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.22'/%3E%3C/svg%3E"); mix-blend-mode: soft-light; }
header { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; padding: 28px 36px; pointer-events: none; }
header button { pointer-events: auto; }
.brand { border: 0; background: none; text-align: left; letter-spacing: .2em; font-size: 15px; cursor: pointer; text-shadow: 0 2px 14px rgba(0,0,0,.28); }
.brand span { display: block; margin-top: 6px; font: 8px system-ui; letter-spacing: .42em; opacity: .62; }
.weather { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border: 1px solid rgba(235,241,226,.08); border-radius: 999px; background: rgba(15,26,22,.2); font: 12px system-ui; opacity: .76; backdrop-filter: blur(8px); }
.weather b { margin-left: 8px; padding-left: 18px; border-left: 1px solid var(--line); font-size: 9px; font-weight: 400; letter-spacing: .14em; }
.weather em { margin-left: 6px; font-style: normal; opacity: .5; }
.weather i { width: 28px; height: 1px; background: currentColor; animation: wind 3s ease-in-out infinite; }
@keyframes wind { 50% { transform: translateX(5px); opacity: .35; } }
.round { border: 1px solid var(--line); background: rgba(20,30,26,.5); border-radius: 50%; width: 36px; height: 36px; cursor: pointer; box-shadow: 0 8px 26px rgba(0,0,0,.16); backdrop-filter: blur(10px); }
.loading { position: absolute; inset: 0; z-index: 10; display: grid; place-content: center; text-align: center; background: #192922; transition: opacity 1.2s, visibility 1.2s; }
.loading.done { opacity: 0; visibility: hidden; }
.loading p { font-size: clamp(19px, 3vw, 30px); letter-spacing: .08em; margin: 0 0 14px; }
.loading strong { color: var(--accent); font-weight: 400; }
.loading span, .eyebrow { font: 11px system-ui; letter-spacing: .22em; opacity: .58; }
.toast { position: absolute; left: 50%; top: 18%; z-index: 3; transform: translate(-50%, 10px); max-width: calc(100% - 40px); padding: 10px 16px; border: 1px solid transparent; border-radius: 999px; background: rgba(16,27,22,.72); opacity: 0; transition: .45s; text-align: center; font-size: 13px; letter-spacing: .06em; pointer-events: none; backdrop-filter: blur(12px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.dock { position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%); display: grid; grid-template-columns: 1fr 1.25fr 1fr; width: min(720px, calc(100% - 32px)); overflow: hidden; background: var(--glass); border: 1px solid var(--line); border-radius: var(--radius); backdrop-filter: blur(20px) saturate(1.08); box-shadow: var(--shadow); transition: opacity .5s; }
.dock > * { min-height: 64px; padding: 13px 22px; background: none; border: 0; text-align: left; }
.dock > * + * { border-left: 1px solid var(--line); }
.dock button { cursor: pointer; }
.dock small { display: block; margin-bottom: 6px; font: 9px system-ui; letter-spacing: .17em; opacity: .62; }
.dock strong { font-weight: 400; font-size: 13px; letter-spacing: .045em; }
.dock .action { background: linear-gradient(135deg, rgba(202,216,158,.13), rgba(151,178,128,.055)); }
.dock .action strong { color: #e7edce; }
.panel { position: absolute; left: 50%; bottom: 108px; transform: translateX(-50%); width: min(560px, calc(100% - 32px)); padding: 28px 30px 26px; background: var(--glass-strong); border: 1px solid var(--line); border-radius: var(--radius); backdrop-filter: blur(22px) saturate(1.08); box-shadow: var(--shadow); animation: panel-in .25s ease-out; }
@keyframes panel-in { from { opacity: 0; transform: translate(-50%, 8px); } }
.panel h1 { margin: 8px 0 11px; font-size: 22px; font-weight: 400; }
.panel > p:not(.eyebrow) { margin: 0; color: var(--muted); font: 13px/1.8 system-ui; }
.buttons { display: flex; align-items: center; justify-content: flex-end; gap: 18px; margin-top: 22px; }
.buttons button { min-height: 42px; border: 0; border-radius: 9px; padding: 11px 20px; cursor: pointer; }
#primary { background: linear-gradient(180deg, #dce3c1, #c8d2a6); color: #1b2821; box-shadow: 0 8px 24px rgba(9,18,14,.22); }
.text-button { background: none; opacity: .65; }
.environment { margin-top: 17px; display: flex; flex-wrap: wrap; gap: 10px 18px; padding-top: 15px; border-top: 1px solid var(--line); font: 12px system-ui; color: var(--muted); }
.drawer, .help-panel { position: absolute; right: 25px; top: 92px; width: min(340px, calc(100% - 50px)); padding: 26px; background: var(--glass-strong); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); backdrop-filter: blur(20px) saturate(1.08); transform: translateX(calc(100% + 40px)); transition: transform .35s; }
.drawer.open { transform: translateX(0); }
.drawer h2 { font-weight: 400; font-size: 22px; margin: 12px 0; }
.drawer p:last-child, .help-panel p { font: 13px/1.8 system-ui; color: var(--muted); }
.drawer-close { position: absolute; right: 14px; top: 12px; border: 0; background: none; font-size: 20px; cursor: pointer; opacity: .6; }
.help-panel { transform: none; }
.mobile-help { display: none; }
kbd { padding: 2px 6px; border: 1px solid var(--line); border-radius: 5px; background: rgba(255,255,255,.035); }
.timeline { position: absolute; left: 50%; bottom: 108px; transform: translateX(-50%); width: min(720px, calc(100% - 32px)); padding: 19px 24px; background: var(--glass-strong); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); backdrop-filter: blur(20px); animation: panel-in .25s ease-out; }
.timeline div { display: flex; justify-content: space-between; font-size: 12px; }
.timeline button { border: 0; background: none; color: var(--accent); cursor: pointer; }
.timeline input { width: 100%; margin-top: 15px; accent-color: var(--accent); }
.exit { position: absolute; right: 32px; top: 90px; padding: 9px 15px; border: 1px solid var(--line); border-radius: 999px; background: var(--glass); box-shadow: 0 10px 30px rgba(0,0,0,.18); backdrop-filter: blur(12px); cursor: pointer; }
.hidden { display: none !important; }
@media (hover: hover) {
  .dock button:hover, .round:hover, .exit:hover { background-color: rgba(218,229,190,.1); }
  #primary:hover { background: linear-gradient(180deg, #e6ebcf, #d2dbae); transform: translateY(-1px); }
  .text-button:hover, .drawer-close:hover { opacity: 1; }
}
@media (max-width: 620px) {
  header { padding: 20px; }
  .weather { position: absolute; top: 68px; left: 20px; padding: 7px 11px; gap: 8px; white-space: nowrap; }
  .weather i { display: none; }
  .weather b { margin-left: 4px; padding-left: 12px; }
  .dock { bottom: 14px; grid-template-columns: .8fr 1.4fr; border-radius: 12px; }
  .dock > * { min-height: 58px; padding: 11px 13px; }
  #status { display: none; }
  .panel, .timeline { bottom: 86px; }
  .panel { width: calc(100% - 48px); padding: 18px; }
  .panel h1 { margin: 6px 0 8px; font-size: 19px; }
  .panel > p:not(.eyebrow) { font-size: 12px; line-height: 1.65; }
  .buttons { margin-top: 14px; }
  .buttons button { min-height: 38px; padding: 9px 16px; }
  .desktop-help { display: none; }
  .mobile-help { display: block; }
  .drawer { top: auto; bottom: 86px; right: 16px; width: calc(100% - 32px); transform: translateY(calc(100% + 120px)); }
  .drawer.open { transform: translateY(0); }
  .environment { gap: 8px 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
