/* site.css — one stylesheet for the whole site. Games add a small file of their own. */

:root {
  --bg: #f6f4ee;
  --surface: #ffffff;
  --surface-2: #efece4;
  --text: #1d1c1a;
  --muted: #68645c;
  --border: #dcd7cb;
  --good: #17875a;
  --bad: #cf4037;
  --warn: #b77c00;
  --memory: #6a47f5;
  --logic: #0a8577;
  --strategy: #cf5a24;
  --brand: #26252b;
  --accent: var(--logic);
  --accent-ink: #ffffff;
  --radius: 14px;
  --radius-s: 9px;
  --shadow: 0 1px 2px rgba(30, 25, 10, .06), 0 6px 20px rgba(30, 25, 10, .06);
  --font: ui-rounded, "SF Pro Rounded", "Hiragino Maru Gothic ProN", "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #131416; --surface: #1c1e22; --surface-2: #272a31; --text: #ecebe7; --muted: #a29f98;
    --border: #353840; --good: #3ecf8e; --bad: #ff6f65; --warn: #f0b429;
    --memory: #a08bff; --logic: #2fcfbc; --strategy: #ff9158; --brand: #ecebe7;
    --accent-ink: #101114;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #131416; --surface: #1c1e22; --surface-2: #272a31; --text: #ecebe7; --muted: #a29f98;
  --border: #353840; --good: #3ecf8e; --bad: #ff6f65; --warn: #f0b429;
  --memory: #a08bff; --logic: #2fcfbc; --strategy: #ff9158; --brand: #ecebe7;
  --accent-ink: #101114;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
  color-scheme: dark;
}
.cat-memory { --accent: var(--memory); }
.cat-logic { --accent: var(--logic); }
.cat-strategy { --accent: var(--strategy); }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 17px/1.55 var(--font); -webkit-font-smoothing: antialiased;
  min-height: 100vh; display: flex; flex-direction: column;
}
main { flex: 1; width: 100%; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -.015em; margin: 0; font-weight: 800; }
p { margin: 0 0 1em; }
button { font: inherit; color: inherit; }
.wrap { width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ---------- header ---------- */
.site-head { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
.site-head .wrap { display: flex; align-items: center; gap: 14px; height: 56px; }
.logo { font-weight: 900; font-size: 1.2rem; text-decoration: none; letter-spacing: -.03em; display: flex; align-items: center; gap: 8px; color: var(--brand); white-space: nowrap; }
.logo-mark { width: 26px; height: 26px; border-radius: 7px; display: grid; grid-template-columns: 1fr 1fr; gap: 2px; padding: 3px; background: var(--brand); flex: none; }
.logo-mark i { border-radius: 2px; background: var(--memory); }
.logo-mark i:nth-child(2) { background: var(--logic); }
.logo-mark i:nth-child(3) { background: var(--strategy); }
.logo-mark i:nth-child(4) { background: var(--surface); }
.nav { display: flex; gap: 2px; margin-left: 6px; }
.nav a { text-decoration: none; padding: 7px 10px; border-radius: 8px; font-weight: 700; font-size: .95rem; color: var(--muted); }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); }
.chips { margin-left: auto; display: flex; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 99px; background: var(--surface-2); font-weight: 800; font-size: .9rem; text-decoration: none; white-space: nowrap; }
.chip small { font-weight: 700; color: var(--muted); font-size: .75rem; }
.chip.lit { background: color-mix(in srgb, var(--strategy) 18%, var(--surface)); }
/* the site name is long, so below tablet width the logo mark stands alone */
@media (max-width: 760px) {
  .logo-text { display: none; }
}
@media (max-width: 560px) {
  .nav a { padding: 7px 7px; font-size: .88rem; }
  .chip small:not(.keep) { display: none; }
}
@media (max-width: 400px) {
  .site-head .wrap { gap: 6px; padding: 0 10px; }
  .nav { margin-left: 0; gap: 0; }
  .nav a { padding: 7px 5px; font-size: .84rem; }
  .chips { gap: 4px; }
  .chip { padding: 5px 8px; font-size: .84rem; gap: 3px; }
}

