:root {
  color-scheme: light;
  --canvas: #f5f2e7;
  --paper: #fffcf2;
  --ink: #203326;
  --muted: #526252;
  --line: #dfdfca;
  --leaf: #315a3d;
  --leaf-dark: #23442d;
  --moss: #e6ead1;
  --gold: #f7cd73;
  --serif: Georgia, "Times New Roman", serif;
  font: 16px/1.5 system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--canvas);
  color: var(--ink);
}

* { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; }
button, input { font: inherit; }
button { touch-action: manipulation; }
button:not(:disabled) { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
h2 { font: 700 clamp(1.9rem, 3.8vw, 2.45rem)/1.07 var(--serif); }
:focus-visible { outline: 3px solid #8a501b; outline-offset: 4px; }
#farm, #about { scroll-margin-top: 1.25rem; }

.skip {
  position: absolute;
  z-index: 4;
  top: 0.6rem;
  left: 0.6rem;
  padding: 0.6rem 1rem;
  background: white;
  transform: translateY(-180%);
}
.skip:focus { transform: none; }

.wrap, .top-inner { width: min(1120px, calc(100% - 48px)); margin-inline: auto; }
.top { background: #faf8ef; border-bottom: 1px solid #e6e3d3; }
.top-inner, .brand, .top nav { display: flex; align-items: center; }
.top-inner { min-height: 67px; justify-content: space-between; gap: 1rem; }
.brand { gap: 0.55rem; text-decoration: none; font: bold 1.45rem/1 var(--serif); }
.brand img { border-radius: 10px; }
.top nav { gap: clamp(0.9rem, 4vw, 2rem); }
.top nav a { padding-block: 0.55rem; text-decoration: none; font-size: 0.91rem; font-weight: 650; color: var(--muted); }
.top nav a:hover { color: var(--leaf-dark); text-decoration: underline; text-underline-offset: 0.22em; }

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 292px;
  margin-top: 1.65rem;
  border-radius: 23px;
  background: #28422c;
  box-shadow: 0 7px 22px #35473521;
  color: #fffcf1;
}
.hero-art, .hero::after { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-art { object-fit: cover; object-position: 64% 57%; z-index: -2; }
.hero::after { z-index: -1; content: ""; background: linear-gradient(90deg, #1a3323 0%, #1a3323e6 19%, #1a33238c 42%, #1a332320 68%, transparent 100%); }
.hero-copy { max-width: 24rem; padding: 2rem 0 2rem 2.55rem; }
.hero h1 { font: 700 clamp(2.85rem, 6.5vw, 4.65rem)/0.94 var(--serif); letter-spacing: -0.035em; }
.hero p { max-width: 19.5rem; margin-top: 0.85rem; color: #f6f2dc; font-size: 0.99rem; }
.primary {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 44px;
  margin-top: 1.1rem;
  padding: 0.55rem 0.9rem;
  border-radius: 10px;
  background: var(--gold);
  color: #28341d;
  font-weight: 750;
  font-size: 0.91rem;
  text-decoration: none;
}
.primary:hover { background: #ffdf97; }
.primary:focus-visible { outline-color: #fff3bb; }

.farm { margin-top: 1.9rem; }
.farm-head { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 0.85rem; }
.farm-head p, .muted { color: var(--muted); font-size: 0.9rem; }
.farm-head p { margin-top: 0.35rem; }
.stats { display: flex; gap: 0.5rem; }
.stat {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 106px;
  padding: 0.4rem 0.65rem;
  background: #fbf8ee;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.stat-label { display: block; color: var(--muted); font-size: 0.73rem; font-weight: 650; line-height: 1.25; }
.stat output { display: block; font-size: 1.02rem; font-weight: 800; line-height: 1.4; font-variant-numeric: tabular-nums; }
.coin {
  display: inline-grid;
  place-items: center;
  background: #f6d279;
  color: #855815;
  width: 1.55rem;
  height: 1.55rem;
  border: 1px solid #ca9538;
  border-radius: 50%;
  box-shadow: inset 0 0 0 2px #ffe4a3;
  flex: none;
}
.basket { font-size: 1.27rem; }

.farm-layout { display: grid; grid-template: "beds seeds" auto "beds order" auto / minmax(0, 1fr) minmax(240px, 30%); gap: 0.85rem; align-items: start; }
.panel { padding: 0.95rem; border: 1px solid var(--line); border-radius: 17px; background: var(--paper); }
.field { grid-area: beds; align-self: stretch; display: flex; flex-direction: column; }
.seeds { grid-area: seeds; min-width: 0; margin: 0; }
.seeds legend, .order h3 { font: 700 1.3rem/1.1 var(--serif); }
.seeds legend { padding-inline: 0.27rem; }
.seed-options { display: grid; gap: 0.37rem; margin-top: 0.65rem; }
.seed-option { position: relative; }
.seed-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  clip-path: inset(50%);
}
.seed-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 42px;
  padding: 0.35rem 0.6rem;
  border: 1px solid #e2e0cc;
  border-radius: 9px;
  background: #f8f6e8;
  cursor: pointer;
}
.seed-label:hover { border-color: #a7b487; }
.seed-option input:checked + .seed-label { border-color: #708859; background: #e8edd4; font-weight: 700; }
.seed-option input:focus-visible + .seed-label { outline: 3px solid #8a501b; outline-offset: 2px; }
.seed-icon { font-size: 1.19rem; }
.seed-price { margin-left: auto; color: #715318; font-size: 0.82rem; font-weight: 700; }

.beds { flex: 1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.6rem; }
.bed {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: stretch;
  min-width: 0;
  min-height: 126px;
  padding: 0.48rem 0.52rem;
  border: 1px solid #a87b52;
  border-radius: 12px;
  background-color: #e9caa1;
  background-image: repeating-linear-gradient(169deg, transparent 0 20px, #ac785328 21px 24px, transparent 26px 33px);
  color: #482e20;
  text-align: center;
}
.bed:not(:disabled):hover { filter: brightness(1.035); border-color: #785635; }
.bed[data-state="ready"] { background-color: #dce6b8; border-color: #82945d; color: var(--leaf-dark); }
.bed[data-state="growing"] { background-color: #ede3b6; }
.bed[data-state="locked"] {
  border-style: dashed;
  border-color: #ac9f85;
  background-color: #eeeadd;
  background-image: repeating-linear-gradient(133deg, transparent 0 9px, #86765e10 10px 12px);
  color: #574e40;
}
.bed:disabled { opacity: 1; }
.bed-illustration { display: grid; flex: 1; min-height: 55px; place-items: center; font-size: clamp(1.75rem, 4vw, 2.6rem); }
.bed-name { font-size: 0.85rem; font-weight: 750; line-height: 1.2; }
.bed-action { min-height: 1.28rem; margin-top: 0.22rem; font-size: 0.77rem; line-height: 1.28; }
.bed-progress {
  display: block;
  width: 76%;
  height: 4px;
  margin: 0.30rem auto 0.10rem;
  border: 0;
  border-radius: 99px;
  appearance: none;
  background: #b6a36a65;
}
.bed-progress[hidden] { display: none; }
.bed-progress::-webkit-progress-bar { background: #b6a36a65; border-radius: 99px; }
.bed-progress::-webkit-progress-value { background: #527345; border-radius: 99px; }
.bed-progress::-moz-progress-bar { background: #527345; border-radius: 99px; }
.notice { margin-top: 0.70rem; color: var(--muted); font-size: 0.86rem; }
.notice[data-warning] { color: #832d1a; }

.order { grid-area: order; }
.order-head { display: flex; justify-content: space-between; align-items: start; gap: 0.25rem; }
.order-pay { white-space: nowrap; color: #785413; font-weight: 750; font-size: 0.84rem; }
.order ul { padding: 0; margin: 0.6rem 0; list-style: none; font-size: 0.9rem; }
.order li { display: flex; justify-content: space-between; gap: 0.5rem; padding: 0.18rem 0; }
.order li [data-complete] { color: var(--leaf); font-weight: 750; }
.order-button {
  min-height: 41px;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 9px;
  background: var(--leaf);
  color: white;
  font-size: 0.88rem;
  font-weight: 750;
}
.order-button:not(:disabled):hover { background: var(--leaf-dark); }
.order-button:disabled { border-color: #dfdfcc; background: #ececdb; color: #565c47; }

.about { display: flex; align-items: start; gap: 0.85rem; margin-top: 1.4rem; padding: 1.35rem 1.05rem; border-top: 1px solid var(--line); }
.about h2 { font-size: 1.5rem; }
.about p { max-width: 660px; margin-top: 0.45rem; }
.about img { border-radius: 13px; }
main.wrap { padding-bottom: 1.35rem; }

@media (max-width: 730px) {
  .wrap, .top-inner { width: calc(100% - 28px); }
  .hero { min-height: 258px; margin-top: 0.9rem; border-radius: 18px; }
  .hero-art { object-position: 62% 56%; }
  .hero::after { background: linear-gradient(90deg, #1a3323f0, #1a332399 54%, #1a332325); }
  .hero-copy { max-width: 20rem; padding: 1.45rem 1.1rem; }
  .farm { margin-top: 1.25rem; }
  .farm-layout { grid-template: "seeds" "beds" "order" / minmax(0, 1fr); gap: 0.6rem; }
  .seeds .muted { font-size: 0.82rem; }
  .seed-options { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.28rem; }
  .seed-label { padding-inline: 0.33rem; gap: 0.25rem; min-height: 44px; font-size: 0.78rem; }
  .seed-icon { font-size: 1rem; }
  .seed-price { font-size: 0.73rem; }
  .panel { padding: 0.67rem; }
}

@media (max-width: 460px) {
  .brand { font-size: 1.26rem; }
  .brand img { width: 29px; height: 29px; }
  .top-inner { min-height: 56px; gap: 0.5rem; }
  .top nav { gap: 0.8rem; }
  .top nav a { font-size: 0.83rem; }
  .hero p { max-width: 15rem; }
  .farm-head { align-items: start; flex-wrap: wrap; gap: 0.55rem; }
  .stat { min-width: 96px; padding: 0.3rem 0.49rem; }
  .beds { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.46rem; }
  .bed { min-height: 109px; }
  .bed-illustration { min-height: 42px; }
  .seed-label { display: grid; grid-template-columns: auto 1fr; gap: 0.05rem 0.27rem; }
  .seed-price { grid-column: 2; justify-self: start; margin-left: 0; }
  .about { padding-inline: 0.25rem; }
}
