:root {
  color-scheme: light;
  --ink: #342c20;
  --pine: #243d32;
  --pine-deep: #192e27;
  --cream: #fff4d4;
  --brass: #c7a46a;
  --bark: #453323;
  --number: ui-monospace, "SFMono-Regular", Consolas, monospace;
  --book: "Songti SC", "STSong", "Noto Serif CJK SC", "SimSun", serif;
  --font: system-ui, "PingFang SC", "Microsoft YaHei", sans-serif;
  --enamel: linear-gradient(140deg,#385446,#213a30 70%,#192f29);
  --panel-shadow: 0 3px 0 #2c3326, 0 7px 17px #15251754;
}
* { box-sizing: border-box }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; background: var(--pine-deep) }
body, button { font-family: var(--font); color: var(--ink) }
button { cursor: pointer; font-size: inherit; font-weight: 650; touch-action: manipulation; -webkit-tap-highlight-color: transparent }
button:disabled { cursor: default }
button:focus-visible { outline: 3px solid #ffedac; outline-offset: 2px; box-shadow: 0 0 0 5px #53412a }
button, img { user-select: none; -webkit-user-select: none }
.pixel { image-rendering: pixelated; object-fit: contain }
.sheet, .sr-only { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; white-space: nowrap }
svg:not(.sheet) { display: inline-block; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none }
[hidden] { display: none !important }
.viewport {
  width: 100%; height: 100%; height: 100dvh; position: relative; overflow: hidden; isolation: isolate;
  background: #688546; font: 16px var(--font);
  --pad: clamp(14px, 2.3vw, 34px);
  --safe-top: max(var(--pad), env(safe-area-inset-top)); --safe-bottom: max(var(--pad), env(safe-area-inset-bottom));
  --safe-left: max(var(--pad), env(safe-area-inset-left)); --safe-right: max(var(--pad), env(safe-area-inset-right));
}
.scene, .locations { position: absolute; inset: 0; transform-origin: 49% 60%; transition: transform .23s ease-out }
.scene {
  isolation: isolate; overflow: hidden; image-rendering: pixelated;
  background: #93ab57 url('art/jiang-landscape.webp') center / 100% 100% no-repeat;
  --field-left: 26%; --field-width: 46%; --field-top: 43%; --field-height: 31%;
}
.close-up :is(.scene,.locations) { transform: scale(1.18) }
.close-up:has(#panel:not([hidden])) :is(.scene,.locations) { transform: translateX(-3.8%) scale(1.14) }
.map-shade { position: absolute; z-index: 1; inset: 0; pointer-events: none; box-shadow: inset 0 -68px 88px -65px #122b27, inset 0 40px 66px -61px #183327 }
.scene[data-season]::before { content: ""; position: absolute; inset: 0; pointer-events: none }
.scene[data-season="夏"]::before { background: #fcdf5a0d }
.scene[data-season="秋"]::before { background: #d7723542; mix-blend-mode: color }
.scene[data-season="冬"]::before { background: #daeaff65; mix-blend-mode: screen }
.hen { position: absolute; z-index: 2; left: 74.4%; top: 70%; width: clamp(32px,3.9vw,70px); aspect-ratio: 1; background: none; border: 0; padding: 0; transform-origin: center bottom; animation: peck 5s steps(2,end) infinite }
.hen img { width: 100%; height: 100%; filter: drop-shadow(1px 3px #44582577) }
.hen.cluck { animation: cluck .42s steps(4,end) }
@keyframes peck { 0%,60%,75%,100% { transform: none } 66% { transform: rotate(7deg) translateY(1px) } }
@keyframes cluck { 45% { transform: translateY(-8px) rotate(-7deg) } }

/* Enamel farm plaque and an inset brass edge. */
.farm-sign, .almanac, .toolrack, .next {
  border: 1px solid #26392b;
  background: var(--enamel); color: var(--cream);
  box-shadow: inset 0 0 0 1px #d3b57b, inset 0 0 0 4px #355043, var(--panel-shadow);
}
.farm-sign {
  position: absolute; z-index: 5; left: var(--safe-left); top: var(--safe-top);
  display: grid; grid-template-columns: auto 1fr; column-gap: 11px; align-items: center;
  padding: 10px 16px 10px 12px; border-radius: 4px 12px 4px 12px;
}
.farm-crest { width: clamp(39px,3.5vw,55px); height: auto; grid-row: 1 / 3; filter: drop-shadow(0 2px 1px #122a21) }
.sign-name h1 { margin: 0; font: 850 clamp(23px,2.15vw,34px)/1.22 var(--book); letter-spacing: .09em; color: #fff1c7; text-shadow: 0 2px #193328 }
#level { display: flex; align-items: center; gap: 7px; padding: 4px 1px 3px; border: 0; color: #e5dfc5; background: none; font-size: 12px; line-height: 1.15; text-align: start }
#level b { color: #f0cd87; font: 750 12px var(--number) }
.xp-track { display: block; width: 31px; height: 4px; background: #152c25; box-shadow: 0 0 0 1px #829274; overflow: hidden }
.xp-track i { background: #dcb971; display: block; height: 100% }
.corner-hud { position: absolute; z-index: 5; top: var(--safe-top); right: var(--safe-right); display: grid; justify-items: end; gap: 9px; pointer-events: none }
.corner-hud > * { pointer-events: auto }
.almanac { display: flex; align-items: center; gap: 9px; min-height: 55px; padding: 7px 13px; border-radius: 10px 4px 10px 4px }
.almanac > img { width: 32px; height: 32px; filter: drop-shadow(0 1px #233726) }
.almanac > div:not(.purse) { display: grid; gap: 3px }
.almanac strong { color: #fff1cf; font: 760 17px/1.15 var(--book); white-space: nowrap }
.almanac span { color: #dddcc0; font-size: 12px; line-height: 1.1 }
.purse { display: flex; align-items: center; gap: 4px; margin-left: 3px; padding: 3px 0 3px 11px; border-left: 1px solid #8d987a }
.purse img { width: 23px; height: 23px }.purse b { font: bold 20px var(--number); color: #ffdd86 }
.utilities { display: flex; gap: 6px }
.utility, .panel-close {
  display: grid; place-items: center; padding: 0; width: 36px; height: 35px;
  border: 1px solid #293c2e; border-radius: 6px; background: #294538; color: #f1e7bd;
  box-shadow: inset 0 0 0 1px #b8a372, 0 2px #30422c, 0 3px 6px #1c281e44;
}
.utility svg { width: 16px; height: 16px }
.utility[aria-pressed=true]#zoom, .utility.current { background: #4e6549; color: #ffdc83 }
.utility:hover, .panel-close:hover, .next:hover { filter: brightness(1.1) }

/* Labels belong to their buildings. */
.locations { z-index: 3; pointer-events: none }
.station { display: flex; flex-direction: column; align-items: center; position: absolute; width: var(--size); justify-content: end; transform: translate(-50%,-100%); pointer-events: auto; border: 0; padding: 0; background: transparent; line-height: 1 }
.station .object { display: block; width: 100%; height: auto; filter: drop-shadow(0 2px 0 #29371759); transition: transform .15s ease-out }
.station.market { --size: clamp(96px,12vw,207px); left: 13%; top: 59% }
.station.barn { --size: clamp(100px,12vw,207px); left: 83%; top: 49% }
.station.coop { --size: clamp(71px,8.5vw,145px); left: 81%; top: 71% }
.station.kitchen { --size: clamp(69px,8.3vw,140px); left: 33%; top: 37.2% }
.nest-badge { position: absolute; right: -4px; top: 10%; display: flex; align-items: center; gap: 2px; padding: 2px 5px 2px 3px; border: 1px solid #5a4b2f; border-radius: 6px; box-shadow: 0 2px #524832; background: #ffe3a1; color: #4d3c24; font: 800 12px var(--number) }
.nest-badge img { width: 16px; height: 16px; image-rendering: pixelated }
.station.post { --size: clamp(61px,6.3vw,113px); left: 17.4%; top: 76% }
.nameplate {
  position: relative; margin-top: -1px; min-width: 63px; padding: 6px 16px 5px; border: 1px solid #483a26;
  border-radius: 3px; background: linear-gradient(#fff2c9,#e9cc92); color: #493723; box-shadow: inset 0 0 0 2px #d6b77c,0 2px #4f412d,0 4px 6px #293b294a;
  font: 800 clamp(13px,1.1vw,17px)/1.05 var(--book); letter-spacing: .08em; white-space: nowrap;
}
.nameplate::before, .nameplate::after { content: ""; position: absolute; top: 44%; width: 3px; height: 3px; background: #8d6c41; box-shadow: 0 1px #ffedba }
.nameplate::before { left: 5px }.nameplate::after { right: 5px }
.station:hover .object, .station:focus-visible .object { transform: translateY(-3px) }
.station:hover .nameplate, .station.current .nameplate { background: #ffdf91; color: #303f2e }
.order-badge { position: absolute; top: 7px; right: -8px; padding: 3px 5px; font: 750 11px var(--number); background: #294936; color: #f6edc4; border: 1px solid #c8af75; border-radius: 4px; box-shadow: 0 2px #374333 }
.order-badge.ready { color: #3b3320; background: #f5cf71 }
.field-summary {
  position: absolute; z-index: 2; bottom: calc(100% - var(--field-top) + 9px); left: calc(var(--field-left) + 1.1%);
  display: flex; align-items: center; gap: 8px; padding: 4px 9px; border-radius: 3px;
  color: #fff5d7; background: #314934ee; box-shadow: 0 1px 0 #d7c388,0 2px 3px #3b512e77; pointer-events: none;
  font-size: 12px; line-height: 1.2;
}
.field-summary span { display: flex; align-items: center; gap: 4px }
.field-summary span + span { padding-left: 8px; border-left: 1px solid #879276 }
.field-summary svg { width: 13px; height: 13px; color: #ffdc88 }.field-summary span + span svg { color: #b3e3dd }
.field-summary b { font: bold 13px var(--number) }

/* A fitted tray with individual porcelain tool slots. */
.dock-hud { position: absolute; z-index: 6; bottom: var(--safe-bottom); left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 10px; pointer-events: none }
.hint { display: flex; align-items: center; gap: 6px; justify-content: center; width: max-content; max-width: min(94vw,560px); padding: 5px 12px; border: 1px solid #c2ad79; border-radius: 20px; color: #fff3d4; background: #253e33f4; box-shadow: 0 2px 5px #1f311f66; font-size: 13px; line-height: 1.45; text-align: center }
.hint svg { width: 15px; height: 15px; color: #d8ca8d }#status.warn { color: #ffdea3 }
.viewport:has(#panel:not([hidden]) .panel-feedback:not(:empty)) .hint { opacity: 0 }
.toolrack { pointer-events: auto; display: flex; align-items: stretch; gap: 11px; padding: 9px 11px; border-radius: 10px 6px; background: linear-gradient(170deg,#3c5142,#2a3d31 60%,#243429) }
#tools { display: flex; align-items: stretch; gap: 6px }
.slot {
  position: relative; width: clamp(60px,4.8vw,79px); display: grid; justify-items: center; align-content: center; gap: 2px;
  border: 1px solid #82775c; border-radius: 5px; padding: 4px 6px 7px; color: #3c3729;
  background: linear-gradient(155deg,#f0e5bf,#d9c99f); box-shadow: inset 0 1px #fff1cb,inset 0 -3px #b8aa85,0 2px #182e25;
}
.slot img { width: clamp(31px,2.8vw,47px); height: clamp(31px,2.8vw,47px); filter: drop-shadow(0 1px 0 #776c502e) }
.slot span { font-size: 13px; line-height: 1.15 }
.slot kbd { position: absolute; top: 3px; left: 5px; font: 600 10px var(--number); color: #7a7057 }
.slot[aria-pressed=true] { background: linear-gradient(145deg,#ffedb4,#edcb79); border-color: #f6d890; box-shadow: inset 0 0 0 1px #fef0c1,inset 0 -4px #aa803d,0 0 0 1px #8b6b36,0 2px #403b24 }
.slot[aria-pressed=true]::after { content: ""; position: absolute; top: 4px; right: 4px; width: 5px; height: 5px; background: #4e703f; transform: rotate(45deg) }
.slot:hover { filter: brightness(1.05) }
.slot:active, .store-action:active:enabled, .next:active, .utility:active, .seed-pick:active { translate: 0 1px }
.seed-pick { position: relative; display: flex; align-items: center; gap: 6px; padding: 4px 12px 4px 9px; border: 1px solid #ad9464; border-radius: 5px; background: #1c352c; color: #fff0cb; box-shadow: inset 0 1px #586b50,0 2px #1a2e23 }
.seed-pick:hover,.seed-pick.current { background: #314c3d }
.seed-pick img { width: 35px; height: 38px; filter: drop-shadow(0 2px #162e23) }
.seed-label { display: grid; justify-items: start; line-height: 1.1; gap: 3px; font-size: 11px; color: #d7d5b1; white-space: nowrap }
.seed-label b { font-size: 15px; color: #fff4d6 }.seed-label small { font-size: 11px; color: #f0ce8d }
.seed-pick i { width: 6px; height: 6px; border: solid #d5bb82; border-width: 1px 0 0 1px; transform: rotate(45deg); margin-left: 2px }
.next { position: absolute; z-index: 6; right: var(--safe-right); bottom: var(--safe-bottom); display: flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 21px; border-radius: 6px 10px 6px 10px; color: #ffedb9; font: 750 17px/1.1 var(--book); letter-spacing: .07em }
.next svg { width: 19px; height: 19px; color: #f4ce7c }
.save-state { position: absolute; z-index: 2; left: var(--safe-left); bottom: var(--safe-bottom); display: flex; align-items: center; gap: 6px; padding: 5px 9px; pointer-events: none; color: #edf1da; font-size: 12px; background: #243c32e8; border-radius: 5px }
.save-state[data-saved="false"] { color: #fff4d4; background: #75422a }.save-state[data-saved="false"] svg { display: none }
.save-state svg { width: 14px; height: 14px; color: #c6de9d }
.day-splash { position: absolute; z-index: 6; left: 50%; top: 32%; transform: translate(-50%,-50%); padding: 8px 20px; pointer-events: none; background: var(--enamel); color: #ffe3a2; border: 1px solid #d1b579; border-radius: 5px 12px; box-shadow: var(--panel-shadow); font: 800 21px/1.3 var(--book) }
.day-splash:empty { display: none }

/* The pinned field notebook stays outside the planting grid. */
.inset-menu {
  --binding: #345544; --stamp: url('art/seeds.png');
  position: absolute; z-index: 7; top: max(136px,17%); right: var(--safe-right);
  display: flex; flex-direction: column; width: clamp(236px,23vw,370px); max-height: calc(100% - max(136px,17%) - 95px);
  padding: 0 12px 12px; overflow: hidden; isolation: isolate;
  color: #413829; border: 1px solid #403b2a; border-radius: 9px 5px 8px 5px;
  background: linear-gradient(110deg,#fff7df,#f4e8c9 96%);
  box-shadow: inset 0 0 0 2px #d6c096,inset 0 -4px #e7d4ad,0 3px #574936,0 8px 23px #152b235e;
  animation: menu-in .15s ease-out;
}
.inset-menu[data-panel="shop"] { --stamp: url('art/market-stall.png') }
.inset-menu[data-panel="barn"] { --stamp: url('art/storehouse.png') }
.inset-menu[data-panel="order"] { --stamp: url('art/letter.png') }
.inset-menu[data-panel="journal"] { --stamp: url('art/harvest-crest.png') }
.inset-menu[data-panel="help"] { --stamp: url('art/hand.png') }
@keyframes menu-in { from { opacity: 0; transform: translateY(4px) } to { opacity: 1; transform: none } }
.panel-top, .panel-tabs, .panel-feedback { flex: none }
.panel-top { display: flex; align-items: center; gap: 9px; margin: 0 -12px; padding: 8px 12px; color: #fff0c8; background: var(--enamel); border-bottom: 2px solid #bb9b65; box-shadow: inset 0 1px #d0b381 }
.panel-emblem { flex: none; width: 30px; height: 30px; background: var(--stamp) center / contain no-repeat; image-rendering: pixelated }
.panel-top h2 { margin: 0; font: 800 clamp(18px,1.5vw,23px)/1.15 var(--book); letter-spacing: .08em }
.panel-close { width: 31px; height: 31px; margin-left: auto; color: #f6e7c0; border-radius: 5px }
.panel-close svg { width: 15px; height: 15px }
.panel-tabs { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); margin: 7px 0; border-bottom: 1px solid #d5c298 }
.panel-tabs button { position: relative; padding: 7px 2px; border: 0; color: #6e6147; background: none; font-size: 14px; line-height: 1.2 }
.panel-tabs .current { color: #294c37; background: #e7e8ce; border-radius: 4px 4px 0 0 }
.panel-tabs .current::after { content: ""; position: absolute; bottom: -1px; left: 18%; right: 18%; height: 3px; background: #637c48; border-radius: 3px }
.panel-scroll { overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #ad9a6b transparent; min-height: 0; padding: 1px 2px 2px }
.panel-scroll button:focus-visible,.panel-tabs button:focus-visible { outline: 2px solid #526c3d; outline-offset: -2px; box-shadow: none }
.seed-list, .store-list { display: grid; gap: 6px }
.seed-row, .store-row { display: flex; align-items: center; gap: 8px; min-width: 0; width: 100%; min-height: 49px; padding: 5px 7px; border: 1px solid #d9caa7; border-radius: 5px; background: #fffae9; color: #423727; text-align: left }
.seed-row[aria-pressed=true] { background: #eaf0d3; border-color: #99a978 }
.seed-row.locked,.store-row:has(.store-action:disabled) { background: #eee6d2; color: #635c48 }
.seed-row > img, .store-row > img { flex: none; width: 34px; height: 34px; background: #f3e6c6; border-radius: 5px; padding: 2px }
.seed-row > span:nth-child(2), .store-row > div { flex: 1; min-width: 0; display: grid; gap: 2px }
.seed-row strong, .store-row strong { font-size: 14px; line-height: 1.2 }
.seed-row small, .store-row small { color: #6d6149; font-size: 12px; line-height: 1.3; font-weight: 500 }
.seed-n, .store-row > b { margin-left: auto; color: #534a33; font: 700 13px var(--number) }
.seed-n svg { width: 14px; height: 14px }
.selector { display: flex; align-items: center; gap: 5px; color: #655b44; font-size: 12px; margin: 0 0 7px }
.selector span { margin-right: auto }.selector button { min-width: 32px; padding: 4px 7px; background: #fff7df; color: #62543d; border: 1px solid #c7b58c; border-radius: 4px; font-size: 12px }
.selector button[aria-pressed=true] { background: #d9e6c3; color: #344c32; border-color: #97a67d }
.store-action, .deliver { border: 1px solid #3d5c41; border-radius: 4px; box-shadow: inset 0 1px #769574,0 1px #304b39; background: #476a4d; color: #fff7dd; padding: 7px; font-size: 12px; font-weight: 700 }
.store-action:hover:enabled, .deliver:hover:enabled { background: #365b42 }
.store-action:disabled,.deliver:disabled { box-shadow: none; border-color: #cbbfa1; color: #756b54; background: #e6ddc5 }
.store-row .store-action { max-width: 110px; flex: none }
.panel-feedback:not(:empty) { margin-top: 7px; border-top: 1px dashed #bcab83; padding: 6px 1px 0; color: #435a3c; font-size: 12px; line-height: 1.45 }
.panel-feedback.warn { color: #8c532d }
#orderSection { position: relative; padding: 10px 10px 8px; background: linear-gradient(145deg,#fffbec,#f7e9c6); border: 1px solid #d7c398; border-left: 3px solid #b99562; border-radius: 3px }
.note-top { display: flex; align-items: center; gap: 5px; font-size: 12px; color: #796646 }.note-top img { width: 21px; height: 21px }
#orderName { display: block; margin: 4px 0; font: 800 20px var(--book); color: #3b4631 }
#orderQuote { font-size: 13px; line-height: 1.5; margin: 3px 0 7px; color: #6d614b }
.order-line { display: flex; align-items: center; gap: 6px; padding: 5px 0 9px; font-size: 14px }.order-line > img { width: 29px; height: 29px }.order-line b { font-family: var(--number) }
.reward { display: flex; align-items: center; margin-left: auto; gap: 4px; color: #825922 }.reward img { width: 18px; height: 18px }
.deliver { width: 100%; font-size: 14px }
.help-row { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 10px }.help-row > img { width: 30px; height: 30px }.help-row b { font-size: 14px }
.help-row p,.guide-copy { font-size: 13px; line-height: 1.52; margin: 2px 0; color: #615640 }
.progress-large { height: 7px; border-radius: 3px; overflow: hidden; background: #dfdfc2; margin: 8px 0 }.progress-large i { display: block; height: 100%; background: #7d9866 }
.journal-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 4px; margin: 7px 0 12px }.journal-stats > div { background: #e4e9cc; border: 1px solid #c6ccac; border-radius: 4px; padding: 5px; text-align: center }.journal-stats b,.journal-stats small { display: block }.journal-stats b { color: #426045; font: 800 17px var(--number) }.journal-stats small,.store-top { font-size: 12px; color: #615b45 }.store-top { margin: 7px 0 }

/* A portrait field is drawn for this aspect ratio, so the controls can stay full size. */
@media (orientation: portrait) {
  .viewport { --pad: clamp(8px,2.5vw,24px) }
  .scene { background-image: url('art/jiang-portrait.webp'); --field-left: 10%; --field-width: 80%; --field-top: 43%; --field-height: 27.2% }
  .close-up :is(.scene,.locations) { transform: scale(1.13); transform-origin: 50% 58% }
  .close-up:has(#panel:not([hidden])) :is(.scene,.locations) { transform: scale(1.10); transform-origin: 50% 43% }
  .farm-sign { column-gap: 4px; padding: 7px 9px 7px 7px; border-radius: 4px 9px }
  .farm-crest { width: clamp(27px,7.6vw,45px) }
  .sign-name h1 { font-size: clamp(18px,4.7vw,29px); letter-spacing: .06em }
  #level { padding: 4px 0 1px; gap: 4px; font-size: 11px }#level b { font-size: 11px }.xp-track { width: 16px; height: 3px }
  .corner-hud { gap: 7px }.almanac { min-height: 44px; gap: 5px; padding: 5px 9px }.almanac > img { width: 25px; height: 25px }.almanac strong { font-size: 14px }.almanac span { font-size: 11px }.purse { padding-left: 6px; gap: 2px; margin-left: 0 }.purse img { width: 18px; height: 18px }.purse b { font-size: 16px }
  .utility { width: 34px; height: 33px }.utilities { gap: 6px }.utility svg { width: 15px; height: 15px }
  .station.market { --size: clamp(55px,18vw,125px); left: 17%; top: 39.5% }
  .station.post { --size: clamp(43px,11vw,80px); left: 52%; top: 39.3% }
  .station.barn { --size: clamp(59px,17.5vw,122px); left: 83%; top: 39.5% }
  .nameplate { min-width: 44px; padding: 4px 9px; font-size: clamp(12px,2.9vw,16px); letter-spacing: .03em }.nameplate::before,.nameplate::after { width: 2px; height: 2px }.nameplate::before { left: 3px }.nameplate::after { right: 3px }
  .order-badge { font-size: 10px; right: -15px; top: -3px; padding: 2px 4px }
  .station.coop { --size: clamp(49px,14.5vw,104px); left: 70%; top: 31.1% }
  .station.kitchen { --size: clamp(50px,14.7vw,106px); left: 34%; top: 32.5% }
  .post .order-badge { top: auto; bottom: 1px; right: auto; left: calc(100% + 3px) }
  .nest-badge { padding: 1px 3px; font-size: 10px; right: -6px; top: 4% }.nest-badge img { width: 13px; height: 13px }
  .hen { left: 62%; top: 31.6%; width: clamp(27px,7vw,48px) }
  .field-summary { top: calc(var(--field-top) + var(--field-height) + 8px); bottom: auto; left: calc(var(--field-left) + 1%); font-size: 11px; gap: 5px; padding: 3px 6px }.field-summary b { font-size: 12px }.field-summary span + span { padding-left: 5px }.field-summary svg { width: 12px; height: 12px }
  .dock-hud { bottom: max(9px,env(safe-area-inset-bottom)); gap: 7px }
  .toolrack { padding: 7px; gap: 7px; border-radius: 8px 5px }.toolrack #tools { gap: 4px }
  .slot { width: clamp(42px,11.3vw,70px); padding: 5px 2px 7px; gap: 3px }.slot img { width: clamp(26px,7vw,38px); height: clamp(26px,7vw,38px) }.slot span { font-size: 12px }.slot kbd { display: none }
  .seed-pick { padding: 2px 7px; gap: 3px }.seed-pick img { width: 25px; height: 28px }.seed-label { font-size: 10px; gap: 2px }.seed-label b { font-size: 13px }.seed-label small { font-size: 11px }.seed-pick i { width: 5px; height: 5px }
  .hint { font-size: 12px; padding: 4px 9px; max-width: 92vw }.hint svg { width: 14px; height: 14px }
  .next { bottom: max(15%,114px); right: var(--safe-right); padding: 11px 13px; font-size: 15px; gap: 5px }
  .next svg { width: 15px; height: 15px }.save-state { bottom: max(15%,114px); font-size: 11px; padding: 4px 6px }
  .inset-menu { top: max(calc(env(safe-area-inset-top) + 93px),12%); left: 4%; right: 4%; width: auto; max-height: calc(42.1% - max(calc(env(safe-area-inset-top) + 93px),12%)); padding: 0 9px 7px }
  .panel-top { margin: 0 -9px; padding: 5px 8px; gap: 7px }.panel-top h2 { font-size: 18px }.panel-emblem { width: 24px; height: 24px }.panel-close { width: 30px; height: 28px }
  .panel-tabs { margin: 3px 0 5px }.panel-tabs button { font-size: 13px; padding: 6px 2px }
  .seed-list { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 4px }.seed-row { padding: 3px; gap: 4px; min-height: 43px }.seed-row > img { width: 24px; height: 25px }.seed-n { font-size: 11px }.seed-row strong,.store-row strong { font-size: 13px }.seed-row small,.store-row small { font-size: 11px }
  .store-list { gap: 4px }.store-row { padding: 3px 5px; gap: 6px; min-height: 38px }.store-row > img { width: 28px; height: 28px }.store-action { padding: 6px; font-size: 12px }.selector { margin-bottom: 4px }.selector button { padding: 3px 7px }
  .panel-feedback:not(:empty) { margin-top: 4px; padding-top: 3px; font-size: 11px }
  #orderSection { padding: 5px 7px }.note-top { float: right; margin-left: 4px }.note-top img { width: 18px; height: 18px }#orderName { font-size: 17px }#orderQuote { font-size: 12px; margin-bottom: 2px }.order-line { padding: 2px 0 5px }.order-line > img { width: 23px; height: 23px }.deliver { padding: 5px }
  .day-splash { top: 40%; font-size: 16px }
}
@media (orientation: portrait) and (max-height: 690px) {
  .corner-hud { gap: 3px }.utility { width: 32px; height: 30px }
  .inset-menu { top: max(calc(env(safe-area-inset-top) + 87px),12%); max-height: calc(42.1% - max(calc(env(safe-area-inset-top) + 87px),12%)) }
  .panel-top { padding: 3px 7px }.panel-tabs { margin: 2px 0 3px }.panel-tabs button { padding: 4px }.panel-close { height: 24px }
  .next,.save-state { bottom: max(16.5%,97px) }.dock-hud { gap: 4px }.toolrack { padding: 5px 6px }.slot { padding: 3px 2px 5px }
  .field-summary { top: calc(var(--field-top) + var(--field-height) + 5px) }
}
@media (orientation: portrait) and (max-width: 345px) {
  .farm-crest { width: 24px }.farm-sign { padding: 6px }.sign-name h1 { font-size: 17px }.xp-track { display: none }.purse { padding-left: 4px }.almanac { padding-inline: 6px }
  .seed-pick { padding: 3px 5px }.seed-pick img { width: 20px }.seed-pick i { display: none }.seed-n { font-size: 10px }
}
@media (orientation: landscape) and (max-width: 1050px) {
  .inset-menu { width: 24%; min-width: 190px; right: 9px; padding: 0 8px 8px }.panel-top { margin: 0 -8px; padding-inline: 8px }
  .scene { --field-width: 45%; --field-left: 26% }.station.post { left: 15% }
  .store-row { gap: 4px; padding-inline: 3px }.store-row > img { width: 25px; height: 26px }.store-action { padding: 6px 4px }.store-row small { font-size: 11px }
}
@media (orientation: landscape) and (max-height: 710px) {
  .viewport { --pad: 13px }.scene { --field-top: 42%; --field-height: 30% }
  .farm-sign { padding: 7px 11px }.farm-crest { width: 36px }.sign-name h1 { font-size: 23px }
  .almanac { min-height: 43px; padding-block: 5px }.almanac > img { width: 26px; height: 26px }.corner-hud { gap: 6px }
  .inset-menu { top: 98px; max-height: calc(100% - 169px) }.toolrack { padding: 6px 8px }.slot img { width: 29px; height: 29px }.slot { padding-top: 3px }.dock-hud { gap: 6px }.next { padding: 10px 14px }
}
@media (orientation: landscape) and (max-height: 500px) {
  .viewport { --pad: 7px }.farm-sign { padding: 5px 8px;column-gap: 4px }.farm-crest { width: 27px }.sign-name h1 { font-size: 18px }#level { font-size: 10px; gap: 4px; padding: 2px 0 }#level b { font-size: 10px }.xp-track { width: 18px }
  .corner-hud { display: flex; align-items: center; gap: 6px }.almanac { min-height: 35px; gap: 4px; padding: 3px 7px }.almanac strong { font-size: 13px }.almanac span { font-size: 10px }.almanac > img { width: 23px; height: 23px }.purse { padding-left: 5px }.purse img { width: 18px; height: 18px }.purse b { font-size: 14px }.utility { width: 30px; height: 30px }.utilities { gap: 3px }
  .station.kitchen,.station.coop { --size: clamp(42px,7.5vw,74px) }
  .station.kitchen { left: 34%; top: 36.5% }.station.coop { top: 71.5% }
  .station.market,.station.barn { --size: clamp(47px,9vw,83px) }.station.post { --size: clamp(31px,5vw,49px); top: 78% }.nameplate { font-size: 12px; padding: 3px 8px; min-width: 39px }.nameplate::before,.nameplate::after { width: 2px; height: 2px }.order-badge { font-size: 9px; top: 0; right: -12px }
  .field-summary { font-size: 10px; bottom: calc(100% - var(--field-top) + 4px); padding: 2px 6px }.field-summary svg { width: 11px; height: 11px }.field-summary b { font-size: 11px }
  .dock-hud { gap: 3px }.toolrack { padding: 4px 6px; gap: 6px }#tools { gap: 4px }.slot { width: 44px; padding: 2px 3px 4px; gap: 0 }.slot img { width: 24px; height: 24px }.slot span { font-size: 11px }.slot kbd { display: none }.seed-pick { padding: 2px 5px; gap: 3px }.seed-pick img { width: 23px; height: 23px }.seed-label { font-size: 9px; gap: 1px }.seed-label b { font-size: 11px }.seed-label small { font-size: 10px }.hint { padding: 2px 7px; font-size: 11px }
  .next { padding: 8px 11px; font-size: 13px }.next svg { width: 14px; height: 14px }.save-state { font-size: 10px }
  #orderSection { padding: 5px }.order-line { flex-wrap: wrap; gap: 3px; font-size: 12px }.order-line > img { width: 19px; height: 19px }.order-line > span { white-space: nowrap }.reward { margin-left: auto }
  .inset-menu { top: 47px; right: 5px; width: 25%; min-width: 0; max-height: calc(100% - 96px); padding: 0 5px 5px }
  .panel-top { margin: 0 -5px; padding: 3px 5px; gap: 4px }.panel-emblem { width: 19px; height: 19px }.panel-top h2 { font-size: 15px }.panel-close { width: 25px; height: 24px }
  .panel-tabs { margin: 2px 0 3px }.panel-tabs button { font-size: 12px; padding: 4px 1px }.selector { margin: 0 0 4px; font-size: 11px }.selector button { padding: 2px 4px; min-width: 23px }.store-list,.seed-list { gap: 3px }.store-row,.seed-row { padding: 2px 3px; gap: 3px; min-height: 33px }.store-row>img,.seed-row>img { width: 22px; height: 22px }.store-row strong,.seed-row strong { font-size: 12px }.store-row small,.seed-row small { font-size: 10px }.store-action { font-size: 11px; padding: 4px 2px }.panel-feedback:not(:empty) { font-size: 10px; margin-top: 3px; padding-top: 2px }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important }
}

.pantry-link { display: flex; align-items: center; gap: 5px; width: 100%; margin-top: 8px; padding: 7px 6px; background: #ebead1; border: 1px solid #c7c4a0; border-radius: 4px; color: #45573c; font-size: 12px; text-align: left }
.pantry-link img { width: 19px; height: 19px }.pantry-link span { margin-left: auto }
@media (orientation: landscape) and (max-width: 760px) { .panel-tabs button { font-size: 11px; padding-inline: 0 } }

/* The dock remains interactive while the rest of the farm is in use. */
.station.riverbank { --size: clamp(58px,6.2vw,108px); left: 91.1%; top: 75.4%; }
.water-float {
  position: absolute; pointer-events: auto; left: 94%; top: 61%; width: 44px; height: 44px; transform: translate(-50%,-50%);
  border: 0; padding: 0; background: none; color: #fff2c1;
}
.water-ring { position: absolute; left: 16%; right: 16%; bottom: 8px; height: 7px; border: 1px solid #c7f9e6; border-radius: 50%; box-shadow: 0 1px #498a83; animation: river-ripple 1.8s ease-out infinite }
.float-body { position: absolute; left: calc(50% - 4px); bottom: 10px; width: 8px; height: 19px; background: linear-gradient(#fff2be 0 4px,#cd4e32 4px 11px,#fff1bc 11px 15px,#98422b 15px); box-shadow: 0 0 0 1px #533e31,0 3px #604632; border-radius: 60% 60% 38% 38%; animation: river-nod 1.8s ease-in-out infinite; }
.float-call { display: none; position: absolute; left: 50%; bottom: 33px; transform: translateX(-50%); width: max-content; padding: 3px 7px; border: 1px solid #bda971; border-radius: 8px; color: #fff0c7; background: #244c42; font-size: 12px; }
.water-float[data-phase="bite"] .float-call { display: inline-block; }
.water-float[data-phase="bite"] .float-body { animation-duration: .73s; }
.water-float[data-phase="bite"] .water-ring { animation-duration: .95s; }
@keyframes river-ripple { from { opacity: .9; transform: scale(.7) } to { opacity: .12; transform: scale(1.3) } }
@keyframes river-nod { 0%,100% { translate: 0 -1px; rotate: -4deg } 50% { translate: 0 3px; rotate: 3deg } }
@media (orientation: portrait) {
  .station.riverbank { --size: clamp(42px,12vw,85px); left: 59%; top: 80%; }
  .water-float { left: 89%; top: 75%; }
}
@media (orientation: landscape) and (max-height: 500px) {
  .station.riverbank { --size: clamp(37px,5.5vw,67px); top: 77%; }
  .water-float { left: 95%; top: 66%; }
}
@media (orientation: landscape) and (max-width: 960px) {
  .panel-tabs { display: flex; overflow-x: auto; scrollbar-width: none; }
  .panel-tabs button { flex: 1 0 30px; }
}

@media (orientation: landscape) {
  .close-up .water-float { left: 90%; }
}

/* Field-edge controls share one footprint with their live crop counts. */
#fieldSummary { display:flex; align-items:center; gap:2px; padding:3px; pointer-events:auto; border:1px solid #d6c395; background:#253e32f2; box-shadow:0 2px 0 #182b1f66; border-radius:7px; }
#fieldSummary button { display:inline-flex; align-items:center; justify-content:center; gap:5px; padding:5px 8px; min-height:27px; border:0; border-radius:4px; background:#536342; color:#fff1c9; font:650 13px/1.1 var(--font); cursor:pointer; }
#fieldSummary button + button { background:#3e5f54; color:#e4f3df; }
#fieldSummary button:disabled { cursor:default; background:transparent; color:#d1d2ba; }
#fieldSummary button:focus-visible { outline:2px solid #f7dda1; outline-offset:0; }
#fieldSummary button:enabled:hover { filter:brightness(1.15); }
#fieldSummary b { color:inherit; font:750 12px var(--number); }
#quickWater svg { color:#b7e6df; }
@media(orientation:portrait){#fieldSummary{left:var(--field-left);top:calc(var(--field-top) + var(--field-height) + 5px)}#fieldSummary button{min-height:30px;padding:4px 6px}}
@media(orientation:portrait) and (max-height:690px){#fieldSummary button{min-height:26px;padding:3px 5px;font-size:11px}#fieldSummary{top:calc(var(--field-top) + var(--field-height) + 2px)}}
@media(orientation:landscape) and (max-height:500px){#fieldSummary button{min-height:22px;padding:2px 6px;font-size:11px}}

@media(orientation:landscape) and (max-height:710px) {
  #fieldSummary { left:calc(var(--field-left) + var(--field-width)); transform:translateX(-100%); }
}