/* ---------- buttons, tabs, chips used by every game ---------- */
.pz-btn {
  appearance: none; border: 1.5px solid var(--border); background: var(--surface); color: var(--text);
  padding: 10px 18px; border-radius: 99px; font-weight: 800; font-size: 1rem; cursor: pointer; min-height: 44px;
  transition: transform .06s, background .15s, border-color .15s; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.pz-btn:hover { border-color: var(--accent); }
.pz-btn:active { transform: scale(.97); }
.pz-btn[disabled] { opacity: .45; cursor: not-allowed; }
.pz-btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.pz-btn-primary:hover { filter: brightness(1.07); }
.pz-btn-small { padding: 6px 13px; min-height: 36px; font-size: .9rem; }
.pz-btn.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.pz-tabs { display: flex; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: 99px; width: fit-content; max-width: 100%; margin: 0 auto 14px; overflow-x: auto; }
.pz-tab { appearance: none; border: 0; background: transparent; padding: 8px 16px; border-radius: 99px; font-weight: 800; cursor: pointer; color: var(--muted); min-height: 40px; white-space: nowrap; font-size: .95rem; }
.pz-tab.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }

.pz-hud { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 0 0 12px; }
.pz-pill { background: var(--surface-2); border-radius: 99px; padding: 6px 13px; font-weight: 800; font-size: .92rem; display: inline-flex; gap: 6px; align-items: baseline; font-variant-numeric: tabular-nums; }
.pz-pill small { font-weight: 700; color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; }
.pz-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; margin: 12px 0; }
.pz-note { text-align: center; color: var(--muted); font-size: .95rem; margin: 10px 0; min-height: 1.5em; }
.pz-error { text-align: center; color: var(--bad); font-weight: 700; padding: 30px 0; }
.pz-select { font: inherit; font-weight: 700; padding: 8px 12px; border-radius: 10px; border: 1.5px solid var(--border); background: var(--surface); color: var(--text); min-height: 40px; }

.pz-daily-done { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 14px; padding: 12px 14px; margin: 0 0 14px; border-radius: var(--radius); background: color-mix(in srgb, var(--good) 13%, var(--surface)); border: 1px solid color-mix(in srgb, var(--good) 35%, var(--border)); font-size: .95rem; text-align: center; }
.pz-countdown { font-variant-numeric: tabular-nums; }

/* level picker used by level-based games */
.pz-levels { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 8px; margin: 10px 0; }
.pz-level { aspect-ratio: 1; border-radius: 12px; border: 1.5px solid var(--border); background: var(--surface); font-weight: 800; cursor: pointer; font-size: 1rem; display: grid; place-items: center; position: relative; }
.pz-level.done { background: color-mix(in srgb, var(--accent) 16%, var(--surface)); border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.pz-level.current { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent) inset; }
.pz-level[disabled] { opacity: .4; cursor: not-allowed; }
.pz-stars { color: var(--warn); letter-spacing: 1px; }

