:root {
  color-scheme: light;
  --ink: #263d2b;
  --leaf: #32593a;
  --paper: #fffcf2;
  --line: #ded8be;
  --serif: Georgia, "Times New Roman", serif;
  font-family: "Trebuchet MS", "Avenir Next", system-ui, sans-serif;
  color: var(--ink);
  background: #f9f4e5;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100svh; background: radial-gradient(ellipse at 60% 22%, #fffdf3, transparent 70%); }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }
button:focus-visible, a:focus-visible { outline: 4px solid #883058; outline-offset: 3px; z-index: 4; }
button:disabled { cursor: default; }
.shell { width: min(1320px, 100%); margin: auto; padding: 0 clamp(12px, 3.2vw, 48px) 25px; }
.mast { display: flex; justify-content: space-between; align-items: center; padding: 15px 0 12px; border-bottom: 1px solid #ccc9ad; }
.brand { display: inline-flex; min-height: 42px; align-items: center; }
.brand img { display: block; width: clamp(130px, 14vw, 185px); height: auto; }
.tools { display: flex; gap: 7px; }
.tools button, .water { background: var(--paper); border: 1px solid #c6c8ac; border-radius: 100px; }
.tools button { min-width: 44px; height: 44px; font-size: 15px; font-weight: 800; display: grid; place-items: center; }
.tools #sound { font-size: 22px; position: relative; }
#sound[aria-pressed=false]::after { content: ""; height: 2px; width: 23px; transform: rotate(-48deg); background: var(--ink); position: absolute; box-shadow: 0 -1px var(--paper); }
.corners { width: 16px; height: 16px; display: block; border: 2px solid currentColor; border-radius: 3px; mask: conic-gradient(at 6px 6px, transparent 25%, #000 0) 0 0 / 10px 10px; }
.game-title { display: flex; align-items: center; gap: 12px; margin: clamp(14px, 2.8vh, 30px) 0 clamp(12px, 2vh, 22px); }
.game-title img { height: clamp(26px, 3.6vw, 46px); width: auto; transform: rotate(-10deg); }
h1, h2, h3, p { margin: 0; }
h1, h2 { font-family: var(--serif); line-height: 1.04; letter-spacing: -.045em; }
h1 { font-size: clamp(32px, 4.3vw, 65px); }
h2 { font-size: clamp(23px, 2.2vw, 34px); }
.game-layout { display: grid; grid-template-columns: minmax(0, 1fr) clamp(255px, 25.5%, 315px); gap: clamp(12px, 1.8vw, 26px); align-items: start; }
.field-card, .market { border: 1px solid #cdcbb1; border-radius: 23px; background: var(--paper); box-shadow: 0 5px 0 #e7e2cc; overflow: hidden; }
.scene { width: 100%; aspect-ratio: 1.57; position: relative; isolation: isolate; overflow: hidden; background: #99c673; container-type: inline-size; }
.land { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; user-select: none; pointer-events: none; }
.pair { position: absolute; left: 1%; bottom: 12%; width: 35%; height: 45%; pointer-events: none; }
.pair img { position: absolute; bottom: 0; width: auto; filter: drop-shadow(1px 5px 2px #4f552d65); }
.yak { height: 100%; left: 0; }
.yasha { height: 67.3563%; left: 46%; }
.beds { position: absolute; left: 33%; right: 3%; top: 46%; bottom: 6%; display: grid; grid-auto-rows: 1fr; gap: 4%; touch-action: none; user-select: none; -webkit-user-select: none; }
.bed { display: grid; position: relative; isolation: isolate; grid-template-columns: repeat(3, 1fr); align-items: stretch; padding: 0 3%; }
.bed::before { content: ""; position: absolute; inset: 18% 0 -3%; z-index: -1; background: url(soil.webp) center / 100% 100% no-repeat; }
.plot { padding: 0; border: 0; background: transparent; min-width: 0; min-height: 0; position: relative; display: grid; place-items: end center; touch-action: none; }
.plot img { position: absolute; bottom: 12%; height: 80%; max-width: 90%; object-fit: contain; pointer-events: none; filter: drop-shadow(1px 3px 1px #68432170); }
.plot[data-stage=ripe] img { transform: rotate(-4deg); animation: ripe 2.7s ease-in-out infinite; }
.plot:nth-child(2) img { animation-delay: -.8s; }
.plot:nth-child(3) img { animation-delay: -1.7s; }
.plot[data-stage=young] img { height: 28%; }
.plot[data-stage=growing] img { height: 47%; }
.plot:focus-visible { outline-offset: -2px; border-radius: 25%; }
.plot .gain { position: absolute; pointer-events: none; left: 50%; top: 1%; font-size: clamp(15px, 3cqw, 26px); color: white; font-weight: 900; text-shadow: 0 2px 3px #344c18; animation: gain .72s ease-out forwards; }
@keyframes ripe { 50% { transform: translateY(-2px) rotate(1deg); } }
@keyframes gain { to { opacity: 0; transform: translateY(-24px); } }
@keyframes splash { 25%, 65% { filter: drop-shadow(0 0 7px #c5f3ff) brightness(1.2); } }
.beds.watered .plot img { animation: splash .65s ease-in-out; }
.scene-message { position: absolute; top: 5%; left: 50%; transform: translateX(-50%); background: #fffcf0f7; border-radius: 100px; padding: 9px 16px; font-weight: bold; text-align: center; font-size: clamp(14px, 2.1cqw, 18px); pointer-events: none; width: max-content; max-width: 90%; box-shadow: 0 2px 8px #51462e25; }
.scene-message:empty { display: none; }
.field-controls { padding: clamp(10px, 1.5vw, 20px); display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.instruction { display: grid; gap: 3px; font-weight: 750; font-size: clamp(15px, 1.35vw, 19px); }
small { font: 400 .88rem/1.35 system-ui, sans-serif; color: #53604d; }
.water { font-weight: bold; min-height: 46px; display: inline-flex; align-items: center; gap: 7px; padding: 3px 17px 3px 8px; background: #f0f5dd; }
.water img { width: 38px; height: 34px; object-fit: contain; }
.water:disabled { background: #f4f3e7; color: #63725b; }
.market { position: relative; }
.awning { height: 17px; background: repeating-linear-gradient(90deg, #ae3e49 0 21px, #f8d7ad 21px 42px); border-bottom: 2px solid #a34a3b; }
.market-inner { padding: clamp(13px, 1.5vw, 24px); }
.market-head { display: flex; align-items: center; gap: 9px; }
.market-head img { width: clamp(41px, 4vw, 57px); height: auto; }
.stock { display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; margin: 15px 0; }
.stock-item { min-width: 0; border-radius: 13px; background: #f3efdf; text-align: center; padding: 9px 2px 6px; }
.stock-item img { height: 33px; width: 40px; object-fit: contain; vertical-align: middle; }
.stock-item b { font-size: 1.02rem; display: block; margin-top: 2px; }
.stock-item[data-locked=true] img { opacity: .48; filter: saturate(.5); }
.trade, .buy { min-height: 46px; border-radius: 13px; width: 100%; font-weight: bold; padding: 9px 12px; border: 1px solid var(--leaf); }
.trade { display: flex; justify-content: space-between; align-items: center; gap: 4px; background: var(--leaf); color: white; font-size: 1.02rem; }
.trade strong { border-radius: 100px; background: #ffffff25; padding: 3px 8px; white-space: nowrap; }
.trade:disabled { color: #51674b; background: #e0e6cf; border-color: #bcc7aa; }
.purse { display: flex; justify-content: space-between; align-items: center; margin: 13px 0; font-weight: bold; }
.purse b { display: inline-flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.coin { border-radius: 50%; display: inline-grid; place-content: center; font-size: 18px; width: 24px; height: 24px; color: #734222; background: #f9c65e; border: 2px solid #cc9744; line-height: 1; }
.upgrade { border-top: 1px dashed #b6b99b; padding-top: 14px; }
.upgrade h3 { font-family: var(--serif); font-size: 1.35rem; letter-spacing: -.035em; }
.upgrade-detail { display: flex; gap: 11px; align-items: center; margin: 12px 0; }
.upgrade-detail img { width: 50px; height: 49px; object-fit: contain; }
.upgrade-detail strong, .upgrade-detail small { display: block; }
.buy { background: #f8c963; border-color: #c39647; color: #463716; }
.buy:disabled { background: #f1eddd; border-color: #d3ccb1; color: #5a5d48; }
button:enabled:hover { filter: brightness(1.04); }
button:enabled:active { scale: .98; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
[hidden] { display: none !important; }
@media (min-width: 780px) and (max-height: 740px) { .shell { max-width: 1100px; } .game-title { margin: 10px 0; } }
@media (max-width: 779px) {
  .game-layout { grid-template-columns: minmax(0, 1fr); }
  .mast { padding: 7px 0; }
  .scene { aspect-ratio: 1.53; }
  .market-inner { display: grid; grid-template-columns: minmax(0,1.1fr) minmax(0,1fr); column-gap: 17px; align-items: start; }
  .market-head, .stock, .trade, .purse { grid-column: 1; }
  .market-head img { width: 37px; }
  .stock { margin: 9px 0; }
  .stock-item { padding: 5px 1px; }
  .stock-item img { height: 28px; }
  .purse { margin: 9px 0 0; }
  .upgrade { grid-column: 2; grid-row: 1/5; border-top: 0; border-left: 1px dashed #b6b99b; padding: 0 0 0 13px; }
  .upgrade-detail { flex-wrap: wrap; gap: 6px; }
  .upgrade-detail img { height: 37px; width: 40px; }
}
@media (max-width: 480px) {
  .shell { padding-inline: 8px; }
  .scene { aspect-ratio: 1.28; }
  .beds { top: 44%; bottom: 6%; left: 27%; right: 2%; gap: 1%; }
  .pair { left: -1%; bottom: 22%; width: 30%; height: 35%; }
  .yasha { left: 43%; }
  h2 { font-size: 21px; }
  .game-title { gap: 8px; margin: 11px 1px; }
  .market-inner { padding: 11px; column-gap: 9px; }
  .market-head { gap: 6px; }
  .trade { font-size: .9rem; padding: 7px; }
  .upgrade h3 { font-size: 1.15rem; }
  .instruction small, .upgrade-detail small { font-size: .82rem; }
  .field-card, .market { border-radius: 15px; }
}
@media (max-width: 345px) { .market-head img { display: none; } .trade { flex-wrap: wrap; } .water { padding-inline: 5px; } }
@media (prefers-reduced-motion: reduce) { *, *::before { animation-duration: .01ms !important; animation-iteration-count: 1 !important; } }

.plot[data-stage=ripe][data-crop=carrot] img { clip-path: polygon(0 0, 100% 0, 100% 89%, 0 82%); }
.plot:nth-child(2) img { bottom: 17%; }
.plot[data-stage=ripe][data-crop=pumpkin] img { height: 66%; }
@media (max-width: 480px) { .scene:has(.bed:nth-child(3)) { aspect-ratio: 1.12; } }
.fly-crop { position: fixed; z-index: 8; pointer-events: none; object-fit: contain; }
