/* FunzoneDopa — builds on the DopaBazaar colour tokens from ../styles.css */
:root { --bad: #D92D20; --bad-soft: #FDECEC; --near: #C9A227; --miss: #7C7C8A; }
:root[data-theme="dark"] { --bad: #F87171; --bad-soft: #2A1414; --near: #B8931F; --miss: #3A3A48; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --bad: #F87171; --bad-soft: #2A1414; --near: #B8931F; --miss: #3A3A48; } }
body { background: var(--bg); }
.pz-card-icon svg { width: 26px; height: 26px; }
.pz-top { position: sticky; top: 0; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); z-index: 10; background: var(--surface); border-bottom: 1px solid var(--line); }
.pz-top-inner { max-width: 960px; margin: 0 auto; height: 60px; padding: 0 16px; display: flex; align-items: center; justify-content: space-between; }
.pz-logo { font-family: var(--display); font-weight: 700; font-size: 20px; letter-spacing: -.03em; color: var(--ink); display: inline-flex; align-items: center; gap: 8px; }
.pz-logo span { color: var(--brand); }
.pz-shop { font-weight: 700; font-size: 14px; color: var(--muted); }
#pz { max-width: 960px; margin: 0 auto; padding: 0 16px 48px; }

/* Hub */
.pz-hero { text-align: center; padding: 28px 8px 8px; }
.pz-hero h1 { margin: 0; font-family: var(--display); font-weight: 600; font-size: 32px; }
.pz-hero p { margin: 8px auto 0; max-width: 520px; color: var(--ink-2); line-height: 1.5; }
.pz-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-top: 24px; }
.pz-card { background: var(--surface); border-radius: 24px; padding: 20px; display: flex; flex-direction: column; gap: 6px; color: var(--ink); border: 1px solid var(--line); box-shadow: 0 6px 18px rgba(13,13,20,.04); animation: rise .45s both; animation-delay: calc(var(--i) * 60ms); transition: transform .15s, box-shadow .15s; }
.pz-card:hover { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(13,13,20,.10); }
.pz-card-icon { width: 52px; height: 52px; border-radius: 16px; background: var(--brand-soft); color: var(--brand); display: flex; align-items: center; justify-content: center; margin-bottom: 6px; }
.pz-card b { font-family: var(--display); font-size: 20px; }
.pz-skill { display: inline-block; font-size: 12px; font-weight: 600; color: var(--brand); background: var(--brand-soft); border-radius: 999px; padding: 3px 10px; align-self: flex-start; }
.pz-card-text { font-size: 14px; color: var(--ink-2); line-height: 1.45; }
.pz-card-stars, .pz-win-stars { color: #F5A623; font-size: 20px; letter-spacing: 2px; }

/* Game frame */
.pz-game { padding-top: 18px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.pz-game-head { display: flex; align-items: center; gap: 12px; align-self: stretch; }
.pz-game-head h1 { margin: 0; font-family: var(--display); font-weight: 600; font-size: 26px; }
.pz-back { width: 44px; height: 44px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; font-size: 20px; color: var(--ink); }
.pz-help { margin: 0; align-self: stretch; color: var(--ink-2); line-height: 1.45; }
.pz-note { margin: 0; color: var(--muted); font-size: 14px; text-align: center; }
.pz-note.msg { color: var(--ink); font-weight: 700; font-size: 15px; }
.pz-tabs { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.pz-tabs button { min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--line-2); background: var(--surface); font-weight: 700; }
.pz-tabs button.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.pz-btn { min-height: 48px; padding: 0 22px; border: 0; border-radius: 16px; background: var(--brand); color: #fff; font-family: var(--display); font-weight: 600; font-size: 16px; box-shadow: none; border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center; }
.pz-btn.ghost { background: var(--surface); color: var(--ink); border: 1.5px solid var(--line-2); box-shadow: none; }
.pz-win { background: var(--surface); border-radius: 22px; padding: 18px; text-align: center; display: flex; flex-direction: column; gap: 10px; align-items: center; box-shadow: 0 10px 30px rgba(13,13,20,.10); animation: pop .45s cubic-bezier(.3,1.6,.5,1); }
.pz-win-stars { font-size: 34px; }
.pz-win-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

/* Sudoku */
.sd-grid { display: grid; grid-template-columns: repeat(var(--n), 1fr); width: min(92vw, 420px); aspect-ratio: 1; background: var(--ink); gap: 2px; padding: 3px; border-radius: 16px; }
.sd-cell { border: 0; background: var(--surface); font-family: var(--display); font-weight: 600; font-size: clamp(20px, 6vw, 32px); color: var(--brand); border-radius: 4px; }
.sd-cell.fixed { color: var(--ink); background: var(--surface-2); }
.sd-cell.sel { background: var(--warn-soft); }
.sd-cell.bad { color: var(--bad); background: var(--bad-soft); }
.sd-cell.edge-r { margin-right: 3px; }
.sd-cell.edge-b { margin-bottom: 3px; }
.sd-pad { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.sd-pad button { width: 56px; height: 56px; border-radius: 16px; border: 0; background: var(--surface); font-family: var(--display); font-weight: 600; font-size: 24px; box-shadow: none; border: 1px solid var(--line); }
.sd-pad button:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--line-2); }

/* Hanoi */
.hn-board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: min(94vw, 620px); }
.hn-peg { position: relative; height: 230px; border: 0; border-radius: 18px; background: var(--surface); display: flex; justify-content: center; align-items: flex-end; padding: 0 6px 14px; }
.hn-peg.held { box-shadow: 0 0 0 3px var(--brand); }
.hn-pole { position: absolute; bottom: 14px; width: 8px; height: 180px; border-radius: 4px; background: var(--surface-3); }
.hn-discs { position: relative; width: 100%; display: flex; flex-direction: column-reverse; align-items: center; gap: 3px; }
.hn-disc { width: var(--w); height: 26px; border-radius: 13px; color: #fff; font-weight: 600; font-size: 12px; display: flex; align-items: center; justify-content: center; background: hsl(var(--h), 80%, 55%); transition: transform .2s; }
.hn-disc.up { transform: translateY(-24px); }

/* Slide 8 */
.sl-board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: min(86vw, 360px); aspect-ratio: 1; padding: 8px; background: var(--surface-2); border-radius: 22px; }
.sl-tile { border: 0; border-radius: 16px; background: var(--surface); font-family: var(--display); font-weight: 600; font-size: clamp(28px, 9vw, 44px); color: var(--brand); box-shadow: none; border: 1px solid var(--line); transition: background .2s; }
.sl-tile.home { background: var(--good-soft); color: var(--good-ink); box-shadow: none; border: 1px solid var(--line); }
.sl-blank { border-radius: 16px; }

/* Robo Path */
.rb-grid { display: grid; grid-template-columns: repeat(var(--w), 1fr); gap: 4px; width: min(90vw, 400px); padding: 6px; background: var(--surface-2); border-radius: 18px; }
.rb-cell { aspect-ratio: 1; background: var(--surface); border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: clamp(20px, 7vw, 34px); }
.rb-cell.wall { background: var(--ink); }
.rb-cell.trail { background: var(--brand-soft); }
.rb-prog { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: center; min-height: 44px; width: min(94vw, 520px); background: var(--surface); border-radius: 14px; padding: 8px 10px; }
.rb-block { background: var(--brand); color: #fff; font-weight: 600; border-radius: 10px; padding: 6px 10px; font-size: 16px; }
.rb-count { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--muted); }
.rb-pad { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.rb-pad button { min-width: 56px; height: 56px; border-radius: 16px; border: 0; background: var(--surface); font-size: 24px; font-weight: 600; box-shadow: none; border: 1px solid var(--line); }
.rb-pad button.ghost { font-size: 15px; padding: 0 14px; }
.rb-pad button.go { background: var(--good); color: #fff; font-size: 17px; padding: 0 18px; box-shadow: none; border: 1px solid var(--line); }
.rb-pad button:disabled { opacity: .45; }

/* What comes next */
.pt-seq { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.pt-seq span { min-width: 52px; height: 52px; padding: 0 8px; border-radius: 14px; background: var(--surface); display: flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 600; font-size: 26px; }
.pt-seq .pt-q { background: var(--brand); color: #fff; animation: bump 1.2s infinite; }
.pt-opts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; width: min(90vw, 360px); }
.pt-opts button { height: 64px; border-radius: 18px; border: 2px solid var(--line-2); background: var(--surface); font-family: var(--display); font-weight: 600; font-size: 28px; }
.pt-opts button.right { background: var(--good-soft); border-color: var(--good); }
.pt-opts button.wrong { background: var(--bad-soft); border-color: var(--bad); }

/* How 30 MaarKaan Are You? */
.pz-card.daily { position: relative; background: linear-gradient(135deg, var(--warn-soft), var(--surface) 60%); border-color: var(--line-2); }
.pz-daily { position: absolute; top: 16px; right: 16px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 600; letter-spacing: .04em; padding: 4px 10px; border-radius: 999px; }
.tmk-intro, .tmk-result { background: var(--surface); border-radius: 24px; padding: 24px 20px; text-align: center; display: flex; flex-direction: column; gap: 12px; align-items: center; width: min(94vw, 560px); box-shadow: 0 10px 30px rgba(13,13,20,.08); }
.tmk-intro p { margin: 0; line-height: 1.5; }
.tmk-nogoogle { font-family: var(--display); font-weight: 600; font-size: 22px; color: var(--bad); background: var(--bad-soft); border-radius: 14px; padding: 8px 14px; transform: rotate(-2deg); }
.tmk-bar { display: flex; justify-content: space-between; align-items: center; width: min(94vw, 560px); font-size: 15px; }
.tmk-clock { font-size: 15px; padding: 6px 12px; border-radius: 999px; background: conic-gradient(var(--brand) calc(var(--p) * 360deg), var(--surface-2) 0); color: #fff; font-weight: 700; text-shadow: 0 1px 2px rgba(0,0,0,.3); }
.tmk-dots { display: flex; gap: 6px; }
.tmk-dots span { width: 22px; height: 8px; border-radius: 4px; background: var(--surface-2); }
.tmk-dots .now { background: var(--brand); }
.tmk-dots .ok { background: var(--good); }
.tmk-dots .no { background: var(--bad); }
.tmk-q { margin: 6px 0 0; font-family: var(--display); font-weight: 600; font-size: 24px; text-align: center; max-width: 560px; line-height: 1.25; }
.tmk-opts { display: grid; gap: 10px; width: min(94vw, 560px); }
.tmk-opts button { display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 10px 14px; border-radius: 18px; border: 2px solid var(--line-2); background: var(--surface); font-size: 17px; font-weight: 700; text-align: left; transition: transform .1s, border-color .15s; }
.tmk-opts button:hover { border-color: var(--brand); }
.tmk-opts button:active { transform: scale(.98); }
.tmk-letter { flex-shrink: 0; width: 32px; height: 32px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); font-weight: 600; display: flex; align-items: center; justify-content: center; }
.tmk-result.champ { background: linear-gradient(160deg, var(--warn-soft), var(--surface)); }
.tmk-emoji { font-size: 72px; animation: pop .6s cubic-bezier(.3,1.6,.5,1); }
.tmk-result h2 { margin: 0; font-family: var(--display); font-weight: 600; font-size: 30px; }
.tmk-result p { margin: 0; }
.tmk-score { font-family: var(--display); font-weight: 600; font-size: 40px; color: var(--brand); }
.tmk-review { display: flex; flex-direction: column; gap: 8px; width: min(94vw, 560px); }
.tmk-rev { background: var(--surface); border-radius: 14px; padding: 10px 14px; display: flex; flex-direction: column; gap: 4px; font-size: 14px; border-left: 5px solid var(--good); }
.tmk-rev.no { border-left-color: var(--bad); }
.tmk-rev i { color: var(--muted); }


/* ---------- Hub: groups, streak, card footers ---------- */
.pz-streak { display: inline-flex; align-items: center; gap: 8px; text-align: left; max-width: 100%; margin-top: 14px; padding: 7px 14px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); font-size: 14px; }
.pz-streak.off { background: var(--surface-2); color: var(--muted); }
.pz-group { margin-top: 34px; }
.pz-group-head h2 { font-size: 22px; font-weight: 600; }
.pz-group-head p { margin-top: 4px; color: var(--muted); font-size: 14px; }
.pz-group .pz-grid { margin-top: 14px; }
.pz-card-cta { margin-top: auto; padding-top: 6px; font-weight: 700; color: var(--brand); font-size: 14px; }
.pz-card-done { margin-top: auto; padding-top: 6px; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--good-ink); }
.pz-card-best { margin-top: auto; padding-top: 6px; font-size: 13px; color: var(--muted); }
.pz-card .pz-card-best b { font-size: 13px; font-family: var(--text); color: var(--ink); }
.pz-card-stars { margin-top: auto; }
.pz-card.test .pz-card-icon { background: var(--good-soft); color: var(--good-ink); }
.pz-card.daily .pz-card-icon { background: var(--accent-soft); color: var(--accent-ink); }

/* ---------- Shared: score card, number pad, clock ---------- */
.pz-score { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 22px 18px; width: min(94vw, 480px); text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; box-shadow: var(--shadow); animation: pop .45s cubic-bezier(.3,1.6,.5,1); }
.pz-score-verdict { font-family: var(--display); font-weight: 600; font-size: 22px; }
.pz-score-num { font-family: var(--display); font-weight: 700; font-size: 56px; line-height: 1; color: var(--brand); letter-spacing: -.03em; }
.pz-score-num small { font-size: 22px; font-weight: 600; margin-left: 4px; color: var(--muted); letter-spacing: 0; }
.pz-score-best { font-size: 14px; font-weight: 600; color: var(--good-ink); background: var(--good-soft); padding: 4px 12px; border-radius: 999px; }
.pz-score .pz-btn { gap: 8px; }
.pz-numpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: min(84vw, 300px); }
.pz-numpad button { height: 56px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); font-family: var(--display); font-weight: 600; font-size: 24px; touch-action: manipulation; }
.pz-numpad button:active { background: var(--surface-2); transform: translateY(1px); }
.cc-clock { font-size: 15px; padding: 6px 12px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-ink); font-variant-numeric: tabular-nums; }

