:root {
  color-scheme: light;
  --paper: #eeeede;
  --card: #f5f4e9;
  --ink: #26322a;
  --olive: #48563b;
  --muted: #5d6557;
  --line: #d9dbca;
  --white: #f8f6e8;
  --gold: #dbbd81;
  --sans: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --serif: "Songti SC", "STSong", "Noto Serif CJK SC", "SimSun", serif;
  font-family: var(--sans);
  color: var(--ink);
  background: #282d23;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 300px; }
button, input, textarea, select { font: inherit; }
button { color: inherit; cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid #c1954e;
  outline-offset: 3px;
}
[hidden] { display: none !important; }
button:disabled { cursor: default; opacity: .52; }
svg { display: block; width: 23px; height: 23px; flex-shrink: 0; }

.game {
  display: grid;
  grid-template-rows: 69px minmax(370px, 1fr) 90px;
  height: 100svh;
  min-height: 529px;
  isolation: isolate;
}
.masthead, .dock { display: flex; align-items: center; background: var(--paper); z-index: 2; }
.masthead { padding: 0 clamp(22px, 4.1vw, 64px); gap: 24px; border-bottom: 1px solid #252c2340; }
.brand { display: flex; text-decoration: none; color: inherit; align-items: center; gap: 13px; margin-right: auto; }
.brand-icon {
  width: 37px; height: 37px; border-radius: 11px;
  background: var(--olive); color: var(--paper); display: grid; place-items: center;
}
.brand-icon svg { width: 23px; height: 23px; }
.brand-name { font-size: 1.25rem; font-family: var(--serif); font-weight: 700; letter-spacing: .12em; white-space: nowrap; }
.weather { display: flex; align-items: center; gap: 10px; white-space: nowrap; font-size: .875rem; color: var(--muted); }
.weather-icon { color: #746330; }
.weather-icon svg { width: 21px; height: 21px; }
.header-line { height: 16px; width: 1px; background: var(--line); margin: 0 5px; }
.weather time { color: var(--ink); margin-left: 3px; font-variant-numeric: tabular-nums; }
.coin-balance {
  display: flex; align-items: center; gap: 7px; min-height: 38px; white-space: nowrap; padding: 0 10px;
  background: #f7efda; color: #5e4820; border: 1px solid #ded1ac; border-radius: 7px; font-size: .84rem;
}
.coin-balance:hover { background: #f0e2bc; }
.coin-balance strong { font-size: 1rem; font-variant-numeric: tabular-nums; min-width: 3ch; text-align: right; }
.coin-balance svg { width: 19px; height: 19px; }
.coin-flight { position: fixed; z-index: 30; pointer-events: none; }
.coin-flight > span { position: absolute; }
.flying-coin {
  display: grid; place-items: center; width: 27px; height: 27px; border-radius: 50%;
  margin: -13.5px 0 0 -13.5px;
  background: #f8cd65; color: #805019; border: 1px solid #ffdd89;
  box-shadow: 0 2px 7px #3a271f87, inset 0 0 0 3px #f4ad43;
}
.flying-coin svg { width: 20px; height: 20px; }
.coin-trail {
  width: 5px; height: 5px; margin: -2.5px 0 0 -2.5px; border-radius: 50%;
  background: #fff1a0; box-shadow: 0 0 7px 2px #ffcc65cf, 0 0 0 1px #684825;
}
.coin-rise {
  color: #fff4ab; font-size: 1.5rem; font-weight: 800; transform: translate(-50%, -50%);
  text-shadow: 0 2px 3px #3e2b12, 0 0 11px #674310;
}
.icon-control { border: 1px solid #d0d3c1; border-radius: 50%; width: 39px; height: 39px; flex: 0 0 auto; display: grid; place-items: center; background: transparent; }
.icon-control svg { width: 19px; height: 19px; }
.icon-control:hover { background: #dfe3d3; }

.stage { background: #3c4130; position: relative; overflow: clip; color: var(--white); isolation: isolate; }
.stage.portrait { background: linear-gradient(155deg, #29392c, #485039 63%, #222d22); }
.world {
  position: absolute; left: 50%; top: 50%; width: var(--frame-width, 100%); height: var(--frame-height, 100%);
  transform: translate(-50%, -50%); isolation: isolate; overflow: hidden;
}
.backdrop, .chair-layer, .atmosphere, .scene-shade { position: absolute; inset: 0; width: 100%; height: 100%; }
.backdrop { object-fit: fill; display: block; }
#scene-back { opacity: 0; }
.chair-layer { pointer-events: none; }
.bouquet-layer {
  position: absolute; height: var(--bouquet-height); left: var(--bouquet-x); top: var(--bouquet-y);
  transform: translate(-50%, -94%); width: auto; pointer-events: none;
  filter: drop-shadow(2px 2px 2px #29201680);
}
.kitten-layer {
  position: absolute; height: var(--kitten-height); left: var(--kitten-x); top: var(--kitten-y);
  width: auto; transform: translate(-50%, -84%); filter: drop-shadow(2px 5px 4px #311d1791);
  pointer-events: none;
}
.atmosphere { pointer-events: none; overflow: hidden; transition: background 1.6s; }
.scene-shade { background: linear-gradient(90deg, #101b12bc 0%, #101b1260 28%, transparent 65%), linear-gradient(0deg, #111b14bc, transparent 27%); pointer-events: none; }
.stage[data-phase="dawn"] .atmosphere { background: linear-gradient(180deg, #d6b5a74c, #8d95a43b 58%, #5c687b43); }
.stage[data-phase="dusk"] .atmosphere { background: linear-gradient(180deg, #f2b18137, #8b513826 65%, #39283056); }
.stage:is([data-weather="cloudy"], [data-weather="rain"]) .world > :is(.backdrop, .chair-layer) { filter: brightness(.77) saturate(.72); }
.stage[data-night-overlay="true"] .world > :is(.backdrop, .chair-layer) { filter: brightness(.53) saturate(.69); }
.stage[data-night-overlay="true"] .atmosphere { background: linear-gradient(165deg, #18365d46, #0e213742); }
.stage[data-phase="night"] :is(.bouquet-layer, .kitten-layer) { filter: brightness(.71) saturate(.78); }
.stage[data-view="room"] .atmosphere::after {
  content: ""; position: absolute; inset: 0; opacity: 0; pointer-events: none;
  background: radial-gradient(ellipse at 82% 56%, #132137a1, #07172845 39%, transparent 74%);
  transition: opacity .35s;
}
.stage[data-view="room"][data-lamp="off"] .atmosphere::after { opacity: 1; }
.stage[data-weather="mist"] .atmosphere::before {
  content: ""; position: absolute; width: 120%; height: 52%; top: 17%; left: -9%;
  background: radial-gradient(ellipse at 78% 50%, #e5e7dd8c, transparent 64%); filter: blur(16px);
}
.rain {
  position: absolute; inset: -50% -10% 0; display: none; opacity: .32;
  background: url("./assets/rain.webp") repeat; transform: rotate(10deg);
  animation: rainfall .65s linear infinite;
}
.stage[data-weather="rain"] .rain { display: block; }
.stage[data-view="room"] .rain {
  inset: 16% 35% 35% 21%; transform: none; opacity: .27;
  clip-path: polygon(1% 0, 100% 6%, 100% 96%, 2% 98%);
}
@keyframes rainfall { from { background-position: 0 0; } to { background-position: 0 260px; } }
.steam { position: absolute; left: var(--steam-x); top: var(--steam-y); display: flex; gap: 3px; pointer-events: none; }
.steam i { width: 4px; height: 19px; border-radius: 70%; filter: blur(2px); background: #f7efdcbb; animation: steam 3s ease-out infinite; }
.steam i:nth-child(2) { animation-delay: .65s; }
.steam i:nth-child(3) { animation-delay: 1.25s; }
@keyframes steam { from { opacity: 0; transform: translateY(6px) scale(.7); } 38% { opacity: .85; } to { opacity: 0; transform: translate(9px, -29px) scale(2); } }

.scene-copy { position: absolute; left: clamp(26px, 6.1vw, 100px); top: 20.5%; max-width: 46%; pointer-events: none; text-shadow: 0 2px 20px #0a1b12ad; }
.place { display: flex; align-items: center; gap: 7px; color: #fbf5de; letter-spacing: .095em; font-size: .93rem; }
.place svg { width: 16px; height: 16px; color: var(--gold); }
.scene-copy h1 { font: 700 clamp(2.65rem, 5.25vw, 6rem)/1.2 var(--serif); letter-spacing: .12em; margin: 18px 0 18px; overflow-wrap: anywhere; }
.scene-copy p { margin: 0; font-size: clamp(.88rem, 1.23vw, 1.09rem); letter-spacing: .07em; color: #f5f0d8; line-height: 1.65; }
.place-line { height: 1px; width: 45px; background: var(--gold); margin-top: 27px; }
.stage[data-farm="true"] .scene-copy { top: 5%; left: clamp(19px, 4.1vw, 64px); max-width: 51%; z-index: 1; }
.stage[data-farm="true"] .scene-copy h1 { font-size: clamp(1.8rem, 3.9vw, 3.8rem); margin: 8px 0 4px; }
.stage[data-farm="true"] .scene-copy p { font-size: .9rem; }
.stage[data-farm="true"] .place-line, .stage[data-farm="true"] .camera { display: none; }
.stage[data-farm="true"] .scene-shade { background: linear-gradient(180deg, #152013b8, transparent 43%), linear-gradient(0deg, #111b148f, transparent 28%); }
.field-board { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.field-tile { position: absolute; inset: 0; pointer-events: none; }
.field-plant {
  position: absolute; width: auto; height: calc(var(--plant-size) * var(--plant-scale, 1)); max-width: var(--plant-size);
  object-fit: contain; transform: translate(-50%, -94%); filter: drop-shadow(2px 4px 3px #222210ad);
  pointer-events: auto; cursor: pointer;
  transition: height .32s ease; z-index: 1;
}
.stage[data-phase="night"] .field-plant { filter: brightness(.58) saturate(.75) drop-shadow(2px 4px 3px #15120ca8); }
.field-furrows {
  display: none; position: absolute; inset: 0; pointer-events: none; opacity: .43;
  background: repeating-linear-gradient(0deg, #36231600 0 6px, #2b1b0da0 7px 10px, #a2734677 11px 12px);
}
.field-tile:is([data-phase="soil"], [data-phase="seed"]) .field-furrows { display: block; }
.field-tile[data-phase="seed"] .field-furrows { background: radial-gradient(circle, #d4a463be 1px, transparent 2px) 5px 6px / 17px 12px; }
.field-pest { display: none; }
.field-tile[data-phase="pest"] .field-pest {
  display: grid; place-items: center; position: absolute; z-index: 2; width: 26px; height: 26px;
  transform: translate(-50%, -50%);
  border-radius: 50%; border: 1px solid #f6bf8a; background: #592c1bea; color: #ffcca2;
}
.field-pest svg { width: 16px; height: 16px; }
.farm-motion { position: absolute; z-index: 5; pointer-events: none; }
.farm-motion img {
  position: absolute; bottom: -6px; left: -22px; width: auto;
  max-width: clamp(63px, 8.3vw, 114px); height: clamp(56px, 7.2vw, 96px); object-fit: contain;
  object-position: left bottom; transform-origin: 61% 68%; filter: drop-shadow(2px 3px 4px #171810a6);
}
.farm-motion i { position: absolute; width: 7px; height: 6px; border-radius: 50%; background: #b48a55; box-shadow: 0 1px 2px #34261d9e; }
.farm-motion[data-tool="water"] i { width: 4px; height: 10px; background: #a8e9ff; box-shadow: 0 0 4px #e4faff; }
.farm-motion[data-tool="fertilize"] i { background: #6b411f; }
.farm-motion[data-tool="sow"] i { width: 5px; height: 3px; background: #f1d0a1; }
.farm-motion[data-tool="pest"] i { width: 18px; height: 10px; background: #ecefd5b8; filter: blur(3px); box-shadow: none; }
.farm-motion[data-tool="harvest"] i { width: 5px; height: 5px; background: #fae58a; box-shadow: 0 0 5px #fbd871a0; }
.field-card {
  pointer-events: auto; position: absolute; z-index: 3; display: grid; transform: translate(-50%, -40%);
  width: clamp(106px, 15.5vw, 198px); text-align: left; gap: 6px;
  padding: 9px 10px 8px; color: #f7f2df; background: #1d2b20f0; box-shadow: 0 5px 15px #13191493;
  border: 1px solid #c0c8ac96; border-radius: 8px;
}
.field-card:hover, .field-card:focus-visible { background: #405238; border-color: #d9e2c6; }
.field-card[data-action-ready="false"] { border-color: #d4dbc958; }
.field-head { display: flex; justify-content: space-between; align-items: baseline; gap: 4px; }
.field-head strong { font-size: .94rem; line-height: 1.25; }
.field-phase { justify-self: end; font-size: .72rem; color: #dbe6c8; white-space: nowrap; }
.field-info { font-size: .77rem; color: #e0e7d2; white-space: nowrap; }
.field-bottom { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 4px; }
.field-count { font-size: .67rem; color: #dbe6c8; white-space: nowrap; }
.field-card progress { width: 100%; height: 6px; appearance: none; border: 0; background: #61715b; border-radius: 7px; overflow: hidden; }
.field-card progress::-webkit-progress-bar { background: #61715b; }
.field-card progress::-webkit-progress-value { background: #a7c478; transition: width .35s linear; }
.field-card progress::-moz-progress-bar { background: #a7c478; }
.field-tile[data-phase="pest"] :is(.field-phase, .field-info) { color: #ffbe9a; }
.field-tile[data-phase="pest"] progress::-webkit-progress-value { background: #e69a66; }
.field-tile[data-phase="ready"] .field-card { border-color: #efce79; }
.field-tile[data-phase="ready"] :is(.field-phase, .field-info) { color: #ffe2a0; }
.field-tile[data-phase="ready"] progress::-webkit-progress-value { background: #f4d16c; }
.field-tools {
  position: absolute; z-index: 2; bottom: 8px; left: 50%; transform: translateX(-50%);
  width: min(600px, calc(100% - 24px)); border-radius: 8px; background: #f0efde; color: var(--ink);
  box-shadow: 0 5px 19px #1b241f66; padding: 5px 7px 4px; border: 1px solid #e4ead280;
}
.field-tool-row { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.field-tool {
  min-width: 0; min-height: 37px; display: flex; align-items: center; justify-content: center;
  gap: 5px; padding: 3px 5px; white-space: nowrap; border-radius: 5px; border: 1px solid transparent;
  background: transparent; color: #334932; font-size: .84rem;
}
.field-tool svg { width: 19px; height: 19px; }
.field-tool:hover { background: #e0e7d4; }
.field-tool[aria-pressed="true"] { color: #fff9e4; background: #42543c; border-color: #3b4d34; }
.field-tools p { font-size: .71rem; margin: 4px 4px 1px; text-align: center; color: #505c4c; }
.room-panel {
  z-index: 3; position: absolute; left: clamp(13px, 4.1vw, 64px); top: 124px; width: min(235px, 61vw);
  max-height: calc(100% - 142px); overflow: auto;
  background: #f4f1e4; color: var(--ink); border: 1px solid #afa987; border-radius: 8px;
  box-shadow: 0 10px 30px #1b1b134f; padding: 12px;
}
.stage[data-view="room"] .scene-copy { left: clamp(13px, 4.1vw, 64px); top: 22px; }
.stage[data-view="room"] .scene-copy h1 { font-size: clamp(1.5rem, 3.4vw, 2.7rem); margin: 9px 0 0; }
.stage[data-view="room"] :is(.scene-copy p, .place-line, .camera) { display: none; }
.stage[data-view="room"]:has(.room-panel:not([hidden])) #scene-action { visibility: hidden; }
.stage[data-view="wide"] :is(.scene-copy, .camera),
body:has(.stage[data-view="wide"]) .toast { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); padding: 0; border: 0; }
.stage[data-view="wide"] .scene-shade { background: none; }
.dock .courtyard-tool { min-width: 40px; justify-content: center; }
.dock .courtyard-tool > span:last-child { display: none; }
.room-panel-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.room-panel-header h2 { margin: 0; font: 700 1.13rem/1.2 var(--serif); }
.room-panel-header button { width: 30px; height: 30px; }
.room-panel-header button svg { width: 15px; height: 15px; }
.room-music { display: flex; align-items: center; gap: 9px; padding: 9px 0 6px; }
.room-music span { display: block; color: var(--muted); font-size: .74rem; }
.room-music strong { display: block; font-size: .89rem; margin-top: 2px; }
.room-play { display: grid; place-items: center; flex: 0 0 auto; border: 0; background: var(--olive); color: var(--paper); width: 37px; height: 37px; border-radius: 50%; }
.room-play:hover { background: #35452d; }
.room-play svg { width: 19px; height: 19px; }
.room-tracks { border-bottom: 1px solid var(--line); padding: 5px 0 8px; font-size: .82rem; }
.room-tracks summary { cursor: pointer; padding: 3px; }
.room-tracks button, .room-actions button {
  width: 100%; display: flex; align-items: center; text-align: left; gap: 6px; padding: 5px;
  background: transparent; border: 0; border-radius: 4px; font-size: .85rem; min-height: 34px;
}
.room-tracks button { display: grid; gap: 2px; }
.room-tracks button small { color: var(--muted); }
.room-tracks button:hover, .room-tracks button[aria-pressed="true"], .room-actions button:hover { background: #e3e7d5; }
.track-credits { margin: 6px 2px 0; color: var(--muted); font-size: .67rem; line-height: 1.55; }
.track-credits a { color: inherit; }
.room-actions { padding-top: 5px; }
.room-actions svg { width: 18px; height: 18px; }
.room-arrange summary {
  list-style: none; display: flex; align-items: center; gap: 6px; padding: 5px;
  min-height: 34px; border-radius: 4px; cursor: pointer; font-size: .85rem;
}
.room-arrange summary::-webkit-details-marker { display: none; }
.room-arrange summary:hover, .room-arrange[open] summary { background: #e3e7d5; }
.room-arrange p { font-size: .78rem; line-height: 1.45; margin: 5px 5px 7px; }
.room-actions .room-flower-action { width: auto; border: 1px solid #b9c3a9; margin: 0 5px 7px; padding: 4px 8px; }
.hotspots { inset: 0; position: absolute; pointer-events: none; }
.hotspot {
  pointer-events: auto; position: absolute; transform: translate(-13px, -50%);
  display: inline-flex; gap: 7px; align-items: center; padding: 5px 10px 5px 5px; min-height: 38px;
  border: 1px solid #f7f6e760; border-radius: 22px; white-space: nowrap;
  background: #202b20e0; color: var(--white); box-shadow: 0 2px 15px #11150d46;
  font-size: .81rem; backdrop-filter: blur(7px); transition: background .15s;
}
.hotspot:hover, .hotspot:focus-visible { background: #465439; z-index: 2; border-color: #f2e8ce; }
.hotspot-icon {
  width: 26px; height: 26px; background: #edebd9; color: #414e36;
  border-radius: 50%; display: grid; place-items: center; flex-shrink: 0;
}
.hotspot-icon svg { width: 16px; height: 16px; }
.scene-action, .camera {
  position: absolute; bottom: clamp(18px, 4.6vh, 43px); display: flex; gap: 9px; align-items: center;
  min-height: 42px; color: var(--white); font-size: .86rem; font-weight: 600;
}
.scene-action { left: clamp(26px, 6.1vw, 100px); border: 1px solid #f0ebd38a; background: #242d239a; border-radius: 4px; padding: 0 14px; backdrop-filter: blur(9px); }
.scene-action:hover { background: #e6e8d7; color: var(--ink); }
.scene-action svg, .camera svg { width: 18px; height: 18px; }
.task-shortcut {
  position: absolute; top: clamp(14px, 3.8vh, 35px); right: clamp(21px, 4.1vw, 64px); min-height: 41px;
  display: flex; align-items: center; gap: 8px; background: #232f25e5; color: var(--white); border: 1px solid #fff8d36e;
  padding: 7px 11px; border-radius: 6px; backdrop-filter: blur(6px); font-size: .85rem;
}
.task-shortcut:hover { background: #44543b; }
.task-shortcut strong { padding-left: 7px; border-left: 1px solid #ede5ca5e; color: #ebce91; font-variant-numeric: tabular-nums; }
.task-shortcut svg { width: 19px; height: 19px; }
.camera { right: clamp(21px, 4.1vw, 64px); text-shadow: 0 1px 8px #000; color: #f4eedc; font-weight: 500; }
.stage-notice { position: absolute; left: 50%; transform: translateX(-50%); bottom: 9px; border-radius: 5px; font-size: .82rem; text-align: center; margin: 0; padding: 7px 10px; color: var(--white); background: #283023; }

.dock { justify-content: space-between; border-top: 1px solid #292c1e40; padding: 0 clamp(16px, 4.1vw, 64px); gap: 10px; }
.spaces, .tools { display: flex; align-items: center; gap: 7px; }
.space-button, .tool-button {
  border: 1px solid transparent; border-radius: 7px; background: transparent; min-height: 56px;
  display: flex; align-items: center; gap: 11px; padding: 7px 12px;
  text-align: left; white-space: nowrap;
}
.space-button:hover, .tool-button:hover { background: #e0e4d3; }
.space-button[aria-current="true"] { background: #dfe5d2; border-color: #c8d0b9; }
.space-icon { width: 36px; height: 36px; display: grid; place-items: center; background: #e2e4d4; color: #455339; border-radius: 5px; }
.space-button[aria-current="true"] .space-icon { background: var(--olive); color: var(--paper); }
.space-text { display: grid; gap: 4px; }
.space-text strong { font-size: .94rem; font-weight: 650; }
.space-text small { font-size: .75rem; color: var(--muted); }
.tool-button { min-height: 43px; padding-inline: 10px; gap: 8px; font-size: .875rem; }
.tool-button svg { width: 20px; height: 20px; color: #4c5b43; }
.tool-button[aria-pressed="true"] { background: #dfe5d2; }
.tool-button[aria-expanded="true"] { background: #dfe5d2; border-color: #c8d0b9; }

.furniture-panel {
  z-index: 3; position: absolute; right: clamp(12px, 3vw, 48px); top: 19px; max-height: calc(100% - 38px);
  width: min(326px, calc(100% - 24px)); display: flex; flex-direction: column;
  background: var(--card); color: var(--ink); border: 1px solid #a5a88c; border-radius: 9px;
  box-shadow: -8px 10px 55px #12180f59;
}
.side-header {
  display: flex; justify-content: space-between; align-items: center; padding: 18px 16px 13px;
  border-bottom: 1px solid var(--line);
}
.side-header .sheet-kind { display: block; }
.side-header h2 { font: 700 1.62rem/1.2 var(--serif); margin: 0; }
.furniture-options { min-height: 0; overflow: auto; padding: 14px 16px; display: grid; gap: 12px; align-content: start; }
.furniture-card {
  display: grid; grid-template-columns: 64px 1fr; align-items: center; gap: 10px;
  border: 1px solid var(--line); padding: 8px; border-radius: 6px;
}
.furniture-card[data-selected="true"] { background: #e9eddd; border-color: #a9b394; }
.furniture-card img { width: 64px; height: 75px; display: block; object-fit: cover; border-radius: 4px; background: #dedfd1; }
.furniture-card strong { display: block; font-size: .95rem; }
.furniture-card p { color: var(--muted); font-size: .78rem; margin: 3px 0 6px; }
.furniture-card button { min-height: 35px; padding: 5px 8px; }

.task-list { list-style: none; margin: 0; padding: 0; }
.task-list li { display: grid; grid-template-columns: 1fr auto; gap: 9px; align-items: center; border-top: 1px solid var(--line); padding: 11px 0; }
.task-list li:first-child { border-top: 0; padding-top: 0; }
.task-list li p { margin: 4px 0; }
.task-list li strong { display: block; font-size: .95rem; }
.task-list .task-state { color: #5c692e; font-weight: 600; font-size: .82rem; }
.task-list .task-action { text-align: right; }
.task-list .task-action small { display: block; color: #745e30; margin-bottom: 4px; }

.sheet {
  position: fixed; inset: auto clamp(20px, 4vw, 64px) 107px auto; width: min(460px, calc(100vw - 40px)); max-height: calc(100svh - 135px);
  border: 1px solid #a5a88c; border-radius: 10px; padding: 0; color: var(--ink); background: var(--card);
  box-shadow: 0 20px 65px #10170d65; margin: 0; overflow: auto;
}
.sheet::backdrop { background: #18241759; }
.sheet-header { padding: 22px 24px 15px; display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); align-items: center; }
.sheet-kind { margin: 0 0 5px; font-size: .79rem; color: var(--muted); }
.sheet-kind:empty { display: none; }
.sheet h2 { font: 700 1.7rem/1.2 var(--serif); margin: 0; }
.sheet-body { padding: 17px 24px 24px; }
.sheet-body p { margin: 0 0 14px; font-size: .96rem; line-height: 1.65; }
.sheet-body label { display: grid; gap: 7px; font-size: .9rem; }
.sheet-body label + label, .sheet-body form + form { margin-top: 11px; }
.sheet input:not([type=range]), .sheet textarea, .sheet select { width: 100%; background: #fffdf3; color: var(--ink); border: 1px solid #c4c7b6; border-radius: 5px; padding: 9px; }
.sheet input[type=range] { width: 100%; accent-color: var(--olive); }
.sheet textarea { resize: vertical; }
.sheet hr { color: var(--line); border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
.sheet h3 { font-size: 1rem; margin: 0 0 10px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 11px; }
.primary, .secondary {
  font-size: .88rem; padding: 9px 13px; min-height: 40px;
  border-radius: 5px; background: var(--olive); color: #ffffef; border: 1px solid var(--olive);
}
.primary:hover { background: #354429; }
.secondary { color: var(--ink); background: transparent; border-color: #c8ccb9; }
.secondary:hover, .secondary[aria-pressed="true"] { background: #e0e5d3; }
.secondary[aria-pressed="true"] { border-color: #9ca888; }
.sheet .muted { color: var(--muted); font-size: .83rem; }
.sheet .compact { margin-bottom: 4px; }
.stages { display: flex; gap: 4px; border: 0; padding: 0; list-style: none; margin: 14px 0; }
.stages li { flex: 1; border-top: 3px solid #dcdfd1; color: var(--muted); padding-top: 6px; font-size: .76rem; }
.stages li[data-current="true"] { border-color: #64764d; font-weight: 700; color: var(--ink); }
.map {
  position: relative; min-height: 160px; border: 1px solid #c9cdb8; border-radius: 5px; background: #dce2ce;
  display: grid; grid-template-columns: 1.15fr .85fr; align-items: stretch; gap: 8px; padding: 13px;
}
.map-house, .map-entrance { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: .8rem; color: #4f6845; }
.map-house { grid-column: 1 / -1; padding: 6px; background: #cbd3ba; border: 1px solid #b6c1a4; border-radius: 3px; }
.map-entrance { grid-column: 1; justify-self: center; }
.map-view[data-value="garden"] { grid-column: 1 / -1; }
.map-house [data-icon] svg, .map-entrance [data-icon] svg { width: 17px; height: 17px; margin: 0; }
.map button { background: #f7f5e9b8; border: 1px solid #aeb89c; border-radius: 4px; display: grid; place-content: center; justify-items: center; gap: 4px; padding: 8px; font-size: .88rem; min-height: 75px; }
.map button:hover, .map button[aria-current="true"] { background: #eef0e1; border-color: #687950; }
.map svg { color: #4f6845; margin-bottom: 4px; }
.journal-entries { list-style: none; margin: 0; padding: 0; }
.journal-entries li { padding: 8px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.sheet .journal-entries p { margin: 4px 0 0; font-size: .91rem; }
.wish { display: flex; align-items: start; gap: 6px; margin: 5px 0; }
.wish span { flex: 1; overflow-wrap: anywhere; }
.wish button { padding: 0 5px; border: 0; background: none; color: var(--muted); }
.toast {
  z-index: 5; position: fixed; max-width: calc(100vw - 34px); right: clamp(20px, 4vw, 64px); bottom: 104px;
  color: var(--white); background: #33402f; border: 1px solid #dde3cd75; border-radius: 6px;
  padding: 10px 15px; font-size: .88rem; opacity: 0; transition: opacity .2s; pointer-events: none;
}
.toast[data-visible="true"] { opacity: 1; }

@media (max-width: 840px) {
  .masthead { gap: 13px; }
  .spaces, .tools { gap: 3px; }
  .space-button, .tool-button { padding-inline: 7px; gap: 6px; }
  .hotspot { font-size: .75rem; gap: 4px; padding-right: 7px; }
}
@media (max-width: 975px) {
  .dock { padding-inline: clamp(10px, 1.8vw, 18px); gap: 8px; }
  .spaces, .tools { gap: 3px; }
  .space-button { padding-inline: 6px; gap: 5px; }
  .tool-button[aria-label] > span:last-child { display: none; }
  .tool-button[aria-label] { min-width: 42px; justify-content: center; }
}
@media (max-width: 650px) and (orientation: portrait) {
  .game { grid-template-rows: 59px minmax(470px, 1fr) auto; }
  .masthead { padding-inline: 12px; gap: 9px; }
  .brand { gap: 6px; }
  .brand-icon { width: 30px; height: 30px; border-radius: 7px; }
  .brand-icon svg { width: 20px; height: 20px; }
  .brand-name { font-size: .98rem; letter-spacing: .02em; }
  .weather { gap: 5px; font-size: .75rem; }
  .weather-icon svg { width: 17px; height: 17px; }
  .header-line, #world-date { display: none; }
  #weather-name, .coin-name { display: none; }
  .coin-balance { padding-inline: 6px; gap: 4px; min-height: 32px; }
  .field-tool { gap: 2px; flex-direction: column; min-height: 37px; font-size: .69rem; }
  .field-card { width: clamp(92px, 28vw, 126px); }
  .field-head strong { font-size: .79rem; }
  .field-phase { font-size: .62rem; }
  .field-card { padding: 6px; gap: 4px; }
  .field-info { font-size: .65rem; }
  .icon-control { width: 34px; height: 34px; }
  .dock { align-items: stretch; flex-wrap: wrap; justify-content: center; padding: 6px 9px; gap: 3px; }
  .spaces, .tools { justify-content: center; }
  .space-button { min-height: 44px; }
  .space-icon { width: 30px; height: 30px; }
  .space-text strong { font-size: .82rem; }
  .space-text small { display: none; }
  .spaces { flex-wrap: wrap; }
  .tool-button { min-height: 36px; font-size: .78rem; }
  .scene-copy { top: 13%; max-width: 81%; }
  .scene-copy h1 { margin-block: 11px; }
  .place-line { margin-top: 14px; }
  .sheet { inset: auto 10px 108px auto; width: calc(100vw - 20px); max-height: calc(100svh - 125px); }
  .camera { bottom: 15px; }
  .scene-action { bottom: 15px; }
  .toast { bottom: 108px; }
}
@media (max-height: 550px) and (orientation: landscape) {
  .game { height: 100svh; min-height: 270px; grid-template-rows: 45px minmax(160px, 1fr) 53px; }
  .masthead { padding-inline: 15px; }
  .brand-icon { width: 30px; height: 30px; border-radius: 7px; }
  .brand-name { font-size: 1rem; }
  .icon-control { width: 34px; height: 34px; }
  .scene-copy { top: 13%; }
  .scene-copy h1 { font-size: clamp(1.9rem, 5vw, 3.7rem); margin: 7px 0 9px; }
  .scene-copy p { display: none; }
  .place-line { margin-top: 12px; }
  .scene-action, .camera { bottom: 10px; min-height: 33px; }
  .task-shortcut { top: 8px; min-height: 33px; padding-block: 4px; }
  .stage[data-farm="true"] .scene-copy { top: 3%; }
  .stage[data-farm="true"] .scene-copy .place { font-size: .72rem; }
  .stage[data-farm="true"] .scene-copy h1 { font-size: clamp(1.35rem, 3.1vw, 2rem); margin-top: 4px; }
  .field-tools { bottom: 4px; padding-block: 3px; }
  .field-tool { min-height: 32px; }
  .field-tools p { display: none; }
  .field-card { padding-block: 6px 5px; gap: 4px; }
  .field-card { width: clamp(108px, 17vw, 162px); }
  .stage[data-view="room"] .scene-copy { top: 8px; }
  .stage[data-view="room"] .scene-copy .place { font-size: .7rem; }
  .stage[data-view="room"] .scene-copy h1 { font-size: 1.3rem; margin-top: 3px; }
  .room-panel { top: 57px; max-height: calc(100% - 65px); }
  .furniture-panel { top: 8px; max-height: calc(100% - 16px); }
  .side-header { padding-block: 9px; }
  .furniture-options { padding: 8px 12px; gap: 6px; }
  .space-button { min-height: 41px; }
  .space-icon { width: 29px; height: 29px; }
  .space-icon svg { width: 19px; height: 19px; }
  .space-text small { display: none; }
  .sheet { inset: auto 12px 59px auto; max-height: calc(100svh - 72px); }
  .sheet-header { padding: 12px 15px 8px; }
  .sheet-body { padding: 10px 15px 15px; }
  .toast { bottom: 60px; }
}
@media (max-width: 740px) and (orientation: landscape) {
  .space-button { padding-inline: 4px; }
  .space-icon { display: none; }
  .tools { min-width: 0; overflow-x: auto; }
  .tool-button[aria-label] { flex-shrink: 0; min-width: 36px; padding-inline: 5px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; }
}
