:root {
  --bg: #f4f2ec;
  --card: #ffffff;
  --ink: #16171c;
  --muted: #676b76;
  --line: rgba(22, 23, 28, 0.09);
  --shadow: 0 1px 2px rgba(20, 20, 30, 0.06), 0 8px 24px rgba(20, 20, 30, 0.06);
  --shadow-hover: 0 2px 4px rgba(20, 20, 30, 0.08), 0 18px 40px rgba(20, 20, 30, 0.12);
  --brand: #5b6cff;
  --sun: #ffb938;
  --done: #1d8f4e;
  --done-bg: rgba(29, 143, 78, 0.1);
  --progress: #b26a00;
  --progress-bg: rgba(255, 170, 40, 0.16);
  --radius: 20px;
  --font: Outfit, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0e13;
    --card: #16181f;
    --ink: #eceef4;
    --muted: #8b91a1;
    --line: rgba(255, 255, 255, 0.08);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 2px 4px rgba(0, 0, 0, 0.5), 0 18px 44px rgba(0, 0, 0, 0.5);
    --brand: #7d8bff;
    --done: #4fd08a;
    --done-bg: rgba(79, 208, 138, 0.12);
    --progress: #ffbd4a;
    --progress-bg: rgba(255, 189, 74, 0.12);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink); font-family: var(--font);
  -webkit-font-smoothing: antialiased; display: flex; flex-direction: column;
}
a { color: inherit; }

.top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; max-width: 1040px; margin: 0 auto; padding: max(18px, env(safe-area-inset-top)) 20px 0;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; font-size: 1.35rem; letter-spacing: -0.01em; }
.brand svg { width: 30px; height: 30px; color: var(--ink); }
.reset { font-size: 0.85rem; color: var(--muted); white-space: nowrap; }
.reset b { font-family: var(--mono); font-weight: 500; color: var(--ink); font-variant-numeric: tabular-nums; }

main { width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 20px; flex: 1; }

.hero { padding: 44px 0 26px; }
.kicker { margin: 0 0 6px; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--brand); }
.hero h1 { margin: 0; font-size: clamp(2rem, 6vw, 3.2rem); font-weight: 800; letter-spacing: -0.02em; line-height: 1.05; }
.progress { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.progress p { margin: 0; color: var(--muted); font-size: 1.02rem; }
.progress p b { color: var(--ink); font-weight: 600; }
.dots { display: flex; gap: 6px; }
.dots i { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--line); }
.dots i.s-done { background: var(--done); border-color: var(--done); }
.dots i.s-progress { background: var(--progress); border-color: var(--progress); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 20px; padding-bottom: 20px; }

.game {
  display: flex; flex-direction: column; background: var(--card); border-radius: var(--radius); overflow: hidden;
  text-decoration: none; box-shadow: var(--shadow); border: 1px solid var(--line);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
a.game:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
a.game:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.art { position: relative; aspect-ratio: 32 / 15; overflow: hidden; background: #111; }
.art svg { display: block; width: 100%; height: 100%; transition: transform 0.4s ease; }
a.game:hover .art svg { transform: scale(1.04); }

.body { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px 16px; flex: 1; }
.meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 26px; }
.num { font-family: var(--mono); font-size: 0.8rem; color: var(--muted); }
.chip { font-size: 0.78rem; font-weight: 600; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.chip-new { background: var(--accent); color: var(--accent-ink); }
.chip-done { background: var(--done-bg); color: var(--done); }
.chip-progress { background: var(--progress-bg); color: var(--progress); }
.game h2 { margin: 2px 0 0; font-size: 1.55rem; font-weight: 800; letter-spacing: -0.01em; }
.tagline { margin: 0; font-weight: 500; }
.blurb { margin: 2px 0 0; color: var(--muted); font-size: 0.92rem; line-height: 1.45; }
.note { margin: 4px 0 0; font-size: 0.86rem; font-weight: 600; color: var(--progress); }
.foot { display: flex; align-items: center; gap: 10px; margin-top: auto; padding-top: 12px; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }
.tags span { font-size: 0.74rem; color: var(--muted); border: 1px solid var(--line); padding: 3px 8px; border-radius: 999px; }
.streak { font-size: 0.86rem; font-weight: 600; }
.go { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-weight: 800; transition: transform 0.18s ease; }
a.game:hover .go { transform: translateX(3px); }
.game.is-done .go { background: var(--line); color: var(--ink); }

.soon { background: transparent; box-shadow: none; border: 2px dashed var(--line); min-height: 220px; display: grid; place-items: center; }
.soon-inner { text-align: center; color: var(--muted); }
.soon-plus { display: grid; place-items: center; width: 44px; height: 44px; margin: 0 auto 8px; border-radius: 50%; border: 2px dashed var(--line); font-size: 1.4rem; }
.soon p { margin: 0; font-size: 0.95rem; }

.foot-note { width: 100%; max-width: 1040px; margin: 0 auto; padding: 18px 20px max(28px, env(safe-area-inset-bottom)); }
.foot-note p { margin: 0; color: var(--muted); font-size: 0.85rem; }

@media (max-width: 520px) {
  .top { padding-left: 16px; padding-right: 16px; }
  main, .foot-note { padding-left: 16px; padding-right: 16px; }
  .hero { padding: 30px 0 20px; }
  .reset span { display: none; }
  .reset::before { content: '⟳ '; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
