:root {
  color-scheme: light;
  --soil: #6f4b35;
  --soil-dark: #463025;
  --leaf: #377d4d;
  --leaf-light: #77b869;
  --bean: #d9b45f;
  --sun: #e7a528;
  --pear: #b9c46a;
  --cream: #fff8e8;
  --paper: #f5e7c8;
  --ink: #29221b;
  --muted: #766a5d;
  --rail: #8d6647;
  --sky-spring: #d8e8c4;
  --sky-summer: #ffe6a8;
  --sky-fall: #f1c79b;
  --ground-spring: #95724c;
  --ground-summer: #b08758;
  --ground-fall: #8e5a3a;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top left, #fff4c6 0, transparent 32rem),
              linear-gradient(180deg, var(--sky-spring) 0%, #f7edd6 48%, #d8c09a 100%);
  color: var(--ink);
  transition: background 0.6s ease;
}

body.season-summer {
  background: radial-gradient(circle at top right, #ffefb8 0, transparent 30rem),
              linear-gradient(180deg, var(--sky-summer) 0%, #f7edd6 48%, #d8c09a 100%);
}
body.season-fall {
  background: radial-gradient(circle at top right, #ffd1a8 0, transparent 30rem),
              linear-gradient(180deg, var(--sky-fall) 0%, #efd8b6 50%, #c79866 100%);
}

.shell {
  width: min(960px, calc(100% - 28px));
  margin: 0 auto;
  padding: 28px 0 44px;
}

.top, .card, .field-card {
  border: 2px solid rgba(70, 48, 37, 0.18);
  background: rgba(255, 248, 232, 0.88);
  border-radius: 24px;
  box-shadow: 0 22px 60px rgba(70, 48, 37, 0.13);
}

.top { padding: 26px; margin-bottom: 16px; }
.eyebrow, .label, .small { color: var(--muted); }
.eyebrow, .label { margin: 0 0 6px; text-transform: uppercase; letter-spacing: .12em; font-size: .75rem; font-weight: 800; }
.micro { color: var(--muted); margin-top: 8px; font-size: .9rem; }

h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(2.2rem, 6.4vw, 4.4rem); line-height: .92; letter-spacing: -.06em; }
h2 { margin-bottom: 6px; font-size: 1.4rem; }
.lede { max-width: 720px; font-size: 1.1rem; line-height: 1.5; margin-bottom: 0; }

.meta { padding: 14px 18px; margin-bottom: 16px; }
.meta-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.meta-grid p { margin: 0; }
.meta-grid span { display: block; color: var(--muted); font-size: .65rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 800; }
.meta-grid strong { display: block; margin-top: 2px; font-size: .95rem; }

.witness { padding: 18px; margin-bottom: 16px; }
.npc-tabs { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.npc-tab {
  appearance: none;
  border: 2px solid #5f402b;
  background: #fff6de;
  color: var(--ink);
  padding: 8px 14px;
  border-radius: 999px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  min-height: 38px;
}
.npc-tab.active { background: #5f402b; color: #fff8e8; }
.nico-line { font-size: 1.2rem; line-height: 1.45; margin: 0; }
.arc-line { margin: 10px 0 0; color: #5b4635; font-weight: 700; font-size: .95rem; }
.micro-where { color: var(--muted); margin: 4px 0 0; font-size: .9rem; font-style: italic; }

.field-card { padding: 18px; margin-bottom: 16px; }
.field-head { display: flex; align-items: start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.layout-picker { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.layout-picker .label { margin-right: 4px; }
.lay {
  appearance: none;
  border: 2px solid #5f402b;
  background: #fff6de;
  color: var(--ink);
  padding: 6px 10px;
  border-radius: 10px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  min-height: 36px;
  font-size: .85rem;
}
.lay.active { background: #5f402b; color: #fff8e8; }

.field {
  position: relative;
  overflow: hidden;
  height: min(56vw, 340px);
  min-height: 240px;
  margin-top: 12px;
  border: 4px solid var(--rail);
  border-radius: 18px;
  background: linear-gradient(#b7d1b0 0 35%, var(--ground-spring) 35% 100%);
  box-shadow: inset 0 0 0 8px rgba(255,255,255,.16);
  transition: background 0.6s ease;
}

body.season-summer .field { background: linear-gradient(#ffe8a8 0 35%, var(--ground-summer) 35% 100%); }
body.season-fall .field { background: linear-gradient(#f3c897 0 35%, var(--ground-fall) 35% 100%); }

.field::before {
  content: "";
  position: absolute;
  left: 6%; right: 6%; bottom: 13%; height: 26%;
  border-radius: 50%;
  background: repeating-linear-gradient(90deg, var(--soil) 0 34px, var(--soil-dark) 34px 44px);
  transform: perspective(260px) rotateX(42deg);
  transform-origin: bottom;
}

.gate {
  position: absolute;
  left: 7%; right: 7%; bottom: 5%; height: 14%;
  border-top: 10px solid var(--rail);
  border-bottom: 10px solid var(--rail);
  transition: transform .3s ease;
}
.gate.open { transform: rotate(-2deg) translateX(-10px); }
.gate.closed { transform: none; }
.gate::before, .gate::after {
  content: ""; position: absolute; top: -18px; bottom: -18px; width: 14px; background: #6b482e; border-radius: 6px;
}
.gate::before { left: 12%; } .gate::after { right: 12%; }

.crop { position: absolute; bottom: 25%; width: 54px; height: 92px; transform: translateX(-50%); }
.crop .stem { position: absolute; left: 24px; bottom: 0; width: 7px; height: 76px; background: var(--leaf); border-radius: 8px; }
.crop .leaf { position: absolute; width: 28px; height: 16px; background: var(--leaf-light); border-radius: 100% 0 100% 0; }
.crop .l1 { left: 2px; bottom: 28px; transform: rotate(-25deg); }
.crop .l2 { right: 1px; bottom: 48px; transform: rotate(205deg); }
.crop .fruit { display: none; position: absolute; }
.crop.ripe .fruit { display: block; }
.crop.weedy .stem, .crop.weedy .leaf, .crop.sprout .fruit { opacity: .35; }
.crop.harvested { opacity: .18; }

/* spring beans */
.crop.spring .fruit { width: 14px; height: 34px; border-radius: 999px; background: var(--bean); border: 2px solid #8e6b28; }
.crop.spring .f1 { left: 10px; bottom: 40px; transform: rotate(-16deg); }
.crop.spring .f2 { right: 10px; bottom: 24px; transform: rotate(17deg); }

/* summer sunflowers */
.crop.summer .fruit { width: 28px; height: 28px; border-radius: 50%; background: var(--sun); border: 3px solid #6b4a18; }
.crop.summer .f1 { left: 12px; bottom: 56px; }
.crop.summer .f2 { display: none; }
.crop.summer .fruit::after {
  content: ""; position: absolute; inset: 6px; border-radius: 50%; background: #5a3812;
}

/* fall pears */
.crop.fall .fruit { width: 22px; height: 26px; border-radius: 60% 60% 80% 80%; background: var(--pear); border: 2px solid #6e7a2c; }
.crop.fall .f1 { left: 6px; bottom: 32px; }
.crop.fall .f2 { right: 4px; bottom: 48px; }

.weed { position: absolute; bottom: 27%; width: 24px; height: 34px; border-left: 5px solid #4b6f35; border-radius: 60% 20%; transform: rotate(var(--r)); }

.rain { position: absolute; top: 0; bottom: 0; width: 2px; background: linear-gradient(180deg, transparent, #6892b5 30%, #6892b5 70%, transparent); opacity: .55; animation: rain 1.2s linear infinite; }
@keyframes rain { from { transform: translateY(-20%); } to { transform: translateY(20%); } }

.first-move-hint {
  margin: 10px 0 0;
  color: #5b4635;
  font-weight: 850;
}
.status-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 10px; }
.field-card.before-first-move .status-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field-card.before-first-move .progress-stat { display: none; }
.status-grid p { margin: 0; background: #fffaf0; border: 1px solid #ead7b7; border-radius: 14px; padding: 12px; }
.status-grid span { display: block; color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 800; }
.status-grid strong { display: block; margin-top: 4px; }

.actions { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; padding: 14px; margin-bottom: 16px; }
button {
  appearance: none;
  border: 2px solid #5f402b;
  background: #fff6de;
  color: var(--ink);
  min-height: 48px;
  padding: 10px 14px;
  border-radius: 14px;
  font: inherit;
  font-weight: 850;
  cursor: pointer;
}
button:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(70,48,37,.15); }
button:disabled { opacity: .45; cursor: not-allowed; }
.primary { background: #5f402b; color: #fff8e8; }
.ghost { background: transparent; white-space: nowrap; margin-top: 12px; }

.board { padding: 18px; margin-bottom: 16px; }
.board-list { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-direction: column; gap: 8px; }
.board-list li {
  background: #fffaf0;
  border: 1px solid #ead7b7;
  border-left: 5px solid #c79866;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: .95rem;
  line-height: 1.4;
}
.board-list li.board-empty { color: var(--muted); font-style: italic; border-left-color: #d8c4a0; }
.board-list li .who { display: block; font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 800; margin-bottom: 2px; }

.close-read { padding: 20px; }
.small { font-size: .92rem; margin-bottom: 0; }

@media (max-width: 760px) {
  .meta-grid { grid-template-columns: repeat(3, 1fr); }
  .status-grid { grid-template-columns: repeat(2, 1fr); }
  .actions { grid-template-columns: repeat(2, 1fr); }
  .field-head { display: block; }
  .layout-picker { margin-top: 10px; }
  .field { min-height: 280px; }
  h1 { font-size: 2rem; }
}
