:root {
  --bg: #f6f7fb; --surface: #ffffff; --surface-2: #eef1f7; --text: #121722; --muted: #5d6677;
  --line: #e1e5ee; --accent: #00a862; --accent-ink: #ffffff; --accent-soft: #e3f7ee; --new: #ff5a36;
  --radius: 14px; --shadow: 0 1px 2px rgb(16 24 40 / .06), 0 4px 16px rgb(16 24 40 / .05);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0f17; --surface: #131a26; --surface-2: #1b2433; --text: #e9edf5; --muted: #95a0b4;
    --line: #243046; --accent: #2bd88b; --accent-ink: #062014; --accent-soft: #123526; --new: #ff7a59;
    --shadow: none;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); }
img { max-width: 100%; }
.wrap { max-width: 960px; margin: 0 auto; padding: 0 16px; }
h1 { font-size: clamp(1.7rem, 4.5vw, 2.4rem); line-height: 1.15; margin: 0 0 .4em; letter-spacing: -.02em; }
h2 { font-size: 1.3rem; margin: 2rem 0 .8rem; letter-spacing: -.01em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.ok { color: var(--accent); font-weight: 600; }

.top { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.logo { font-weight: 800; font-size: 1.15rem; color: var(--text); text-decoration: none; }
.logo-mark { color: var(--accent); }
.lang { font-size: .9rem; text-decoration: none; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--text); }

main { padding: 24px 16px 48px; }
.hero { padding: 16px 0 8px; }
.hero p { max-width: 65ch; }
.stats { color: var(--muted); font-size: .95rem; margin: .2em 0; }
#q {
  width: 100%; max-width: 420px; margin-top: 12px; padding: 12px 16px; font: inherit;
  border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text);
}

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.card {
  display: flex; gap: 12px; align-items: center; padding: 12px; text-decoration: none; color: var(--text);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  transition: transform .12s, border-color .12s;
}
.card:hover { transform: translateY(-2px); border-color: var(--accent); }
.card img, .card .noicon { border-radius: 12px; flex: none; }
.card div { display: flex; flex-direction: column; min-width: 0; font-size: .9rem; }
.card strong { font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.noicon { display: grid; place-items: center; background: var(--surface-2); font-weight: 800; font-size: 1.5rem; border-radius: 12px; }

.codes { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.code {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.code-main { flex: 1; min-width: 0; }
.code code {
  font: 700 1.05rem/1.3 ui-monospace, "SFMono-Regular", Consolas, monospace; letter-spacing: .02em;
  background: var(--accent-soft); padding: 3px 8px; border-radius: 8px; word-break: break-all;
}
.reward { color: var(--muted); font-size: .92rem; margin-top: 4px; }
.badge { display: inline-block; font-size: .7rem; font-weight: 800; color: #fff; background: var(--new); padding: 2px 7px; border-radius: 999px; vertical-align: middle; }
.copy, .btn {
  flex: none; font: 600 .95rem system-ui, sans-serif; cursor: pointer; border: 0; border-radius: 10px;
  background: var(--accent); color: var(--accent-ink); padding: 10px 16px; text-decoration: none; display: inline-block;
}
.copy:hover, .btn:hover { filter: brightness(1.08); }
.copy.done { background: var(--text); color: var(--bg); }

.crumbs { font-size: .9rem; color: var(--muted); margin-bottom: 12px; }
.crumbs a { text-decoration: none; }
.game-head { display: flex; gap: 16px; align-items: center; }
.game-head img, .game-head .noicon { border-radius: 18px; flex: none; }
.game-head h1 { margin: 0; }
.intro { max-width: 70ch; }
.empty { padding: 16px; background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); }

.howto { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 20px 20px; margin-top: 24px; }
.howto ol { padding-left: 1.2em; }

details { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; margin-bottom: 8px; }
summary { cursor: pointer; font-weight: 600; }
details p { margin: .6em 0 0; color: var(--muted); }
.expired { columns: 2 220px; padding-left: 1.1em; margin: 12px 0 0; }
.expired li { break-inside: avoid; margin-bottom: 4px; }
.expired code { text-decoration: line-through; opacity: .75; }

.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 0; }
.facts div { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.facts dt { font-size: .8rem; color: var(--muted); }
.facts dd { margin: 0; font-weight: 700; font-size: 1.1rem; overflow-wrap: anywhere; }

.prose { max-width: 70ch; }
.foot { border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; padding: 16px 0 32px; }

@media (max-width: 520px) {
  .code { flex-wrap: wrap; }
  .copy { width: 100%; }
  .game-head img, .game-head .noicon { width: 72px; height: 72px; }
}