/* ---------- Daily Word ---------- */
.wd-legend { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: center; font-size: 13px; color: var(--muted); }
.wd-legend .wd-tile { width: 22px; height: 22px; font-size: 12px; border-radius: 5px; margin-left: 6px; }
.wd-grid { display: grid; gap: 6px; }
.wd-grid.shake .wd-row.cur { animation: shake .4s; }
.wd-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.wd-tile { width: min(15vw, 58px); height: min(15vw, 58px); border: 2px solid var(--line-2); border-radius: 10px; display: flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 700; font-size: clamp(22px, 7vw, 30px); text-transform: uppercase; background: var(--surface); }
.wd-tile.typed { border-color: var(--ink-2); animation: bump .15s; }
.wd-tile.hit, .wd-tile.near, .wd-tile.miss { border-color: transparent; color: #fff; }
.wd-tile.hit { background: var(--good); }
.wd-tile.near { background: var(--near); }
.wd-tile.miss { background: var(--miss); }
.wd-row.flip .wd-tile { animation: flipIn .5s both; animation-delay: var(--d); }
.wd-keys { display: flex; flex-direction: column; gap: 7px; width: min(98vw, 520px); }
.wd-krow { display: flex; gap: 5px; justify-content: center; }
.wd-krow button { flex: 1; max-width: 46px; height: 54px; border: 0; border-radius: 8px; background: var(--surface-3); font-weight: 700; font-size: 16px; text-transform: uppercase; padding: 0; touch-action: manipulation; }
.wd-krow button.wide { max-width: 72px; flex: 1.5; font-size: 13px; text-transform: none; }
.wd-krow button.hit { background: var(--good); color: #fff; }
.wd-krow button.near { background: var(--near); color: #fff; }
.wd-krow button.miss { background: var(--miss); color: #fff; opacity: .7; }
.wd-answer { text-transform: uppercase; letter-spacing: .08em; color: var(--brand); }
.wd-stats { width: min(94vw, 480px); background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.wd-nums { display: grid; grid-template-columns: repeat(4, 1fr); text-align: center; }
.wd-nums b { display: block; font-family: var(--display); font-size: 26px; }
.wd-nums span { font-size: 12px; color: var(--muted); }
.wd-dist { display: flex; flex-direction: column; gap: 4px; }
.wd-dist div { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; }
.wd-dist .me i { background: var(--good); color: #fff; }
.wd-dist i { font-style: normal; width: var(--w); min-width: 22px; background: var(--surface-3); border-radius: 4px; padding: 2px 6px; text-align: right; }
@keyframes flipIn { 0% { transform: rotateX(90deg); } 100% { transform: rotateX(0); } }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

/* ---------- Guess the Film ---------- */
.fm-clue { font-size: clamp(44px, 14vw, 72px); letter-spacing: 6px; text-align: center; padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; width: min(94vw, 560px); animation: pop .4s cubic-bezier(.3,1.6,.5,1); }
.fm-badge { font-size: 64px; line-height: 1; }
.fm-mini { letter-spacing: 2px; margin-right: 4px; }
.tmk-opts button.right { border-color: var(--good); background: var(--good-soft); }
.tmk-opts button.wrong { border-color: var(--bad); background: var(--bad-soft); }
.tmk-opts button.dim { opacity: .55; }
.tmk-opts button:disabled { cursor: default; }

/* ---------- Reaction Time ---------- */
.rx-pad { width: min(94vw, 560px); height: min(58vh, 360px); border: 0; border-radius: 28px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: #fff; padding: 20px; touch-action: manipulation; user-select: none; -webkit-user-select: none; background: var(--brand); }
.rx-pad b { font-family: var(--display); font-size: clamp(34px, 10vw, 54px); font-weight: 700; }
.rx-pad span { font-size: 15px; opacity: .9; max-width: 340px; }
.rx-pad.wait { background: #C2410C; }
.rx-pad.go { background: #059669; }
.rx-pad.early { background: #7F1D1D; }
.rx-times { display: flex; gap: 8px; }
.rx-times span { min-width: 56px; padding: 6px 8px; text-align: center; border-radius: 10px; background: var(--surface-2); color: var(--muted); font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; }
.rx-times span.on { background: var(--brand-soft); color: var(--brand-ink); }

/* ---------- Colour Eye ---------- */
.cc-grid { display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 6px; width: min(92vw, 440px); aspect-ratio: 1; }
.cc-grid.miss { animation: shake .35s; }
.cc-tile { border: 0; border-radius: 12px; padding: 0; touch-action: manipulation; }

/* ---------- Maths Sprint & Number Memory ---------- */
.sp-q { font-family: var(--display); font-weight: 600; font-size: clamp(34px, 11vw, 52px); padding: 14px 22px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.sp-q.wrong { animation: shake .35s; border-color: var(--bad); }
.sp-ans { color: var(--brand); display: inline-block; min-width: 1.4em; }
.dg-show { font-family: var(--display); font-weight: 700; font-size: clamp(30px, 10vw, 52px); letter-spacing: .12em; min-height: 90px; width: min(94vw, 560px); display: flex; align-items: center; justify-content: center; text-align: center; word-break: break-all; padding: 12px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.dg-show.typing { color: var(--brand); }
.dg-hint { font-size: 17px; letter-spacing: 0; font-weight: 500; color: var(--muted); }
.dg-bar { width: min(94vw, 560px); height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.dg-bar i { display: block; height: 100%; background: var(--brand); animation: drain linear both; transform-origin: left; }
.dg-go { grid-column: 1 / -1; }
.dg-mono { font-variant-numeric: tabular-nums; letter-spacing: .06em; }
@keyframes drain { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* ---------- Typing Speed ---------- */
.ty-box { position: relative; width: min(94vw, 640px); height: 150px; overflow: hidden; padding: 14px 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); font-size: 19px; line-height: 1.7; color: var(--muted); }
.ty-box .ok { color: var(--good-ink); }
.ty-box .no { color: var(--bad); background: var(--bad-soft); border-radius: 3px; }
.ty-cur { color: var(--ink); background: var(--brand-soft); border-bottom: 2px solid var(--brand); }
.ty-in { width: min(94vw, 640px); height: 52px; padding: 0 16px; border-radius: 14px; border: 2px solid var(--line-2); background: var(--surface); font-size: 17px; }
.ty-in:focus { outline: none; border-color: var(--brand); }

/* ---------- 2048 ---------- */
.g2-top { display: flex; gap: 8px; align-items: stretch; width: min(94vw, 440px); }
.g2-stat { flex: 1; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 6px 12px; display: flex; flex-direction: column; }
.g2-stat span { font-size: 12px; color: var(--muted); font-weight: 600; }
.g2-stat b { font-family: var(--display); font-size: 20px; font-variant-numeric: tabular-nums; }
.g2-top .pz-btn { min-height: 0; padding: 0 14px; font-size: 14px; }
.g2-wrap { position: relative; width: min(94vw, 440px); }
.g2-board { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 8px; aspect-ratio: 1; border-radius: 20px; background: var(--surface-3); touch-action: none; user-select: none; -webkit-user-select: none; }
.g2-cell { border-radius: 12px; background: var(--surface-2); position: relative; }
.g2-tile { position: absolute; inset: 0; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 700; font-size: clamp(22px, 8vw, 38px); color: var(--ink); background: var(--surface); }
.g2-tile.small { font-size: clamp(17px, 6vw, 30px); }
.g2-tile.new { animation: pop .2s ease-out; }
.g2-tile.merged { animation: bump .2s; }
.g2-tile.v4 { background: #E0E7FF; } .g2-tile.v8 { background: #C7D2FE; } .g2-tile.v16 { background: #A5B4FC; }
.g2-tile.v32 { background: #818CF8; color: #fff; } .g2-tile.v64 { background: #6366F1; color: #fff; } .g2-tile.v128 { background: #4F46E5; color: #fff; }
.g2-tile.v256 { background: #4338CA; color: #fff; } .g2-tile.v512 { background: #3730A3; color: #fff; } .g2-tile.v1024 { background: #F59E0B; color: #fff; }
.g2-tile.v2048 { background: #EA580C; color: #fff; box-shadow: 0 0 24px rgba(234,88,12,.5); } .g2-tile.v4096 { background: #0D0D14; color: #fff; }
:root[data-theme="dark"] .g2-tile.v2 { background: #3A3A4C; } :root[data-theme="dark"] .g2-tile.v4 { background: #3B3770; } :root[data-theme="dark"] .g2-tile.v8 { background: #4A4494; color: #fff; } :root[data-theme="dark"] .g2-tile.v16 { background: #5B54BE; color: #fff; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .g2-tile.v2 { background: #3A3A4C; } :root:not([data-theme="light"]) .g2-tile.v4 { background: #3B3770; } :root:not([data-theme="light"]) .g2-tile.v8 { background: #4A4494; color: #fff; } :root:not([data-theme="light"]) .g2-tile.v16 { background: #5B54BE; color: #fff; }
}
.g2-over { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 10px; border-radius: 20px; background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(2px); }
.g2-over .pz-score { width: 100%; }

/* ---------- Minesweeper ---------- */
.mn-bar { width: min(94vw, 440px); }
.mn-grid { display: grid; grid-template-columns: repeat(var(--w), 1fr); gap: 2px; width: min(94vw, calc(var(--w) * 44px)); padding: 4px; border-radius: 12px; background: var(--line-2); user-select: none; -webkit-user-select: none; }
.mn-cell { aspect-ratio: 1; border: 0; padding: 0; border-radius: 5px; background: color-mix(in srgb, var(--brand) 26%, var(--surface)); font-weight: 800; font-size: clamp(13px, 4.2vw, 18px); touch-action: manipulation; }
.mn-cell:not(.open):hover { background: color-mix(in srgb, var(--brand) 40%, var(--surface)); }
.mn-cell.open { background: var(--surface); cursor: default; }
.mn-cell.boom { background: var(--bad); }
.mn-cell.n1 { color: #2563EB; } .mn-cell.n2 { color: #059669; } .mn-cell.n3 { color: #DC2626; } .mn-cell.n4 { color: #7C3AED; }
.mn-cell.n5 { color: #B45309; } .mn-cell.n6 { color: #0891B2; } .mn-cell.n7 { color: var(--ink); } .mn-cell.n8 { color: var(--muted); }
.mn-mode { display: inline-flex; background: var(--surface-2); padding: 4px; border-radius: 14px; gap: 4px; }
.mn-mode button { min-height: 42px; padding: 0 18px; border: 0; border-radius: 10px; background: transparent; font-weight: 700; }
.mn-mode button.on { background: var(--surface); box-shadow: var(--shadow-sm); color: var(--brand); }

/* ---------- Memory Match ---------- */
.mt-grid { display: grid; grid-template-columns: repeat(var(--c), 1fr); gap: 8px; width: min(94vw, calc(var(--c) * 96px)); }
.mt-card { aspect-ratio: 3 / 4; border: 0; border-radius: 14px; padding: 0; background: linear-gradient(135deg, var(--brand), var(--brand-hover)); font-size: clamp(28px, 9vw, 42px); touch-action: manipulation; }
.mt-card.open, .mt-card.done { background: var(--surface); border: 1px solid var(--line); }
.mt-card.done { background: var(--good-soft); border-color: transparent; }
.mt-card.flip span { display: inline-block; animation: pop .25s ease-out; }

/* ---------- "More free games" links under each game, and the hub's fallback list ---------- */
.pz-more { max-width: 960px; margin: 0 auto; padding: 8px 16px 60px; border-top: 1px solid var(--line); }
.pz-more h2 { font-size: 18px; font-weight: 600; margin: 24px 0 12px; }
.pz-more div { display: flex; flex-wrap: wrap; gap: 8px; }
.pz-more a { padding: 8px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); font-size: 14px; font-weight: 600; }
.pz-more a:hover { border-color: var(--brand); color: var(--brand); }
.pz-group ul { margin: 10px 0 0; padding-left: 20px; line-height: 1.8; }

/* Phones: cards turn into compact rows (icon left) so all 16 games fit in a few swipes. */
@media (max-width: 600px) {
  .pz-grid { gap: 10px; }
  .pz-card { display: grid; grid-template-columns: 48px 1fr; column-gap: 14px; row-gap: 4px; padding: 14px 16px; border-radius: 20px; align-items: start; }
  .pz-card > * { grid-column: 2; }
  .pz-card .pz-card-icon { grid-column: 1; grid-row: 1 / span 4; width: 48px; height: 48px; border-radius: 14px; margin: 0; }
  .pz-card > b { font-size: 17px; padding-right: 86px; }
  .pz-card:not(.daily) > b { padding-right: 0; }
  .pz-card .pz-skill { font-size: 11px; padding: 2px 8px; justify-self: start; }
  .pz-card-text { font-size: 13px; }
  .pz-card-cta, .pz-card-done, .pz-card-best, .pz-card-stars { padding-top: 2px; }
  .pz-daily { top: 14px; right: 14px; }
  .pz-group { margin-top: 26px; }
}