/* ---------- result pop-up ---------- */
.pz-modal { position: fixed; inset: 0; background: rgba(15, 14, 12, .55); display: grid; place-items: center; padding: 16px; z-index: 100; animation: pzfade .18s ease-out; overflow-y: auto; }
.pz-modal-box { position: relative; background: var(--surface); border-radius: 20px; padding: 26px 22px 20px; width: 100%; max-width: 400px; text-align: center; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); animation: pzpop .22s cubic-bezier(.2, 1.3, .5, 1); }
.pz-modal-x { position: absolute; top: 8px; right: 10px; border: 0; background: transparent; font-size: 1.7rem; line-height: 1; cursor: pointer; color: var(--muted); width: 40px; height: 40px; border-radius: 50%; }
.pz-modal-x:hover { background: var(--surface-2); }
.pz-res-icon { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 10px; font-size: 1.7rem; font-weight: 900; color: #fff; background: var(--muted); }
.pz-res-icon.win { background: var(--good); }
.pz-res-title { font-size: 1.6rem; margin-bottom: 6px; }
.pz-res-msg { color: var(--muted); margin: 0 0 10px; }
.pz-res-stats { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 12px 0; }
.pz-stat { background: var(--surface-2); border-radius: 12px; padding: 9px 12px; min-width: 78px; display: flex; flex-direction: column; flex: 1 1 78px; }
.pz-stat-v { font-weight: 900; font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.pz-stat-l { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.pz-res-flags { list-style: none; margin: 10px 0; padding: 0; font-weight: 700; font-size: .95rem; display: grid; gap: 4px; }
.pz-xp { margin: 14px 0; text-align: left; }
.pz-xp-top { display: flex; justify-content: space-between; font-weight: 800; font-size: .9rem; margin-bottom: 5px; }
.pz-xp-gain { color: var(--good); }
.pz-xp-bar { height: 10px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.pz-xp-fill { height: 100%; background: linear-gradient(90deg, var(--memory), var(--logic)); border-radius: 99px; transition: width .6s ease; }
.pz-levelup { margin-top: 6px; font-weight: 900; color: var(--good); text-align: center; }
.pz-res-btns { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 14px 0 4px; }
.pz-upnext { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 12px; padding: 11px 14px; border-radius: 12px; text-decoration: none; background: color-mix(in srgb, var(--accent) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border)); }
.pz-upnext-l { font-size: .8rem; color: var(--muted); font-weight: 700; }
.pz-upnext-t { font-weight: 900; color: var(--accent); }
body.pz-modal-open { overflow: hidden; }
@keyframes pzfade { from { opacity: 0; } }
@keyframes pzpop { from { opacity: 0; transform: scale(.92) translateY(8px); } }

.pz-toasts { position: fixed; left: 0; right: 0; bottom: 20px; display: grid; justify-items: center; gap: 8px; z-index: 200; pointer-events: none; padding: 0 16px; }
.pz-toast { background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 99px; font-weight: 700; font-size: .93rem; box-shadow: var(--shadow); animation: pzpop .2s ease-out; transition: opacity .3s, transform .3s; }
.pz-toast.out { opacity: 0; transform: translateY(8px); }

/* ---------- home ---------- */
.hero { padding: 30px 0 8px; }
.hero h1 { font-size: clamp(1.9rem, 5vw, 2.9rem); max-width: 17ch; }
.hero p.lede { color: var(--muted); font-size: 1.1rem; max-width: 52ch; margin: 12px 0 0; }
.today { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 18px; margin: 22px 0 6px; box-shadow: var(--shadow); }
.today-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-bottom: 4px; }
.today-head h2 { font-size: 1.35rem; }
.today-head .muted { font-size: .95rem; }
.today-progress { margin-left: auto; font-weight: 800; font-size: .92rem; background: var(--surface-2); padding: 4px 11px; border-radius: 99px; }
.streak-line { font-weight: 700; margin: 4px 0 14px; font-size: .97rem; }
.today-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; min-height: 86px; }
.today-card { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 14px 14px 14px 46px; border-radius: var(--radius); text-decoration: none; background: color-mix(in srgb, var(--accent) 10%, var(--surface)); border: 1.5px solid color-mix(in srgb, var(--accent) 30%, var(--border)); transition: transform .1s, border-color .15s; }
.today-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.today-check { position: absolute; left: 13px; top: 50%; translate: 0 -50%; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--accent); display: grid; place-items: center; font-weight: 900; font-size: .85rem; color: var(--accent-ink); }
.today-card.done .today-check { background: var(--accent); }
.today-title { font-weight: 900; }
.today-sub { font-size: .85rem; color: var(--muted); font-weight: 600; }
.continue-box { margin: 12px 0 0; }
.continue-link { display: inline-block; text-decoration: none; padding: 8px 14px; border-radius: 99px; background: var(--surface-2); font-size: .95rem; }
.continue-link strong { color: var(--accent); }

.section { padding: 26px 0 4px; }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-bottom: 12px; }
.section-head h2 { font-size: 1.4rem; }
.section-head .dot { width: 12px; height: 12px; border-radius: 4px; background: var(--accent); display: inline-block; flex: none; align-self: center; }
.section-head p { margin: 0; color: var(--muted); font-size: .95rem; }
@media (max-width: 560px) { .section-head p { flex-basis: 100%; } }
.section-head h2 a:hover { text-decoration: underline !important; }
.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.game-card { display: flex; gap: 13px; align-items: center; padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); text-decoration: none; transition: transform .1s, box-shadow .15s, border-color .15s; }
.game-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--accent); }
.game-icon { width: 54px; height: 54px; border-radius: 13px; background: color-mix(in srgb, var(--accent) 14%, var(--surface)); color: var(--accent); display: grid; place-items: center; flex: none; }
.game-icon svg { width: 34px; height: 34px; }
.game-card h3 { font-size: 1.08rem; }
.game-card p { margin: 3px 0 0; font-size: .87rem; color: var(--muted); line-height: 1.35; }
.badge { display: inline-block; font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; padding: 2px 7px; border-radius: 99px; background: color-mix(in srgb, var(--accent) 16%, var(--surface)); color: var(--accent); margin-left: 6px; vertical-align: 2px; }

