:root {
  --bg: #101814;
  --panel: rgba(29, 42, 34, 0.9);
  --panel-strong: #24362c;
  --text: #edf6ee;
  --muted: #b8c7bb;
  --accent: #f0b45a;
  --accent-2: #7dd4a6;
  --danger: #ff7b72;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  background: radial-gradient(circle at top, #25382d, #101814 60%);
  color: var(--text);
}
button { font: inherit; }
.shell {
  width: min(1100px, calc(100% - 24px));
  margin: 0 auto;
  padding: 18px 0 32px;
}
.topnav, .eyebrow, .label { text-transform: uppercase; letter-spacing: 0.08em; }
.topnav {
  display: flex; gap: 10px; align-items: center;
  justify-content: center; margin-bottom: 14px; color: var(--muted); font-size: 0.9rem;
}
.topnav a { color: var(--text); }
.panel {
  background: var(--panel); border: 1px solid rgba(255,255,255,0.08); border-radius: 24px;
  box-shadow: var(--shadow); backdrop-filter: blur(8px);
}
.hero { padding: 22px; margin-bottom: 14px; }
.hero h1 { margin: 6px 0 10px; font-size: clamp(2rem, 4vw, 3.2rem); }
.subtitle { margin: 0; color: var(--muted); max-width: 70ch; line-height: 1.5; }
.eyebrow, .label { color: var(--accent-2); font-size: 0.74rem; }
.hud {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px;
  padding: 16px 18px; margin-bottom: 14px;
}
.hud div { background: rgba(255,255,255,0.04); border-radius: 16px; padding: 10px 12px; }
.hud strong { display: block; margin-top: 4px; font-size: 1.2rem; }
.layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr); gap: 14px; }
.board-panel { padding: 18px; }
.board-top { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; margin-bottom: 12px; }
.board-top h2, .recipes h2, .howto h2 { margin: 0 0 8px; }
#statusText { margin: 0; color: var(--muted); text-align: right; }
.board {
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px;
}
.cell {
  aspect-ratio: 1; border-radius: 18px; border: 1px solid rgba(255,255,255,0.08);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  font-weight: 700; cursor: pointer; user-select: none; position: relative;
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}
.cell:hover { transform: translateY(-2px); }
.cell.selected { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(240,180,90,0.22); }
.cell.tomato { background: linear-gradient(160deg, #a83a3a, #7a2323); }
.cell.herb { background: linear-gradient(160deg, #3b8f58, #245f3a); }
.cell.cheese { background: linear-gradient(160deg, #d69d2a, #996c11); }
.cell.berry { background: linear-gradient(160deg, #7d4bc9, #47227a); }
.cell.empty { background: rgba(255,255,255,0.03); color: #728274; }
.freshness { font-size: 0.8rem; color: rgba(255,255,255,0.92); }
.spoiled::after {
  content: '×'; position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(10,10,10,0.42); border-radius: inherit; font-size: 2rem; color: rgba(255,255,255,0.88);
}
.board-actions { display: flex; gap: 10px; justify-content: space-between; margin-top: 14px; }
button {
  border: 0; border-radius: 999px; padding: 12px 16px; background: var(--accent);
  color: #251708; font-weight: 800; cursor: pointer;
}
button.ghost { background: rgba(255,255,255,0.08); color: var(--text); }
button:disabled { opacity: 0.45; cursor: not-allowed; }
.side-panel { display: grid; gap: 14px; }
.recipes, .howto { padding: 18px; }
.recipes-head p { margin: 0 0 10px; color: var(--muted); }
.recipe-list { display: grid; gap: 10px; }
.recipe {
  border: 1px solid rgba(255,255,255,0.08); border-radius: 18px; padding: 14px;
  background: rgba(255,255,255,0.03); cursor: pointer;
}
.recipe.active { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(240,180,90,0.18); }
.recipe.done { opacity: 0.65; }
.recipe h3 { margin: 0 0 6px; }
.recipe p { margin: 4px 0; color: var(--muted); }
.recipe .tag { display: inline-block; margin-right: 6px; padding: 4px 8px; border-radius: 999px; background: rgba(255,255,255,0.08); color: var(--text); font-size: 0.84rem; }
.bonus { margin-top: 12px; color: var(--accent-2); min-height: 1.4em; }
.howto ul { margin: 0; padding-left: 18px; color: var(--muted); line-height: 1.5; }
@media (max-width: 860px) {
  .hud, .layout { grid-template-columns: 1fr; }
  .board-top { flex-direction: column; }
  #statusText { text-align: left; }
  .board-actions { flex-wrap: wrap; }
  .board-actions button { flex: 1 1 150px; }
}
@media (max-width: 560px) {
  .shell { width: min(100% - 14px, 1100px); }
  .hero, .board-panel, .recipes, .howto { padding: 14px; border-radius: 18px; }
  .board { gap: 6px; }
  .cell { border-radius: 14px; font-size: 0.9rem; }
}
