:root {
  color-scheme: dark;
  --bg: #141713;
  --panel: #20251d;
  --line: #414b38;
  --text: #f1f3e8;
  --muted: #b3bfaa;
  --lime: #ccf476;
  --amber: #ffc36d;
  font: 16px/1.45 system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); }
main { max-width: 720px; margin: auto; padding: max(14px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(28px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; }
.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; min-height: 44px; font-size: 21px; font-weight: 850; letter-spacing: -.06em; }
.brand span, h1 span, .exact { color: var(--lime); }
#sync { max-width: 60%; text-align: right; color: var(--muted); font-size: .75rem; }
.hero { position: relative; isolation: isolate; padding: 35px 0 22px; overflow: hidden; }
.hero-art { position: absolute; z-index: -1; top: 1.35rem; right: .4rem; display: grid; grid-template-columns: repeat(2, 1fr); gap: .35rem; transform: rotate(-12deg); opacity: .48; }
.hero-art span { display: grid; place-items: center; width: clamp(46px, 13vw, 76px); aspect-ratio: 1; border: 1px solid #667f40; border-radius: .55rem; background: #273219; color: var(--lime); font: 700 clamp(18px, 5vw, 34px)/1 ui-monospace, monospace; }
.hero-art span:nth-child(2) { color: #1a2311; background: var(--lime); }
h1 { font-size: clamp(42px, 11vw, 72px); line-height: .98; letter-spacing: -.075em; margin: 0 0 .6rem; }
h2 { font-size: 1.25rem; margin: 0 0 .65rem; letter-spacing: -.03em; }
h3 { font-size: 1.4rem; margin: 0; line-height: 1.15; }
p { margin: 0 0 .85rem; color: var(--muted); }
section + section { margin-top: 1.4rem; }
.card { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; border: 1px solid var(--line); background: var(--panel); border-radius: 16px; padding: 14px; }
.card:hover { border-color: var(--lime); }
.card p { margin: .3rem 0 0; font-size: .875rem; }
.card-icon { display: grid; place-items: center; width: 48px; aspect-ratio: 1; background: var(--lime); color: #1b240d; border-radius: 11px; font: 800 1.7rem/1 ui-monospace, monospace; }
.arrow, .tag { color: var(--lime); }
.tag, .caption { font-size: .8rem; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; }
.stats div { background: var(--panel); border-radius: 12px; padding: 10px; }
dt { font-size: .75rem; color: var(--muted); }
dd { margin: 0; font-size: 1.45rem; font-weight: 750; }
.back-link { display: inline-flex; align-items: center; min-height: 44px; color: var(--lime); margin: .35rem 0; }
.actions { display: flex; gap: 8px; }
.actions button { flex: 1; }
button { font: inherit; color: var(--text); cursor: pointer; min-height: 44px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; touch-action: manipulation; }
button:disabled { opacity: .46; cursor: default; }
button[aria-pressed="true"], .primary { background: var(--lime); color: #17230e; border-color: var(--lime); font-weight: 750; }
.game-meta, .legend { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: .8rem; margin: .65rem 0; }
.near { color: var(--amber); }
.board { display: grid; gap: 4px; }
.attempt { display: grid; grid-template-columns: 18px repeat(4, minmax(0, 1fr)) 62px; gap: 5px; align-items: center; }
.num { color: var(--muted); font-size: .75rem; }
.cell { display: grid; place-items: center; height: 32px; border: 1px solid var(--line); border-radius: 6px; font: 700 1.1rem/1 ui-monospace, monospace; }
.current .cell { border-color: var(--lime); background: #28341d; }
.feedback { display: flex; justify-content: space-around; font-size: .8rem; }
.keypad { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: .7rem 0 .5rem; }
.keypad button { font-size: 1.25rem; font-weight: 750; }
.message { margin-top: .6rem; font-size: .875rem; }
.win { color: var(--lime); }
.loss { color: var(--amber); }
#restart { width: 100%; }
details { margin-top: .8rem; font-size: .875rem; }
summary { cursor: pointer; min-height: 44px; align-content: center; }