.pitch { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-top: 8px; }
.pitch div { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.pitch h3 { font-size: 1.02rem; margin-bottom: 5px; }
.pitch p { margin: 0; color: var(--muted); font-size: .93rem; }

/* ---------- game page ---------- */
.game-head { padding: 18px 0 10px; text-align: center; }
.game-head h1 { font-size: clamp(1.5rem, 4.5vw, 2.1rem); }
.game-head p { color: var(--muted); margin: 5px auto 0; max-width: 56ch; font-size: .98rem; }
.crumbs { font-size: .82rem; color: var(--muted); margin-bottom: 6px; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.game-shell { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 16px 12px 18px; box-shadow: var(--shadow); max-width: 640px; margin: 0 auto; }
.game-root { max-width: 560px; margin: 0 auto; min-height: 420px; touch-action: manipulation; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
.game-tools { display: flex; justify-content: center; gap: 8px; margin-top: 12px; }
.tool-btn { border: 0; background: transparent; color: var(--muted); font-weight: 700; font-size: .85rem; cursor: pointer; padding: 6px 10px; border-radius: 8px; }
.tool-btn:hover { background: var(--surface-2); color: var(--text); }
.noscript { text-align: center; padding: 40px 10px; color: var(--muted); }

.prose { max-width: 700px; margin: 0 auto; padding: 8px 0 0; }
.prose h2 { font-size: 1.35rem; margin: 30px 0 10px; }
.prose h3 { font-size: 1.05rem; margin: 18px 0 4px; }
.prose ol, .prose ul { padding-left: 1.3em; margin: 0 0 1em; }
.prose li { margin-bottom: .4em; }
.prose a { color: var(--accent); font-weight: 700; }
.prose details { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-s); padding: 12px 14px; margin-bottom: 8px; }
.prose summary { font-weight: 800; cursor: pointer; }
.prose details p { margin: 8px 0 0; color: var(--muted); }
.page-title { padding: 28px 0 6px; }
.page-title h1 { font-size: clamp(1.7rem, 4.5vw, 2.3rem); }

/* ---------- ad slots: space is reserved so the page never jumps ---------- */
.ad-slot { margin: 18px auto; max-width: 728px; min-height: 100px; display: grid; place-items: center; }
.ad-slot.ad-rect { min-height: 250px; max-width: 336px; }
.ad-slot:empty { display: none; }
.ad-label { font-size: .65rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); text-align: center; }

/* ---------- stats ---------- */
.stats-hero { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 18px; box-shadow: var(--shadow); }
.stats-level { display: flex; gap: 16px; align-items: center; margin-bottom: 6px; }
.stats-level > div:last-child { flex: 1; }
.stats-level-n { width: 68px; height: 68px; border-radius: 20px; background: linear-gradient(135deg, var(--memory), var(--logic)); color: #fff; font-weight: 900; font-size: 1.9rem; display: grid; place-items: center; flex: none; }
.stats-level-t { font-weight: 900; font-size: 1.25rem; margin-bottom: 6px; }
.stats-level-s { font-size: .85rem; color: var(--muted); margin-top: 5px; font-weight: 600; }
.stats-block { margin-top: 26px; }
.stats-block h2 { font-size: 1.25rem; margin-bottom: 10px; }
.stats-cal { display: grid; grid-template-columns: repeat(14, 1fr); gap: 5px; max-width: 420px; margin-bottom: 8px; }
.cal-day { aspect-ratio: 1; border-radius: 5px; background: var(--surface-2); }
.cal-day.on { background: color-mix(in srgb, var(--logic) 55%, var(--surface)); }
.cal-day.sweep { background: var(--logic); }
.stats-rows { display: grid; gap: 6px; }
.stats-row { display: grid; grid-template-columns: 1fr repeat(3, auto); gap: 14px; padding: 11px 14px; background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: var(--radius-s); text-decoration: none; align-items: center; }
.stats-row-t { font-weight: 800; }
.stats-row-n { font-size: .85rem; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 480px) { .stats-row { grid-template-columns: 1fr auto auto; } .stats-row-n:last-child { display: none; } }
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.ach { padding: 12px; border-radius: var(--radius-s); border: 1.5px dashed var(--border); opacity: .6; }
.ach.got { border-style: solid; border-color: var(--warn); background: color-mix(in srgb, var(--warn) 12%, var(--surface)); opacity: 1; }
.ach-n { font-weight: 900; font-size: .95rem; }
.ach-d { font-size: .8rem; color: var(--muted); }

/* ---------- footer ---------- */
.site-foot { margin-top: 44px; border-top: 1px solid var(--border); background: var(--surface); padding: 24px 0 30px; font-size: .9rem; color: var(--muted); }
.foot-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 18px; }
.foot-cols h4 { margin: 0 0 6px; font-size: .78rem; text-transform: uppercase; letter-spacing: .07em; color: var(--text); }
.foot-cols a { display: block; text-decoration: none; padding: 3px 0; }
.foot-cols a:hover { color: var(--text); text-decoration: underline; }
.foot-note { margin-top: 18px; font-size: .82rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
