:root {
  --bg: #f4f6ef;
  --ink: #18140f;
  --surface: #fffdf7;
  --accent: #0b7a53;
  --accent-2: #d4502a;
  --muted: #6e665c;
  --ring: #193d2f;
  --radius: 18px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Avenir Next", "Segoe Print", "Trebuchet MS", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 20%, #f9e9ce 0, transparent 30%),
    radial-gradient(circle at 80% 0%, #d9f3e7 0, transparent 35%),
    var(--bg);
  min-height: 100vh;
}

.app-shell {
  max-width: 980px;
  margin: 0 auto;
  padding: 2rem 1rem 3rem;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1.05;
}

.kicker {
  margin: 0 0 .5rem;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.lead {
  margin: .8rem 0 1.5rem;
  color: var(--muted);
  max-width: 60ch;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.card {
  background: var(--surface);
  border: 2px solid #e6decd;
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: 0 8px 24px rgba(16, 16, 12, .06);
}

.card header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .5rem;
}

.card h2 {
  margin: 0;
  font-size: 1.1rem;
}

.badge {
  font-size: .72rem;
  padding: .25rem .5rem;
  border-radius: 999px;
  background: #d9f3e7;
  color: #0e553d;
  font-weight: 700;
}

.badge-muted {
  background: #eee7db;
  color: #7a746a;
}

.card p {
  color: var(--muted);
  min-height: 48px;
}

.card-disabled {
  opacity: .88;
}

.btn {
  border: 0;
  border-radius: 12px;
  padding: .7rem 1rem;
  font-weight: 700;
  background: var(--ink);
  color: #fff;
  cursor: pointer;
}

.btn:hover { transform: translateY(-1px); }
.btn:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 2px solid #d1c8b6;
}

.reaction {
  margin-top: 1.5rem;
  background: var(--surface);
  border: 2px solid #e6decd;
  border-radius: var(--radius);
  padding: 1rem;
}

.reaction-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.reaction-board {
  margin-top: 1rem;
  min-height: 220px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 1rem;
  border: 2px dashed rgba(0,0,0,.15);
  user-select: none;
}

.reaction-board p {
  margin: 0;
  font-size: clamp(1rem, 2vw, 1.4rem);
}

.state-idle { background: #f0ece2; }
.state-wait { background: #d4502a; color: #fff; }
.state-ready { background: #0b7a53; color: #fff; }
.state-result { background: #dfeeed; }

.reaction-controls {
  margin-top: .8rem;
  display: flex;
  gap: .6rem;
}

.stats {
  margin: 1rem 0 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .7rem;
}

.stats div {
  background: #f5f1e8;
  border-radius: 10px;
  padding: .7rem;
}

.stats dt {
  font-size: .8rem;
  color: var(--muted);
}

.stats dd {
  margin: .2rem 0 0;
  font-size: 1.2rem;
  font-weight: 700;
}

.footer {
  margin-top: 1.6rem;
  color: var(--muted);
  font-size: .92rem;
}

@media (max-width: 720px) {
  .stats { grid-template-columns: 1fr; }
  .reaction-board { min-height: 180px; }
}
