:root {
  --pitch: #0b6b3a;
  --pitch-2: #128a4c;
  --gold: #ffc93c;
  --bg: #f3f6f2;
  --surface: #ffffff;
  --surface-2: #e8eee7;
  --ink: #14211a;
  --muted: #5b6b61;
  --line: #d8e1d8;
  --ok: #128a4c;
  --ok-bg: #dff5e7;
  --bad: #d64545;
  --bad-bg: #fde6e6;
  --shadow: 0 8px 28px rgba(10, 40, 25, .12);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1612; --surface: #16231c; --surface-2: #1e2f25; --ink: #eaf3ec; --muted: #9db3a4; --line: #29402f;
    --ok-bg: #12351f; --bad-bg: #3a1a1a; --shadow: 0 8px 28px rgba(0, 0, 0, .4);
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); min-height: 100dvh;
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; }
h1, h2, p { margin: 0; }
.wrap { max-width: 640px; margin: 0 auto; padding: 0 16px calc(32px + env(safe-area-inset-bottom)); }

/* ---------- home ---------- */
.hero {
  background: repeating-linear-gradient(90deg, var(--pitch) 0 44px, var(--pitch-2) 44px 88px);
  color: #fff; text-align: center; padding: calc(44px + env(safe-area-inset-top)) 20px 36px; border-radius: 0 0 32px 32px;
  box-shadow: var(--shadow);
}
.ball { font-size: 54px; animation: bounce 1.6s ease-in-out infinite; display: inline-block; }
@keyframes bounce { 50% { transform: translateY(-10px) rotate(12deg); } }
.hero h1 { font-size: clamp(34px, 9vw, 52px); font-weight: 900; letter-spacing: -.03em; line-height: 1.05; margin-top: 6px; }
.hero p { margin-top: 10px; font-size: 18px; opacity: .92; }
.section-h { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; margin: 26px 0 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 10px 14px; border-radius: 999px; background: var(--surface); border: 2px solid var(--line); font-weight: 700; font-size: 15px; }
.chip.on { background: var(--pitch); border-color: var(--pitch); color: #fff; }
.btn { padding: 15px 22px; border-radius: 16px; font-weight: 800; font-size: 17px; background: var(--surface-2); }
.btn.primary { background: linear-gradient(135deg, var(--gold), #ffb020); color: #2b1d00; box-shadow: 0 8px 20px rgba(255, 176, 32, .4); }
.btn.green { background: var(--pitch); color: #fff; }
.btn.block { display: block; width: 100%; }
.btn.small { padding: 10px 14px; font-size: 15px; border-radius: 12px; }
.btn:disabled { opacity: .5; }
.card { background: var(--surface); border-radius: 20px; padding: 18px; box-shadow: var(--shadow); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; text-align: center; }
.stats b { display: block; font-size: 26px; }
.stats span { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
details { margin-top: 16px; }
summary { font-weight: 800; cursor: pointer; }
details ul { margin: 10px 0 0; padding-left: 20px; color: var(--muted); }
.foot { margin-top: 28px; font-size: 13px; color: var(--muted); text-align: center; }

/* ---------- play ---------- */
.bar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: calc(14px + env(safe-area-inset-top)) 0 10px;
}
.bar .x { width: 40px; height: 40px; border-radius: 50%; background: var(--surface); box-shadow: var(--shadow); font-size: 18px; }
.lives { font-size: 24px; letter-spacing: 3px; }
.round { font-weight: 800; color: var(--muted); }
.tag { display: inline-block; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: var(--pitch); background: var(--ok-bg); padding: 4px 10px; border-radius: 999px; }
.q h2 { font-size: 26px; line-height: 1.15; letter-spacing: -.02em; margin: 10px 0 8px; }
.q p { color: var(--muted); }
.board { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 8px; }
@media (min-width: 560px) { .board { grid-template-columns: 1fr 1fr; } }
.slot {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--surface); border: 2px solid var(--line);
  border-radius: 16px; min-height: 58px; transition: transform .2s, background .2s;
}
.slot .n { width: 30px; height: 30px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; font-weight: 800; font-size: 14px; flex: none; }
.slot .t { font-weight: 800; font-size: 17px; flex: 1; min-width: 0; }
.slot .t small { display: block; font-weight: 500; color: var(--muted); font-size: 13px; }
.slot.hidden .t { color: var(--muted); letter-spacing: 6px; font-weight: 700; }
.slot.found { background: var(--ok-bg); border-color: var(--ok); animation: pop .35s; }
.slot.found .n { background: var(--ok); color: #fff; }
.slot.missed { background: var(--bad-bg); border-color: var(--bad); }
.slot.missed .n { background: var(--bad); color: #fff; }
@keyframes pop { 40% { transform: scale(1.04); } }
.guess { display: flex; gap: 8px; margin-top: 18px; position: sticky; bottom: 0; z-index: 2; padding: 12px 0 calc(10px + env(safe-area-inset-bottom)); background: linear-gradient(to bottom, transparent, var(--bg) 22%); }
.guess input {
  flex: 1; min-width: 0; padding: 15px 16px; border-radius: 16px; border: 2px solid var(--line); background: var(--surface); outline: none; font-size: 17px;
}
.guess input:focus { border-color: var(--pitch-2); }
.msg { min-height: 28px; margin-top: 10px; font-weight: 700; }
.msg.ok { color: var(--ok); }
.msg.bad { color: var(--bad); }
.wrong { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.wrong span { background: var(--bad-bg); color: var(--bad); padding: 5px 11px; border-radius: 999px; font-size: 14px; font-weight: 700; text-decoration: line-through; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.result { text-align: center; margin-top: 18px; }
.result .score { font-size: 54px; font-weight: 900; letter-spacing: -.03em; line-height: 1; }
.result .sub { color: var(--muted); margin: 6px 0 16px; }
.result .row { display: grid; gap: 10px; }
.perfect { animation: pop .6s; }
