:root {
  color-scheme: light;
  --ink: #3c2417;
  --muted: #7a5a43;
  --cream: #fff7df;
  --butter: #ffe6a7;
  --biscuit: #d8893b;
  --jam: #b94848;
  --mint: #487d69;
  --shadow: 0 18px 40px rgba(82, 45, 15, 0.18);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: ui-rounded, "SF Pro Rounded", "Trebuchet MS", system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 233, 159, 0.9), transparent 25rem),
    radial-gradient(circle at 88% 12%, rgba(255, 188, 149, 0.7), transparent 24rem),
    linear-gradient(135deg, #fffaf0, #f5d59b 55%, #e5a45e);
}
.topbar {
  padding: 1rem clamp(1rem, 4vw, 2rem);
}
nav { display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; }
nav a {
  color: var(--ink);
  background: rgba(255,255,255,.62);
  border: 2px solid rgba(100, 56, 26, .18);
  border-radius: 999px;
  padding: .55rem .9rem;
  text-decoration: none;
  font-weight: 800;
}
.shell { width: min(980px, calc(100% - 1.4rem)); margin: 0 auto 2rem; }
.hero { text-align: center; margin: .3rem auto 1rem; }
.eyebrow, .label { margin: 0; color: var(--muted); font-size: .78rem; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; }
h1 { margin: .1rem 0; font-size: clamp(2.3rem, 9vw, 5rem); line-height: .95; }
.lede { margin: .5rem auto 0; max-width: 42rem; color: #5e3d29; font-size: 1.05rem; }
.game-card {
  background: rgba(255, 252, 241, .9);
  border: 3px solid rgba(91, 49, 22, .18);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: clamp(1rem, 3vw, 1.5rem);
}
.status-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .75rem;
  margin-bottom: 1rem;
}
.status-row > div, .order-card {
  background: #fffaf0;
  border: 2px solid rgba(96, 54, 27, .15);
  border-radius: 18px;
  padding: .75rem;
}
.status-row strong { display:block; margin-top:.15rem; font-size:1.3rem; }
.order-card { display:flex; align-items:center; justify-content:space-between; gap:1rem; }
h2 { margin: .15rem 0; font-size: clamp(1.2rem, 5vw, 1.7rem); }
#orderText { margin: 0; color: var(--muted); }
button {
  border: 0;
  border-radius: 16px;
  padding: .8rem 1rem;
  background: var(--mint);
  color: #fff;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 7px 0 rgba(0,0,0,.13);
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}
button:hover { filter: brightness(1.04); transform: translateY(-1px); }
button:active { transform: translateY(3px); box-shadow: 0 3px 0 rgba(0,0,0,.13); }
button:disabled { opacity: .48; cursor: not-allowed; transform:none; }
.ghost, .secondary { background: #fff3cf; color: var(--ink); border: 2px solid rgba(74, 39, 16, .18); }
.scale-wrap {
  display: grid;
  grid-template-columns: 1fr minmax(110px, .65fr) 1fr;
  gap: .85rem;
  align-items: stretch;
  margin: 1rem 0;
}
.pan {
  min-height: 170px;
  background: linear-gradient(#fff7d9, #ffd98e);
  color: var(--ink);
  border: 3px solid rgba(107, 58, 25, .22);
  box-shadow: inset 0 -10px rgba(132, 73, 32, .08), 0 9px 0 rgba(90,44,10,.12);
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  align-items:center;
}
.pan-name { font-weight: 950; color: var(--muted); }
.pan strong { font-size: 3rem; }
.pan-biscuits { display:flex; gap:.35rem; flex-wrap:wrap; justify-content:center; min-height:2.2rem; }
.mini-biscuit, .biscuit {
  display:inline-grid;
  place-items:center;
  border-radius: 50%;
  border: 2px dashed rgba(82, 43, 12, .36);
  background: radial-gradient(circle at 35% 28%, #ffe2a6, var(--biscuit));
  color: #43210b;
  font-weight: 950;
}
.mini-biscuit { width: 2rem; height: 2rem; font-size:.9rem; }
.needle {
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  gap:.8rem;
  color: var(--muted);
  font-weight:950;
}
.beam {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--jam), #f9d77b, var(--mint));
  transform-origin: center;
  transition: transform .25s ease;
}
.shelf-section { background:#fff4d3; border-radius:20px; padding:.8rem; border:2px solid rgba(88,48,20,.12); }
.shelf { display:flex; flex-wrap:wrap; gap:.55rem; margin-top:.65rem; }
.biscuit {
  width: 3.2rem;
  height: 3.2rem;
  color: var(--ink);
  box-shadow: 0 5px 0 rgba(91,45,12,.16);
  padding: 0;
}
.biscuit.selected { outline: 4px solid #5c9d85; transform: translateY(-4px) rotate(-4deg); }
.message { min-height: 1.5rem; font-weight: 850; color: #65391f; text-align:center; }
.message.win { color: #247258; }
.message.warn { color: #a33e35; }
.actions { display:flex; gap:.65rem; justify-content:center; flex-wrap:wrap; }
@media (max-width: 720px) {
  .status-row { grid-template-columns: 1fr 1fr 1fr; gap:.45rem; }
  .status-row > div { padding:.55rem; }
  .order-card { flex-direction:column; align-items:stretch; }
  .scale-wrap { grid-template-columns: 1fr; }
  .needle { order: -1; }
  .pan { min-height: 135px; }
  .pan strong { font-size: 2.35rem; }
}
