/* ============ Purrcentage design tokens ============ */
:root {
  /* Soft pastel 8-bit palette */
  --lavender: #8B68AC; --lavender-2: #A486C2; --lavender-deep: #6F4F92; --lavender-soft: #EFE7F8; --lavender-line: #E6DCF2;
  --pink: #F6DCEB; --pink-ink: #C2588E; --blue: #DCEBFA; --blue-ink: #4C7FB8; --mint: #DFEFD9; --mint-ink: #4E9A5C; --butter: #F5E5B8; --butter-ink: #A9821F;
  --bg: #FAF7FF; --bg-2: #F3EEFA; --surface: #FFFFFF; --surface-2: #FCFAFF;
  --ink: #382D46; --ink-2: #4E4260; --muted: #82768E; --line: #EDE6F5; --line-2: #E2D8EE;
  --primary: #8B68AC; --primary-2: #A486C2; --primary-ink: #FFFFFF; --primary-soft: #EFE7F8;
  --accent: #C2588E; --accent-soft: #F6DCEB;
  --logo-ink: #382D46;
  --t-purrfect: #B8891A; --t-purrfect-soft: #F5E5B8;
  --t-clawsome: #4E9A5C; --t-clawsome-soft: #DFEFD9;
  --t-sharp: #4C7FB8; --t-sharp-soft: #DCEBFA;
  --t-close: #8B68AC; --t-close-soft: #EFE7F8;
  --t-catastrophe: #C7577F; --t-catastrophe-soft: #F6DCEB;
  --shadow-sm: 0 1px 2px rgba(72, 48, 110, .06);
  --shadow: 0 2px 4px rgba(72, 48, 110, .04), 0 12px 28px -14px rgba(72, 48, 110, .22);
  --shadow-lg: 0 30px 60px -24px rgba(72, 48, 110, .38);
  --r-sm: 12px; --r: 20px; --r-lg: 24px; --r-pill: 999px;
  --ui: "Nunito", ui-rounded, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font: var(--ui); --display: var(--ui);
  --nav-h: 68px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1E1828; --bg-2: #261F33; --surface: #2B2339; --surface-2: #30283F;
    --ink: #F4EEFB; --ink-2: #DCD2EA; --muted: #A99DBA; --line: #3A3049; --line-2: #463A58;
    --primary: #A486C2; --primary-2: #B79BD1; --primary-soft: #3A2E4D; --accent-soft: #46304A; --logo-ink: #1E1828; --lavender-soft: #3A2E4D; --lavender-line: #463A58;
    --pink: #4A3043; --blue: #2C3A50; --mint: #2E4033; --butter: #4A4128;
    --t-purrfect: #E8C25A; --t-clawsome: #8CCB96; --t-sharp: #8DB6E6; --t-close: #C2A6DE; --t-catastrophe: #EC93B4;
    --t-purrfect-soft: #4A4128; --t-clawsome-soft: #2E4033; --t-sharp-soft: #2C3A50; --t-close-soft: #3A2E4D; --t-catastrophe-soft: #4A3043;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.3); --shadow: 0 12px 28px -14px rgba(0,0,0,.6); --shadow-lg: 0 30px 60px -20px rgba(0,0,0,.8);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1E1828; --bg-2: #261F33; --surface: #2B2339; --surface-2: #30283F;
  --ink: #F4EEFB; --ink-2: #DCD2EA; --muted: #A99DBA; --line: #3A3049; --line-2: #463A58;
  --primary: #A486C2; --primary-2: #B79BD1; --primary-soft: #3A2E4D; --accent-soft: #46304A; --logo-ink: #1E1828; --lavender-soft: #3A2E4D; --lavender-line: #463A58;
  --pink: #4A3043; --blue: #2C3A50; --mint: #2E4033; --butter: #4A4128;
  --t-purrfect: #E8C25A; --t-clawsome: #8CCB96; --t-sharp: #8DB6E6; --t-close: #C2A6DE; --t-catastrophe: #EC93B4;
  --t-purrfect-soft: #4A4128; --t-clawsome-soft: #2E4033; --t-sharp-soft: #2C3A50; --t-close-soft: #3A2E4D; --t-catastrophe-soft: #4A3043;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.3); --shadow: 0 12px 28px -14px rgba(0,0,0,.6); --shadow-lg: 0 30px 60px -20px rgba(0,0,0,.8);
  color-scheme: dark;
}

/* ============ base ============ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.5 var(--font); -webkit-font-smoothing: antialiased; min-height: 100vh; overflow-x: hidden;
  /* Long names and words wrap inside their container instead of widening it (deliberately single-line UI keeps white-space: nowrap) */
  overflow-wrap: anywhere; }
h1, h2, h3, h4 { font-family: var(--display); line-height: 1.15; margin: 0 0 .4em; letter-spacing: -.01em; }
h3 { font-size: 1.1rem; font-weight: 700; }
p { margin: 0 0 .75em; }
a { color: inherit; }
button { font: inherit; color: inherit; }
img { max-width: 100%; }
.muted { color: var(--muted); } .small { font-size: .875rem; } .center { text-align: center; }
.mono { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .75rem; font-weight: 700; color: var(--muted); margin: 0 0 .25rem; }
.page-title { font-size: clamp(1.6rem, 4vw, 2.1rem); font-weight: 800; margin-bottom: .6rem; }
.ic { width: 20px; height: 20px; flex: none; vertical-align: -4px; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 60%, transparent); outline-offset: 2px; border-radius: 12px; }
.boot { min-height: 100vh; display: grid; place-items: center; }
.boot img { animation: breathe 1.4s ease-in-out infinite; }

/* ============ shell ============ */
.shell { min-height: 100vh; }
.sidenav { display: none; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; padding: calc(env(safe-area-inset-top) + 10px) 16px 10px; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
.topbar-actions { display: flex; gap: 4px; }
.brand { text-decoration: none; }
.wordmark { display: inline-flex; align-items: center; gap: 8px; font-family: var(--display); font-weight: 800; font-size: 1.35rem; letter-spacing: -.02em; }
.wordmark b { color: var(--primary); font-weight: 800; }
.logo-mark { width: 34px; height: 34px; }
#view { max-width: 760px; margin: 0 auto; padding: 16px 16px calc(var(--nav-h) + env(safe-area-inset-bottom) + 28px); outline: none; }
#view.enter { animation: viewIn .35s cubic-bezier(.2, .8, .2, 1); }
.bottomnav { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(5, 1fr); height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--line); }
.nav-link { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-decoration: none; color: var(--muted); font-size: .7rem; font-weight: 600; transition: color .2s; }
.nav-link .ic { width: 22px; height: 22px; transition: transform .25s cubic-bezier(.3, 1.6, .5, 1); }
.nav-link.active { color: var(--primary); }
.nav-link.active .ic { transform: translateY(-2px) scale(1.08); }
.bottomnav .nav-link.active::before { content: ""; position: absolute; top: 0; width: 28px; height: 3px; border-radius: 0 0 6px 6px; background: var(--primary); }
.badge { position: absolute; top: 8px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--primary); color: #fff; font-size: .68rem; font-weight: 700; display: grid; place-items: center; line-height: 1; }
.badge[hidden], .dot[hidden] { display: none; }
.seg-btn .badge { position: static; display: inline-grid; margin-left: 4px; }
.dot { position: absolute; top: 8px; right: 8px; width: 9px; height: 9px; border-radius: 50%; background: var(--primary); border: 2px solid var(--bg); }
.focus-mode .bottomnav { display: none; }
.focus-mode #view { padding-bottom: 32px; }

@media (min-width: 960px) {
  .topbar, .bottomnav { display: none; }
  .shell { display: grid; grid-template-columns: 248px 1fr; }
  .sidenav { display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; height: 100vh; padding: 24px 16px; border-right: 1px solid var(--line); background: var(--surface-2); }
  .sidenav .brand { padding: 4px 10px 22px; }
  .side-links { display: flex; flex-direction: column; gap: 2px; flex: 1; }
  .side-links .nav-link { flex-direction: row; justify-content: flex-start; gap: 12px; padding: 11px 14px; border-radius: 18px; font-size: .95rem; color: var(--ink-2); }
  .side-links .nav-link:hover { background: var(--bg-2); }
  .side-links .nav-link.active { background: var(--primary-soft); color: var(--primary); }
  .side-links .nav-link.active .ic { transform: none; }
  .side-links .badge { position: static; margin-left: auto; }
  .side-me { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 18px; text-decoration: none; }
  .side-me:hover { background: var(--bg-2); }
  .side-me span { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
  .side-me small { color: var(--muted); }
  #view { padding: 36px 32px 60px; }
  .focus-mode { grid-template-columns: 1fr; }
  .focus-mode .sidenav { display: none; }
}

/* ============ primitives ============ */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; box-shadow: var(--shadow-sm); margin-bottom: 16px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.card-head h3 { margin: 0; }
.grid-2 { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.grid-2 > .card { margin-bottom: 0; }
.grid-2 { margin-bottom: 16px; }
@media (min-width: 720px) { .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: var(--r-pill); border: 1.5px solid transparent; font-weight: 700; font-size: .95rem; text-decoration: none; cursor: pointer; transition: transform .12s, background .2s, box-shadow .2s, border-color .2s; white-space: nowrap; -webkit-tap-highlight-color: transparent; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: var(--primary-ink); box-shadow: 0 6px 18px -6px color-mix(in srgb, var(--primary) 70%, transparent), inset 0 -2px 0 rgba(0,0,0,.12); }
.btn-primary:hover { background: color-mix(in srgb, var(--primary) 88%, #000); }
.btn-ghost { background: var(--surface); border-color: var(--line-2); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink-2); }
.btn-danger { background: var(--t-catastrophe-soft); color: var(--t-catastrophe); }
.btn-danger:hover { background: var(--t-catastrophe); color: #fff; }
.btn-sm { padding: 7px 13px; font-size: .85rem; }
.btn-lg { padding: 13px 22px; font-size: 1rem; }
.btn-xl { padding: 17px 28px; font-size: 1.08rem; border-radius: 20px; }
.btn-block { width: 100%; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.btn-row.center { justify-content: center; }
.icon-btn { position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 18px; border: 0; background: transparent; color: var(--ink-2); cursor: pointer; text-decoration: none; transition: background .2s; }
.icon-btn:hover { background: var(--bg-2); }
.icon-btn:disabled { opacity: .3; cursor: default; }
.icon-btn.danger:hover { color: var(--t-catastrophe); background: var(--t-catastrophe-soft); }
.link { background: none; border: 0; padding: 0; color: var(--primary); font-weight: 600; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 2px; }
.link .ic { width: 16px; height: 16px; vertical-align: -3px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: var(--r-pill); background: var(--bg-2); color: var(--ink-2); font-size: .78rem; font-weight: 600; white-space: nowrap; }
.chip-muted { color: var(--muted); }
.chip-done, .chip-approved { background: var(--t-clawsome-soft); color: var(--t-clawsome); }
.chip-playing, .chip-pending { background: var(--accent-soft); color: var(--accent); }
.chip-lost, .chip-rejected { background: var(--t-catastrophe-soft); color: var(--t-catastrophe); }
.chip-easy { background: var(--t-clawsome-soft); color: var(--t-clawsome); }
.chip-medium { background: var(--t-purrfect-soft); color: color-mix(in srgb, var(--t-purrfect) 75%, var(--ink)); }
.chip-hard { background: var(--t-catastrophe-soft); color: var(--t-catastrophe); }
.pill { display: inline-flex; padding: 5px 12px; border-radius: var(--r-pill); font-weight: 700; font-size: .82rem; }
.pill-primary { background: var(--primary-soft); color: var(--primary); }
.av { display: inline-grid; place-items: center; flex: none; width: var(--s); height: var(--s); border-radius: 50%; background: var(--c); font-size: calc(var(--s) * .55); line-height: 1; box-shadow: inset 0 -3px 0 rgba(0,0,0,.12); }
.av-icon { width: 40px; height: 40px; display: grid; place-items: center; font-size: 1.3rem; background: var(--bg-2); border-radius: 50%; flex: none; }
.input, .form input:not([type=checkbox]), .form select, .form textarea, textarea.input { width: 100%; padding: 12px 14px; border-radius: 18px; border: 1.5px solid var(--line-2); background: var(--surface); color: var(--ink); font: inherit; transition: border-color .2s, box-shadow .2s; }
.input:focus, .form input:focus, .form select:focus, .form textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.form { display: flex; flex-direction: column; gap: 14px; margin-bottom: 16px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: .9rem; }
.form-row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); align-items: end; }
.form label.check { flex-direction: row; align-items: center; gap: 8px; }
.form-error { color: var(--t-catastrophe); font-weight: 600; font-size: .9rem; margin: 0; }
.toggle { display: flex !important; flex-direction: row !important; align-items: center; justify-content: space-between; gap: 16px; cursor: pointer; padding: 4px 0; }
.toggle span { display: flex; flex-direction: column; }
.toggle small { color: var(--muted); font-weight: 400; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle i { flex: none; width: 48px; height: 28px; border-radius: 18px; background: var(--line-2); position: relative; transition: background .2s; }
.toggle i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform .25s cubic-bezier(.3, 1.4, .5, 1); }
.toggle input:checked + i { background: var(--t-clawsome); }
.toggle input:checked + i::after { transform: translateX(20px); }
.toggle input:focus-visible + i { outline: 3px solid var(--primary-soft); }
.seg { display: inline-flex; padding: 4px; gap: 2px; background: var(--bg-2); border-radius: var(--r-pill); margin-bottom: 14px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg-btn { border: 0; background: transparent; padding: 8px 16px; border-radius: var(--r-pill); font-weight: 700; font-size: .9rem; color: var(--muted); cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .2s, color .2s; }
.seg-btn.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.seg-sm .seg-btn { padding: 6px 12px; font-size: .82rem; }
.loading { display: grid; place-items: center; padding: 60px 0; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line-2); border-top-color: var(--primary); animation: spin .8s linear infinite; }
.empty { text-align: center; padding: 36px 20px; }
.empty .av { margin: 0 auto 12px; }
.empty-emoji { font-size: 2.6rem; margin-bottom: 6px; }
.empty-inline { text-align: center; padding: 12px 0; }
.banner { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 16px; border-radius: var(--r); margin-bottom: 16px; font-size: .95rem; }
.banner > span:first-of-type { flex: 1; min-width: 180px; }
.banner-challenge { background: var(--accent-soft); color: var(--ink); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent); }
.banner-challenge > .ic { color: var(--accent); }
.banner-warn { background: var(--t-purrfect-soft); }
.banner-actions { display: flex; gap: 6px; }

/* toasts & modals */
#toasts { position: fixed; z-index: 100; left: 50%; bottom: calc(var(--nav-h) + 20px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: min(92vw, 420px); }
.toast { background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 18px; font-weight: 600; font-size: .92rem; box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(12px) scale(.96); transition: all .28s cubic-bezier(.2, 1.4, .4, 1); text-align: center; }
.toast.in { opacity: 1; transform: none; }
.toast-error { background: var(--t-catastrophe); color: #fff; }
.toast-success { background: var(--t-clawsome); color: #fff; }
.modal-wrap { position: fixed; inset: 0; z-index: 90; background: rgba(20, 14, 30, .45); backdrop-filter: blur(4px); display: grid; place-items: end center; padding: 0; opacity: 0; transition: opacity .2s; }
.modal-wrap.in { opacity: 1; }
.modal { width: 100%; max-width: 480px; max-height: 92vh; overflow: auto; background: var(--surface); border-radius: 26px 26px 0 0; padding: 22px 20px calc(20px + env(safe-area-inset-bottom)); box-shadow: var(--shadow-lg); transform: translateY(30px); transition: transform .3s cubic-bezier(.2, 1.2, .4, 1); }
.modal.wide { max-width: 720px; }
.modal-wrap.in .modal { transform: none; }
@media (min-width: 640px) { .modal-wrap { place-items: center; padding: 20px; } .modal { border-radius: 26px; padding: 24px; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.modal-head h3 { margin: 0; font-size: 1.25rem; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
.modal-actions .btn { flex: 1 1 auto; }
.confirm-guess { font-family: var(--display); font-size: 4rem; font-weight: 800; text-align: center; color: var(--primary); line-height: 1; margin: 8px 0 12px; }
.confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 120; pointer-events: none; }

/* ============ auth ============ */
.auth { min-height: 100vh; display: grid; gap: 24px; padding: calc(env(safe-area-inset-top) + 28px) 16px 32px; max-width: 1080px; margin: 0 auto; align-content: center; }
.auth-hero h1 { font-size: clamp(2.6rem, 8vw, 4.4rem); font-weight: 800; letter-spacing: -.035em; margin: 26px 0 12px; line-height: .98; }
.auth-hero > p { font-size: 1.12rem; color: var(--ink-2); max-width: 30ch; }
.auth-card { padding: 24px; }
.auth-demo { margin-top: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; box-shadow: var(--shadow); max-width: 440px; }
.demo-q { font-family: var(--display); font-weight: 700; font-size: 1.05rem; margin-bottom: 18px; }
.demo-track { position: relative; height: 12px; border-radius: 10px; background: var(--bg-2); margin: 10px 8px 22px; }
.demo-fill { position: absolute; inset: 0 auto 0 0; width: 71%; border-radius: 10px; background: linear-gradient(90deg, var(--primary-2), var(--primary)); animation: demoSlide 4s ease-in-out infinite; }
.demo-thumb { position: absolute; top: 50%; left: 71%; width: 32px; height: 32px; margin: -16px 0 0 -16px; background: var(--surface); border-radius: 50%; display: grid; place-items: center; box-shadow: var(--shadow); font-size: 15px; animation: demoThumb 4s ease-in-out infinite; }
.demo-tiers { display: flex; flex-wrap: wrap; gap: 6px; }
.invite-banner { display: flex; align-items: center; gap: 10px; background: var(--primary-soft); padding: 12px; border-radius: 18px; margin-bottom: 16px; font-size: .92rem; }
.auth .seg { width: 100%; }
.auth .seg-btn { flex: 1; }
@media (min-width: 900px) { .auth { grid-template-columns: 1.15fr 1fr; gap: 56px; align-items: center; } }

/* ============ tiers ============ */
.t-purrfect { --t: var(--t-purrfect); --ts: var(--t-purrfect-soft); }
.t-clawsome { --t: var(--t-clawsome); --ts: var(--t-clawsome-soft); }
.t-sharp { --t: var(--t-sharp); --ts: var(--t-sharp-soft); }
.t-close { --t: var(--t-close); --ts: var(--t-close-soft); }
.t-catastrophe { --t: var(--t-catastrophe); --ts: var(--t-catastrophe-soft); }
.tchip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: var(--r-pill); background: var(--ts); color: color-mix(in srgb, var(--t) 80%, var(--ink)); font-size: .8rem; font-weight: 700; white-space: nowrap; }
.tier-legend { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); margin-top: 12px; }
.tier-legend .tchip { flex-direction: column; align-items: flex-start; border-radius: 18px; padding: 10px 12px; white-space: normal; }
.tier-legend small { font-weight: 500; opacity: .8; }
.tier-row { display: flex; gap: 6px; margin: 4px 0 18px; flex-wrap: wrap; }
.tier-dot { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 18px; background: var(--ts); font-size: 1.1rem; box-shadow: inset 0 -3px 0 color-mix(in srgb, var(--t) 30%, transparent); }

/* ============ home ============ */
.home-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 8px; }
.streak-pill { display: inline-flex; align-items: center; gap: 4px; padding: 8px 14px; border-radius: var(--r-pill); background: var(--surface); border: 1px solid var(--line); text-decoration: none; font-size: .85rem; color: var(--muted); box-shadow: var(--shadow-sm); flex: none; }
.streak-pill b { font-family: var(--display); font-size: 1.1rem; color: var(--ink); }
.streak-pill.hot .ic { color: var(--primary); fill: color-mix(in srgb, var(--primary) 30%, transparent); }
.hero-card { position: relative; overflow: hidden; padding: 24px; background: radial-gradient(120% 120% at 100% 0%, var(--primary-soft) 0%, transparent 55%), var(--surface); box-shadow: var(--shadow); }
.hero-card::after { content: "%"; position: absolute; right: -10px; bottom: -60px; font-family: var(--display); font-weight: 800; font-size: 220px; line-height: 1; color: var(--primary); opacity: .06; pointer-events: none; }
.hero-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.hero-top .ic { width: 15px; height: 15px; vertical-align: -2px; }
.hero-title { font-size: clamp(1.5rem, 4.5vw, 2rem); font-weight: 800; margin-bottom: 6px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; position: relative; z-index: 1; }
.hero-actions .btn-xl { flex: 1 1 260px; }
.hero-score { display: flex; align-items: center; gap: 14px; margin: 8px 0 12px; }
.big-num { font-family: var(--display); font-weight: 800; font-size: 4rem; line-height: .9; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.seg-progress { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin: 16px 0 4px; }
.seg-progress i { height: 8px; border-radius: 6px; background: var(--line); transition: background .3s; }
.seg-progress i[class*="t-"] { background: var(--t); }
.seg-progress.lg i { height: 10px; }
.seg-progress i.current { background: var(--ink); animation: pulse 1.6s ease-in-out infinite; }
.streak-warn { margin: 14px 0 0; color: var(--primary); font-weight: 600; font-size: .92rem; }
.mini-board { list-style: none; margin: 8px 0 0; padding: 0; }
.mini-board li { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-radius: 18px; }
.mini-board li.me { background: var(--primary-soft); }
.mini-board .rank { width: 20px; text-align: center; font-weight: 700; color: var(--muted); font-size: .85rem; }
.mini-board .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.mini-board .score b { font-family: var(--display); font-size: 1.1rem; }
.invite-row { display: flex; gap: 8px; margin: 10px 0; }
.invite-row input { flex: 1; min-width: 0; padding: 9px 12px; border-radius: 18px; border: 1.5px dashed var(--line-2); background: var(--surface-2); color: var(--ink-2); font: 500 .85rem var(--font); }
.invite-card .share-btns { margin-top: 0; }
.how summary { display: flex; align-items: center; justify-content: space-between; cursor: pointer; list-style: none; }
.how summary::-webkit-details-marker { display: none; }
.how summary h3 { margin: 0; }
.how summary .ic { transition: transform .2s; }
.how[open] summary .ic { transform: rotate(90deg); }
.how-list { padding-left: 20px; margin: 12px 0 0; }
.how-list li { margin-bottom: 6px; }

/* ============ play ============ */
.play { max-width: 620px; margin: 0 auto; }
.play-head { display: flex; align-items: center; gap: 10px; }
.play-meta { flex: 1; display: flex; flex-direction: column; line-height: 1.2; }
.play-meta span { color: var(--muted); font-size: .82rem; }
.qcount { font-size: .9rem; color: var(--muted); }
.qcount b { color: var(--ink); font-family: var(--display); font-size: 1.1rem; }
.qcard, .reveal { margin-top: 16px; padding: 24px 20px; box-shadow: var(--shadow); }
.swap-in { animation: swapIn .45s cubic-bezier(.2, .9, .3, 1); }
.q-tags { display: flex; gap: 6px; margin-bottom: 14px; }
.q-img { width: 100%; max-height: 220px; object-fit: cover; border-radius: var(--r); margin-bottom: 14px; }
.q-text { font-size: clamp(1.3rem, 4.6vw, 1.7rem); font-weight: 700; letter-spacing: -.015em; }
.q-text.sm { font-size: 1.05rem; font-weight: 600; color: var(--ink-2); text-align: center; margin: 4px 0 12px; }
.q-context { color: var(--muted); font-size: .9rem; margin-top: -2px; }
.guess-display { display: flex; justify-content: center; align-items: baseline; margin: 18px 0 4px; }
.guess-input { width: 2.2ch; min-width: 1.2ch; transition: width .1s; font-family: var(--display); font-weight: 800; font-size: clamp(4.2rem, 16vw, 5.6rem); line-height: 1; border: 0; background: transparent; color: var(--ink); text-align: center; padding: 0; letter-spacing: -.04em; font-variant-numeric: tabular-nums; -moz-appearance: textfield; border-radius: 18px; }
.guess-input::-webkit-outer-spin-button, .guess-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.guess-input:focus { outline: none; background: var(--primary-soft); }
.guess-display .pct { font-family: var(--display); font-weight: 800; font-size: 2.6rem; color: var(--primary); margin-left: 2px; }
.slider-wrap { padding: 34px 6px 6px; }
.slider { position: relative; height: 48px; cursor: pointer; touch-action: none; display: flex; align-items: center; -webkit-tap-highlight-color: transparent; }
.slider-track { position: relative; width: 100%; height: 16px; border-radius: 12px; background: var(--bg-2); box-shadow: inset 0 2px 3px rgba(0,0,0,.06); overflow: hidden; }
.slider-fill { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, var(--primary-2), var(--primary)); border-radius: 12px 0 0 12px; }
.tick { position: absolute; top: 4px; bottom: 4px; width: 2px; margin-left: -1px; background: color-mix(in srgb, var(--ink) 14%, transparent); border-radius: 1px; }
.tick.major { top: 2px; bottom: 2px; background: color-mix(in srgb, var(--ink) 24%, transparent); }
.slider-thumb { position: absolute; top: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%; background: var(--surface); border: 3px solid var(--primary); box-shadow: 0 6px 16px -4px rgba(255, 106, 61, .55); display: grid; place-items: center; transition: transform .15s cubic-bezier(.3, 1.6, .5, 1); pointer-events: none; }
.slider-thumb .paw { font-size: 18px; }
.slider-bubble { position: absolute; bottom: calc(100% + 10px); left: 50%; transform: translateX(-50%) scale(.85); opacity: 0; background: var(--ink); color: var(--bg); padding: 4px 10px; border-radius: 14px; font-weight: 800; font-family: var(--display); font-size: .95rem; white-space: nowrap; transition: all .15s; }
.slider-bubble::after { content: ""; position: absolute; top: 100%; left: 50%; margin-left: -5px; border: 5px solid transparent; border-top-color: var(--ink); }
.slider.active .slider-thumb, .slider:focus-visible .slider-thumb { transform: scale(1.12); }
.slider.active .slider-bubble, .slider:focus-visible .slider-bubble { opacity: 1; transform: translateX(-50%) scale(1); }
.slider:focus-visible { outline: none; }
.slider-scale { display: flex; justify-content: space-between; font-size: .75rem; color: var(--muted); font-weight: 600; padding: 2px 0 0; }
.fine { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 14px 0 20px; }
.fine .muted { flex: 1; text-align: center; }
.fine-btn { min-width: 46px; height: 40px; border-radius: 18px; border: 1.5px solid var(--line-2); background: var(--surface); font-weight: 700; cursor: pointer; transition: all .15s; }
.fine-btn:hover { border-color: var(--primary); color: var(--primary); }
.fine-btn:active { transform: scale(.94); }

/* reveal */
.reveal { text-align: left; border-top: 6px solid var(--t); }
.reward { text-align: center; margin-bottom: 8px; }
.reward-badge { position: relative; width: 104px; height: 104px; margin: 0 auto 10px; border-radius: 32px; display: grid; place-items: center; background: var(--ts); animation: badgeIn .7s cubic-bezier(.2, 1.6, .4, 1) both; box-shadow: inset 0 -5px 0 color-mix(in srgb, var(--t) 22%, transparent); }
.reward-emoji { font-size: 56px; line-height: 1; animation: wiggle 1s .5s ease-in-out; }
.reward-title { font-size: 1.8rem; font-weight: 800; color: color-mix(in srgb, var(--t) 85%, var(--ink)); margin: 0; animation: fadeUp .5s .2s both; }
.reward-sub { color: var(--muted); margin: 2px 0 6px; animation: fadeUp .5s .3s both; }
.reveal.t-purrfect { background: radial-gradient(100% 70% at 50% 0%, var(--t-purrfect-soft), var(--surface) 70%); border-top-color: var(--t-purrfect); }
.reveal.t-purrfect .reward-badge { background: linear-gradient(145deg, #FFE27A, #F2B100); box-shadow: 0 0 0 8px var(--t-purrfect-soft), 0 0 50px 10px rgba(242, 177, 0, .45); animation: badgeIn .8s cubic-bezier(.2, 1.6, .4, 1) both, glow 2s 1s ease-in-out infinite; }
.reveal.t-purrfect .reward-title { background: linear-gradient(90deg, #C98A00, #F2B100, #FF6A3D, #C98A00); background-size: 300% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: fadeUp .5s .2s both, shimmer 3s linear infinite; font-size: 2.2rem; }
.crown { position: absolute; top: -22px; right: -14px; font-size: 34px; animation: crownDrop .8s .4s cubic-bezier(.2, 1.6, .4, 1) both; transform-origin: bottom; }
.reveal-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 18px 0 10px; }
.reveal-stats > div { background: var(--surface-2); border: 1px solid var(--line); border-radius: 20px; padding: 10px; text-align: center; }
.reveal-stats small { display: block; color: var(--muted); font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.reveal-stats b { font-family: var(--display); font-size: 1.6rem; font-weight: 800; }
.reveal-stats .answer-num { color: color-mix(in srgb, var(--t) 85%, var(--ink)); }
.reveal-stats .unit { font-size: .9rem; color: var(--muted); }
.direction { text-align: center; font-weight: 600; }
.explain { background: var(--surface-2); border-radius: 20px; padding: 14px 16px; margin: 14px 0 18px; border: 1px solid var(--line); }
.explain p:last-of-type { margin-bottom: 6px; }
.source { display: inline-flex; align-items: center; gap: 4px; font-size: .85rem; font-weight: 600; color: var(--accent); text-decoration: none; }
.source .ic { width: 15px; height: 15px; }
.source:hover { text-decoration: underline; }
.report-link { display: flex; margin: 14px auto 0; color: var(--muted); gap: 4px; }
.report-link .ic { width: 14px; height: 14px; }

/* compare track */
.ctrack { position: relative; height: 66px; margin: 10px 12px 4px; }
.ctrack-bar { position: absolute; left: 0; right: 0; top: 30px; height: 10px; border-radius: 5px; background: var(--bg-2); }
.ctrack-gap { position: absolute; top: 0; bottom: 0; background: color-mix(in srgb, var(--t) 45%, transparent); border-radius: 5px; }
.ctrack.anim .ctrack-gap { animation: gapIn .7s .25s cubic-bezier(.3, 1, .3, 1) both; transform-origin: left; }
.ctrack-mark { position: absolute; top: 0; height: 100%; width: 0; }
.ctrack-mark::before { content: ""; position: absolute; left: -9px; top: 26px; width: 18px; height: 18px; border-radius: 50%; border: 3px solid var(--surface); box-shadow: var(--shadow-sm); }
.ctrack-mark span { position: absolute; left: 0; transform: translateX(-50%); font-size: .74rem; font-weight: 800; white-space: nowrap; padding: 1px 7px; border-radius: 12px; }
.ctrack-mark.guess::before { background: var(--ink-2); }
.ctrack-mark.guess span { bottom: 0; color: var(--ink-2); }
.ctrack-mark.answer::before { background: var(--t); width: 22px; height: 22px; left: -11px; top: 24px; }
.ctrack-mark.answer span { top: 0; background: var(--t); color: #fff; }
.ctrack-mark.extra::before { background: var(--accent); width: 12px; height: 12px; left: -6px; top: 29px; }
.ctrack-mark.extra span { bottom: -16px; color: var(--accent); }
.ctrack.anim .ctrack-mark.answer { animation: dropIn .5s .1s cubic-bezier(.2, 1.6, .4, 1) both; }

/* ============ results ============ */
.results-hero { text-align: center; padding: 28px 20px; background: radial-gradient(120% 80% at 50% 0%, var(--primary-soft), var(--surface) 65%); box-shadow: var(--shadow); }
.score-ring { width: 196px; height: 196px; margin: 14px auto 12px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--surface); box-shadow: 0 0 0 10px var(--primary-soft), var(--shadow); }
.score-ring .big-num { font-size: 4.6rem; }
.score-ring small { font-weight: 700; color: var(--ink-2); }
.score-ring .of { font-size: .78rem; color: var(--muted); }
.avg { font-size: 1.05rem; }
.pb-badge { display: inline-block; padding: 6px 14px; border-radius: var(--r-pill); background: var(--t-purrfect-soft); color: color-mix(in srgb, var(--t-purrfect) 70%, var(--ink)); font-weight: 800; margin-bottom: 12px; animation: badgeIn .6s .6s cubic-bezier(.2, 1.6, .4, 1) both; }
.rank-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0 16px; }
.rank-box { display: flex; flex-direction: column; align-items: center; padding: 12px 6px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; }
.rank-box small { color: var(--muted); font-weight: 600; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; }
.rank-box b { font-family: var(--display); font-size: 1.6rem; font-weight: 800; }
.rank-box span { font-size: .78rem; color: var(--muted); }
.tier-break { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.tb { display: flex; flex-direction: column; align-items: center; padding: 10px 2px; border-radius: 18px; background: var(--ts); }
.tb.zero { opacity: .45; }
.tb-e { font-size: 1.15rem; }
.tb b { font-family: var(--display); font-size: 1.4rem; line-height: 1.1; color: color-mix(in srgb, var(--t) 80%, var(--ink)); }
.tb small { font-size: .62rem; font-weight: 700; line-height: 1.2; text-align: center; color: color-mix(in srgb, var(--t) 70%, var(--ink)); }
.history-note { margin: 14px 0 0; color: var(--ink-2); font-size: .92rem; }
.hero-reacts { display: flex; justify-content: center; margin-top: 14px; }
.share-preview { background: var(--surface-2); border: 1px dashed var(--line-2); border-radius: 18px; padding: 12px 14px; font: 500 .9rem/1.55 var(--font); white-space: pre-wrap; margin: 0 0 12px; }
.share-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.share-img { width: 100%; border-radius: 20px; display: block; }
.breakdown { list-style: none; margin: 0; padding: 0; }
.breakdown > li { border-bottom: 1px solid var(--line); }
.breakdown > li:last-child { border-bottom: 0; }
.breakdown details summary { display: flex; align-items: center; gap: 12px; padding: 12px 2px; cursor: pointer; list-style: none; }
.breakdown summary::-webkit-details-marker { display: none; }
.bd-n { flex: none; width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; font-weight: 800; font-size: .85rem; background: var(--ts); color: color-mix(in srgb, var(--t) 80%, var(--ink)); }
.bd-q { flex: 1; font-weight: 600; font-size: .94rem; min-width: 0; }
.bd-err { flex: none; display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; }
.bd-err b { font-family: var(--display); font-size: 1.2rem; }
.breakdown details[open] { padding-bottom: 12px; }
.bd-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.breakdown.cards > li { border: 1px solid var(--line); margin-bottom: 12px; }
.bd-top { display: flex; align-items: flex-start; gap: 10px; }

/* reactions */
.reacts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.react { display: inline-flex; align-items: center; gap: 4px; height: 32px; padding: 0 9px; border-radius: var(--r-pill); border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; font-size: 1rem; filter: grayscale(.6); opacity: .65; transition: all .15s; }
.react:hover { filter: none; opacity: 1; transform: translateY(-1px); }
.react.has { filter: none; opacity: 1; background: var(--surface-2); }
.react.mine { border-color: var(--primary); background: var(--primary-soft); }
.react span { font-size: .78rem; font-weight: 700; }
.react.pop { animation: pop .3s; }

/* ============ leaderboard ============ */
.lb-controls { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; align-items: center; }
.lb-controls .seg { margin-bottom: 6px; }
.date-nav { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 4px 0; }
.date-nav > div { display: flex; flex-direction: column; align-items: center; min-width: 140px; line-height: 1.2; }
.lb-card { padding: 8px; }
.lb-list { list-style: none; margin: 0; padding: 0; }
.lb-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 20px; cursor: pointer; transition: background .15s; }
.lb-row:hover { background: var(--surface-2); }
.lb-row.me { background: var(--primary-soft); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--primary) 40%, transparent); }
.lb-row .rank { width: 28px; text-align: center; font-weight: 800; font-family: var(--display); color: var(--muted); font-size: 1rem; }
.lb-row.top .rank { font-size: 1.35rem; }
.who { flex: 1; min-width: 0; display: flex; flex-direction: column; text-decoration: none; line-height: 1.25; }
.who b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who small { color: var(--muted); font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.you { display: inline-block; padding: 0 6px; border-radius: 10px; background: var(--primary); color: #fff; font-size: .65rem; vertical-align: 2px; }
.lb-score { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.15; }
.lb-score b { font-family: var(--display); font-size: 1.4rem; font-weight: 800; }
.lb-score small { color: var(--muted); font-size: .72rem; white-space: nowrap; }
.lb-sep { text-align: center; color: var(--muted); font-size: .8rem; padding: 8px 0 4px; border-top: 1px dashed var(--line-2); margin-top: 6px; }

/* ============ friends & lists ============ */
.search-row { position: relative; }
.search-row .ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-row .input { padding-left: 42px; }
.user-list { list-style: none; margin: 8px 0 0; padding: 0; }
.user-list > li { display: flex; align-items: center; gap: 12px; padding: 10px 2px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.user-list > li:last-child { border-bottom: 0; }
.user-list .actions { display: flex; gap: 4px; align-items: center; }
.attention { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); background: linear-gradient(var(--accent-soft), var(--surface) 70%); }
.friends-list .today-status { flex: none; }
@media (max-width: 520px) { .friends-list > li { row-gap: 4px; } .friends-list .actions { margin-left: auto; } }

/* ============ activity ============ */
.act-list { list-style: none; margin: 0; padding: 0; }
.act { padding: 16px; }
.act.gold { background: linear-gradient(135deg, var(--t-purrfect-soft), var(--surface) 60%); }
.act-top { display: flex; gap: 12px; align-items: flex-start; }
.act-main { flex: 1; min-width: 0; }
.act-main p { margin: 0 0 2px; }
.act-tiers { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.more { text-align: center; }
.notif-list { list-style: none; padding: 6px; }
.notif-list li a { display: flex; gap: 12px; padding: 12px; border-radius: 18px; text-decoration: none; align-items: flex-start; }
.notif-list li a:hover { background: var(--surface-2); }
.notif-list li.unread a { background: var(--primary-soft); }
.notif-list small { display: block; color: var(--muted); font-size: .78rem; }
.notif-ic { font-size: 1.2rem; }

/* ============ profile ============ */
.profile-head { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.ph-info { flex: 1; min-width: 200px; }
.ph-info h1 { font-size: 1.7rem; font-weight: 800; margin: 0; }
.ph-info p { margin: 2px 0 6px; }
.bio { color: var(--ink-2); }
.ph-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 16px; }
@media (min-width: 640px) { .stat-grid { grid-template-columns: repeat(3, 1fr); } }
.stat { margin: 0; padding: 16px; display: flex; flex-direction: column; }
.stat b { font-family: var(--display); font-size: 1.8rem; font-weight: 800; line-height: 1.1; }
.stat small { color: var(--muted); font-weight: 600; font-size: .8rem; }
.stat em { font-style: normal; color: var(--muted); font-size: .75rem; margin-top: 2px; }
.tier-bars { list-style: none; padding: 0; margin: 8px 0 12px; display: flex; flex-direction: column; gap: 10px; }
.tier-bars li { display: grid; grid-template-columns: minmax(130px, auto) 1fr 40px; align-items: center; gap: 10px; font-size: .88rem; }
.tb-label { font-weight: 600; white-space: nowrap; }
.tier-bars .bar { height: 10px; border-radius: 5px; background: var(--ts); overflow: hidden; }
.tier-bars .bar i { display: block; height: 100%; background: var(--t); border-radius: 5px; transition: width .8s cubic-bezier(.2, 1, .3, 1); }
.tier-bars b { text-align: right; font-family: var(--display); }
.spark { display: flex; align-items: flex-end; gap: 3px; height: 110px; margin: 10px 0 12px; }
.spark-bar { flex: 1; height: var(--h); min-width: 4px; background: linear-gradient(var(--primary-2), var(--primary)); border-radius: 6px 6px 2px 2px; position: relative; opacity: .85; transition: opacity .15s; }
.spark-bar:hover { opacity: 1; }
.spark-bar span { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); font-size: .65rem; font-weight: 700; opacity: 0; transition: opacity .15s; color: var(--ink-2); }
.spark-bar:hover span { opacity: 1; }
.hist-list { list-style: none; padding: 0; margin: 0; }
.hist-list a { display: flex; gap: 8px; align-items: baseline; padding: 6px 0; border-top: 1px solid var(--line); text-decoration: none; font-size: .9rem; }
.hist-list a span { flex: 1; color: var(--ink-2); }
.hist-list b { font-family: var(--display); }
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.ach { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 14px 10px; border-radius: 20px; background: var(--surface-2); border: 1px solid var(--line); opacity: .55; filter: grayscale(1); }
.ach.on { opacity: 1; filter: none; background: linear-gradient(160deg, var(--t-purrfect-soft), var(--surface)); border-color: color-mix(in srgb, var(--t-purrfect) 30%, var(--line)); }
.ach-i { font-size: 1.9rem; margin-bottom: 4px; }
.ach b { font-size: .88rem; line-height: 1.2; }
.ach small { color: var(--muted); font-size: .72rem; line-height: 1.3; margin-top: 3px; }
.friend-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.fchip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px 4px 4px; border-radius: var(--r-pill); background: var(--surface-2); border: 1px solid var(--line); text-decoration: none; font-size: .88rem; font-weight: 600; }
.h2h-mini { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.h2h-mini span { flex: 1; }
.rec .w, .h2h-score .w { color: var(--t-clawsome); }
.rec .l, .h2h-score .l { color: var(--t-catastrophe); }
.ach-unlock { text-align: center; position: relative; padding: 10px 0 0; }
.ach-icon { position: relative; font-size: 64px; width: 120px; height: 120px; margin: 0 auto 12px; border-radius: 36px; display: grid; place-items: center; background: linear-gradient(145deg, var(--t-purrfect-soft), var(--primary-soft)); animation: badgeIn .8s cubic-bezier(.2, 1.6, .4, 1) both; }
.ach-burst { position: absolute; left: 50%; top: 70px; width: 220px; height: 220px; margin: -110px 0 0 -110px; background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--t-purrfect) 30%, transparent) 0 10deg, transparent 10deg 20deg); border-radius: 50%; animation: spin 12s linear infinite; mask: radial-gradient(circle, #000 30%, transparent 70%); -webkit-mask: radial-gradient(circle, #000 30%, transparent 70%); }

/* settings */
.av-editor { display: flex; gap: 20px; flex-wrap: wrap; align-items: flex-start; margin-bottom: 14px; }
.av-preview { flex: none; }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 40px); gap: 6px; margin-bottom: 10px; }
@media (max-width: 420px) { .emoji-grid { grid-template-columns: repeat(6, 40px); } }
.emoji-opt { width: 40px; height: 40px; border-radius: 18px; border: 1.5px solid var(--line); background: var(--surface); font-size: 1.3rem; cursor: pointer; }
.emoji-opt.on { border-color: var(--primary); background: var(--primary-soft); }
.color-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.color-opt { width: 32px; height: 32px; border-radius: 50%; background: var(--c); border: 3px solid var(--surface); box-shadow: 0 0 0 1.5px var(--line-2); cursor: pointer; }
.color-opt.on { box-shadow: 0 0 0 3px var(--ink); }

/* h2h & day */
.h2h-head { display: flex; align-items: center; justify-content: space-around; gap: 10px; padding: 24px 12px; }
.h2h-side { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.h2h-side b { font-size: .9rem; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.h2h-score { display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 6px; font-family: var(--display); font-weight: 800; font-size: 3rem; line-height: 1; }
.h2h-score .dash { color: var(--muted); }
.h2h-score small { flex-basis: 100%; text-align: center; font-family: var(--font); font-size: .8rem; color: var(--muted); font-weight: 600; margin-top: 6px; }
.h2h-list { list-style: none; padding: 0; margin: 0; }
.h2h-list li, .h2h-list li > a { display: flex; align-items: center; gap: 10px; }
.h2h-list li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.h2h-list li > a { flex: 1; text-decoration: none; }
.h2h-list li:last-child { border-bottom: 0; }
.h2h-list span:first-child { flex: 1; display: flex; flex-direction: column; font-weight: 600; }
.h2h-list small { color: var(--muted); font-weight: 400; font-size: .78rem; }
.h2h-totals b { font-family: var(--display); font-size: 1.1rem; }
.h2h-totals b.win { color: var(--t-clawsome); }
.day-head { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.day-head > div { flex: 1; min-width: 180px; }
.day-head h1 { font-size: 1.4rem; margin: 0; }
.day-head p { margin: 0; }

/* ============ admin ============ */
.admin-toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.admin-toolbar .input { flex: 1 1 160px; width: auto; }
.qa { padding: 16px; }
.qa.past { opacity: .7; }
.qa-top { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px; }
.qa-text { font-weight: 600; margin-bottom: 4px; }
.qa-ans { font-family: var(--display); font-size: 1.1rem; color: var(--primary); }
.qa-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.qa blockquote { margin: 6px 0; padding: 8px 12px; border-left: 3px solid var(--primary); background: var(--surface-2); border-radius: 0 14px 14px 0; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 160px; margin-top: 12px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; gap: 4px; }
.bar-stack { position: relative; flex: 1; width: 100%; max-width: 32px; }
.bar-stack i { position: absolute; bottom: 0; left: 0; right: 0; border-radius: 10px 10px 2px 2px; }
.bar-stack i.started { background: var(--accent-soft); }
.bar-stack i.done { background: var(--accent); }
.bar-col small { font-size: .68rem; color: var(--muted); }
.lg-dot { display: inline-block; width: 10px; height: 10px; border-radius: 4px; vertical-align: -1px; margin-left: 8px; }
.lg-dot.started { background: var(--accent-soft); } .lg-dot.done { background: var(--accent); }
.cat-list { list-style: none; padding: 0; margin: 8px 0 0; columns: 2; font-size: .88rem; }
.cat-list li { display: flex; justify-content: space-between; padding: 3px 8px 3px 0; break-inside: avoid; }
.sday { padding: 14px 16px; }
.sday.today { border-color: var(--primary); }
.sday.past { opacity: .65; }
.sday-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.sday-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.sday-qs { list-style: none; padding: 0; margin: 10px 0 0; font-size: .86rem; }
.sday-qs li { display: flex; gap: 6px; align-items: center; padding: 4px 0; border-top: 1px solid var(--line); }
.sq-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-list { list-style: none; padding: 0; margin: 10px 0 0; max-height: 50vh; overflow: auto; font-size: .88rem; }
.pick-list label { display: flex; gap: 6px; align-items: center; padding: 6px 4px; border-bottom: 1px solid var(--line); cursor: pointer; }
.preview-list { padding-left: 0; list-style: none; }
.preview-list li { padding: 10px 0; border-bottom: 1px solid var(--line); }

/* ============ animation ============ */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes breathe { 50% { transform: scale(1.08); } }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } }
@keyframes swapIn { from { opacity: 0; transform: translateY(16px) scale(.98); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } }
@keyframes badgeIn { 0% { opacity: 0; transform: scale(.3) rotate(-15deg); } 100% { opacity: 1; transform: none; } }
@keyframes wiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-12deg); } 75% { transform: rotate(12deg); } }
@keyframes glow { 50% { box-shadow: 0 0 0 12px var(--t-purrfect-soft), 0 0 70px 20px rgba(242, 177, 0, .6); } }
@keyframes shimmer { to { background-position: 300% 0; } }
@keyframes crownDrop { from { opacity: 0; transform: translateY(-30px) rotate(-30deg); } }
@keyframes gapIn { from { transform: scaleX(0); } }
@keyframes dropIn { from { opacity: 0; transform: translateY(-14px); } }
@keyframes pulse { 50% { opacity: .35; } }
@keyframes pop { 50% { transform: scale(1.3); } }
@keyframes demoSlide { 0%, 100% { width: 30%; } 50% { width: 71%; } }
@keyframes demoThumb { 0%, 100% { left: 30%; } 50% { left: 71%; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }

/* ============ pixel cats ============ */
:root { --arcade: "Press Start 2P", ui-monospace, monospace; --pixel: var(--arcade);
  --tier-starter: #8B68AC; --tier-bronze: #C08A5B; --tier-silver: #8C97AE; --tier-gold: #C99A22; --tier-rare: #6F8FD0; --tier-legendary: #D0679A; }
.pcat, .pix { image-rendering: pixelated; image-rendering: crisp-edges; display: block; }
.av { overflow: hidden; align-items: end; }
.av .av-img { width: 92%; height: auto; max-width: none; margin-bottom: -6%; }
.cat-mini { width: 36px; height: 44px; }
.cat-mid { width: 54px; height: 66px; }
.cat-big { width: 90px; height: 110px; }
.idle { animation: catIdle 1.6s steps(2) infinite; }
.hop { animation: catHop 1.2s steps(6) infinite; }
@keyframes catIdle { 50% { transform: translateY(3px); } }
@keyframes catHop { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-14px); } }
.tier-starter { --tc: var(--tier-starter); } .tier-bronze { --tc: var(--tier-bronze); } .tier-silver { --tc: var(--tier-silver); }
.tier-gold { --tc: var(--tier-gold); } .tier-rare { --tc: var(--tier-rare); } .tier-legendary { --tc: var(--tier-legendary); }
.tier-badge { display: inline-block; font: 400 .58rem/1 var(--arcade); text-transform: uppercase; letter-spacing: .04em; padding: 5px 7px 4px; color: #fff; background: var(--tc, var(--tier-bronze)); box-shadow: inset 0 -2px 0 rgba(0,0,0,.25), 0 0 0 2px color-mix(in srgb, var(--tc, var(--tier-bronze)) 40%, transparent); border-radius: 4px; vertical-align: 2px; }
.tier-badge.tier-legendary { background: linear-gradient(90deg, #FF3D8B, #FFB020, #7C5CFF); background-size: 200% 100%; animation: shimmer 3s linear infinite; }

/* home + results cats */
.hero-card .hero-cat { position: absolute; right: 18px; top: 52px; z-index: 1; display: flex; flex-direction: column; align-items: center; text-decoration: none; }
.hero-card .hero-cat .cat-big { width: 72px; height: 88px; }
.hero-cat span { font: 400 .58rem var(--arcade); color: #FFC531; text-shadow: 1px 1px 0 #8A4B00, 2px 2px 0 rgba(27, 11, 79, .35); margin-top: 4px; letter-spacing: .02em; }
.hero-card .hero-title, .hero-card > p.muted { padding-right: 84px; }
@media (max-width: 420px) { .hero-card .hero-cat .cat-big { width: 54px; height: 66px; } .hero-card .hero-title, .hero-card > p.muted { padding-right: 62px; } }
.results-cat { display: flex; justify-content: center; margin: 4px 0 -18px; position: relative; z-index: 1; }
.cat-reward { position: absolute; inset: 6px auto auto 50%; transform: translateX(-50%); width: 72px; height: 88px; }
.reward-badge { overflow: visible; }
.reward-badge .reward-emoji { position: absolute; right: -4px; bottom: -4px; font-size: 30px; z-index: 2; }
.ach-icon { position: relative; }
.ach-cat { position: absolute; right: -26px; bottom: -10px; }

/* yarn stage */
.qcard.yarn-host { padding: 14px; display: flex; justify-content: center; background: #1B1426; border-color: #1B1426; min-height: 200px; align-items: center; }
.yarn-stage { position: relative; width: 100%; display: flex; flex-direction: column; align-items: center; cursor: pointer; animation: fadeUp .2s; user-select: none; -webkit-user-select: none; }
.yarn-stage canvas { image-rendering: pixelated; max-width: 100%; border-radius: 10px; box-shadow: 0 0 0 3px #3a3150; }
.yarn-stage.out { opacity: 0; transition: opacity .18s; }
.yarn-caption { position: absolute; top: 10px; left: 0; right: 0; text-align: center; pointer-events: none; }
.yarn-caption span { font: 400 clamp(.7rem, 3vw, 1rem)/1 var(--arcade); color: #fff; text-shadow: 2px 2px 0 #1B1426, -2px 2px 0 #1B1426, 2px -2px 0 #1B1426, -2px -2px 0 #1B1426; opacity: 0; animation: yarnCap 3s steps(1) forwards; }
.yarn-stage.t-purrfect .yarn-caption span { color: #FFE45C; } .yarn-stage.t-clawsome .yarn-caption span { color: #8CF5C8; }
.yarn-stage.t-sharp .yarn-caption span { color: #A8C8FF; } .yarn-stage.t-close .yarn-caption span { color: #DCC2FF; } .yarn-stage.t-catastrophe .yarn-caption span { color: #FFB3C1; }
@keyframes yarnCap { 0% { opacity: 0; } 33% { opacity: 1; } 100% { opacity: 1; } }
.yarn-skip { margin-top: 10px; font: 800 0.825rem var(--ui); color: #cfc6e8; background: #2a2340; border: 2px solid #4a4068; padding: 7px 10px; border-radius: 6px; cursor: pointer; }
.yarn-skip:hover { color: #fff; border-color: #fff; }
.yarn-legend { display: flex; align-items: flex-end; justify-content: space-around; gap: 6px; padding: 10px; background: #1B1426; border-radius: 18px; }
.yarn-legend figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.yarn-legend img { width: 68px; height: 68px; }
.yarn-legend figcaption { font: 400 .5rem var(--arcade); color: #cfc6e8; }
@media (max-width: 420px) { .yarn-legend img { width: 52px; height: 52px; } }

/* collection */
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.cat-hero { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; border-top: 5px solid var(--tc); }
.cat-stage { position: relative; width: 150px; height: 150px; flex: none; display: grid; place-items: end center; padding-bottom: 18px; border-radius: 18px; background: linear-gradient(#2E2A55 0 70%, #8F633C 70% 100%); box-shadow: inset 0 0 0 3px #1B1426; overflow: hidden; }
.cat-stage::before { content: ""; position: absolute; inset: 14px 18px auto auto; width: 18px; height: 18px; background: #FFF1A8; box-shadow: 4px 4px 0 #2E2A55; }
.cat-stage .cat-big { position: relative; }
.cat-hero-info { flex: 1; min-width: 200px; }
.cat-hero-info h2 { font-size: 1.6rem; margin: 0 0 6px; }
.collect-meter { margin: 12px 0 4px; font-size: .9rem; }
.collect-meter i { display: block; height: 12px; margin-top: 6px; background: var(--bg-2); border: 2px solid var(--ink); border-radius: 2px; overflow: hidden; }
.collect-meter i b { display: block; height: 100%; background: repeating-linear-gradient(90deg, var(--primary) 0 8px, var(--primary-2) 8px 10px); }
.cat-tier { margin-bottom: 18px; }
.cat-tier-head { display: flex; align-items: center; gap: 10px; margin: 8px 2px 10px; flex-wrap: wrap; }
.cat-tier-count { margin-left: auto; }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.cat-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 12px 10px 14px; background: var(--surface); border: 2px solid var(--line); border-radius: 18px; }
.cat-card.on { border-color: color-mix(in srgb, var(--tc) 45%, var(--line)); }
.cat-card.equipped { box-shadow: 0 0 0 3px var(--tc); }
.cat-tile { position: relative; width: 100%; display: grid; place-items: center; padding: 8px 0 4px; border-radius: 14px; background: color-mix(in srgb, var(--tc) 14%, var(--surface-2)); }
.cat-card.locked .cat-tile { background: var(--bg-2); }
.cat-card .lock { position: absolute; right: 8px; top: 6px; font-size: .9rem; }
.cat-name { font-size: .92rem; }
.cat-desc { color: var(--muted); font-size: .75rem; line-height: 1.35; min-height: 2.7em; }
.cat-prog { width: 100%; }
.cat-prog i { display: block; height: 8px; background: var(--bg-2); border-radius: 2px; overflow: hidden; border: 1px solid var(--line-2); }
.cat-prog i b { display: block; height: 100%; background: var(--tc); }
.cat-prog small { font-size: .7rem; color: var(--muted); }
.cat-shelf { display: flex; flex-wrap: wrap; gap: 8px; }
.shelf-cat { margin: 0; display: flex; flex-direction: column; align-items: center; padding: 6px 6px 4px; border-radius: 14px; background: color-mix(in srgb, var(--tc) 14%, var(--surface-2)); }
.shelf-cat.equipped { box-shadow: 0 0 0 2px var(--tc); }
.shelf-cat figcaption { font-size: .66rem; font-weight: 700; max-width: 64px; text-align: center; line-height: 1.2; }
.act-cat { margin-top: 6px; display: inline-block; padding: 4px 8px; border-radius: 14px; background: var(--surface-2); }

/* unlock modal */
.cat-unlock { position: relative; text-align: center; padding-top: 4px; overflow: hidden; }
.cu-rays { position: absolute; left: 50%; top: 80px; width: 360px; height: 360px; margin: -180px 0 0 -180px; background: repeating-conic-gradient(color-mix(in srgb, var(--tc) 35%, transparent) 0 12deg, transparent 12deg 24deg); border-radius: 50%; animation: spin 10s linear infinite; mask: radial-gradient(circle, #000 25%, transparent 68%); -webkit-mask: radial-gradient(circle, #000 25%, transparent 68%); }
.cu-stage { position: relative; height: 140px; display: grid; place-items: end center; }
.cu-cat { animation: cuDrop .7s steps(7) both, catHop 1.2s 0.8s steps(6) infinite; }
@keyframes cuDrop { 0% { transform: translateY(-120px) scale(.4); opacity: 0; } 70% { transform: translateY(6px) scale(1.05); opacity: 1; } 100% { transform: none; } }
.cu-kicker { position: relative; font: 400 .72rem/1.4 var(--arcade); color: var(--tc); margin: 12px 0 6px; animation: blink 1s steps(2) 3; }
@keyframes blink { 50% { opacity: .2; } }
.cat-unlock h3 { position: relative; font-size: 1.6rem; margin: 0 0 6px; }
.cu-how { position: relative; font-weight: 600; margin: 12px 0 4px; }

/* ============ animated cats ============ */
.acat { display: inline-block; width: 72px; height: 88px; background-repeat: no-repeat; background-size: 600% 100%; background-position: 0 0; image-rendering: pixelated; image-rendering: crisp-edges;
  animation: catIdleFrames 4.8s step-end infinite; animation-delay: var(--delay, 0s); }
.acat-xl { width: 144px; height: 176px; }
.acat-lg { width: 90px; height: 110px; }
/* strip frames: 0 sit · 1 tail · 2 blink · 3 happy · 4 jump · 5 paw  (x positions 0, 20, 40, 60, 80, 100%) */
@keyframes catIdleFrames { 0% { background-position-x: 0; } 22% { background-position-x: 20%; } 30% { background-position-x: 0; } 38% { background-position-x: 20%; } 46% { background-position-x: 0; } 78% { background-position-x: 40%; } 82% { background-position-x: 0; } 90% { background-position-x: 40%; } 92% { background-position-x: 0; } }
.acat.excited { animation: catExcitedFrames .9s step-end infinite, catBounce .9s steps(5) infinite; }
@keyframes catExcitedFrames { 0% { background-position-x: 60%; } 35% { background-position-x: 80%; } 70% { background-position-x: 100%; } }
@keyframes catBounce { 0%, 100% { transform: translateY(0); } 35% { transform: translateY(-12%); } 70% { transform: translateY(-3%); } }

/* ============ starter selection ============ */
.starter { position: relative; min-height: 100vh; overflow: hidden; display: flex; flex-direction: column; align-items: center; gap: 22px;
  padding-block: calc(env(safe-area-inset-top, 0px) + 32px) calc(env(safe-area-inset-bottom, 0px) + 32px);
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  background: linear-gradient(180deg, #23068F 0%, #4A1FD0 52%, #9B4DF5 100%); color: #FFF6E6; }
.starter-sky { position: absolute; inset: 0; pointer-events: none; }
.starter-sky i { position: absolute; width: 6px; height: 6px; background: #FFE45C; box-shadow: 0 -6px 0 #FFE45C, 0 6px 0 #FFE45C, -6px 0 0 #FFE45C, 6px 0 0 #FFE45C; opacity: .8; animation: twinkle 2.4s steps(2) infinite; }
.starter-sky i:nth-child(1) { left: 8%; top: 9%; } .starter-sky i:nth-child(2) { left: 88%; top: 14%; animation-delay: -.8s; }
.starter-sky i:nth-child(3) { left: 18%; top: 62%; animation-delay: -1.6s; } .starter-sky i:nth-child(4) { left: 92%; top: 70%; animation-delay: -.4s; }
.starter-sky i:nth-child(5) { left: 50%; top: 4%; animation-delay: -1.1s; transform: scale(.6); } .starter-sky i:nth-child(6) { left: 4%; top: 88%; animation-delay: -2s; transform: scale(.7); }
@keyframes twinkle { 50% { opacity: .15; } }
.starter-head { position: relative; text-align: center; max-width: 640px; }
.starter-kicker { font: 400 .7rem/1 var(--arcade); letter-spacing: .12em; text-transform: uppercase; color: #CDB8FF; margin: 0 0 12px; }
.starter-title { font: 400 clamp(1.7rem, 7vw, 3rem)/1.1 var(--arcade); margin: 0 0 14px; color: #FFF6E6; text-shadow: 4px 4px 0 #1B0B4F; letter-spacing: -.02em; }
.starter-title span { color: #FFC531; text-shadow: 4px 4px 0 #C2410C, 8px 8px 0 #1B0B4F; }
.starter-sub { font-size: 1.05rem; color: #E7DDFF; max-width: 52ch; margin: 0 auto; }
.starter-warn { display: inline-block; margin: 14px auto 0; padding: 8px 12px 7px; font: 400 .58rem/1.6 var(--arcade); color: #1B0B4F; background: #FFC531; border: 3px solid #1B0B4F; border-radius: 10px; box-shadow: 0 4px 0 #1B0B4F; }
.starter-confirm .sc-cat { display: flex; justify-content: center; margin: 4px 0 10px; }
.starter-cards { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; width: 100%; max-width: 980px; }
.starter-card { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 18px 16px 20px; cursor: pointer; font: inherit; color: inherit;
  background: rgba(23, 8, 74, .55); border: 4px solid #1B0B4F; border-radius: 20px; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .08), 0 8px 0 #1B0B4F;
  transition: transform .18s cubic-bezier(.3, 1.6, .5, 1), box-shadow .2s, background .2s; -webkit-tap-highlight-color: transparent; }
.starter-card:hover, .starter-card:focus-visible { transform: translateY(-4px) scale(1.03); background: rgba(40, 16, 120, .7); outline: none; box-shadow: inset 0 0 0 2px var(--accent), 0 0 28px -4px var(--accent), 0 10px 0 #1B0B4F; }
.starter-card:hover .acat, .starter-card.selected .acat { animation: catExcitedFrames .9s step-end infinite, catBounce .9s steps(5) infinite; }
.starter-card.selected { transform: translateY(-6px) scale(1.05); background: rgba(52, 22, 150, .85); border-color: var(--accent); box-shadow: 0 0 0 4px #1B0B4F, 0 0 44px 2px var(--accent), 0 12px 0 #1B0B4F; }
.starter-stage { position: relative; width: 100%; display: grid; place-items: end center; padding: 10px 0 14px; border-radius: 18px;
  background: radial-gradient(60% 55% at 50% 60%, color-mix(in srgb, var(--accent) 35%, transparent), transparent 70%); }
.starter-floor { position: absolute; bottom: 8px; width: 120px; height: 10px; background: rgba(10, 2, 40, .45); clip-path: polygon(8% 0, 92% 0, 100% 50%, 92% 100%, 8% 100%, 0 50%); }
.starter-stage .acat { position: relative; z-index: 1; }
.starter-kind { font: 800 0.825rem/1 var(--ui); letter-spacing: 0; text-transform: uppercase; color: var(--accent); }
.starter-name { font: 400 1.15rem/1.2 var(--arcade); color: #FFF6E6; text-shadow: 3px 3px 0 #1B0B4F; margin: 4px 0 2px; }
.starter-trait { font-weight: 700; font-size: .85rem; color: #FFE45C; }
.starter-bio { font-size: .9rem; color: #DCD0FA; line-height: 1.45; }
.starter-check { position: absolute; top: -14px; left: 50%; transform: translateX(-50%) scale(.6); opacity: 0; font: 400 .55rem/1 var(--arcade); padding: 7px 10px 6px; color: #1B0B4F; background: var(--accent); border: 3px solid #1B0B4F; border-radius: 10px; transition: all .2s cubic-bezier(.3, 1.6, .5, 1); white-space: nowrap; }
.starter-card.selected .starter-check { opacity: 1; transform: translateX(-50%) scale(1); }
.starter-cta { position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; width: 100%; max-width: 520px; }
.starter-go { width: 100%; font-family: var(--ui); font-size: 1.275rem; letter-spacing: 0; padding: 20px 24px; border: 4px solid #1B0B4F; border-radius: 18px; box-shadow: 0 6px 0 #1B0B4F; font-weight: 800; }
.starter-go:not(:disabled):hover { transform: translateY(-2px); box-shadow: 0 8px 0 #1B0B4F; }
.starter-go:disabled { background: #6B5AA8; color: #D7CCF5; opacity: 1; box-shadow: 0 6px 0 #1B0B4F; }
.starter-note { font-size: .82rem; color: #CDB8FF; margin: 0; }
.starter.done .starter-card:not(.chosen) { opacity: .35; transform: scale(.94); }
.starter-card.chosen { animation: chosenPop .6s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes chosenPop { 40% { transform: translateY(-14px) scale(1.12); } }
@media (max-width: 760px) {
  .starter { gap: 18px; padding-block: calc(env(safe-area-inset-top, 0px) + 22px) calc(env(safe-area-inset-bottom, 0px) + 24px); }
  .starter-cards { grid-template-columns: 1fr; gap: 12px; max-width: 460px; }
  .starter-card { display: grid; grid-template-columns: 104px 1fr; grid-template-areas: "stage kind" "stage name" "stage trait" "stage bio"; text-align: left; align-items: start; column-gap: 14px; row-gap: 2px; padding: 12px 14px; }
  .starter-stage { grid-area: stage; align-self: center; padding: 4px 0 10px; }
  .starter-stage .acat { width: 72px; height: 88px; }
  .starter-floor { width: 64px; height: 6px; bottom: 6px; }
  .starter-kind { grid-area: kind; margin-top: 4px; } .starter-name { grid-area: name; font-size: .95rem; } .starter-trait { grid-area: trait; } .starter-bio { grid-area: bio; font-size: .84rem; }
  .starter-check { top: 10px; left: auto; right: 10px; transform: scale(.6); }
  .starter-card.selected .starter-check { transform: scale(1); }
  .starter-card:hover, .starter-card:focus-visible, .starter-card.selected { transform: scale(1.02); }
  .starter-cta { position: sticky; bottom: 0; z-index: 2; margin-bottom: calc(-1 * (env(safe-area-inset-bottom, 0px) + 24px)); padding: 14px 0 calc(env(safe-area-inset-bottom, 0px) + 16px); background: linear-gradient(transparent, #8F45EE 30%); }
  .starter-note { font-size: .75rem; color: #EFE7FF; }
}
@media (prefers-reduced-motion: reduce) { .acat, .starter-card .acat { animation: none !important; } .starter-sky i { animation: none; } }

/* =====================================================================
   8-BIT SKIN — chunky outlines, hard shadows, pixel type.
   Same colours as before; only shape, type and depth change.
   ===================================================================== */
:root {
  --px-ink: #E3D8F0; --px-b: 2px;
  --shadow-sm: 0 2px 0 var(--px-ink); --shadow: 0 3px 0 var(--px-ink), 0 14px 28px -18px rgba(72, 48, 110, .3); --shadow-lg: 0 4px 0 var(--px-ink), 0 30px 60px -24px rgba(72, 48, 110, .4);
  --bg-dots: none;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --px-ink: #3E3350; } }
:root[data-theme="dark"] { --px-ink: #3E3350; }

body { background-color: var(--bg); background-image: var(--bg-dots); }
h1, h2, h3, h4 { font-family: var(--ui); font-weight: 800; letter-spacing: 0; line-height: 1.4; }
h3 { font-size: .78rem; }
.page-title { font-size: clamp(1rem, 3.4vw, 1.4rem); line-height: 1.45; text-shadow: 3px 3px 0 color-mix(in srgb, var(--primary) 30%, transparent); margin-bottom: .9rem; }
.eyebrow { font-family: var(--arcade); font-size: .55rem; letter-spacing: .08em; line-height: 1.6; }
.muted.small, .small.muted { line-height: 1.55; }

/* brand */
.wordmark { gap: 10px; }
.wordmark span { font-family: var(--arcade); font-weight: 400; font-size: .92rem; letter-spacing: -.02em; }
.wordmark b { font-weight: 400; color: var(--primary); text-shadow: 2px 2px 0 color-mix(in srgb, var(--primary) 30%, transparent); }
.logo-mark { width: 32px; height: 32px; }

/* chrome */
.topbar { border-bottom: var(--px-b) solid var(--px-ink); background: var(--bg); backdrop-filter: none; -webkit-backdrop-filter: none; }
.bottomnav { border-top: var(--px-b) solid var(--px-ink); background: var(--surface); backdrop-filter: none; -webkit-backdrop-filter: none; }
.nav-link { font-family: var(--ui); font-size: 0.66rem; font-weight: 800; letter-spacing: 0; }
.bottomnav .nav-link.active::before { width: 34px; height: 5px; border-radius: 0; background: var(--primary); box-shadow: 0 0 0 2px var(--px-ink); }
.badge { border-radius: 6px; font-family: var(--ui); font-size: 0.75rem; box-shadow: 0 0 0 2px var(--px-ink); font-weight: 800; }
.dot { border-radius: 2px; border: 2px solid var(--px-ink); }
@media (min-width: 960px) {
  .sidenav { border-right: var(--px-b) solid var(--px-ink); background: var(--surface-2); }
  .side-links .nav-link { font-size: .6rem; padding: 13px 14px; border: var(--px-b) solid transparent; border-radius: 12px; }
  .side-links .nav-link:hover { background: var(--bg-2); border-color: var(--px-ink); }
  .side-links .nav-link.active { background: var(--primary-soft); color: var(--primary); border-color: var(--px-ink); box-shadow: 0 4px 0 var(--px-ink); }
  .side-me { border: var(--px-b) solid var(--px-ink); border-radius: 12px; background: var(--surface); box-shadow: 0 4px 0 var(--px-ink); }
  .side-me b { font-family: var(--ui); font-weight: 800; font-size: 0.9rem; line-height: 1.5; }
}

/* surfaces */
.card { border: var(--px-b) solid var(--px-ink); border-radius: 18px; box-shadow: 0 5px 0 var(--px-ink); margin-bottom: 20px; }
.grid-2 > .card { margin-bottom: 0; }
.grid-2 { margin-bottom: 20px; }
.hero-card { border-width: 4px; box-shadow: 0 7px 0 var(--px-ink); }
.hero-card::after { font-family: var(--ui); font-size: 170px; bottom: -36px; right: -6px; font-weight: 800; }
.hero-title { font-size: clamp(.95rem, 3.4vw, 1.25rem); line-height: 1.5; }
.card-head h3, .how summary h3 { font-size: .74rem; }

/* buttons */
.btn { font-family: var(--ui); font-weight: 800; font-size: 0.93rem; letter-spacing: 0; line-height: 1.4; border: var(--px-b) solid var(--px-ink); border-radius: 12px; padding: 11px 16px; box-shadow: 0 4px 0 var(--px-ink); transition: transform .06s, box-shadow .06s, background .15s; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 5px 0 var(--px-ink); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--px-ink); }
.btn:disabled { transform: none; box-shadow: 0 4px 0 var(--px-ink); }
.btn-primary { box-shadow: 0 4px 0 var(--px-ink), inset 0 -4px 0 rgba(0,0,0,.18), inset 0 3px 0 rgba(255,255,255,.25); }
.btn-primary:hover { background: color-mix(in srgb, var(--primary) 90%, #fff); box-shadow: 0 5px 0 var(--px-ink), inset 0 -4px 0 rgba(0,0,0,.18), inset 0 3px 0 rgba(255,255,255,.25); }
.btn-ghost { border-color: var(--px-ink); }
.btn-ghost:hover { border-color: var(--px-ink); background: var(--bg-2); }
.btn-danger { border-color: var(--px-ink); }
.btn-sm { font-size: .52rem; padding: 8px 11px; box-shadow: 0 3px 0 var(--px-ink); }
.btn-lg { font-size: .68rem; padding: 14px 20px; }
.btn-xl { font-size: .78rem; padding: 18px 24px; border-width: 4px; border-radius: 14px; box-shadow: 0 6px 0 var(--px-ink), inset 0 -5px 0 rgba(0,0,0,.18), inset 0 4px 0 rgba(255,255,255,.25); }
.btn-xl:active { box-shadow: 0 2px 0 var(--px-ink); transform: translateY(4px); }
.icon-btn { border-radius: 12px; }
.icon-btn:hover { background: var(--bg-2); box-shadow: inset 0 0 0 2px var(--px-ink); }
.link { font-family: var(--ui); font-weight: 800; font-size: 0.825rem; }

/* chips, pills, badges */
.chip, .tchip, .pill { font-family: var(--ui); font-weight: 800; font-size: 0.75rem; letter-spacing: 0; line-height: 1.5; border-radius: 6px; padding: 5px 8px 4px; box-shadow: inset 0 0 0 2px color-mix(in srgb, currentColor 35%, transparent); }
.pill { font-size: .58rem; padding: 7px 10px 6px; }
.tier-legend .tchip small { font-family: var(--font); font-size: .75rem; }
.tier-legend .tchip b { font-weight: 400; }
.streak-pill { border: var(--px-b) solid var(--px-ink); border-radius: 12px; box-shadow: 0 4px 0 var(--px-ink); font-family: var(--ui); font-size: 0.75rem; font-weight: 800; }
.streak-pill b { font-family: var(--ui); font-size: 1.35rem; font-weight: 800; }

/* forms */
.input, .form input:not([type=checkbox]), .form select, .form textarea, textarea.input { border: var(--px-b) solid var(--px-ink); border-radius: 12px; box-shadow: inset 0 3px 0 rgba(0,0,0,.06); }
.input:focus, .form input:focus, .form select:focus, .form textarea:focus { border-color: var(--px-ink); box-shadow: 0 0 0 3px var(--primary), inset 0 3px 0 rgba(0,0,0,.06); }
.form label { font-family: var(--ui); font-weight: 800; font-size: 0.825rem; line-height: 1.6; gap: 8px; }
.form label input, .form label select, .form label textarea { font-family: var(--font); font-size: 1rem; }
.toggle span b { font-family: var(--ui); font-weight: 800; font-size: 0.87rem; line-height: 1.6; }
.toggle small { font-family: var(--font); font-size: .82rem; }
.toggle i { border-radius: 6px; border: var(--px-b) solid var(--px-ink); width: 54px; height: 30px; }
.toggle i::after { border-radius: 2px; top: 2px; left: 2px; width: 20px; height: 20px; background: var(--surface); box-shadow: 0 0 0 2px var(--px-ink); transition: transform .12s steps(3); }
.toggle input:checked + i::after { transform: translateX(24px); }
.form-error { font-family: var(--ui); font-weight: 800; font-size: 0.825rem; line-height: 1.6; }

/* tabs */
.seg { border: var(--px-b) solid var(--px-ink); border-radius: 14px; background: var(--surface-2); padding: 4px; box-shadow: 0 4px 0 var(--px-ink); gap: 4px; }
.seg-btn { font-family: var(--ui); font-weight: 800; font-size: 0.825rem; border-radius: 10px; padding: 9px 12px; }
.seg-btn.on { background: var(--primary); color: #fff; box-shadow: inset 0 0 0 2px var(--px-ink), inset 0 -3px 0 rgba(0,0,0,.2); }
.seg-sm .seg-btn { font-size: .5rem; padding: 7px 10px; }

/* avatars: square pixel frames */
.av { border-radius: 12px; border: 2px solid var(--px-ink); box-shadow: inset 0 -3px 0 rgba(0,0,0,.15); }
.av-icon { border-radius: 12px; border: 2px solid var(--px-ink); }

/* toasts & modals */
.toast { font-family: var(--ui); font-weight: 800; font-size: 0.9rem; line-height: 1.6; border: var(--px-b) solid var(--px-ink); border-radius: 12px; box-shadow: 0 5px 0 var(--px-ink); }
.modal { border: 4px solid var(--px-ink); box-shadow: 0 8px 0 var(--px-ink); }
.modal-head h3 { font-size: .85rem; }
.confirm-guess { font-family: var(--ui); font-size: 4.5rem; font-weight: 800; }
.banner { border: var(--px-b) solid var(--px-ink); border-radius: 14px; box-shadow: 0 4px 0 var(--px-ink); }
.spinner { border-radius: 0; border: 4px solid var(--line-2); border-top-color: var(--primary); animation: spin .8s steps(8) infinite; }

/* numbers in pixel type */
.big-num { font-family: var(--ui); font-size: 3.75rem; letter-spacing: 0; line-height: 1; font-weight: 800; }
.hero-score .big-num { font-size: 2.3rem; }
.lb-score b, .stat b, .rank-box b, .tb b, .mini-board .score b, .bd-err b, .h2h-totals b, .hist-list b, .qa-ans, .tier-bars b, .qcount b { font-family: var(--ui); font-weight: 800; }
.lb-score b { font-size: 1rem; } .stat b { font-size: 1.15rem; line-height: 1.4; } .rank-box b { font-size: 1rem; line-height: 1.6; }
.tb b { font-size: .95rem; line-height: 1.5; } .mini-board .score b { font-size: .8rem; } .bd-err b { font-size: .8rem; } .qcount b { font-size: .9rem; }
.stat small, .rank-box small, .reveal-stats small { font-family: var(--ui); font-size: 0.72rem; letter-spacing: 0; line-height: 1.6; font-weight: 800; }
.stat em { font-size: .72rem; }
.tb small { font-family: var(--ui); font-size: 0.6rem; line-height: 1.5; font-weight: 800; }
.score-ring { border-radius: 20px; border: 4px solid var(--px-ink); box-shadow: 0 0 0 8px var(--primary-soft), 0 0 0 11px var(--px-ink), 0 14px 0 3px var(--px-ink); width: 190px; height: 170px; }
.score-ring .big-num { font-size: 2.8rem; }
.score-ring small { font-family: var(--ui); font-weight: 800; font-size: 0.825rem; margin-top: 10px; }
.h2h-score { font-family: var(--ui); font-size: 3rem; font-weight: 800; }
.lb-row .rank { font-family: var(--ui); font-size: 1.125rem; font-weight: 800; }

/* tiles & lists */
.rank-box, .reveal-stats > div, .explain, .stat, .tb, .tier-dot, .ach, .cat-card, .shelf-cat, .fchip, .sday, .qa, .share-preview, .auth-demo, .invite-banner, .hero-reacts .reacts { border-radius: 12px; }
.rank-box, .reveal-stats > div, .explain { border: var(--px-b) solid var(--px-ink); box-shadow: 0 4px 0 var(--px-ink); }
.tb { border: 2px solid var(--px-ink); }
.tier-dot { border-radius: 12px; border: 2px solid var(--px-ink); box-shadow: 0 3px 0 var(--px-ink); }
.ach { border: 2px solid var(--px-ink); }
.ach b { font-family: var(--ui); font-weight: 800; font-size: 0.75rem; line-height: 1.6; }
.cat-card { border: var(--px-b) solid var(--px-ink); box-shadow: 0 4px 0 var(--px-ink); }
.cat-card.on { border-color: var(--px-ink); }
.cat-card.equipped { box-shadow: 0 0 0 3px var(--tc), 0 6px 0 3px var(--px-ink); }
.cat-name { font-family: var(--ui); font-weight: 800; font-size: 0.9rem; line-height: 1.5; }
.fchip, .shelf-cat { border: 2px solid var(--px-ink); }
.fchip span { font-family: var(--ui); font-size: 0.75rem; font-weight: 800; }
.share-preview { border: 2px dashed var(--px-ink); }
.invite-row input { border: 2px dashed var(--px-ink); border-radius: 10px; }
.mini-board li, .lb-row { border-radius: 12px; border: 2px solid transparent; }
.mini-board li.me, .lb-row.me { border-color: var(--px-ink); box-shadow: 0 3px 0 var(--px-ink); }
.mini-board .name, .who b { font-family: var(--ui); font-weight: 800; font-size: 0.87rem; line-height: 1.7; }
.you { font-family: var(--ui); font-size: 0.63rem; border-radius: 4px; padding: 2px 4px; font-weight: 800; }
.user-list > li, .h2h-list li, .breakdown > li { border-bottom: 2px dashed var(--line-2); }
.breakdown.cards > li { border: var(--px-b) solid var(--px-ink); }
.bd-n { border-radius: 6px; font-family: var(--ui); font-weight: 800; font-size: 0.9rem; box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--t) 50%, transparent); }
.react { border-radius: 10px; border: 2px solid var(--px-ink); box-shadow: 0 2px 0 var(--px-ink); }
.react span { font-family: var(--ui); font-size: 0.75rem; font-weight: 800; }
.react.mine { border-color: var(--px-ink); }
.act { padding: 16px; }
.act-main p b { font-weight: 700; }
.notif-list li a { border-radius: 12px; }
.tier-bars .bar { height: 14px; border-radius: 2px; border: 2px solid var(--px-ink); }
.tier-bars .bar i { border-radius: 0; background: repeating-linear-gradient(90deg, var(--t) 0 8px, color-mix(in srgb, var(--t) 75%, #000) 8px 10px); }
.spark-bar { border-radius: 0; border: 2px solid var(--px-ink); border-bottom: 0; }
.tb-label { font-family: var(--ui); font-weight: 800; font-size: 0.75rem; }

/* progress */
.seg-progress { gap: 5px; }
.seg-progress i { height: 14px; border-radius: 4px; border: 2px solid var(--px-ink); box-shadow: inset 0 -3px 0 rgba(0,0,0,.12); }
.seg-progress.lg i { height: 16px; }
.seg-progress i.current { background: var(--ink); animation: pulse 1s steps(2) infinite; }

/* gameplay */
.qcard, .reveal { border-width: 4px; box-shadow: 0 7px 0 var(--px-ink); }
.play-meta b { font-family: var(--ui); font-weight: 800; font-size: 1.05rem; line-height: 1.6; }
.qcount { font-family: var(--ui); font-size: 0.75rem; font-weight: 800; }
.guess-input { font-family: var(--ui); font-size: clamp(3.9rem, 11vw, 5.4rem); letter-spacing: 0; padding: 6px 2px; font-weight: 800; }
.guess-display .pct { font-family: var(--ui); font-size: 2.7rem; font-weight: 800; }
.slider-track { height: 22px; border-radius: 6px; border: var(--px-b) solid var(--px-ink); box-shadow: inset 0 3px 0 rgba(0,0,0,.08); }
.slider-fill { border-radius: 0; background: repeating-linear-gradient(90deg, var(--primary) 0 10px, var(--primary-2) 10px 12px); }
.tick { top: 3px; bottom: 3px; width: 2px; border-radius: 0; }
.slider-thumb { width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 12px; border: var(--px-b) solid var(--px-ink); background: var(--surface); box-shadow: 0 4px 0 var(--px-ink); transition: transform .08s steps(2); }
.slider-bubble { font-family: var(--ui); font-weight: 800; font-size: 0.93rem; border-radius: 6px; padding: 6px 8px 5px; border: 2px solid var(--px-ink); }
.slider-scale { font-family: var(--ui); font-size: 0.675rem; font-weight: 800; padding-top: 6px; }
.fine-btn { font-family: var(--ui); font-weight: 800; font-size: 0.9rem; border: var(--px-b) solid var(--px-ink); border-radius: 12px; box-shadow: 0 3px 0 var(--px-ink); }
.fine-btn:hover { border-color: var(--px-ink); background: var(--primary-soft); color: var(--ink); }
.fine-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--px-ink); }
.fine .muted.small { font-family: var(--ui); font-size: 0.675rem; font-weight: 800; }
.q-tags .chip { font-size: .48rem; }
.q-text { font-family: var(--display); }
.reveal { border-top: 4px solid var(--px-ink); }
.reveal::before { content: ""; display: block; height: 10px; margin: -24px -20px 18px; background: var(--t); border-bottom: 3px solid var(--px-ink); border-radius: 12px 12px 0 0; }
.reward-badge { border-radius: 20px; border: 4px solid var(--px-ink); box-shadow: 0 6px 0 var(--px-ink), inset 0 -6px 0 color-mix(in srgb, var(--t) 25%, transparent); }
.reward-title { font-family: var(--arcade); font-size: 1.1rem; line-height: 1.5; text-shadow: 3px 3px 0 var(--px-ink); color: var(--t); }
.reveal.t-purrfect .reward-title { font-size: 1.25rem; text-shadow: none; filter: drop-shadow(3px 3px 0 var(--px-ink)); }
.reward-sub { font-size: .9rem; }
.reveal-stats b { font-family: var(--ui); font-weight: 800; font-size: 1.575rem; line-height: 1.7; white-space: nowrap; }
.reveal-stats > div { display: flex; flex-direction: column; justify-content: space-between; gap: 6px; }
.reveal-stats .unit { font-size: .5rem; margin-left: -2px; }
.direction { font-weight: 700; }
.source { font-family: var(--ui); font-weight: 800; font-size: 0.75rem; line-height: 1.6; }
.report-link { font-size: .48rem; }
.ctrack-bar { height: 14px; top: 28px; border-radius: 2px; border: 2px solid var(--px-ink); }
.ctrack-gap { border-radius: 0; }
.ctrack-mark::before { border-radius: 4px; border: 2px solid var(--px-ink); box-shadow: none; }
.ctrack-mark span { font-family: var(--ui); font-weight: 800; font-size: 0.72rem; padding: 3px 5px 2px; border-radius: 4px; }
.ctrack-mark.answer span { border: 2px solid var(--px-ink); }

/* results */
.results-hero, .hero-card { background-image: var(--bg-dots), radial-gradient(120% 80% at 50% 0%, var(--primary-soft), var(--surface) 65%); }
.hero-card { background-image: radial-gradient(120% 120% at 100% 0%, var(--primary-soft) 0%, transparent 55%); }
.pb-badge { font-family: var(--arcade); font-weight: 400; font-size: .6rem; border-radius: 10px; border: var(--px-b) solid var(--px-ink); box-shadow: 0 3px 0 var(--px-ink); padding: 8px 12px; }
.history-note, .avg { font-weight: 600; }
.avg b { font-family: var(--ui); font-weight: 800; font-size: 1.2rem; }

/* leaderboard & misc */
.date-nav b { font-family: var(--ui); font-weight: 800; font-size: 1.05rem; }
.lb-sep { font-family: var(--ui); font-size: 0.75rem; border-top: 2px dashed var(--line-2); font-weight: 800; }
.ph-info h1 { font-size: 1.05rem; line-height: 1.5; text-shadow: 3px 3px 0 color-mix(in srgb, var(--primary) 30%, transparent); }
.day-head h1 { font-size: .9rem; line-height: 1.5; }
.h2h-side b { font-family: var(--ui); font-weight: 800; font-size: 0.825rem; }
.cat-hero-info h2 { font-size: 1.05rem; text-shadow: 3px 3px 0 color-mix(in srgb, var(--tc) 40%, transparent); }
.cat-unlock h3, .ach-unlock h3 { font-size: 1.1rem; text-shadow: 3px 3px 0 color-mix(in srgb, var(--primary) 30%, transparent); }
.cat-stage, .cu-stage { image-rendering: pixelated; }
.collect-meter i { border-width: var(--px-b); }
.cat-prog i { border: 2px solid var(--px-ink); height: 10px; }
.cat-prog i b { background: repeating-linear-gradient(90deg, var(--tc) 0 6px, color-mix(in srgb, var(--tc) 70%, #000) 6px 8px); }
.empty-emoji { filter: drop-shadow(3px 3px 0 color-mix(in srgb, var(--ink) 25%, transparent)); }
.empty h3 { font-size: .85rem; }
.yarn-legend { border: var(--px-b) solid var(--px-ink); }
.qa-text { font-weight: 700; }
.sday { border-width: var(--px-b); }
.bars .bar-stack i { border-radius: 0; border: 2px solid var(--px-ink); border-bottom: 0; }
.cat-list li span { font-size: .85rem; }

/* auth */
.auth-hero h1 { font-family: var(--arcade); font-size: clamp(1.6rem, 5.4vw, 2.7rem); line-height: 1.3; letter-spacing: -.02em; text-shadow: 4px 4px 0 var(--primary), 8px 8px 0 var(--px-ink); }
.auth-hero .wordmark span { font-size: 1.1rem; }
.auth-card { border-width: 4px; box-shadow: 0 8px 0 var(--px-ink); }
.auth-demo { border: var(--px-b) solid var(--px-ink); box-shadow: 0 5px 0 var(--px-ink); }
.demo-q { font-family: var(--display); }
.demo-track { height: 16px; border-radius: 4px; border: var(--px-b) solid var(--px-ink); }
.demo-fill { border-radius: 0; background: repeating-linear-gradient(90deg, var(--primary) 0 10px, var(--primary-2) 10px 12px); animation-timing-function: steps(12); }
.demo-thumb { border-radius: 10px; border: var(--px-b) solid var(--px-ink); box-shadow: 0 3px 0 var(--px-ink); animation-timing-function: steps(12); }
.invite-banner { border: 2px solid var(--px-ink); }
.welcome-h { font-size: 1rem; line-height: 1.5; }

/* admin */
.admin-toolbar .input { min-width: 0; }
.lg-dot { border-radius: 0; border: 1px solid var(--px-ink); }

/* ============ logo plate (matches the splash artwork) ============ */
.wordmark { --wm-ink: #1D1A2F; display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 7px 8px; border: 3px solid var(--wm-ink); border-radius: 14px;
  background: linear-gradient(180deg, #5B2BE0 0%, #3E14B8 100%); box-shadow: 0 4px 0 var(--wm-ink), inset 0 3px 0 rgba(255, 255, 255, .18), inset 0 -3px 0 rgba(0, 0, 0, .25); }
.wordmark .logo-mark { width: 30px; height: 30px; flex: none; filter: drop-shadow(0 2px 0 var(--wm-ink)); }
.wordmark > span { font-family: var(--arcade); font-weight: 400; font-size: .8rem; letter-spacing: -.01em; line-height: 1; color: #FFF3DC; padding: 2px 2px 4px;
  text-shadow: -2px 0 0 var(--wm-ink), 2px 0 0 var(--wm-ink), 0 -2px 0 var(--wm-ink), 0 2px 0 var(--wm-ink), -2px -2px 0 var(--wm-ink), 2px -2px 0 var(--wm-ink), -2px 2px 0 var(--wm-ink), 2px 2px 0 var(--wm-ink), 0 4px 0 var(--wm-ink), 2px 4px 0 var(--wm-ink), -2px 4px 0 var(--wm-ink); }
.wordmark > span b { font-weight: 400; color: #FF8A2A; text-shadow: inherit; }
.auth-hero .wordmark { padding: 9px 16px 10px 10px; border-width: 4px; border-radius: 18px; box-shadow: 0 6px 0 var(--wm-ink), inset 0 3px 0 rgba(255, 255, 255, .18), inset 0 -4px 0 rgba(0, 0, 0, .25); }
.auth-hero .wordmark .logo-mark { width: 44px; height: 44px; }
.auth-hero .wordmark > span { font-size: 1.15rem; }
@media (max-width: 380px) { .topbar .wordmark > span { font-size: .68rem; } .topbar .wordmark .logo-mark { width: 24px; height: 24px; } }

/* ============ rules (welcome page + how to play) ============ */
.rules { list-style: none; margin: 4px 0 14px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.rules li { display: flex; gap: 12px; align-items: flex-start; line-height: 1.5; }
.rule-n { flex: none; width: 28px; height: 28px; display: grid; place-items: center; font: 400 .7rem/1 var(--arcade); color: #fff; background: var(--primary); border: 3px solid var(--px-ink); border-radius: 10px; box-shadow: 0 3px 0 var(--px-ink); }
.auth-rules { margin-top: 0; background: var(--surface); border: var(--px-b) solid var(--px-ink); border-radius: 18px; box-shadow: 0 5px 0 var(--px-ink); padding: 18px; max-width: 520px; }
.auth-rules h2 { font-size: .8rem; margin: 0 0 12px; }
.auth-rules .tier-legend { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
@media (min-width: 900px) {
  .auth { grid-template-columns: 1.15fr 1fr; column-gap: 56px; row-gap: 24px; align-items: start; }
  .auth-hero { grid-column: 1; grid-row: 1; }
  .auth-card { grid-column: 2; grid-row: 1 / span 2; align-self: start; position: sticky; top: 32px; margin-top: 120px; }
  .auth-rules { grid-column: 1; grid-row: 2; }
}

/* ============ full-screen yarn chase ============ */
body.yarn-open { overflow: hidden; }
.yarn-full { position: fixed; inset: 0; z-index: 300; background: #1B1426; cursor: pointer; overflow: hidden; display: grid; place-items: start; animation: yarnIn .18s steps(3); user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
.yarn-full canvas { display: block; image-rendering: pixelated; image-rendering: crisp-edges; }
.yarn-full.out { opacity: 0; transition: opacity .2s steps(3); }
.yarn-full.shake canvas { animation: yarnShake .32s steps(6); }
@keyframes yarnIn { from { opacity: 0; } }
@keyframes yarnShake { 0%, 100% { transform: translate(0, 0); } 20% { transform: translate(-6px, 4px); } 40% { transform: translate(6px, -4px); } 60% { transform: translate(-4px, -2px); } 80% { transform: translate(4px, 2px); } }
.yarn-cap { position: absolute; left: 0; right: 0; top: calc(env(safe-area-inset-top, 0px) + 9vh); display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; pointer-events: none; padding: 0 16px; }
.yarn-cap span { font: 400 clamp(1.3rem, 6vw, 2.6rem)/1.2 var(--arcade); color: #fff; letter-spacing: .02em;
  text-shadow: -3px 0 0 #1B1426, 3px 0 0 #1B1426, 0 -3px 0 #1B1426, 0 3px 0 #1B1426, -3px -3px 0 #1B1426, 3px -3px 0 #1B1426, -3px 3px 0 #1B1426, 3px 3px 0 #1B1426, 0 7px 0 #1B1426;
  opacity: 0; animation: capPop .35s .45s steps(4) forwards; }
.yarn-cap small { font: 400 clamp(.6rem, 2.4vw, .85rem)/1 var(--arcade); color: #FFF6E6; background: rgba(27, 20, 38, .75); padding: 8px 12px 7px; border: 3px solid #1B1426; border-radius: 10px; opacity: 0; animation: capPop .3s .75s steps(3) forwards; }
@keyframes capPop { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }
.yarn-full.t-purrfect .yarn-cap span { color: #FFE45C; animation: capPop .35s 2.9s steps(4) forwards, capGlow .6s 3.25s steps(2) infinite; }
.yarn-full.t-purrfect .yarn-cap small { animation-delay: 3.1s; color: #FFE45C; }
@keyframes capGlow { 50% { color: #FFFFFF; } }
.yarn-full.t-clawsome .yarn-cap span { color: #8CF5C8; } .yarn-full.t-sharp .yarn-cap span { color: #A8C8FF; }
.yarn-full.t-close .yarn-cap span { color: #DCC2FF; } .yarn-full.t-catastrophe .yarn-cap span { color: #FFB3C1; }
.yarn-full .yarn-skip { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom, 0px) + 5vh); margin: 0; font: 800 0.9rem var(--ui); color: #FFF6E6; background: #2a2340; border: 3px solid #1B1426; box-shadow: 0 4px 0 #1B1426; padding: 10px 14px 9px; border-radius: 10px; }
@media (prefers-reduced-motion: reduce) { .yarn-full, .yarn-cap span, .yarn-cap small { animation: none !important; opacity: 1; } }

/* ============ 20-second question timer ============ */
.qtimer { display: flex; align-items: center; gap: 10px; margin: -4px 0 16px; }
.qt-icon { font-size: 1.1rem; }
.qt-bar { flex: 1; height: 18px; border: var(--px-b) solid var(--px-ink); border-radius: 6px; background: var(--bg-2); overflow: hidden; box-shadow: inset 0 3px 0 rgba(0,0,0,.08); }
.qt-bar i { display: block; height: 100%; width: 100%; background: repeating-linear-gradient(90deg, var(--t-clawsome) 0 10px, color-mix(in srgb, var(--t-clawsome) 78%, #000) 10px 12px); transition: background .2s; }
.qt-num { min-width: 2.6ch; text-align: right; font: 800 1.5rem/1 var(--ui); color: var(--ink); font-variant-numeric: tabular-nums; }
.qtimer.warn .qt-bar i { background: repeating-linear-gradient(90deg, #F5A300 0 10px, #C77F00 10px 12px); }
.qtimer.warn .qt-num { color: #D98A00; }
.qtimer.urgent .qt-bar i { background: repeating-linear-gradient(90deg, var(--t-catastrophe) 0 10px, color-mix(in srgb, var(--t-catastrophe) 75%, #000) 10px 12px); }
.qtimer.urgent .qt-num { color: var(--t-catastrophe); font-size: 1.25rem; }
.qtimer.urgent.qt-tick .qt-num { animation: tickPop .35s steps(3); }
@keyframes tickPop { 0% { transform: scale(1.6); } 100% { transform: scale(1); } }
.qt-warn { margin: -8px 0 14px; padding: 9px 12px 8px; text-align: center; font: 800 0.9rem/1.5 var(--ui); color: #7A4A00; background: #FFF1C2; border: var(--px-b) solid var(--px-ink); border-radius: 12px; box-shadow: 0 3px 0 var(--px-ink); animation: blink .5s steps(2) 4; }
.qt-warn.urgent { color: #fff; background: var(--t-catastrophe); animation: blink .5s steps(2) infinite; }
.urgent-shake { animation: urgentShake 1s steps(1) infinite; }
@keyframes urgentShake { 0% { transform: translate(-5px, 3px); } 6% { transform: translate(5px, -3px); } 12% { transform: translate(-4px, -2px); } 18% { transform: translate(4px, 2px); } 24% { transform: translate(-2px, 1px); } 30%, 100% { transform: none; } }
.ctrack-timeout { position: absolute; left: 0; right: 0; bottom: 0; text-align: center; font: 800 0.75rem var(--ui); color: var(--t-catastrophe); }
@media (prefers-reduced-motion: reduce) { .urgent-shake { animation: none; } .qt-warn.urgent { animation: none; } }

/* ============ collars & customisation ============ */
.rarity-common { --rc: #8F9BB3; } .rarity-uncommon { --rc: #22B07D; } .rarity-rare { --rc: #3B7BF6; } .rarity-epic { --rc: #A855F7; } .rarity-legendary { --rc: #FF8A1C; }
.collar-unlock.rarity-common, .collar-unlock.rarity-uncommon, .collar-unlock.rarity-rare, .collar-unlock.rarity-epic, .collar-unlock.rarity-legendary { --tc: var(--rc); }
.rarity-badge { display: inline-block; font: 400 .5rem/1 var(--arcade); text-transform: uppercase; letter-spacing: .04em; padding: 5px 7px 4px; color: #fff; background: var(--rc); border-radius: 4px; box-shadow: inset 0 -2px 0 rgba(0,0,0,.25), 0 0 0 2px color-mix(in srgb, var(--rc) 40%, transparent); vertical-align: 2px; }
.rarity-badge.rarity-legendary { background: linear-gradient(90deg, #FF3D8B, #FFB020, #A855F7, #FF3D8B); background-size: 300% 100%; animation: shimmer 2.5s linear infinite; }
/* animated sprites (cats wearing animated collars, collar icons) */
.pcat-anim { display: block; aspect-ratio: 18 / 22; background-repeat: no-repeat; background-size: calc(var(--n) * 100%) 100%; image-rendering: pixelated; image-rendering: crisp-edges; animation: frameStep calc(var(--n) * .16s) steps(var(--n)) infinite; }
.av .pcat-anim.av-img { width: 92%; height: auto; margin-bottom: -6%; }
@keyframes frameStep { from { background-position-x: 0; } to { background-position-x: var(--end); } }
.collar-icon { display: inline-grid; place-items: center; width: 52px; height: 40px; vertical-align: middle; }
.collar-icon img, .collar-icon .collar-anim { width: 52px; height: 40px; image-rendering: pixelated; }
.collar-anim { display: block; background-repeat: no-repeat; background-size: calc(var(--n) * 100%) 100%; animation: frameStep calc(var(--n) * .16s) steps(var(--n)) infinite; }
.collar-icon.dim { filter: grayscale(1) brightness(.75); opacity: .55; }
.cust-collar-name .collar-icon { width: 39px; height: 30px; } .cust-collar-name .collar-icon img, .cust-collar-name .collar-anim { width: 39px; height: 30px; }
.cat-xxl { width: 144px; height: 176px; }
.cust-cat-row { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 10px; scrollbar-width: thin; }
.cust-cat { position: relative; flex: none; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 8px 6px; background: var(--surface-2); border: var(--px-b) solid var(--px-ink); border-radius: 14px; box-shadow: 0 3px 0 var(--px-ink); cursor: pointer; font: inherit; color: inherit; }
.cust-cat small { font: 800 0.675rem/1.3 var(--ui); max-width: 64px; text-align: center; }
.cust-cat.on { background: var(--primary-soft); box-shadow: 0 0 0 3px var(--primary), 0 5px 0 3px var(--px-ink); }
.cust-active { position: absolute; top: -9px; right: -7px; width: 20px; height: 20px; display: grid; place-items: center; font-style: normal; font-size: .7rem; color: #1B0B4F; background: #FFC531; border: 2px solid var(--px-ink); border-radius: 6px; }
.cust-stage-card { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 20px; align-items: center; border-top: 6px solid var(--rc, var(--px-ink)); }
@media (max-width: 640px) { .cust-stage-card { grid-template-columns: minmax(0, 1fr); text-align: center; } .cust-stage-card .btn-row { justify-content: center; } }
.cust-stage { position: relative; width: 200px; max-width: 100%; height: 210px; margin: 0 auto; display: grid; place-items: end center; padding-bottom: 22px; border-radius: 18px; overflow: hidden; background: linear-gradient(#2E2A55 0 72%, #8F633C 72% 100%); box-shadow: inset 0 0 0 3px var(--px-ink); }
.cust-stage::before { content: ""; position: absolute; inset: 16px 20px auto auto; width: 18px; height: 18px; background: #FFF1A8; box-shadow: 4px 4px 0 #2E2A55; }
.cust-floor { position: absolute; bottom: 14px; width: 110px; height: 10px; background: rgba(10, 2, 40, .45); clip-path: polygon(8% 0, 92% 0, 100% 50%, 92% 100%, 8% 100%, 0 50%); }
.cust-stage .pcat { position: relative; z-index: 1; animation: catIdle 1.6s steps(2) infinite; }
.cust-stage.equipped-anim .pcat { animation: catHop .5s steps(5) 2, catIdle 1.6s 1s steps(2) infinite; }
.cust-rays { position: absolute; left: 50%; top: 55%; width: 320px; height: 320px; margin: -160px 0 0 -160px; background: repeating-conic-gradient(rgba(255, 196, 49, .28) 0 12deg, transparent 12deg 24deg); animation: spin 12s linear infinite; mask: radial-gradient(circle, #000 20%, transparent 65%); -webkit-mask: radial-gradient(circle, #000 20%, transparent 65%); }
.cust-info { min-width: 0; }
.cust-info h2 { font-size: 1rem; margin: 0 0 8px; }
.cust-collar-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
@media (max-width: 640px) { .cust-collar-name { justify-content: center; } }
.cust-collar-name b { font-family: var(--ui); font-weight: 800; font-size: 0.93rem; }
.cust-locked { font-weight: 600; color: var(--t-catastrophe); }
.collar-tier { margin-bottom: 14px; }
.collar-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(138px, 100%), 1fr)); gap: 10px; }
.collar-tile { min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; padding: 10px 8px 12px; cursor: pointer; font: inherit; color: inherit;
  background: color-mix(in srgb, var(--rc) 12%, var(--surface)); border: var(--px-b) solid var(--px-ink); border-radius: 14px; box-shadow: 0 3px 0 var(--px-ink); transition: transform .08s; }
.collar-tile > * { max-width: 100%; }
.collar-tile:hover { transform: translateY(-2px); }
.collar-tile.locked { background: var(--bg-2); }
.collar-tile.previewing { box-shadow: 0 0 0 3px var(--rc), 0 5px 0 3px var(--px-ink); }
.collar-tile.equipped b::after { content: " ★"; color: var(--rc); }
.collar-tile b { font: 800 0.75rem/1.5 var(--ui); }
.collar-tile small { font-size: .7rem; color: var(--muted); line-height: 1.3; }
.collar-tile small.ok { color: var(--t-clawsome); font-weight: 700; }
.collar-tile .cat-prog { width: 100%; --tc: var(--rc); }
.collar-tile.rarity-legendary.on { background: linear-gradient(160deg, #FFF1C2, color-mix(in srgb, #FF8A1C 18%, var(--surface))); }
.admin-collar { width: 52px; height: 40px; flex: none; }
.cos-preview { display: flex; align-items: center; gap: 16px; padding: 8px; background: #2E2A55; border-radius: 12px; width: fit-content; }
.cos-preview img:first-child { width: 78px; height: 60px; } .cos-preview img:last-child { width: 72px; height: 88px; }
@media (prefers-reduced-motion: reduce) { .pcat-anim, .collar-anim { animation: none; } }

/* ============ Archive & Category Mode ============ */
.bottomnav { grid-template-columns: repeat(var(--tabs, 5), 1fr); }
.bottomnav .nav-link { font-size: .38rem; padding: 0 2px; text-align: center; }
.nav-lock { position: absolute; top: 6px; right: 18%; font-style: normal; font-size: .6rem; }
.side-links .nav-lock { position: static; margin-left: auto; }
.cat-ic { image-rendering: pixelated; image-rendering: crisp-edges; display: inline-block; vertical-align: middle; }
.cm-ic { width: 56px; height: 56px; flex: none; } .cm-ic-xl { width: 96px; height: 96px; flex: none; } .cm-ic-sm { width: 32px; height: 32px; flex: none; }
.head-ic { width: 18px; height: 18px; vertical-align: -3px; } .mw-pix { width: 30px; height: 30px; }
.more-ways { margin: -4px 0 20px; }
.more-ways-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.more-way { position: relative; display: flex; align-items: center; gap: 12px; padding: 12px 14px; text-decoration: none; color: #FFF6E6; border: var(--px-b) solid var(--px-ink); border-radius: 18px; box-shadow: 0 4px 0 var(--px-ink); background: linear-gradient(135deg, #4A1FD0, #2A0E8F); transition: transform .08s; }
.more-way:hover { transform: translateY(-2px); }
.more-way b { display: block; font: 800 0.93rem/1.5 var(--ui); }
.more-way small { color: #D9CCFF; font-size: .8rem; }
.more-way i { position: absolute; top: 8px; right: 10px; font-style: normal; }
.mw-ic { flex: none; width: 40px; height: 40px; display: grid; place-items: center; font-size: 1.5rem; background: rgba(255,255,255,.12); border-radius: 12px; }
/* archive */
.arch-card { padding: 16px; }
.arch-week, .arch-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.arch-week span { text-align: center; font: 800 0.75rem var(--ui); color: var(--muted); padding-bottom: 6px; }
.arch-day { aspect-ratio: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; cursor: pointer; font: inherit; color: var(--ink);
  border: var(--px-b) solid var(--px-ink); border-radius: 12px; box-shadow: 0 3px 0 var(--px-ink); background: var(--surface); transition: transform .08s; }
.arch-day b { font: 800 1.125rem/1 var(--ui); }
.arch-day small { font: 800 0.6rem/1 var(--ui); color: var(--muted); }
.arch-day:hover:not(:disabled) { transform: translateY(-2px); }
.arch-day:disabled { opacity: .35; cursor: default; box-shadow: none; }
.arch-day.s-played { background: var(--accent-soft); } .arch-day.s-replayed { background: var(--t-clawsome-soft); } .arch-day.s-playing { background: var(--t-purrfect-soft); }
.arch-day.on { background: var(--primary); color: #fff; box-shadow: 0 0 0 3px var(--primary-soft), 0 4px 0 var(--px-ink); } .arch-day.on small { color: #FFE9DF; }
.arch-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 14px; font-size: .78rem; color: var(--muted); }
.arch-legend i { display: inline-block; width: 12px; height: 12px; border: 2px solid var(--px-ink); border-radius: 4px; vertical-align: -2px; margin-right: 4px; background: var(--surface); }
.arch-legend i.s-played { background: var(--accent-soft); } .arch-legend i.s-replayed { background: var(--t-clawsome-soft); } .arch-legend i.s-playing { background: var(--t-purrfect-soft); }
.arch-detail h2 { font-size: .9rem; margin: 0 0 12px; }
.arch-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 16px; }
.arch-stats div { text-align: center; padding: 10px 4px; border: 2px solid var(--px-ink); border-radius: 12px; background: var(--surface-2); }
.arch-stats small { display: block; font: 800 0.63rem/1.5 var(--ui); color: var(--muted); } .arch-stats b { font: 800 1.425rem/1.6 var(--ui); }
/* categories */
.cm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.cm-card { display: flex; flex-direction: column; gap: 12px; padding: 16px; background: var(--surface); border: var(--px-b) solid var(--px-ink); border-radius: 18px; box-shadow: 0 5px 0 var(--px-ink); border-top: 8px solid var(--cc); }
.cm-card-top { display: flex; gap: 12px; align-items: center; }
.cm-card-top .cm-ic { padding: 6px; background: color-mix(in srgb, var(--cc) 18%, var(--surface-2)); border: 2px solid var(--px-ink); border-radius: 14px; box-sizing: content-box; }
.cm-card h3 { margin: 0 0 4px; font-size: .74rem; } .cm-card p { margin: 0; }
.cm-card-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.cm-card-stats div { text-align: center; padding: 6px 2px; background: var(--surface-2); border-radius: 10px; border: 2px solid var(--line-2); }
.cm-card-stats small { display: block; font: 800 0.57rem/1.5 var(--ui); color: var(--muted); } .cm-card-stats b { font: 800 1.08rem/1.6 var(--ui); }
.cm-card-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.cm-hero { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; border-top: 8px solid var(--cc); background: linear-gradient(135deg, color-mix(in srgb, var(--cc) 14%, var(--surface)), var(--surface) 60%); }
.cm-hero .cm-ic-xl { padding: 10px; background: color-mix(in srgb, var(--cc) 20%, var(--surface-2)); border: 3px solid var(--px-ink); border-radius: 18px; box-shadow: 0 4px 0 var(--px-ink); box-sizing: content-box; }
.cm-hero-info { flex: 1; min-width: 220px; } .cm-hero-info h1 { font-size: 1.15rem; margin: 0 0 6px; }
.cm-stats { grid-template-columns: repeat(2, 1fr); } @media (min-width: 640px) { .cm-stats { grid-template-columns: repeat(4, 1fr); } }
.cm-graph svg { width: 100%; height: 140px; display: block; background: var(--surface-2); border: 2px solid var(--px-ink); border-radius: 12px; }
.cm-bar { fill: color-mix(in srgb, var(--primary) 75%, transparent); } .cm-avg { stroke: var(--accent); stroke-width: 3; }
.lg-dot.cm-key-bar { background: var(--primary); } .lg-dot.cm-key-avg { background: var(--accent); }
.cm-winners { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; padding-top: 10px; border-top: 2px dashed var(--line-2); }
.cm-winners .eyebrow { width: 100%; margin: 0; }
.cm-winner { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border: 2px solid var(--px-ink); border-radius: 12px; background: var(--surface-2); font-size: .85rem; }
.cm-prof { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.cm-prof a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; text-decoration: none; border: 2px solid var(--line-2); border-left: 6px solid var(--cc); border-radius: 12px; }
.cm-prof a:hover { background: var(--surface-2); }
.chip.diff-easy { background: var(--t-clawsome-soft); color: var(--t-clawsome); } .chip.diff-hard { background: var(--t-purrfect-soft); color: color-mix(in srgb, var(--t-purrfect) 70%, var(--ink)); } .chip.diff-very_hard { background: var(--t-catastrophe-soft); color: var(--t-catastrophe); }
.cm-result-ic { display: flex; justify-content: center; margin: 6px 0; }
/* final boss */
.seg-progress i.boss-seg { background: #2B1660; } .seg-progress i.boss-seg.current { background: #FF4D7E; }
.boss-mode .qcard, .boss-reveal { background: radial-gradient(120% 90% at 50% 0%, #4A1F9A 0%, #1D0F45 70%); color: #FFF6E6; border-color: #0B0518; box-shadow: 0 0 0 3px #FF4D7E, 0 8px 0 3px #0B0518, 0 0 40px 6px rgba(255, 77, 126, .35); }
.boss-card { animation: bossIn .6s steps(6); }
@keyframes bossIn { 0% { transform: scale(.85); filter: brightness(2.5); } 50% { transform: scale(1.04); } 100% { transform: none; filter: none; } }
.boss-mode .q-text, .boss-mode .guess-input, .boss-reveal .q-text.sm, .boss-reveal .direction, .boss-reveal .reveal-stats b { color: #FFF6E6; }
.boss-mode .q-context, .boss-mode .muted, .boss-mode .slider-scale { color: #CDB8FF; }
.boss-mode .qt-num { color: #FFE45C; } .boss-mode .qt-bar { background: #2B1660; }
.boss-mode .fine-btn { background: #2B1660; color: #FFF6E6; }
.boss-mode .slider-track { background: #2B1660; }
.boss-reveal .reveal-stats > div, .boss-reveal .explain { background: rgba(255,255,255,.08); color: #FFF6E6; }
.boss-reveal .reveal-stats small, .boss-reveal .explain .muted { color: #CDB8FF; }
.boss-reveal .reward-title { color: #FFE45C; text-shadow: 3px 3px 0 #0B0518, 0 0 18px rgba(255, 228, 92, .6); }
.boss-reveal::before { background: linear-gradient(90deg, #FF4D7E, #FFE45C, #B784FF); }
.boss-label { margin: -6px auto 14px; width: fit-content; padding: 8px 14px 7px; font: 400 .7rem/1 var(--arcade); color: #1B0B4F; background: #FFE45C; border: 3px solid #0B0518; border-radius: 10px; box-shadow: 0 4px 0 #0B0518; animation: blink .8s steps(2) 3; }
.boss-intro { position: fixed; inset: 0; z-index: 280; display: grid; place-items: center; background: radial-gradient(circle, #4A1F9A, #0B0518 70%); animation: bossFlash .35s steps(3); cursor: pointer; }
.boss-intro.out { opacity: 0; transition: opacity .25s steps(3); }
.boss-intro-inner { text-align: center; color: #FFF6E6; animation: bossShake .5s .2s steps(5); }
.boss-intro-inner p { font: 400 .8rem var(--arcade); color: #CDB8FF; margin: 0 0 10px; }
.boss-intro-inner h2 { font: 400 clamp(1.8rem, 9vw, 3.4rem)/1.1 var(--arcade); color: #FFE45C; text-shadow: 4px 4px 0 #FF4D7E, 8px 8px 0 #0B0518; margin: 0 0 18px; }
.boss-intro-inner span { display: flex; justify-content: center; }
@keyframes bossFlash { 0% { background: #FFF; } 100% { background: radial-gradient(circle, #4A1F9A, #0B0518 70%); } }
@keyframes bossShake { 0%, 100% { transform: none; } 20% { transform: translate(-8px, 4px); } 40% { transform: translate(8px, -4px); } 60% { transform: translate(-5px, -3px); } 80% { transform: translate(5px, 3px); } }
.yarn-full.boss .yarn-cap span { color: #FFE45C; }
/* premium placeholder */
.premium-card { max-width: 520px; margin: 0 auto; text-align: center; background: linear-gradient(160deg, #4A1FD0, #23068F); color: #FFF6E6; border-color: #0B0518; }
.premium-badge { display: inline-block; margin-bottom: 12px; padding: 7px 12px 6px; font: 400 .6rem var(--arcade); color: #1B0B4F; background: #FFC531; border: 3px solid #0B0518; border-radius: 10px; }
.premium-card h1 { font-size: 1.1rem; color: #FFF6E6; text-shadow: 3px 3px 0 #0B0518; }
.premium-list { list-style: none; padding: 0; margin: 16px 0 20px; text-align: left; display: grid; gap: 10px; }
.premium-list li { padding: 10px 12px; background: rgba(255,255,255,.1); border: 2px solid rgba(255,255,255,.2); border-radius: 12px; }
.premium-card .muted { color: #D9CCFF; }
/* admin table */
.table-wrap { overflow-x: auto; }
.adm-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.adm-table th { font: 800 0.675rem/1.5 var(--ui); text-align: left; padding: 8px 6px; border-bottom: 2px solid var(--px-ink); white-space: nowrap; }
.adm-table td { padding: 8px 6px; border-bottom: 1px dashed var(--line-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.adm-table td.low { color: var(--t-catastrophe); font-weight: 700; } .adm-table td.ok { color: var(--t-clawsome); font-weight: 700; }
.adm-table tr.off { opacity: .5; }
.adm-cat { display: inline-flex; align-items: center; gap: 8px; }

/* ---------- Limitless Mode ---------- */
:root { --hp-green: #2ECC71; --hp-yellow: #FFD23F; --hp-orange: #FF8A2A; --hp-red: #FF3B5C; }
.hp { --hp: var(--hp-green); width: 100%; }
.hp.band-yellow { --hp: var(--hp-yellow); } .hp.band-orange { --hp: var(--hp-orange); } .hp.band-red, .hp.band-over { --hp: var(--hp-red); }
.hp-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.hp-label { font: 800 0.75rem/1 var(--ui); color: var(--muted); }
.hp-num { font: 800 1.2rem/1 var(--ui); color: var(--ink); }
.hp-track { position: relative; height: 16px; background: #2A2340; border: var(--px-b, 3px) solid var(--px-ink, #1D1A2F); border-radius: 6px; overflow: hidden; box-shadow: 0 3px 0 var(--px-ink, #1D1A2F); }
.hp-fill { position: absolute; inset: 0 auto 0 0; background: var(--hp); box-shadow: inset 0 3px 0 rgba(255,255,255,.35), inset 0 -3px 0 rgba(0,0,0,.18); transition: width .5s steps(10), background .3s; }
.hp-ticks { position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 calc(10% - 2px), rgba(27,20,38,.45) calc(10% - 2px) 10%); pointer-events: none; }
.hp-big .hp-track { height: 26px; } .hp-big .hp-num { font-size: 1.1rem; }
.hp-state { display: block; margin-top: 6px; font: 800 0.75rem/1 var(--ui); color: var(--hp); text-align: right; }
.hp.band-red .hp-fill { animation: hpPulse .8s steps(2) infinite; }
@keyframes hpPulse { 50% { filter: brightness(1.5); } }

.lm-hud-bar { display: grid; grid-template-columns: auto auto 1fr auto; align-items: center; gap: 10px; padding: 10px 12px; margin-bottom: 12px; background: var(--surface); border: var(--px-b) solid var(--px-ink); border-radius: 18px; box-shadow: 0 4px 0 var(--px-ink); }
.lm-hud-cat { width: 40px; height: 48px; display: grid; place-items: center; }
.lm-hud-img { width: 36px; height: auto; image-rendering: pixelated; }
.lm-hud-nums { display: flex; gap: 10px; }
.lm-hud-nums span { display: flex; flex-direction: column; align-items: center; min-width: 46px; }
.lm-hud-nums small { font: 400 .42rem/1 var(--arcade); color: var(--muted); margin-bottom: 5px; text-transform: uppercase; }
.lm-hud-nums b { font: 400 .9rem/1 var(--arcade); }
.lm-hud-nums .hot b { color: var(--hp-orange); }
@media (max-width: 420px) { .lm-hud-bar { grid-template-columns: auto 1fr auto; gap: 8px; } .lm-hud-cat { display: none; } .lm-hud-nums span { min-width: 38px; } }
.lm-play.band-red .qcard { animation: lmTense 1.2s steps(2) infinite; }
@keyframes lmTense { 50% { box-shadow: 0 4px 0 var(--px-ink), 0 0 0 4px rgba(255, 59, 92, .45); } }
.lm-play.band-red .lm-hud-bar { border-color: var(--hp-red); }
.lm-tier { font-family: var(--ui); font-weight: 800; }
.lm-t-easy { background: #D7F7E5; color: #166B3E; } .lm-t-medium { background: #FFF2C2; color: #7A5A00; } .lm-t-hard { background: #FFE0C7; color: #8A3B00; }
.lm-t-very_hard { background: #FFD0D8; color: #8A0F2B; } .lm-t-expert { background: #2A1550; color: #FFE45C; }
.lm-cat-chip { background: color-mix(in srgb, var(--cc) 18%, var(--surface)); color: var(--ink); }
.lm-cat-chip .cat-ic { width: 14px; height: 14px; }
.lm-hint { margin: 10px 0 0; }
.lm-calc { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 14px 0 10px; text-align: center; }
.lm-calc div { padding: 8px 4px; border: var(--px-b) solid var(--px-ink); border-radius: 12px; background: var(--bg-2); }
.lm-calc small { display: block; font-size: .66rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.lm-calc b { font: 800 1.2rem/1.6 var(--ui); }
.lm-calc .neg b { color: var(--hp-red); } .lm-calc .pos b { color: #18A058; } .lm-calc .pos.zero b { color: var(--muted); }
.lm-calc .res { background: var(--surface); } .lm-calc .res.band-green b { color: #18A058; } .lm-calc .res.band-yellow b { color: #B98900; } .lm-calc .res.band-orange b { color: #D2600A; } .lm-calc .res.band-red b, .lm-calc .res.band-over b { color: var(--hp-red); }
@media (max-width: 420px) { .lm-calc { grid-template-columns: repeat(2, 1fr); } }

/* home */
.lm-hero { display: flex; gap: 20px; align-items: center; background: radial-gradient(circle at 20% 30%, #3B1F8C, #160A3A 70%); color: #FFF6E6; border-color: var(--px-ink); }
.lm-hero .muted { color: #D9CCFF; }
.lm-hero .eyebrow { color: #FFB86B; }
.lm-hero-cat { position: relative; flex: none; width: 120px; display: grid; place-items: center; }
.lm-hero-acat { width: 108px; height: 132px; }
.lm-title { font: 400 clamp(1.4rem, 6vw, 2.2rem)/1.1 var(--arcade); margin: 4px 0 8px; color: #FFE45C; text-shadow: 3px 3px 0 #1B1426; letter-spacing: .04em; }
.lm-pb { display: inline-flex; align-items: baseline; gap: 8px; margin: 6px 0 12px; padding: 8px 12px; background: rgba(255,255,255,.1); border: 3px solid #1B1426; border-radius: 12px; }
.lm-pb span, .lm-pb small { font-size: .78rem; color: #D9CCFF; } .lm-pb b { font: 400 1.2rem/1 var(--arcade); color: #FFE45C; }
@media (max-width: 520px) { .lm-hero { flex-direction: column; text-align: center; } .lm-hero .btn-row { justify-content: center; } }
.lm-rules { margin: 0 0 12px; padding-left: 20px; } .lm-rules li { margin: 6px 0; }
.lm-rec { border-collapse: collapse; font-size: .8rem; margin-top: 6px; }
.lm-rec th, .lm-rec td { border: 2px solid var(--px-ink); padding: 4px 8px; text-align: center; } .lm-rec th { background: var(--bg-2); text-align: left; }
.lm-mini-boards { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; } @media (min-width: 720px) { .lm-mini-boards { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.lm-mini-boards .who { min-width: 0; } .lm-mini-boards .who small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.lm-runs { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.lm-run-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; text-decoration: none; color: var(--ink); border: var(--px-b) solid var(--px-ink); border-radius: 14px; background: var(--surface); box-shadow: 0 3px 0 var(--px-ink); }
.lm-run-row:hover { transform: translateY(-1px); }
.lm-run-n { display: flex; flex-direction: column; align-items: center; min-width: 54px; } .lm-run-n b { font: 800 1.5rem/1.2 var(--ui); color: var(--accent); } .lm-run-n small { font-size: .66rem; color: var(--muted); }
.lm-run-info { flex: 1; min-width: 0; display: flex; flex-direction: column; } .lm-run-info small { color: var(--muted); font-size: .8rem; }
.lm-run-tags { display: flex; gap: 4px; } .lm-pb-chip { background: #FFE45C; color: #5A4000; font-family: var(--arcade); }
.lm-ach { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.lm-ach-i { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; padding: 10px 8px; border: var(--px-b) solid var(--px-ink); border-radius: 14px; background: var(--bg-2); opacity: .6; }
.lm-ach-i.on { opacity: 1; background: var(--surface); box-shadow: 0 3px 0 var(--px-ink); } .lm-ach-i span { font-size: 1.5rem; } .lm-ach-i b { font-size: .82rem; } .lm-ach-i small { font-size: .7rem; color: var(--muted); }
.lm-bar { fill: var(--accent); } .lm-graph svg { width: 100%; height: 90px; }
.lm-topcats { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.lm-topcat { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 2px solid var(--px-ink); border-radius: 12px; background: color-mix(in srgb, var(--cc) 14%, var(--surface)); font-size: .8rem; }
.lm-topcat .cat-ic { width: 18px; height: 18px; } .lm-topcat small { color: var(--muted); }
.lm-pstats { grid-template-columns: repeat(2, 1fr); } @media (min-width: 640px) { .lm-pstats { grid-template-columns: repeat(5, 1fr); } }
.lm-pstats .stat { padding: 10px; border: 2px solid var(--line-2); border-radius: 12px; text-align: center; } .lm-pstats .stat b { display: block; font: 800 1.275rem/1.6 var(--ui); } .lm-pstats .stat small { color: var(--muted); font-size: .72rem; }
.mw-lm { background: linear-gradient(135deg, #8A2BE2, #3B0F7A); }
.mode-card { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--ink); margin-bottom: 12px; }
.mode-card b { display: block; font: 800 1.05rem/1.6 var(--ui); } .mode-card small { color: var(--muted); }
.mode-card > span:nth-child(2) { flex: 1; } .mode-card i { font-style: normal; }
.mode-ic { flex: none; width: 48px; height: 48px; display: grid; place-items: center; font-size: 1.7rem; background: var(--bg-2); border: 3px solid var(--px-ink); border-radius: 14px; }

/* game over */
.lm-over-card { text-align: center; }
.lm-over-yarn { display: grid; place-items: center; margin: 4px 0; } .lm-over-yarn img { width: 96px; }
.lm-ring .big-num { color: var(--accent); }
.lm-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0; }
.lm-summary div { padding: 8px; border: 2px solid var(--line-2); border-radius: 12px; } .lm-summary small { display: block; color: var(--muted); font-size: .7rem; } .lm-summary b { font: 800 1.2rem/1.7 var(--ui); }
@media (max-width: 420px) { .lm-summary { grid-template-columns: repeat(2, 1fr); } }
.lm-cats { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.lm-cats span { width: 34px; height: 34px; display: grid; place-items: center; border: 2px solid var(--px-ink); border-radius: 12px; background: color-mix(in srgb, var(--cc) 20%, var(--surface)); } .lm-cats .cat-ic { width: 22px; height: 22px; }
.lm-ending { text-align: left; padding: 12px; margin: 10px 0; border: 2px dashed var(--line-2); border-radius: 14px; }
.lm-sum-line { font-weight: 700; margin: 12px 0; }
.lm-hgraph svg { width: 100%; height: 70px; } .lm-hg-line { stroke: var(--hp-red); stroke-width: 2.5; } .lm-hg-crit { stroke: var(--muted); stroke-dasharray: 2 2; stroke-width: .5; }
.lm-breakdown .bd-q .chip { font-size: .45rem; } .lm-breakdown .bd-q .cat-ic { width: 14px; height: 14px; }
.ach-pop { text-align: center; } .ach-pop-ic { font-size: 3rem; display: block; }
.lm-dist { display: flex; flex-wrap: wrap; gap: 8px; } .lm-dist span { display: flex; flex-direction: column; align-items: center; min-width: 74px; padding: 8px; border: 2px solid var(--line-2); border-radius: 12px; } .lm-dist small { color: var(--muted); font-size: .72rem; text-align: center; }
.admin-table td.warn { color: var(--hp-red); font-weight: 700; } .nowrap { white-space: nowrap; }

/* the health-yarn overlay */
.lm-hud { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom, 0px) + 9vh); width: min(420px, 86vw); display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 6px 12px; pointer-events: none; }
.lm-hud-label { font: 400 .6rem/1 var(--arcade); color: #FFF6E6; }
.lm-hud-num { font: 400 1.4rem/1 var(--arcade); color: #fff; text-align: right; text-shadow: 3px 3px 0 #1B1426; }
.lm-hud .lm-ov-bar { grid-column: 1 / -1; display: block; height: 22px; padding: 0; margin: 0; background: #2A2340; border: 4px solid #1B1426; border-radius: 6px; overflow: hidden; box-shadow: 0 4px 0 #1B1426; }
.lm-hud .lm-ov-bar i { display: block; height: 100%; background: var(--hp-green); box-shadow: inset 0 4px 0 rgba(255,255,255,.35); }
.lm-hud[data-band="yellow"] .lm-ov-bar i { background: var(--hp-yellow); } .lm-hud[data-band="orange"] .lm-ov-bar i { background: var(--hp-orange); }
.lm-hud[data-band="red"] .lm-ov-bar i, .lm-hud[data-band="over"] .lm-ov-bar i { background: var(--hp-red); }
.lm-hud[data-band="red"] .lm-hud-num { color: #FFB3C1; animation: hpPulse .5s steps(2) infinite; }
.lm-float { position: absolute; left: 50%; top: 42vh; font: 400 clamp(1.4rem, 7vw, 2.6rem)/1 var(--arcade); pointer-events: none; text-shadow: -3px 0 0 #1B1426, 3px 0 0 #1B1426, 0 -3px 0 #1B1426, 0 3px 0 #1B1426, 0 6px 0 #1B1426; }
.lm-minus { color: #FF5C7A; } .lm-plus { color: #6CFFAE; }
.lm-float.go { animation: lmFloat 1.1s steps(8) forwards; }
@keyframes lmFloat { 0% { opacity: 0; transform: translate(-50%, 10px) scale(.6); } 20% { opacity: 1; transform: translate(-50%, 0) scale(1.1); } 70% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -60px) scale(1); } }
.lm-yarn.lm-over .yarn-cap span { color: #FFB3C1; } .lm-yarn.lm-perfect .yarn-cap span { color: #FFE45C; } .lm-yarn.band-green .yarn-cap span { color: #8CF5C8; }
@media (prefers-reduced-motion: reduce) { .lm-float.go { animation: none; opacity: 1; transform: translate(-50%, 0); } .hp-fill { transition: none; } .hp.band-red .hp-fill, .lm-play.band-red .qcard { animation: none; } }
.lm-over-card .rank-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } @media (min-width: 640px) { .lm-over-card .rank-row { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
button.mode-card { width: 100%; text-align: left; font: inherit; cursor: pointer; }

/* =====================================================================
   SOFT PASTEL 8-BIT THEME
   A cosy lavender world: white rounded cards, subtle pixel ledges, Nunito for reading,
   Press Start 2P only for the logo and arcade moments. Cats, yarn and pixel icons are unchanged.
   ===================================================================== */
:root { --deco: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='260'%20height='260'%3E%3Crect%20x='33'%20y='40'%20width='3'%20height='3'%20fill='%238B68AC'%20fill-opacity='0.09'/%3E%3Crect%20x='39'%20y='40'%20width='3'%20height='3'%20fill='%238B68AC'%20fill-opacity='0.09'/%3E%3Crect%20x='30'%20y='43'%20width='3'%20height='3'%20fill='%238B68AC'%20fill-opacity='0.09'/%3E%3Crect%20x='36'%20y='43'%20width='3'%20height='3'%20fill='%238B68AC'%20fill-opacity='0.09'/%3E%3Crect%20x='42'%20y='43'%20width='3'%20height='3'%20fill='%238B68AC'%20fill-opacity='0.09'/%3E%3Crect%20x='33'%20y='49'%20width='3'%20height='3'%20fill='%238B68AC'%20fill-opacity='0.09'/%3E%3Crect%20x='36'%20y='49'%20width='3'%20height='3'%20fill='%238B68AC'%20fill-opacity='0.09'/%3E%3Crect%20x='39'%20y='49'%20width='3'%20height='3'%20fill='%238B68AC'%20fill-opacity='0.09'/%3E%3Crect%20x='30'%20y='52'%20width='3'%20height='3'%20fill='%238B68AC'%20fill-opacity='0.09'/%3E%3Crect%20x='33'%20y='52'%20width='3'%20height='3'%20fill='%238B68AC'%20fill-opacity='0.09'/%3E%3Crect%20x='36'%20y='52'%20width='3'%20height='3'%20fill='%238B68AC'%20fill-opacity='0.09'/%3E%3Crect%20x='39'%20y='52'%20width='3'%20height='3'%20fill='%238B68AC'%20fill-opacity='0.09'/%3E%3Crect%20x='42'%20y='52'%20width='3'%20height='3'%20fill='%238B68AC'%20fill-opacity='0.09'/%3E%3Crect%20x='33'%20y='55'%20width='3'%20height='3'%20fill='%238B68AC'%20fill-opacity='0.09'/%3E%3Crect%20x='36'%20y='55'%20width='3'%20height='3'%20fill='%238B68AC'%20fill-opacity='0.09'/%3E%3Crect%20x='39'%20y='55'%20width='3'%20height='3'%20fill='%238B68AC'%20fill-opacity='0.09'/%3E%3Crect%20x='176'%20y='26'%20width='3'%20height='3'%20fill='%23D9B85A'%20fill-opacity='0.22'/%3E%3Crect%20x='173'%20y='29'%20width='3'%20height='3'%20fill='%23D9B85A'%20fill-opacity='0.22'/%3E%3Crect%20x='176'%20y='29'%20width='3'%20height='3'%20fill='%23D9B85A'%20fill-opacity='0.22'/%3E%3Crect%20x='179'%20y='29'%20width='3'%20height='3'%20fill='%23D9B85A'%20fill-opacity='0.22'/%3E%3Crect%20x='170'%20y='32'%20width='3'%20height='3'%20fill='%23D9B85A'%20fill-opacity='0.22'/%3E%3Crect%20x='173'%20y='32'%20width='3'%20height='3'%20fill='%23D9B85A'%20fill-opacity='0.22'/%3E%3Crect%20x='176'%20y='32'%20width='3'%20height='3'%20fill='%23D9B85A'%20fill-opacity='0.22'/%3E%3Crect%20x='179'%20y='32'%20width='3'%20height='3'%20fill='%23D9B85A'%20fill-opacity='0.22'/%3E%3Crect%20x='182'%20y='32'%20width='3'%20height='3'%20fill='%23D9B85A'%20fill-opacity='0.22'/%3E%3Crect%20x='173'%20y='35'%20width='3'%20height='3'%20fill='%23D9B85A'%20fill-opacity='0.22'/%3E%3Crect%20x='176'%20y='35'%20width='3'%20height='3'%20fill='%23D9B85A'%20fill-opacity='0.22'/%3E%3Crect%20x='179'%20y='35'%20width='3'%20height='3'%20fill='%23D9B85A'%20fill-opacity='0.22'/%3E%3Crect%20x='176'%20y='38'%20width='3'%20height='3'%20fill='%23D9B85A'%20fill-opacity='0.22'/%3E%3Crect%20x='120'%20y='150'%20width='3'%20height='3'%20fill='%23D98AB3'%20fill-opacity='0.16'/%3E%3Crect%20x='123'%20y='150'%20width='3'%20height='3'%20fill='%23D98AB3'%20fill-opacity='0.16'/%3E%3Crect%20x='129'%20y='150'%20width='3'%20height='3'%20fill='%23D98AB3'%20fill-opacity='0.16'/%3E%3Crect%20x='132'%20y='150'%20width='3'%20height='3'%20fill='%23D98AB3'%20fill-opacity='0.16'/%3E%3Crect%20x='120'%20y='153'%20width='3'%20height='3'%20fill='%23D98AB3'%20fill-opacity='0.16'/%3E%3Crect%20x='123'%20y='153'%20width='3'%20height='3'%20fill='%23D98AB3'%20fill-opacity='0.16'/%3E%3Crect%20x='126'%20y='153'%20width='3'%20height='3'%20fill='%23D98AB3'%20fill-opacity='0.16'/%3E%3Crect%20x='129'%20y='153'%20width='3'%20height='3'%20fill='%23D98AB3'%20fill-opacity='0.16'/%3E%3Crect%20x='132'%20y='153'%20width='3'%20height='3'%20fill='%23D98AB3'%20fill-opacity='0.16'/%3E%3Crect%20x='120'%20y='156'%20width='3'%20height='3'%20fill='%23D98AB3'%20fill-opacity='0.16'/%3E%3Crect%20x='123'%20y='156'%20width='3'%20height='3'%20fill='%23D98AB3'%20fill-opacity='0.16'/%3E%3Crect%20x='126'%20y='156'%20width='3'%20height='3'%20fill='%23D98AB3'%20fill-opacity='0.16'/%3E%3Crect%20x='129'%20y='156'%20width='3'%20height='3'%20fill='%23D98AB3'%20fill-opacity='0.16'/%3E%3Crect%20x='132'%20y='156'%20width='3'%20height='3'%20fill='%23D98AB3'%20fill-opacity='0.16'/%3E%3Crect%20x='123'%20y='159'%20width='3'%20height='3'%20fill='%23D98AB3'%20fill-opacity='0.16'/%3E%3Crect%20x='126'%20y='159'%20width='3'%20height='3'%20fill='%23D98AB3'%20fill-opacity='0.16'/%3E%3Crect%20x='129'%20y='159'%20width='3'%20height='3'%20fill='%23D98AB3'%20fill-opacity='0.16'/%3E%3Crect%20x='126'%20y='162'%20width='3'%20height='3'%20fill='%23D98AB3'%20fill-opacity='0.16'/%3E%3Crect%20x='223'%20y='200'%20width='3'%20height='3'%20fill='%238B68AC'%20fill-opacity='0.12'/%3E%3Crect%20x='220'%20y='203'%20width='3'%20height='3'%20fill='%238B68AC'%20fill-opacity='0.12'/%3E%3Crect%20x='223'%20y='203'%20width='3'%20height='3'%20fill='%238B68AC'%20fill-opacity='0.12'/%3E%3Crect%20x='226'%20y='203'%20width='3'%20height='3'%20fill='%238B68AC'%20fill-opacity='0.12'/%3E%3Crect%20x='223'%20y='206'%20width='3'%20height='3'%20fill='%238B68AC'%20fill-opacity='0.12'/%3E%3Crect%20x='202'%20y='120'%20width='2'%20height='2'%20fill='%238B68AC'%20fill-opacity='0.08'/%3E%3Crect%20x='206'%20y='120'%20width='2'%20height='2'%20fill='%238B68AC'%20fill-opacity='0.08'/%3E%3Crect%20x='200'%20y='122'%20width='2'%20height='2'%20fill='%238B68AC'%20fill-opacity='0.08'/%3E%3Crect%20x='204'%20y='122'%20width='2'%20height='2'%20fill='%238B68AC'%20fill-opacity='0.08'/%3E%3Crect%20x='208'%20y='122'%20width='2'%20height='2'%20fill='%238B68AC'%20fill-opacity='0.08'/%3E%3Crect%20x='202'%20y='126'%20width='2'%20height='2'%20fill='%238B68AC'%20fill-opacity='0.08'/%3E%3Crect%20x='204'%20y='126'%20width='2'%20height='2'%20fill='%238B68AC'%20fill-opacity='0.08'/%3E%3Crect%20x='206'%20y='126'%20width='2'%20height='2'%20fill='%238B68AC'%20fill-opacity='0.08'/%3E%3Crect%20x='200'%20y='128'%20width='2'%20height='2'%20fill='%238B68AC'%20fill-opacity='0.08'/%3E%3Crect%20x='202'%20y='128'%20width='2'%20height='2'%20fill='%238B68AC'%20fill-opacity='0.08'/%3E%3Crect%20x='204'%20y='128'%20width='2'%20height='2'%20fill='%238B68AC'%20fill-opacity='0.08'/%3E%3Crect%20x='206'%20y='128'%20width='2'%20height='2'%20fill='%238B68AC'%20fill-opacity='0.08'/%3E%3Crect%20x='208'%20y='128'%20width='2'%20height='2'%20fill='%238B68AC'%20fill-opacity='0.08'/%3E%3Crect%20x='202'%20y='130'%20width='2'%20height='2'%20fill='%238B68AC'%20fill-opacity='0.08'/%3E%3Crect%20x='204'%20y='130'%20width='2'%20height='2'%20fill='%238B68AC'%20fill-opacity='0.08'/%3E%3Crect%20x='206'%20y='130'%20width='2'%20height='2'%20fill='%238B68AC'%20fill-opacity='0.08'/%3E%3Crect%20x='63'%20y='210'%20width='3'%20height='3'%20fill='%236F9BD1'%20fill-opacity='0.14'/%3E%3Crect%20x='60'%20y='213'%20width='3'%20height='3'%20fill='%236F9BD1'%20fill-opacity='0.14'/%3E%3Crect%20x='63'%20y='213'%20width='3'%20height='3'%20fill='%236F9BD1'%20fill-opacity='0.14'/%3E%3Crect%20x='66'%20y='213'%20width='3'%20height='3'%20fill='%236F9BD1'%20fill-opacity='0.14'/%3E%3Crect%20x='63'%20y='216'%20width='3'%20height='3'%20fill='%236F9BD1'%20fill-opacity='0.14'/%3E%3C/svg%3E"); --mode: var(--lavender); --mode-ink: var(--lavender-deep); --mode-soft: var(--lavender-soft); }
body { background-color: var(--bg); background-image: var(--deco), linear-gradient(180deg, #F6F0FD 0, var(--bg) 320px); background-repeat: repeat, no-repeat; font-family: var(--ui); }
body:has(.focus-mode), body:has(.starter) { background-image: linear-gradient(180deg, #F6F0FD 0, var(--bg) 320px); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) body { background-image: none; } }
:root[data-theme="dark"] body { background-image: none; }
h1, h2, h3, h4 { font-family: var(--ui); font-weight: 800; letter-spacing: -.01em; line-height: 1.25; color: var(--ink); }
h3 { font-size: 1.05rem; }
.page-title { font-size: clamp(1.45rem, 4.4vw, 1.9rem); font-weight: 900; color: var(--ink); margin-bottom: .9rem; }
.eyebrow { font-family: var(--arcade); font-size: .5rem; letter-spacing: .08em; color: var(--mode-ink); line-height: 1.8; }
.muted { color: var(--muted); }

/* mode accents: lavender daily · pink limitless · blue categories · muted archive · butter leaderboards */
#view[data-mode="limitless"], .play.mode-limitless { --mode: #D488B0; --mode-ink: var(--pink-ink); --mode-soft: var(--pink); }
#view[data-mode="category"], .play.mode-category { --mode: #7FA8D8; --mode-ink: var(--blue-ink); --mode-soft: var(--blue); }
#view[data-mode="archive"], .play.mode-archive { --mode: #A99CB8; --mode-ink: #75688A; --mode-soft: #EFEBF4; }
#view[data-mode="leaderboard"] { --mode: #D9B85A; --mode-ink: var(--butter-ink); --mode-soft: var(--butter); }
#view[data-mode] .page-head .page-title::after { content: ""; display: block; width: 42px; height: 6px; margin-top: 8px; background: repeating-linear-gradient(90deg, var(--mode) 0 6px, transparent 6px 9px); }

/* chrome */
.topbar { background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.bottomnav { background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -8px 24px -18px rgba(72, 48, 110, .35); }
.nav-link { font: 700 .72rem/1.2 var(--ui); color: var(--muted); }
.nav-link.active { color: var(--lavender-deep); }
.bottomnav .nav-link.active::before { top: 6px; width: 46px; height: 30px; border-radius: 12px; background: var(--lavender-soft); box-shadow: none; z-index: -1; }
.bottomnav .nav-link { z-index: 0; }
.badge { border-radius: 999px; font: 800 .68rem/1 var(--ui); box-shadow: 0 0 0 2px var(--surface); background: var(--pink-ink); }
@media (min-width: 960px) {
  .sidenav { background: var(--surface); border-right: 1px solid var(--line); }
  .side-links .nav-link { font: 700 .95rem/1.2 var(--ui); padding: 11px 14px; border: 0; border-radius: 14px; }
  .side-links .nav-link:hover { background: var(--bg-2); border-color: transparent; }
  .side-links .nav-link.active { background: var(--lavender-soft); color: var(--lavender-deep); box-shadow: inset 3px 0 0 var(--lavender); }
  .side-me { border: 2px solid var(--line); border-radius: 18px; box-shadow: 0 3px 0 var(--px-ink); }
  .side-me b { font: 800 .95rem/1.3 var(--ui); }
}

/* logo: lavender plate, pixel type */
.wordmark { --wm-ink: #382D46; border: 2px solid #6F4F92; border-radius: 14px; background: linear-gradient(180deg, #A07FC0 0%, #8B68AC 100%); box-shadow: 0 3px 0 #6F4F92, inset 0 2px 0 rgba(255, 255, 255, .25); }
.wordmark > span { font-family: var(--arcade); color: #FFFFFF; }
.wordmark > span b { color: #F5E5B8; }
.wordmark .logo-mark { filter: drop-shadow(0 2px 0 rgba(56, 45, 70, .5)); }
.auth-hero .wordmark { border-width: 2px; border-radius: 18px; box-shadow: 0 4px 0 #6F4F92, inset 0 2px 0 rgba(255, 255, 255, .25); }

/* cards */
.card { background: var(--surface); border: 2px solid var(--line); border-radius: 20px; box-shadow: 0 3px 0 var(--px-ink), 0 16px 32px -24px rgba(72, 48, 110, .35); }
.hero-card { border-width: 2px; border-radius: 24px; background: radial-gradient(120% 120% at 100% 0%, var(--lavender-soft) 0%, transparent 55%), var(--surface); box-shadow: 0 4px 0 var(--px-ink), 0 22px 40px -26px rgba(72, 48, 110, .45); }
.hero-card::after { color: var(--lavender); opacity: .07; font-family: var(--arcade); font-size: 150px; bottom: -20px; }
.hero-title { font: 900 clamp(1.35rem, 4.2vw, 1.75rem)/1.2 var(--ui); }
.card-head h3, .how summary h3 { font-size: 1.05rem; }
.banner { border: 2px solid var(--line); border-radius: 16px; box-shadow: 0 3px 0 var(--px-ink); }
.banner-warn { background: var(--butter); color: #5E4A12; }
.banner-challenge { background: var(--blue); }
.modal { border: 0; border-radius: 24px 24px 0 0; box-shadow: var(--shadow-lg); }
@media (min-width: 600px) { .modal { border-radius: 24px; } }
.modal-head h3 { font-size: 1.2rem; }
.toast { background: var(--ink); color: #fff; border: 0; border-radius: 14px; font: 700 .92rem/1.4 var(--ui); box-shadow: var(--shadow-lg); }
.toast.success { background: var(--mint-ink); } .toast.error { background: var(--t-catastrophe); }
/* tiny pixel corner stars on special panels */
.hero-card::before, .results-hero::before, .lm-hero::before, .reward-panel::before { content: ""; position: absolute; top: 12px; left: 12px; width: 3px; height: 3px; background: var(--butter-ink); opacity: .55;
  box-shadow: 0 -3px 0 currentColor, 0 3px 0 currentColor, -3px 0 0 currentColor, 3px 0 0 currentColor; color: #D9B85A; pointer-events: none; }
.results-hero { position: relative; }

/* buttons */
.btn { font: 800 .95rem/1.2 var(--ui); letter-spacing: 0; border: 0; border-radius: 14px; padding: 12px 18px; box-shadow: 0 3px 0 var(--px-ink); transition: transform .08s, box-shadow .08s, background .15s; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 4px 0 var(--px-ink); }
.btn:active { transform: translateY(3px); box-shadow: 0 0 0 var(--px-ink); }
.btn:disabled { transform: none; opacity: .55; }
.btn-primary { background: var(--lavender); color: #fff; box-shadow: 0 4px 0 var(--lavender-deep), inset 0 2px 0 rgba(255, 255, 255, .2); }
.btn-primary:hover { background: #9675B6; box-shadow: 0 5px 0 var(--lavender-deep), inset 0 2px 0 rgba(255, 255, 255, .2); }
.btn-primary:active { box-shadow: 0 1px 0 var(--lavender-deep); }
.btn-ghost { background: var(--surface); color: var(--ink); border: 2px solid var(--line-2); box-shadow: 0 3px 0 var(--px-ink); }
.btn-ghost:hover { background: var(--bg-2); border-color: var(--line-2); }
.btn-danger { background: var(--t-catastrophe); color: #fff; border: 0; box-shadow: 0 3px 0 #9E3E62; }
.btn-sm { font-size: .82rem; padding: 8px 12px; border-radius: 12px; }
.btn-lg { font-size: 1rem; padding: 14px 20px; }
.btn-xl { font-size: 1.08rem; padding: 16px 22px; border-width: 0; border-radius: 16px; box-shadow: 0 5px 0 var(--lavender-deep), inset 0 2px 0 rgba(255, 255, 255, .2); }
.btn-xl.btn-ghost { box-shadow: 0 4px 0 var(--px-ink); border: 2px solid var(--line-2); }
.btn-xl:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--lavender-deep); }
.icon-btn { border-radius: 12px; }
.icon-btn:hover { background: var(--lavender-soft); box-shadow: none; }
.link { font: 800 .85rem var(--ui); color: var(--lavender-deep); }

/* chips & pills */
.chip, .tchip, .pill { font: 700 .76rem/1.3 var(--ui); letter-spacing: 0; border-radius: 999px; padding: 4px 10px; box-shadow: none; background: var(--lavender-soft); color: var(--lavender-deep); }
.chip-muted { background: var(--bg-2); color: var(--muted); }
.pill { font-size: .85rem; padding: 6px 12px; }
.streak-pill { border: 2px solid var(--line); border-radius: 999px; box-shadow: 0 3px 0 var(--px-ink); font: 700 .78rem var(--ui); background: var(--surface); }
.streak-pill b { font: 900 1.05rem var(--ui); color: var(--pink-ink); }
.tier-badge, .rarity-badge { border-radius: 6px; }

/* forms */
.input, .form input:not([type=checkbox]), .form select, .form textarea, textarea.input { border: 2px solid var(--line-2); border-radius: 14px; background: var(--surface); box-shadow: none; font-family: var(--ui); }
.input:focus, .form input:focus, .form select:focus, .form textarea:focus { border-color: var(--lavender); box-shadow: 0 0 0 4px var(--lavender-soft); outline: none; }
.form label { font: 700 .88rem/1.4 var(--ui); color: var(--ink-2); }
.toggle span b { font: 800 .95rem/1.4 var(--ui); }
.toggle i { border-radius: 999px; border: 2px solid var(--line-2); background: var(--bg-2); }
.toggle i::after { border-radius: 50%; box-shadow: 0 1px 3px rgba(56, 45, 70, .3); transition: transform .15s; }
.toggle input:checked + i { background: var(--lavender); border-color: var(--lavender); }
.form-error { font: 700 .88rem/1.4 var(--ui); }

/* tabs */
.seg { border: 0; border-radius: 16px; background: var(--lavender-soft); padding: 4px; box-shadow: none; }
.seg-btn { font: 800 .86rem var(--ui); border-radius: 12px; padding: 8px 14px; color: var(--muted); }
.seg-btn.on { background: var(--surface); color: var(--lavender-deep); box-shadow: 0 2px 0 var(--px-ink), 0 4px 10px -6px rgba(72, 48, 110, .4); }
.seg-sm .seg-btn { font-size: .8rem; padding: 6px 11px; }

/* avatars keep their pixel cats, framed softly */
.av, .av-icon { border-radius: 12px; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line-2), inset 0 -3px 0 rgba(0, 0, 0, .08); }

/* numbers */
.big-num { font: 900 3rem/1 var(--ui); color: var(--lavender-deep); }
.score-ring { border: 2px solid var(--line); border-radius: 26px; background: var(--surface); box-shadow: 0 0 0 8px var(--lavender-soft), 0 4px 0 8px var(--px-ink); }
.score-ring small { font: 700 .82rem var(--ui); color: var(--muted); }
.lb-score b, .stat b, .rank-box b, .tb b, .mini-board .score b, .bd-err b, .h2h-totals b, .hist-list b, .qa-ans, .tier-bars b, .qcount b { font-family: var(--ui); font-weight: 900; }
.stat small, .rank-box small, .reveal-stats small { font: 700 .74rem/1.4 var(--ui); letter-spacing: .02em; color: var(--muted); }
.rank-box, .reveal-stats > div, .explain { border: 2px solid var(--line); border-radius: 16px; box-shadow: 0 3px 0 var(--px-ink); background: var(--surface); }
.explain { background: var(--surface-2); }
.stat { border-radius: 18px; }
.tb, .tier-dot, .ach, .fchip, .shelf-cat, .cat-card { border: 2px solid var(--line); border-radius: 16px; }
.ach.on { background: color-mix(in srgb, var(--butter) 45%, var(--surface)); border-color: color-mix(in srgb, #D9B85A 45%, var(--line)); }
.ach b, .cat-name, .fchip span, .mini-board .name, .who b, .tb-label { font-family: var(--ui); font-weight: 800; letter-spacing: 0; }
.who b, .mini-board .name { font-size: .95rem; }
.you { font: 800 .62rem var(--ui); border-radius: 999px; padding: 2px 6px; background: var(--lavender); color: #fff; }
.cat-card { box-shadow: 0 3px 0 var(--px-ink); }
.cat-card.equipped { box-shadow: 0 0 0 3px var(--tc), 0 3px 0 3px var(--px-ink); }
.mini-board li.me, .lb-row.me { background: var(--lavender-soft); border-color: transparent; box-shadow: none; }
.lb-row .rank { font: 900 1rem var(--ui); }
/* leaderboards: butter, blue and pink podium rows */
.lb-list > .lb-row:nth-child(1):not(.me) { background: linear-gradient(90deg, color-mix(in srgb, var(--butter) 75%, transparent), transparent 80%); }
.lb-list > .lb-row:nth-child(2):not(.me) { background: linear-gradient(90deg, color-mix(in srgb, var(--blue) 75%, transparent), transparent 80%); }
.lb-list > .lb-row:nth-child(3):not(.me) { background: linear-gradient(90deg, color-mix(in srgb, var(--pink) 75%, transparent), transparent 80%); }
.lb-sep { font: 800 .78rem var(--ui); color: var(--muted); border-top: 2px dashed var(--line-2); }
.react { border: 2px solid var(--line); border-radius: 999px; box-shadow: none; }
.react.mine { border-color: var(--lavender); background: var(--lavender-soft); }
.tier-bars .bar { border: 0; border-radius: 999px; background: var(--bg-2); height: 12px; }
.tier-bars .bar i { border-radius: 999px; background: var(--t); }
.spark-bar { border: 0; border-radius: 6px 6px 0 0; }
.bd-n { border-radius: 10px; font: 900 .9rem var(--ui); }
.breakdown.cards > li { border: 2px solid var(--line); border-radius: 16px; }
.pb-badge { font-family: var(--arcade); border: 2px solid #E3C976; border-radius: 12px; background: var(--butter); color: #6B5310; box-shadow: 0 3px 0 #E3C976; }

/* progress */
.seg-progress i { height: 10px; border: 0; border-radius: 999px; box-shadow: none; background: var(--line-2); }
.seg-progress.lg i { height: 12px; }
.seg-progress i.current { background: var(--mode); animation: pulse 1.2s ease-in-out infinite; }
.seg-progress i[class*="t-"] { background: var(--t); }

/* gameplay: clean, focused */
.qcard, .reveal { border: 2px solid var(--line); border-radius: 24px; box-shadow: 0 4px 0 var(--px-ink), 0 24px 44px -30px rgba(72, 48, 110, .5); }
.q-text { font: 800 clamp(1.2rem, 4.4vw, 1.5rem)/1.35 var(--ui); color: var(--ink); }
.q-tags .chip { font-size: .74rem; }
.play-meta b { font: 800 .98rem/1.3 var(--ui); }
.qcount { font: 700 .85rem var(--ui); }
.guess-input { font: 900 clamp(3rem, 13vw, 4.2rem)/1 var(--ui); color: var(--lavender-deep); letter-spacing: -.02em; }
.guess-display .pct { font: 800 2rem var(--ui); color: var(--lavender-2); }
.slider-track { height: 16px; border: 0; border-radius: 999px; background: var(--lavender-soft); box-shadow: inset 0 2px 0 rgba(72, 48, 110, .08); }
.slider-fill { border-radius: 999px; background: repeating-linear-gradient(90deg, var(--lavender) 0 8px, var(--lavender-2) 8px 10px); }
.tick { background: rgba(139, 104, 172, .25); }
.slider-thumb { width: 42px; height: 42px; margin: -21px 0 0 -21px; border-radius: 14px; border: 2px solid var(--lavender); background: var(--surface); box-shadow: 0 3px 0 var(--lavender-deep); }
.slider-bubble { font: 800 .85rem var(--ui); border: 0; border-radius: 10px; background: var(--lavender); color: #fff; }
.slider-scale { font: 700 .74rem var(--ui); color: var(--muted); }
.fine-btn { font: 800 .9rem var(--ui); border: 2px solid var(--line-2); border-radius: 12px; background: var(--surface); box-shadow: 0 3px 0 var(--px-ink); }
.fine-btn:hover { background: var(--lavender-soft); border-color: var(--line-2); }
.fine .muted.small { font: 700 .76rem var(--ui); }
.qt-bar { height: 12px; border: 0; border-radius: 999px; background: var(--lavender-soft); box-shadow: none; }
.qt-bar i { background: repeating-linear-gradient(90deg, #8CC896 0 8px, #7DBB88 8px 10px); border-radius: 999px; }
.qtimer.warn .qt-bar i { background: repeating-linear-gradient(90deg, #EBC65E 0 8px, #DDB54C 8px 10px); } .qtimer.warn .qt-num { color: var(--butter-ink); }
.qtimer.urgent .qt-bar i { background: repeating-linear-gradient(90deg, #E58AAE 0 8px, #D9779E 8px 10px); }
.qt-num { font: 900 1.3rem/1 var(--ui); }
.qt-warn { border: 0; border-radius: 14px; background: var(--butter); color: #6B5310; box-shadow: none; font: 800 .88rem/1.4 var(--ui); }
.reveal::before { height: 8px; margin: -24px -20px 18px; background: var(--t); border: 0; border-radius: 22px 22px 0 0; }
.reward-badge { border: 2px solid var(--line); border-radius: 22px; background: var(--t-soft, var(--lavender-soft)); box-shadow: 0 4px 0 var(--px-ink); }
.reveal.t-purrfect { --t-soft: var(--butter); } .reveal.t-clawsome { --t-soft: var(--mint); } .reveal.t-sharp { --t-soft: var(--blue); } .reveal.t-close { --t-soft: var(--lavender-soft); } .reveal.t-catastrophe { --t-soft: var(--pink); }
.reward-title { font-family: var(--arcade); font-size: 1rem; color: var(--t); text-shadow: 2px 2px 0 color-mix(in srgb, var(--t) 22%, transparent); }
.reveal.t-purrfect .reward-title { filter: none; text-shadow: 2px 2px 0 #F0D88E; }
.reveal-stats b { font: 900 1.3rem/1.5 var(--ui); }
.reveal-stats .unit { font-size: .8rem; }
.source { font: 800 .82rem var(--ui); color: var(--lavender-deep); }
.ctrack-bar { height: 12px; border: 0; border-radius: 999px; background: var(--lavender-soft); }
.ctrack-mark::before { border: 2px solid var(--surface); border-radius: 50%; box-shadow: 0 0 0 1px var(--line-2); }
.ctrack-mark span { font: 800 .74rem var(--ui); border-radius: 8px; }
.confirm-guess { font: 900 3.4rem var(--ui); color: var(--lavender-deep); text-shadow: none; }
.rule-n { font-family: var(--arcade); border: 0; border-radius: 10px; background: var(--lavender); box-shadow: 0 3px 0 var(--lavender-deep); }
.auth-rules { border: 2px solid var(--line); border-radius: 22px; box-shadow: 0 3px 0 var(--px-ink); }
.auth-rules h2 { font-size: 1.15rem; }
.auth-hero h1 { color: var(--ink); text-shadow: 3px 3px 0 var(--pink), 6px 6px 0 var(--lavender-line); }
.auth-card { border-width: 2px; }
.auth-demo { border: 2px solid var(--line); border-radius: 20px; box-shadow: 0 3px 0 var(--px-ink); }
.demo-track { border: 0; border-radius: 999px; background: var(--lavender-soft); }
.demo-fill { border-radius: 999px; background: repeating-linear-gradient(90deg, var(--lavender) 0 8px, var(--lavender-2) 8px 10px); }
.demo-thumb { border: 2px solid var(--lavender); border-radius: 10px; box-shadow: 0 2px 0 var(--lavender-deep); }

/* results */
.results-hero { background-image: radial-gradient(120% 80% at 50% 0%, var(--mode-soft), var(--surface) 65%); }

/* home "my cats" label + yarn panels in pastel */
.hero-cat span { font-family: var(--arcade); color: var(--lavender-deep); text-shadow: 1px 1px 0 #fff; }
.yarn-legend { background: linear-gradient(180deg, var(--lavender-soft), #F7F1FD); border: 2px solid var(--line); border-radius: 18px; }
.yarn-legend figcaption { color: var(--lavender-deep); }
.cat-stage { background: linear-gradient(#EDE3F8 0 70%, #E2D3C2 70% 100%); box-shadow: inset 0 0 0 2px var(--line-2); border-radius: 18px; }
.cat-stage::before { background: #F5E5B8; box-shadow: 4px 4px 0 #E1D5EF; }
.collect-meter i, .cat-prog i { border: 0; border-radius: 999px; background: var(--bg-2); }
.collect-meter i b { background: repeating-linear-gradient(90deg, var(--lavender) 0 8px, var(--lavender-2) 8px 10px); }
.cat-tile { border-radius: 14px; }

/* more ways to play + mode hub: white cards with a coloured icon tile */
.more-way, .mode-card { color: var(--ink); background: var(--surface); border: 2px solid var(--line); border-radius: 20px; box-shadow: 0 3px 0 var(--px-ink); --mw: var(--lavender-soft); }
.more-way b, .mode-card b { font: 800 1rem/1.3 var(--ui); color: var(--ink); }
.more-way small, .mode-card small { color: var(--muted); font-size: .84rem; }
.more-way .mw-ic, .mode-ic { background: var(--mw); border: 0; border-radius: 14px; }
.more-way[href="#/archive"], .more-way[data-go="archive"], .mode-card[href="#/archive"], .mode-card[data-go="archive"] { --mw: #EFEBF4; }
.more-way[href="#/categories"], .more-way[data-go="categories"], .mode-card[href="#/categories"], .mode-card[data-go="categories"] { --mw: var(--blue); }
.mw-lm, .mode-card[href="#/limitless"], .mode-card[data-go="limitless"] { --mw: var(--pink); background: var(--surface); }
.mode-daily { --mw: var(--lavender-soft); border-color: color-mix(in srgb, var(--lavender) 30%, var(--line)); }
.more-way i, .mode-card i { color: var(--muted); }

/* archive (muted lavender) */
.arch-day { border: 2px solid var(--line); border-radius: 14px; box-shadow: 0 2px 0 var(--px-ink); }
.arch-day b { font: 900 1rem/1 var(--ui); } .arch-day small { font: 700 .62rem/1 var(--ui); }
.arch-week span { font: 800 .74rem var(--ui); }
.arch-day.on { border-color: var(--mode); box-shadow: 0 0 0 3px var(--mode-soft), 0 2px 0 var(--px-ink); }

/* category mode (blue) */
.cm-hero { border-radius: 24px; background: linear-gradient(135deg, color-mix(in srgb, var(--cc) 12%, var(--surface)), var(--surface) 70%); }
.cm-card { border-radius: 20px; }
.diff-easy { background: var(--mint); color: var(--mint-ink); } .diff-hard { background: var(--blue); color: var(--blue-ink); } .diff-very_hard { background: var(--pink); color: var(--pink-ink); }

/* limitless (pink) */
.lm-hero { position: relative; background: linear-gradient(135deg, #FBE9F3 0%, #F1E8FA 70%); color: var(--ink); border: 2px solid color-mix(in srgb, #D488B0 30%, var(--line)); }
.lm-hero .muted { color: var(--ink-2); }
.lm-hero .eyebrow { color: var(--pink-ink); }
.lm-title { color: var(--lavender-deep); text-shadow: 3px 3px 0 #F3C6DD; }
.lm-pb { background: rgba(255, 255, 255, .75); border: 2px solid #F0CDE0; border-radius: 14px; }
.lm-pb span, .lm-pb small { color: var(--muted); } .lm-pb b { color: var(--pink-ink); }
.lm-hud-bar { border: 2px solid var(--line); border-radius: 20px; box-shadow: 0 3px 0 var(--px-ink); }
.lm-hud-nums small, .hp-label, .hp-state { font: 800 .7rem/1 var(--ui); }
.lm-hud-nums b { font: 900 1.15rem/1 var(--ui); } .lm-hud-nums .hot b { color: var(--pink-ink); }
.hp-num { font: 900 1rem/1 var(--ui); }
.hp-track { border: 2px solid var(--line-2); border-radius: 999px; background: var(--bg-2); box-shadow: none; height: 16px; }
.hp-fill { border-radius: 999px; box-shadow: inset 0 3px 0 rgba(255, 255, 255, .35); }
.hp-ticks { background: repeating-linear-gradient(90deg, transparent 0 calc(10% - 2px), rgba(255, 255, 255, .6) calc(10% - 2px) 10%); }
.hp-label::first-letter { color: var(--pink-ink); }
.lm-calc div, .lm-summary div, .lm-pstats .stat, .lm-dist span { border: 2px solid var(--line); border-radius: 14px; background: var(--surface); }
.lm-calc b, .lm-summary b, .lm-pstats .stat b, .lm-run-n b { font-family: var(--ui); font-weight: 900; }
.lm-run-row { border: 2px solid var(--line); border-radius: 16px; box-shadow: 0 3px 0 var(--px-ink); }
.lm-run-n b { color: var(--pink-ink); }
.lm-ach-i { border: 2px solid var(--line); border-radius: 16px; }
.lm-ach-i.on { background: color-mix(in srgb, var(--pink) 50%, var(--surface)); box-shadow: 0 3px 0 var(--px-ink); }
.lm-rec th, .lm-rec td { border: 2px solid var(--line); } .lm-rec { border-radius: 12px; overflow: hidden; border-collapse: separate; border-spacing: 0; }
.lm-bar { fill: #D488B0; } .lm-hg-line { stroke: var(--pink-ink); }
.lm-tier { font-family: var(--ui); }
.lm-t-easy { background: var(--mint); color: var(--mint-ink); } .lm-t-medium { background: var(--butter); color: #7A5E14; } .lm-t-hard { background: #FBE3CF; color: #A35B22; }
.lm-t-very_hard { background: var(--pink); color: var(--pink-ink); } .lm-t-expert { background: var(--lavender-deep); color: #F5E5B8; }
.lm-pb-chip { font-family: var(--arcade); background: var(--butter); color: #6B5310; }
:root { --hp-green: #7CC68A; --hp-yellow: #EECB62; --hp-orange: #F0A35E; --hp-red: #E26D8C; }
.lm-play.band-red .lm-hud-bar { border-color: #EBA3BC; }

/* starter selection: soft lavender sky instead of deep purple */
.starter { background: linear-gradient(180deg, #F4EDFC 0%, #ECE2F8 55%, #F8E6F1 100%); color: var(--ink); }
.starter-sky i { background: #E3C976; box-shadow: 0 -6px 0 #E3C976, 0 6px 0 #E3C976, -6px 0 0 #E3C976, 6px 0 0 #E3C976; opacity: .6; }
.starter-kicker { color: var(--pink-ink); }
.starter-title { color: var(--lavender-deep); text-shadow: 3px 3px 0 #FFFFFF, 5px 5px 0 var(--lavender-line); }
.starter-title span { color: var(--pink-ink); text-shadow: 3px 3px 0 #FFFFFF, 5px 5px 0 #F3C6DD; }
.starter-sub { color: var(--ink-2); }
.starter-warn { color: #6B5310; background: var(--butter); border: 2px solid #E3C976; border-radius: 12px; box-shadow: 0 3px 0 #E3C976; }
.starter-card { background: var(--surface); border: 2px solid var(--line); border-radius: 24px; box-shadow: 0 4px 0 var(--px-ink), 0 20px 40px -28px rgba(72, 48, 110, .5); }
.starter-card:hover, .starter-card:focus-visible { background: var(--surface); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent), 0 6px 0 var(--px-ink); }
.starter-card.selected { background: color-mix(in srgb, var(--accent) 10%, var(--surface)); border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 30%, transparent), 0 8px 0 var(--px-ink); }
.starter-stage { background: radial-gradient(60% 55% at 50% 60%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%); }
.starter-floor { background: rgba(72, 48, 110, .14); }
.starter-name { color: var(--ink); text-shadow: 2px 2px 0 var(--lavender-line); }
.starter-trait { color: var(--pink-ink); }
.starter-bio { color: var(--muted); }
.starter-check { color: #fff; border: 0; border-radius: 10px; }
.starter-go { font-family: var(--ui); font-weight: 900; font-size: 1.1rem; border: 0; border-radius: 16px; box-shadow: 0 5px 0 var(--lavender-deep); }
.starter-go:not(:disabled):hover { box-shadow: 0 6px 0 var(--lavender-deep); }
.starter-go:disabled { background: #D9CDE8; color: #fff; box-shadow: 0 5px 0 #C5B6D9; }
.starter-note { color: var(--muted); }
@media (max-width: 760px) { .starter-cta { background: linear-gradient(transparent, #F6E7F1 35%); } .starter-note { color: var(--muted); } }

/* premium, boss and admin keep their drama but in the new type */
.premium-badge { border: 2px solid #E3C976; border-radius: 10px; background: var(--butter); color: #6B5310; box-shadow: 0 3px 0 #E3C976; }
.adm-table th { font: 800 .74rem/1.4 var(--ui); color: var(--muted); }

/* yarn overlay: pastel room (the cats and yarn are the original pixel art) */
.yarn-full { background: var(--bg); }
.yarn-cap span { text-shadow: -3px 0 0 #382D46, 3px 0 0 #382D46, 0 -3px 0 #382D46, 0 3px 0 #382D46, -3px -3px 0 #382D46, 3px -3px 0 #382D46, -3px 3px 0 #382D46, 3px 3px 0 #382D46, 0 6px 0 #382D46; }
.yarn-cap small { background: rgba(56, 45, 70, .82); border: 0; border-radius: 12px; }
.yarn-full .yarn-skip { font: 800 .9rem var(--ui); color: #fff; background: rgba(56, 45, 70, .82); border: 0; border-radius: 999px; padding: 9px 16px; }
.lm-hud .lm-ov-bar { border: 3px solid #382D46; border-radius: 999px; box-shadow: 0 3px 0 #382D46; }
.lm-hud .lm-ov-bar i { border-radius: 999px; }
.lm-hud-label { color: #382D46; text-shadow: 1px 1px 0 #fff; }
.lm-hud-num { text-shadow: -2px 0 0 #382D46, 2px 0 0 #382D46, 0 -2px 0 #382D46, 0 3px 0 #382D46; }
.lm-float { text-shadow: -3px 0 0 #382D46, 3px 0 0 #382D46, 0 -3px 0 #382D46, 0 3px 0 #382D46, 0 6px 0 #382D46; }

/* loading: the player's own pixel cat batting a ball of yarn */
html.has-load-art .loading .spinner { position: relative; width: 54px; height: 66px; border: 0; border-radius: 0; background: var(--load-cat) 0 0 / 600% 100% no-repeat; image-rendering: pixelated; animation: loadCat .9s step-end infinite; margin-right: 24px; }
html.has-load-art .loading .spinner::after { content: ""; position: absolute; left: 100%; bottom: 0; width: 24px; height: 24px; background: var(--load-yarn) center / contain no-repeat; image-rendering: pixelated; animation: loadYarn .9s steps(6) infinite; }
@keyframes loadCat { 0% { background-position-x: 0; } 40% { background-position-x: 100%; } 70% { background-position-x: 60%; } }
@keyframes loadYarn { 0%, 100% { transform: translate(0, 0) rotate(0); } 45% { transform: translate(10px, -10px) rotate(120deg); } 70% { transform: translate(14px, 0) rotate(200deg); } }
@media (prefers-reduced-motion: reduce) { html.has-load-art .loading .spinner, html.has-load-art .loading .spinner::after { animation: none; } }

/* heading sizes that were tuned for the pixel font */
.ph-info h1 { font-size: 1.6rem; text-shadow: none; line-height: 1.2; }
.day-head h1 { font-size: 1.35rem; }
.cat-hero-info h2 { font-size: 1.5rem; text-shadow: none; }
.cat-unlock h3, .ach-unlock h3 { font-family: var(--arcade); font-size: 1rem; line-height: 1.5; text-shadow: 2px 2px 0 var(--lavender-line); }
.empty h3 { font-size: 1.15rem; }
.arch-detail h2 { font-size: 1.25rem; }
.cm-card h3 { font-size: 1.08rem; }
.h2h-side b { font-size: .95rem; }
.lm-mini-boards .who b small.you { display: inline-block; overflow: visible; }
.premium-card { background: linear-gradient(160deg, #F3ECFB, #FBE9F3); }
.premium-card h1 { font-size: 1.5rem; color: var(--lavender-deep); text-shadow: none; }
.premium-list li { color: var(--ink); }
.premium-card { color: var(--ink); border-color: var(--line); }
.premium-list li { background: rgba(255, 255, 255, .8); border: 2px solid var(--line); }
.premium-card .muted { color: var(--muted); }
.who small.you, .lm-mini-boards .who small.you { display: inline-block; color: #fff; font: 800 .66rem/1.5 var(--ui); padding: 0 7px; border-radius: 999px; background: var(--lavender); vertical-align: 2px; overflow: visible; }
.page-title, .ph-info h1, .cat-hero-info h2 { text-shadow: none; }
.av { background: color-mix(in srgb, var(--c) 42%, #FFFFFF); }
.stat-grid > .card { margin-bottom: 0; }
.arch-day.s-played, .arch-legend i.s-played { background: #ECE6F4; } .arch-day.s-replayed, .arch-legend i.s-replayed { background: var(--mint); } .arch-day.s-playing, .arch-legend i.s-playing { background: var(--butter); }
.arch-day.on { background: var(--lavender); color: #fff; } .arch-day.on small { color: rgba(255, 255, 255, .85); }
.cust-stage { background: linear-gradient(#EDE3F8 0 72%, #E2D3C2 72% 100%); box-shadow: inset 0 0 0 2px var(--line-2); }
.cust-stage::before { background: #F5E5B8; box-shadow: 4px 4px 0 #E1D5EF; }
.cos-preview { background: var(--lavender-soft); border-radius: 16px; }
.qcard.yarn-host { background: var(--lavender-soft); border-color: var(--line); }
.seg-progress i.boss-seg { background: color-mix(in srgb, var(--pink-ink) 30%, var(--line-2)); } .seg-progress i.boss-seg.current { background: var(--pink-ink); }
.hero-card .seg-progress { padding-right: 84px; } @media (max-width: 420px) { .hero-card .seg-progress { padding-right: 62px; } }
@media (max-width: 420px) { .hero-card .hero-title, .hero-card > p.muted { padding-right: 78px; } .hero-card .seg-progress { padding-right: 78px; } }
/* lavender night (dark theme) versions of the pastel panels */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --lm-hero-bg: linear-gradient(135deg, #3E2A3D 0%, #2F2742 70%); --starter-bg: linear-gradient(180deg, #2A2238 0%, #2D2340 55%, #3A2537 100%); --stage-bg: linear-gradient(#3A2E4D 0 72%, #4A3D36 72% 100%); --tint-panel: linear-gradient(160deg, #33284A, #3E2A3D); } }
:root[data-theme="dark"] { --lm-hero-bg: linear-gradient(135deg, #3E2A3D 0%, #2F2742 70%); --starter-bg: linear-gradient(180deg, #2A2238 0%, #2D2340 55%, #3A2537 100%); --stage-bg: linear-gradient(#3A2E4D 0 72%, #4A3D36 72% 100%); --tint-panel: linear-gradient(160deg, #33284A, #3E2A3D); }
.lm-hero { background: var(--lm-hero-bg, linear-gradient(135deg, #FBE9F3 0%, #F1E8FA 70%)); }
.lm-title { color: var(--lm-title, var(--lavender-deep)); }
.lm-pb { background: color-mix(in srgb, var(--surface) 80%, transparent); }
.starter { background: var(--starter-bg, linear-gradient(180deg, #F4EDFC 0%, #ECE2F8 55%, #F8E6F1 100%)); }
.cust-stage, .cat-stage { background: var(--stage-bg, linear-gradient(#EDE3F8 0 72%, #E2D3C2 72% 100%)); }
.premium-card { background: var(--tint-panel, linear-gradient(160deg, #F3ECFB, #FBE9F3)); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .lm-title, :root:not([data-theme="light"]) .starter-title { color: #E6D6F5; text-shadow: 3px 3px 0 #5A3A57; } :root:not([data-theme="light"]) .starter-cta { background: linear-gradient(transparent, #3A2537 35%); } }
:root[data-theme="dark"] .lm-title, :root[data-theme="dark"] .starter-title { color: #E6D6F5; text-shadow: 3px 3px 0 #5A3A57; }
:root[data-theme="dark"] .starter-cta { background: linear-gradient(transparent, #3A2537 35%); }

/* =====================================================================
   CLEAN-UP PASS — lighter cards, one spacing scale, quieter secondary info,
   and the 8-bit reward star system.
   ===================================================================== */
:root { --gap: 16px; --pad: 20px; --card-border: 1.5px solid var(--line); --card-shadow: 0 1px 2px rgba(72, 48, 110, .05), 0 10px 28px -20px rgba(72, 48, 110, .35); --tile: var(--bg-2); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --tile: #332A43; } } :root[data-theme="dark"] { --tile: #332A43; }

/* calm background: plain lavender wash; pixel motifs stay on the welcome page only */
body { background-image: linear-gradient(180deg, #F5EFFC 0, var(--bg) 360px); }
body:has(.auth) { background-image: var(--deco), linear-gradient(180deg, #F5EFFC 0, var(--bg) 360px); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) body, :root:not([data-theme="light"]) body:has(.auth) { background-image: none; } }
:root[data-theme="dark"] body, :root[data-theme="dark"] body:has(.auth) { background-image: none; }

/* cards: one border, one soft shadow, consistent padding and rhythm */
.card, .hero-card, .qcard, .reveal, .more-way, .mode-card, .cm-card, .lm-run-row, .starter-card { border: var(--card-border); box-shadow: var(--card-shadow); }
.card { padding: var(--pad); margin-bottom: var(--gap); border-radius: 20px; }
.hero-card, .qcard, .reveal { border-radius: 24px; }
.grid-2 { gap: var(--gap); margin-bottom: var(--gap); }
.stat-grid { gap: 10px; margin-bottom: var(--gap); }
.card-head { margin-bottom: 12px; align-items: center; }
.card-head h3, .how summary h3, .card > h3 { font-size: 1.02rem; font-weight: 800; margin: 0; }
.card > h3 { margin-bottom: 12px; }
.page-head { margin-bottom: 4px; }
.page-title { margin-bottom: 14px; }
#view[data-mode] .page-head .page-title::after { display: none; }
/* decorations removed: big % glyph, corner sparkles */
.hero-card::after, .hero-card::before, .results-hero::before, .lm-hero::before, .reward-panel::before { display: none; }

/* inner tiles: no borders inside cards — soft tinted blocks instead */
.rank-box, .reveal-stats > div, .explain, .lm-calc div, .lm-summary div, .lm-pstats .stat, .lm-dist span, .cm-card-stats div, .arch-stats > div, .stat-grid .stat:not(.card) { border: 0; box-shadow: none; background: var(--tile); border-radius: 14px; }
.stat-grid > .card.stat { box-shadow: none; }
.explain { background: var(--tile); }
.tb, .ach, .fchip, .shelf-cat, .cat-card, .lm-ach-i, .collar-tile { border: 0; box-shadow: none; background: var(--tile); }
.cat-card { background: var(--surface); border: var(--card-border); }
.cat-card.equipped { box-shadow: 0 0 0 2px var(--lavender); }
.mini-board li, .lb-row { border: 0; }
.user-list > li, .h2h-list li, .breakdown > li { border-bottom: 1px solid var(--line); }
.btn-ghost { border-width: 1.5px; box-shadow: 0 2px 0 var(--px-ink); }
.chip { background: var(--tile); color: var(--ink-2); }
.pill-primary, .pill { background: var(--lavender-soft); color: var(--lavender-deep); }
small, .small { line-height: 1.45; }

/* ---------- 8-bit reward stars ---------- */
.star { display: inline-block; width: var(--s); height: var(--s); flex: none; vertical-align: middle; background-repeat: no-repeat; image-rendering: pixelated; image-rendering: crisp-edges; }
.star[style*="--n"] { background-size: calc(var(--n) * 100%) 100%; animation: frameStep calc(var(--n) * .18s) steps(var(--n)) infinite; }
.star-rainbow[style*="--n"] { animation-duration: .9s; }
.star-silver[style*="--n"] { animation: frameStep 1.6s steps(var(--n)) infinite; }
.star-gold { filter: drop-shadow(0 0 3px rgba(246, 200, 62, .45)); } .star-diamond { filter: drop-shadow(0 0 4px rgba(134, 227, 246, .6)); } .star-rainbow { filter: drop-shadow(0 0 5px rgba(180, 140, 255, .55)); }
.star-locked { opacity: .7; }
@media (prefers-reduced-motion: reduce) { .star[style*="--n"] { animation: none; } }
.star-badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 5px; border-radius: 999px; background: var(--tile); font: 800 .76rem/1 var(--ui); color: var(--ink-2); vertical-align: middle; }
.star-badge-gold { background: color-mix(in srgb, var(--butter) 70%, var(--surface)); color: #6B5310; }
.star-badge-diamond { background: color-mix(in srgb, #D7F6FC 80%, var(--surface)); color: #1E5C80; }
.star-badge-rainbow { background: linear-gradient(90deg, #FFE3EC, #FFF3D6, #E2F7E5, #E0EEFF, #EFE4FF); color: #4A2A6A; }
.tile-star { position: absolute; top: 6px; left: 6px; line-height: 0; }
.cat-tile, .collar-tile { position: relative; }
.cat-card .lock { display: none; }
.pb-badge { display: inline-flex; align-items: center; gap: 8px; font: 800 .9rem/1 var(--ui); padding: 8px 14px; }
.reward-badge .reward-star { position: absolute; right: -10px; bottom: -10px; z-index: 2; line-height: 0; }
.ach-i { line-height: 0; display: block; margin-bottom: 6px; }
.lm-ach-i span:first-child { line-height: 0; }
.ach:not(.on) b, .lm-ach-i:not(.on) b { color: var(--muted); }
.act-main small .star { margin-right: 2px; vertical-align: -3px; }

/* ---------- reward reveal ---------- */
.reward-modal .modal-head { display: none; }
.reward-reveal { position: relative; text-align: center; padding: 8px 4px 0; overflow: hidden; }
.rr-glow { position: absolute; left: 50%; top: 96px; width: 300px; height: 300px; margin: -150px 0 0 -150px; border-radius: 50%; pointer-events: none; background: radial-gradient(circle, var(--rr-c, #EFE7F8) 0, transparent 62%); opacity: .9; }
.reward-silver { --rr-c: #E9EDF5; } .reward-gold { --rr-c: #FBEFC4; } .reward-diamond { --rr-c: #D4F5FC; } .reward-rainbow { --rr-c: #F4E2FF; } .reward-bronze { --rr-c: #F6E6D8; }
.reward-diamond .rr-glow, .reward-rainbow .rr-glow { background: repeating-conic-gradient(color-mix(in srgb, var(--rr-c) 90%, transparent) 0 10deg, transparent 10deg 20deg); mask: radial-gradient(circle, #000 0, transparent 65%); -webkit-mask: radial-gradient(circle, #000 0, transparent 65%); animation: spin 14s linear infinite; }
.reward-rainbow .rr-glow { background: repeating-conic-gradient(#FFD1DC 0 10deg, #FFF0C2 10deg 20deg, #D7F5DC 20deg 30deg, #D6E8FF 30deg 40deg, #EADBFF 40deg 50deg, transparent 50deg 60deg); }
.rr-stage { position: relative; display: inline-grid; place-items: end center; min-height: 150px; padding: 0 18px; animation: rrDrop .55s cubic-bezier(.3, 1.4, .5, 1) both; }
.rr-art { width: 108px !important; height: 132px !important; }
.rr-badge { line-height: 0; margin-bottom: 18px; }
.rr-buddy { position: absolute; right: -34px; bottom: 0; }
.rr-star { position: absolute; right: 0; bottom: 4px; line-height: 0; animation: rrStar .5s .35s cubic-bezier(.3, 1.6, .5, 1) both; }
.achievement .rr-star { display: none; }
.rr-kicker { position: relative; margin: 14px 0 4px; font: 400 .58rem/1.6 var(--arcade); letter-spacing: .06em; color: var(--lavender-deep); }
.rr-name { position: relative; margin: 0; font: 900 1.45rem/1.2 var(--ui); }
.rr-tier { position: relative; margin: 6px 0 10px; font: 800 .82rem var(--ui); color: var(--muted); }
.reward-gold .rr-tier { color: var(--butter-ink); } .reward-diamond .rr-tier { color: #2C86A8; }
.reward-rainbow .rr-tier { background: linear-gradient(90deg, #E5577F, #E8962F, #4E9A5C, #4C7FB8, #8B68AC); -webkit-background-clip: text; background-clip: text; color: transparent; }
.rr-how { position: relative; font-weight: 700; margin: 0 0 4px; }
@keyframes rrDrop { from { opacity: 0; transform: translateY(-24px) scale(.85); } to { opacity: 1; transform: none; } }
@keyframes rrStar { from { opacity: 0; transform: scale(.2) rotate(-60deg); } to { opacity: 1; transform: none; } }
.reward-bronze .rr-stage, .reward-silver .rr-stage { animation-duration: .4s; }
.reward-rainbow .rr-stage { animation: rrDrop .6s cubic-bezier(.3, 1.4, .5, 1) both, rrFloat 2.4s 1s ease-in-out infinite; }
@keyframes rrFloat { 50% { transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) { .rr-stage, .rr-star, .rr-glow { animation: none !important; } }
/* Limitless: the health maths as one readable line */
.lm-eq { display: flex; align-items: center; justify-content: space-between; gap: 4px; margin: 14px 0 6px; padding: 12px 10px; border-radius: 16px; background: var(--tile); }
.lm-eq span { display: flex; flex-direction: column; align-items: center; min-width: 0; flex: 1; }
.lm-eq b { font: 900 1.1rem/1.2 var(--ui); } .lm-eq small { font: 700 .68rem var(--ui); color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.lm-eq i { font: 800 1rem var(--ui); color: var(--muted); font-style: normal; }
.lm-eq .neg b { color: var(--t-catastrophe); } .lm-eq .pos b { color: var(--mint-ink); } .lm-eq .pos.zero b { color: var(--muted); }
.lm-eq .res.band-green b { color: var(--mint-ink); } .lm-eq .res.band-yellow b { color: var(--butter-ink); } .lm-eq .res.band-orange b { color: #C2671F; } .lm-eq .res.band-red b, .lm-eq .res.band-over b { color: var(--t-catastrophe); }
.lm-hero-stats { display: flex; gap: 8px; margin: 10px 0 16px; }
.lm-hero-stats div { flex: 1; padding: 10px 6px; text-align: center; border-radius: 14px; background: color-mix(in srgb, var(--surface) 75%, transparent); }
.lm-hero-stats b { display: block; font: 900 1.3rem/1.1 var(--ui); color: var(--pink-ink); } .lm-hero-stats small { font: 700 .72rem var(--ui); color: var(--muted); }
.lm-hero .btn-xl { width: 100%; }
.lm-board-tabs { margin-bottom: 10px; }
.lm-ach { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); }
.lm-ach-i small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.page-lede { margin: -6px 0 16px; max-width: 60ch; }
.cm-grid { gap: 12px; }
.cm-card { flex-direction: row; align-items: center; gap: 12px; padding: 14px; border-radius: 20px; border-top: var(--card-border); }
.cm-card::before { display: none; }
.cm-card-top { flex: 1; min-width: 0; text-decoration: none; color: inherit; }
.cm-card-top .cm-ic { width: 44px; height: 44px; padding: 6px; border: 0; background: color-mix(in srgb, var(--cc) 14%, var(--surface)); }
.cm-card h3 { font-size: 1rem; margin: 0; }
.cm-desc { margin: 2px 0 0; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.cm-meta { margin: 4px 0 0; font: 700 .74rem var(--ui); color: var(--muted); }
.cm-card-actions { flex-direction: column; gap: 6px; margin: 0; flex: none; }
.cm-card-actions .btn { justify-content: center; min-width: 84px; }
@media (min-width: 760px) { .cm-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* sidebar groups */
.nav-group { display: none; }
@media (min-width: 960px) { .nav-group { display: block; margin: 16px 14px 4px; font: 800 .7rem/1 var(--ui); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); } .side-links > .nav-group:first-child { margin-top: 4px; } }
/* section titles + compact game-mode tiles */
.section-title { font: 800 1.02rem/1.2 var(--ui); margin: 6px 2px 10px; }
.more-ways { margin: 0 0 var(--gap); }
.more-ways-row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.more-way { flex-direction: column; align-items: flex-start; gap: 8px; padding: 14px; border-radius: 18px; }
.more-way b { font-size: .95rem; }
.more-way small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: .78rem; }
@media (max-width: 520px) { .more-way small { display: none; } .more-way { align-items: center; text-align: center; padding: 12px 8px; } .more-way b { font-size: .86rem; } }
.home-head { margin-bottom: 4px; }
.mini-board li { padding: 7px 8px; }
@media (max-width: 420px) { .hero-card .hero-title, .hero-card > p.muted, .hero-card .seg-progress { padding-right: 96px; } }
@media (max-width: 520px) {
  .lm-ach, .ach-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .lm-ach-i small, .ach small { display: none; }
  .lm-ach-i, .ach { padding: 10px 6px; }
  .lm-ach-i b, .ach b { font-size: .74rem; line-height: 1.25; }
}
.lm-ach-i:not(.on), .ach:not(.on) { background: color-mix(in srgb, var(--tile) 60%, var(--surface)); }
.lm-ach-i.on, .ach.on { background: color-mix(in srgb, var(--butter) 40%, var(--surface)); box-shadow: none; }
.rr-tier { display: inline-block; }
.rr-star { right: -14px; bottom: -6px; }
.reward-badge .reward-star { right: -14px; bottom: -14px; }
.star-locked { opacity: .95; } .tile-star { top: 4px; left: 4px; }
.notif-list { display: grid; gap: 6px; } .notif-list li a { border-radius: 14px; }
/* 8-bit accuracy-title icons */
.tier-ic { display: inline-block; width: 1.3em; height: 1.3em; vertical-align: -.28em; image-rendering: pixelated; image-rendering: crisp-edges; }
.reward-emoji .tier-ic { width: 40px; height: 40px; }
.tier-dot .tier-ic { width: 26px; height: 26px; vertical-align: middle; }
.tb-e .tier-ic { width: 28px; height: 28px; }
.tier-legend .tchip .tier-ic { width: 26px; height: 26px; display: block; margin-bottom: 4px; }
.bd-err small .tier-ic { width: 18px; height: 18px; }
/* starter page: decorations never sit on top of text */
.starter-sky { z-index: 0; }
.starter-head, .starter-cards, .starter-cta { position: relative; z-index: 1; }
@media (max-width: 1100px) { .starter-sky { display: none; } }
.starter-sky i:nth-child(1) { left: 3%; top: 6%; } .starter-sky i:nth-child(2) { left: auto; right: 3%; top: 10%; }
.starter-sky i:nth-child(3) { left: 2%; top: 55%; } .starter-sky i:nth-child(4) { left: auto; right: 2%; top: 60%; }
.starter-sky i:nth-child(5) { left: 4%; top: 88%; } .starter-sky i:nth-child(6) { left: auto; right: 4%; top: 90%; }
@media (max-width: 760px) {
  .starter-card { grid-template-areas: "stage check" "stage kind" "stage name" "stage trait" "stage bio"; }
  .starter-check { position: static; grid-area: check; justify-self: start; display: none; margin: 0 0 6px; transform: none !important; opacity: 1; }
  .starter-card.selected .starter-check { display: inline-block; }
  .starter-stage .acat { max-width: 100%; }
}
/* home daily card: the cat gets its own column so it never covers the text */
.hero-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 14px; align-items: start; }
.hero-card > * { grid-column: 1 / -1; }
.hero-card .hero-cat { position: static; grid-column: 2; grid-row: 2 / span 2; align-self: center; justify-self: end; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 8px 4px; border-radius: 14px; background: var(--lavender-soft); text-decoration: none; }
.hero-card .hero-cat .acat { width: 60px; height: 74px; }
.hero-card .hero-cat span { font: 800 .7rem/1.2 var(--ui); color: var(--lavender-deep); text-shadow: none; margin: 0; white-space: nowrap; }
.hero-card .hero-top { grid-row: 1; }
.hero-card .hero-title { grid-column: 1; grid-row: 2; padding-right: 0 !important; align-self: end; }
.hero-card > p.muted, .hero-card .hero-score { grid-column: 1; grid-row: 3; padding-right: 0 !important; }
.hero-card .seg-progress { padding-right: 0 !important; }
@media (max-width: 420px) { .hero-card .hero-cat .acat { width: 50px; height: 62px; } .hero-card .hero-title { font-size: 1.3rem; } }
/* pinch zoom stays available; 16px+ inputs just stop iPhones jumping in when a field is tapped */
input, select, textarea { font-size: max(16px, 1em); }

/* =====================================================================
   FIT-TO-SCREEN DENSITY — everything a notch smaller so each screen fits
   comfortably on phones, tablets and desktops (pinch zoom still works).
   ===================================================================== */
html { font-size: 15px; }
@media (max-width: 480px) { html { font-size: 14.5px; } }
@media (max-width: 360px) { html { font-size: 14px; } }
body { font-size: 1rem; }
:root { --pad: 16px; --gap: 12px; --nav-h: 60px; }
@media (max-width: 480px) { :root { --pad: 14px; --gap: 10px; } }

/* chrome */
.topbar { padding: calc(env(safe-area-inset-top) + 8px) 14px 8px; }
.wordmark { padding: 4px 10px 5px 6px; gap: 6px; border-radius: 12px; }
.wordmark .logo-mark { width: 24px; height: 24px; }
.wordmark > span { font-size: .68rem; }
.icon-btn { width: 38px; height: 38px; }
.nav-link .ic { width: 20px; height: 20px; }
.nav-link { font-size: .68rem; }
.bottomnav .nav-link.active::before { top: 5px; width: 42px; height: 27px; }
#view { padding: 12px 14px calc(var(--nav-h) + env(safe-area-inset-bottom) + 20px); }
@media (min-width: 960px) {
  .shell { grid-template-columns: 224px 1fr; }
  #view { max-width: 820px; padding: 28px 28px 48px; }
  .side-links .nav-link { padding: 9px 12px; font-size: .9rem; }
  .sidenav { padding: 18px 14px; }
}

/* type scale */
.page-title { font-size: clamp(1.3rem, 4vw, 1.6rem); margin-bottom: 10px; }
.home-head .page-title { font-size: clamp(1.25rem, 4vw, 1.55rem); }
h3, .card-head h3, .card > h3, .how summary h3 { font-size: .98rem; }
.hero-title { font-size: clamp(1.15rem, 3.8vw, 1.45rem) !important; }
.section-title { font-size: .98rem; margin: 4px 2px 8px; }
.eyebrow { font-size: .46rem; }
.muted { line-height: 1.45; }

/* cards & tiles */
.card { padding: var(--pad); border-radius: 18px; }
.hero-card { padding: 18px; border-radius: 20px; }
.qcard, .reveal { padding: 16px; border-radius: 20px; }
.reveal::before { margin: -16px -16px 14px; border-radius: 18px 18px 0 0; }
.stat-grid .stat, .stat-grid > .card.stat { padding: 12px; }
.stat b { font-size: 1.05rem; }
.banner { padding: 12px 14px; border-radius: 14px; }
.more-way { padding: 12px; }
.mini-board li { padding: 5px 8px; }
.lb-row { padding: 8px 10px; }
.cm-card { padding: 12px; }

/* buttons */
.btn { font-size: .9rem; padding: 10px 16px; border-radius: 12px; }
.btn-sm { font-size: .8rem; padding: 7px 11px; }
.btn-lg { font-size: .95rem; padding: 12px 18px; }
.btn-xl { font-size: 1rem; padding: 13px 18px; border-radius: 14px; }
.seg-btn { font-size: .82rem; padding: 7px 12px; }

/* big numbers */
.big-num { font-size: 2.4rem; }
.score-ring { width: 160px; height: 140px; }
.score-ring .big-num { font-size: 2.5rem; }
.confirm-guess { font-size: 2.8rem; }

/* gameplay: question, number, slider and button all on one screen */
.play-head { margin-bottom: 8px; }
.qtimer { margin: -2px 0 10px; }
.q-tags { margin-bottom: 8px; }
.q-text { font-size: clamp(1.05rem, 3.9vw, 1.3rem); margin-bottom: 6px; }
.guess-display { margin: 8px 0 4px; }
.guess-input { font-size: clamp(2.5rem, 11vw, 3.3rem); }
.guess-display .pct { font-size: 1.6rem; }
.slider-wrap { margin: 6px 0 2px; }
.fine { margin: 8px 0 12px; }
.fine-btn { padding: 7px 0; min-width: 44px; font-size: .85rem; }
.reward-badge { width: 92px; height: 92px; }
.cat-reward { width: 60px !important; height: 74px !important; }
.reveal-stats b { font-size: 1.15rem; }
.lm-hud-bar { padding: 8px 10px; margin-bottom: 10px; }
@media (max-height: 700px) {
  .qcard { padding: 12px 14px; }
  .q-text { font-size: 1.02rem; }
  .guess-input { font-size: 2.4rem; }
  .fine { margin: 6px 0 8px; }
  .slider-thumb { width: 38px; height: 38px; margin: -19px 0 0 -19px; }
  .qtimer { margin-bottom: 6px; }
}

/* home + modes */
.hero-card .hero-cat .acat { width: 52px; height: 64px; }
.lm-hero { gap: 14px; }
.lm-hero-acat { width: 84px; height: 102px; }
.lm-title { font-size: clamp(1.2rem, 5vw, 1.8rem); }
.lm-hero-stats b { font-size: 1.15rem; }
.cat-stage { width: 128px; height: 128px; }
.cust-stage { width: 172px; height: 180px; }
.cat-xxl { width: 120px; height: 146px; }
.profile-head .av { --s: 72px !important; width: 72px; height: 72px; }
.ph-info h1 { font-size: 1.35rem; }
.rr-stage { min-height: 128px; }
.rr-name { font-size: 1.25rem; }
.lm-rec { font-size: .78rem; } .lm-rec th, .lm-rec td { padding: 3px 6px; }
.table-wrap, .lm-rules + .lm-rec { max-width: 100%; overflow-x: auto; }

/* ---------- today's leaderboard (home) ---------- */
:root { --dist-bar: #9A7BC9; --dist-me: #D6457F; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --dist-bar: #A07FD0; --dist-me: #E85A86; } }
:root[data-theme="dark"] { --dist-bar: #A07FD0; --dist-me: #E85A86; }
.dist-hero { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.dist-hero > b { flex: none; font: 900 2rem/1 var(--ui); color: var(--lavender-deep); min-width: 64px; }
.dist-hero > span { font-weight: 800; line-height: 1.3; }
.dist-hero small { display: block; font-weight: 600; color: var(--muted); font-size: .8rem; margin-top: 2px; }
.dist-hero small b { color: var(--ink); }
.dist { margin: 4px 0 6px; }
.dist-bars { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 2px; align-items: end; height: 96px; padding-top: 18px; border-bottom: 1.5px solid var(--line-2); }
.dist-col { position: relative; height: 100%; display: flex; align-items: flex-end; outline: none; cursor: default; }
.dist-col i { display: block; width: 100%; background: var(--dist-bar); border-radius: 4px 4px 0 0; opacity: .85; transition: opacity .15s; }
.dist-col.me i { background: var(--dist-me); opacity: 1; }
.dist-col:hover i, .dist-col:focus-visible i { opacity: 1; }
.dist-col i { position: relative; }
.dist-you { position: absolute; left: 50%; bottom: calc(100% + 3px); transform: translateX(-50%); font: 800 .66rem/1 var(--ui); color: var(--ink); white-space: nowrap; }
.dist-col[data-tip]:hover::after, .dist-col[data-tip]:focus-visible::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); z-index: 5; padding: 6px 9px; border-radius: 8px;
  background: var(--ink); color: var(--surface); font: 700 .72rem/1.2 var(--ui); white-space: nowrap; pointer-events: none; box-shadow: var(--shadow); }
.dist-col:first-child[data-tip]:hover::after, .dist-col:first-child[data-tip]:focus-visible::after { left: 0; transform: none; }
.dist-col:last-child[data-tip]:hover::after, .dist-col:last-child[data-tip]:focus-visible::after, .dist-col:nth-last-child(2)[data-tip]:hover::after { left: auto; right: 0; transform: none; }
.dist-axis { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); margin-top: 4px; font: 700 .7rem var(--ui); color: var(--muted); }
.dist-axis span { white-space: nowrap; }
.dist-note { display: flex; justify-content: space-between; margin: 2px 0 0; font: 700 .7rem var(--ui); color: var(--muted); }
.dist-empty { margin: 4px 0 8px; }
.dist-sub { margin: 12px 0 6px; font: 800 .74rem var(--ui); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.dist-top { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.dist-top li { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 12px; }
.dist-top li:nth-child(1) { background: color-mix(in srgb, var(--butter) 60%, transparent); }
.dist-top li.me { background: var(--lavender-soft); }
.dist-medal { width: 18px; text-align: center; font: 900 .9rem var(--ui); color: var(--muted); }
.dist-name { flex: 1; min-width: 0; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dist-name small { font-weight: 600; color: var(--muted); }
.dist-top b { font: 900 .95rem var(--ui); }

/* ---------- accounts: Google sign-in, guests, save prompts ---------- */
.auth-title { font: 900 1.3rem/1.2 var(--ui); margin: 0 0 12px; }
.auth-option { padding: 14px; border-radius: 16px; }
.auth-google { background: var(--lavender-soft); }
.auth-option h3 { font: 800 1rem/1.3 var(--ui); margin: 0 0 4px; }
.auth-option p { margin: 0 0 12px; }
.auth-rec { display: inline-block; margin-bottom: 6px; padding: 2px 8px; border-radius: 999px; background: var(--lavender); color: #fff; font: 800 .66rem/1.5 var(--ui); letter-spacing: .04em; text-transform: uppercase; }
.auth-or { display: flex; align-items: center; gap: 10px; margin: 12px 0; color: var(--muted); font: 700 .78rem var(--ui); }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--line-2); }
.auth-foot { margin: 14px 0 0; text-align: center; }
.auth-back { display: inline-flex; align-items: center; gap: 2px; margin: 0 0 8px; padding: 0; border: 0; background: none; cursor: pointer; }
.gbtn-slot { min-height: 44px; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 999px; }
.gbtn-slot.pulse-once { animation: gPulse .8s ease-in-out 2; }
@keyframes gPulse { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--lavender) 35%, transparent); } }
.gbtn-fallback { display: inline-flex; align-items: center; gap: 10px; height: 40px; padding: 0 18px; border-radius: 999px; border: 1px solid #DADCE0; background: #fff; color: #3C4043; font: 500 .9rem/1 'Roboto', var(--ui); opacity: .7; }
.gbtn-note { margin: 6px 0 0; font: 600 .74rem var(--ui); color: var(--muted); text-align: center; }
.acct-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font: 800 .78rem var(--ui); background: var(--tile); color: var(--ink-2); margin: 0 0 8px; }
.acct-badge.guest { background: var(--butter); color: #6B5310; }
.acct-badge.saved { background: var(--mint); color: var(--mint-ink); }
.acct-card p { margin: 0 0 10px; }
.acct-card .gbtn-slot { align-items: flex-start; }
.acct-modal .modal-body { text-align: center; }
.acct-modal .form { text-align: left; }
.acct-warn h3, .acct-save h3 { font: 900 1.2rem/1.25 var(--ui); margin: 6px 0 8px; }
.acct-warn-ic { font-size: 2rem; }
.acct-save .gbtn-slot { margin: 14px 0 4px; }
.guest-pill { padding: 5px 10px; border-radius: 999px; border: 0; background: var(--butter); color: #6B5310; font: 800 .72rem/1 var(--ui); cursor: pointer; white-space: nowrap; }
@media (max-width: 380px) { .guest-pill { font-size: .64rem; padding: 5px 8px; } }
.side-save { margin: 8px 0 0; width: 100%; }
.save-card { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; background: color-mix(in srgb, var(--butter) 45%, var(--surface)); border-color: color-mix(in srgb, #E3C976 50%, var(--line)); }
.save-card p { margin: 2px 0 0; }
.save-card-actions { display: flex; align-items: center; gap: 10px; }
@media (max-width: 899px) { .auth-demo { display: none; } .auth-hero h1 { margin: 16px 0 8px; } .auth { gap: 16px; padding-top: calc(env(safe-area-inset-top) + 16px); } }

/* ---------- Premium & charity ---------- */
.charity-card { background: linear-gradient(160deg, color-mix(in srgb, var(--pink) 55%, var(--surface)), var(--surface) 70%); border-color: color-mix(in srgb, #E5A1C2 35%, var(--line)); }
.ct-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 10px; }
.ct-head h3 { margin: 0 0 2px; font-size: 1.02rem; }
.ct-head p { margin: 0; }
.ct-ic { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; background: var(--surface); }
.ct-heart { width: 30px; height: 30px; }
.ct-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 6px 0 8px; }
.ct-stats div { padding: 10px 8px; border-radius: 14px; background: color-mix(in srgb, var(--surface) 85%, transparent); text-align: center; }
.ct-stats b { display: block; font: 900 1.15rem/1.2 var(--ui); color: var(--ink); }
.ct-stats small { font: 700 .72rem/1.3 var(--ui); color: var(--muted); }
.ct-await { margin: 0 0 8px; font: 700 .8rem var(--ui); color: var(--pink-ink); text-align: center; }
.ct-goal { margin: 10px 0 6px; padding: 12px; border-radius: 16px; background: color-mix(in srgb, var(--surface) 85%, transparent); }
.ct-goal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.ct-goal-head b { display: block; font-weight: 800; } .ct-goal-head small { color: var(--muted); font-weight: 700; }
.ct-bar { height: 14px; border-radius: 999px; background: var(--bg-2); overflow: hidden; }
.ct-bar i { display: block; height: 100%; min-width: 0; border-radius: 999px; background: repeating-linear-gradient(90deg, #E58AAE 0 8px, #D9779E 8px 10px); transition: width .6s; }
.ct-goal-text { margin: 8px 0 0; font: 700 .82rem var(--ui); color: var(--ink-2); }
.ct-per { margin: 6px 0 10px; font: 700 .8rem var(--ui); color: var(--muted); text-align: center; }
.ct-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.ct-demo { text-align: center; margin: 4px 0 6px; }
.ct-milestones { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 12px 0 6px; padding: 0; }
.ct-milestones li { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 52px; padding: 6px; border-radius: 12px; background: var(--tile); }
.ct-milestones li.on { background: color-mix(in srgb, var(--butter) 55%, var(--surface)); }
.ct-milestones small { font: 800 .7rem var(--ui); color: var(--muted); }
.charity-hero { text-align: center; }
.charity-hero h2 { font: 900 1.35rem/1.25 var(--ui); margin: 6px 0 10px; }
.charity-hero p { max-width: 58ch; margin-left: auto; margin-right: auto; }
.ch-art { display: flex; justify-content: center; align-items: flex-end; gap: 6px; }
.ch-heart { width: 44px; height: 44px; }
.ch-rules { margin: 8px 0; padding-left: 18px; } .ch-rules li { margin: 6px 0; }
.ch-disclaimer { background: var(--tile); box-shadow: none; } .ch-disclaimer p { margin: 0; font-size: .86rem; color: var(--ink-2); }
.premium-hero { text-align: center; background: linear-gradient(160deg, var(--lavender-soft), color-mix(in srgb, var(--pink) 45%, var(--surface))); }
.premium-hero h1 { font: 900 clamp(1.4rem, 5vw, 1.9rem)/1.15 var(--ui); margin: 4px 0 10px; }
.premium-hero p { max-width: 56ch; margin: 0 auto 10px; }
.pp-facts { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; font: 700 .82rem var(--ui); }
.pp-facts li { display: inline-flex; align-items: center; gap: 4px; } .pp-facts .ic { width: 16px; height: 16px; color: var(--mint-ink); }
.pm-modes { display: grid; gap: 10px; margin-bottom: var(--gap); }
@media (min-width: 760px) { .pm-modes { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.pm-mode { display: flex; gap: 12px; align-items: flex-start; margin: 0; }
.pm-mode h3 { margin: 0 0 2px; } .pm-mode p { margin: 0; }
.pm-art { flex: none; width: 52px; height: 52px; display: grid; place-items: center; border-radius: 14px; background: var(--lavender-soft); }
.pm-ic { width: 38px; height: 38px; }
.pp-rows { display: grid; gap: 6px; margin: 8px 0 10px; }
.pp-row { display: flex; align-items: baseline; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--tile); }
.pp-row b { min-width: 64px; font: 900 1.1rem var(--ui); }
.pp-row.charity { background: var(--pink); } .pp-row.charity b { color: var(--pink-ink); }
.pp-row.total b { color: var(--lavender-deep); }
.pp-barsplit { display: flex; height: 10px; border-radius: 999px; overflow: hidden; margin: 0 0 14px; gap: 2px; }
.pp-barsplit i { display: block; background: var(--lavender-2); } .pp-barsplit i.c { background: #E58AAE; }
.pp-cta { margin: 6px 0 8px; }
.pp-soon { margin: 8px 0 0; text-align: center; font: 800 .9rem var(--ui); color: var(--lavender-deep); }
.pp-owned { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 16px; background: var(--mint); }
.pp-owned b { display: block; } .pp-owned small { color: var(--ink-2); }
.pp-disc { margin-top: 4px; }
.banner-ok { background: var(--mint); }
.locked-mode { text-align: center; }
.locked-mode h2 { font: 900 1.35rem var(--ui); margin: 2px 0 6px; }
.lm-lock-art { position: relative; display: inline-grid; place-items: center; width: 72px; height: 72px; border-radius: 20px; background: var(--lavender-soft); margin-bottom: 8px; }
.lm-lock-art .pm-ic, .lm-lock-art img { width: 46px; height: 46px; }
.lm-lock-badge { position: absolute; right: -6px; bottom: -6px; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--surface); box-shadow: var(--shadow); }
.lm-lock-badge .ic { width: 16px; height: 16px; }
.locked-charity { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 12px; background: var(--pink); font-size: .9rem; }
.lc-heart { width: 22px; height: 22px; flex: none; }
.app-foot { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 8px; padding: 6px 16px calc(var(--nav-h) + env(safe-area-inset-bottom) + 18px); font: 600 .74rem/1.4 var(--ui); color: var(--muted); text-align: center; }
.app-foot a { color: var(--lavender-deep); font-weight: 800; }
#view { padding-bottom: 12px; }
.focus-mode .app-foot { display: none; }
@media (min-width: 960px) { .app-foot { grid-column: 2; padding-bottom: 24px; max-width: 820px; margin: 0 auto; } }
.topbar-charity .ic { color: var(--pink-ink); }
.public-page { max-width: 820px; margin: 0 auto; padding: 16px; }
.public-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.admin-table tr.voided td { opacity: .55; text-decoration: line-through; }
.chip.pst-completed { background: var(--mint); color: var(--mint-ink); } .chip.pst-refunded, .chip.pst-disputed { background: var(--pink); color: var(--pink-ink); } .chip.pst-pending { background: var(--butter); color: #6B5310; }
code { font-size: .8em; background: var(--tile); padding: 1px 5px; border-radius: 6px; }

/* =====================================================================
   TOP BAR ALIGNMENT — one height, everything vertically centred, edges lined
   up with the page content, and a lighter logo plate that sits level with the icons.
   ===================================================================== */
:root { --bar-h: 56px; --bar-item: 36px; }
.topbar { box-sizing: content-box; height: var(--bar-h); padding: env(safe-area-inset-top) max(14px, calc(50% - 366px)) 0; display: flex; align-items: center; gap: 10px; }
.topbar .brand { display: flex; align-items: center; flex: 0 1 auto; min-width: 0; text-decoration: none; }
.topbar-actions { display: flex; align-items: center; gap: 2px; flex: none; margin-left: auto; }
.topbar .icon-btn { width: var(--bar-item); height: var(--bar-item); border-radius: 12px; }
.topbar .icon-btn .ic { width: 21px; height: 21px; }
/* logo: same pixel cat and lettering, slimmer plate so it lines up with the icons */
.wordmark { height: var(--bar-item); box-sizing: border-box; padding: 0 11px 0 7px; gap: 7px; border-width: 1.5px; border-radius: 12px; box-shadow: 0 2px 0 #6F4F92, inset 0 1px 0 rgba(255, 255, 255, .25); }
.wordmark .logo-mark { width: 22px; height: 22px; }
.wordmark > span { font-size: .62rem; padding: 0 0 2px; line-height: 1; }
.auth-hero .wordmark, .public-head .wordmark { height: 44px; padding: 0 14px 0 9px; }
.auth-hero .wordmark .logo-mark { width: 28px; height: 28px; } .auth-hero .wordmark > span { font-size: .8rem; }
/* notification dot: small round dot in the corner of the bell */
.topbar .dot, .dot { top: 6px; right: 6px; width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--bg); background: var(--pink-ink); box-shadow: none; }
/* guest tag: same height as the icons; shorter wording on phones */
.guest-pill { height: 28px; display: inline-flex; align-items: center; padding: 0 10px; margin-right: 4px; }
.gp-short { display: none; }
@media (max-width: 440px) { .gp-long { display: none; } .gp-short { display: inline; } }
/* the narrowest phones: cat-only logo so nothing overlaps */
@media (max-width: 370px) { .topbar .wordmark > span { display: none; } .topbar .wordmark { padding: 0 7px; } }
@media (max-width: 370px) { .topbar-actions { gap: 0; } .topbar .icon-btn { width: 34px; } }
/* desktop sidebar: logo level with the page heading, same slim plate */
@media (min-width: 960px) {
  .sidenav { padding-top: 28px; }
  .sidenav .brand { display: flex; align-items: center; height: 40px; margin: 0 0 8px 2px; text-decoration: none; }
  .sidenav .wordmark { height: 40px; }
  .sidenav .wordmark .logo-mark { width: 24px; height: 24px; } .sidenav .wordmark > span { font-size: .68rem; }
}
@media (min-width: 960px) { .topbar { display: none; } }
@media (min-width: 960px) { .sidenav .brand { padding: 0; height: auto; margin: 0 0 18px 4px; } }

/* ---------- always room to scroll past the fixed bottom navigation ---------- */
@media (max-width: 959px) {
  .shell { padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); }
  .shell.focus-mode { padding-bottom: env(safe-area-inset-bottom); }
  #view { padding-bottom: 24px; }
  .app-foot { padding-bottom: 20px; }
}

/* ---------- bottom navigation: bigger 8-bit icons, equal spacing ---------- */
:root { --nav-h: 70px; }
.bottomnav { display: grid; grid-template-columns: repeat(var(--tabs, 5), minmax(0, 1fr)); align-items: stretch; height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding: 0 max(6px, env(safe-area-inset-left)) env(safe-area-inset-bottom); }
.bottomnav .nav-link { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 0; padding: 6px 0; border: 0; background: none; cursor: pointer; text-decoration: none; -webkit-tap-highlight-color: transparent; }
.bottomnav .nav-link::before { display: none !important; }
.bottomnav .nav-link > .ic { display: none; }
.nav-pix { position: relative; display: grid; place-items: center; width: 52px; height: 38px; border-radius: 14px; transition: background .2s; }
.nav-pix img { width: 32px; height: 32px; image-rendering: pixelated; image-rendering: crisp-edges; filter: grayscale(.6) opacity(.62); transition: filter .2s, transform .15s; }
.nav-label { font: 800 .7rem/1 var(--ui); color: var(--muted); letter-spacing: .01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.bottomnav .nav-link:hover .nav-pix img { filter: grayscale(.25) opacity(.9); }
.bottomnav .nav-link:active .nav-pix img { transform: translateY(2px); }
.bottomnav .nav-link.active .nav-pix { background: var(--lavender-soft); box-shadow: inset 0 -2px 0 color-mix(in srgb, var(--lavender) 30%, transparent); }
.bottomnav .nav-link.active .nav-pix img { filter: none; animation: navHop .45s steps(4); }
.bottomnav .nav-link.active .nav-label { color: var(--lavender-deep); }
@keyframes navHop { 0% { transform: translateY(0); } 40% { transform: translateY(-5px); } 70% { transform: translateY(1px); } 100% { transform: translateY(0); } }
.nav-pix .badge { position: absolute; top: -2px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; display: inline-grid; place-items: center; }
@media (prefers-reduced-motion: reduce) { .bottomnav .nav-link.active .nav-pix img { animation: none; } }
@media (max-width: 340px) { .nav-pix { width: 46px; } .nav-label { font-size: .64rem; } }
.nav-pix .badge { top: -7px; right: -7px; }
.nav-pix img { filter: grayscale(.35) opacity(.78); }
.ct-sub { margin: 12px 0 6px; font: 800 .72rem var(--ui); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.ct-donations { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.ct-donations li { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 12px; background: color-mix(in srgb, var(--surface) 85%, transparent); }
.ct-donations li span { flex: 1; font-weight: 700; } .ct-donations li b { font: 900 .95rem var(--ui); color: var(--mint-ink); }
.ct-don-ic { width: 18px; height: 18px; flex: none; }
.ct-none { margin: 0; padding: 8px 10px; border-radius: 12px; background: color-mix(in srgb, var(--surface) 85%, transparent); font: 600 .82rem var(--ui); color: var(--muted); }
.ct-demo-note { margin: 4px 0 8px; padding: 6px 10px; border-radius: 10px; background: var(--butter); color: #6B5310; font: 700 .76rem var(--ui); text-align: center; }
.charity-card .ct-milestones { margin: 4px 0 2px; justify-content: flex-start; }
.community-card .ct-stats div, .community-card .ct-goal, .community-card .ct-donations li, .community-card .ct-none { background: var(--tile); }
.ct-milestones { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; } .ct-milestones li { min-width: 0; padding: 6px 2px; } .ct-milestones small { font-size: .64rem; white-space: nowrap; }
.legal h3 { margin: 16px 0 6px; } .legal ul { padding-left: 18px; margin: 0 0 8px; } .legal li { margin: 5px 0; }
.pp-agree { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 12px; padding: 10px 12px; border-radius: 12px; background: var(--tile); font: 600 .84rem/1.4 var(--ui); text-align: left; cursor: pointer; }
.pp-agree input { width: 20px; height: 20px; margin: 1px 0 0; flex: none; accent-color: var(--lavender); }

/* ---------- Desktop layout fixes ----------
   The phone bottom bar must never show beside the sidebar (a later rule above re-enabled it), and the sidebar
   keeps the logo and the player card visible on short screens: only the link list scrolls. */
@media (min-width: 960px) {
  .bottomnav { display: none !important; }
  .shell { padding-bottom: 0; }
  .app-foot { padding-bottom: 24px; }
  #view { padding-bottom: 32px; }
  .sidenav { height: 100vh; height: 100dvh; overflow: hidden; gap: 8px; }
  .sidenav .brand, .side-me, .side-save { flex-shrink: 0; }
  .side-links { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; margin-right: -6px; padding-right: 6px; }
  .side-me { margin-top: 4px; }
}

/* ---------- Page scrolling ----------
   overflow-x:hidden on <body> makes the body its own scroll box, which on iPhone Safari can stop the page
   short of the bottom. Clip sideways overflow on <html> instead (clip never creates a scroll container). */
html { overflow-x: clip; }
body { overflow-x: visible; overflow-y: visible; min-height: 100vh; min-height: 100dvh; }
@supports not (overflow: clip) { html { overflow-x: hidden; } }

/* ---------- Admin: automatic questions ---------- */
.autoq-run { border-top: 1px solid var(--line); padding: 10px 0; }
.autoq-run summary { cursor: pointer; font-size: .9rem; }
.autoq-log { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.autoq-log li { font-size: .85rem; line-height: 1.4; }
.autoq-log li small { display: block; color: var(--muted); }

.autoq-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px 16px; margin-top: 8px; }
.autoq-cat { display: grid; grid-template-columns: 1fr auto; gap: 4px; font-size: .88rem; }



/* ---------- Prism, the admin's one-of-one rainbow cat: a glow that cycles through the rainbow ---------- */
.cat-prism { filter: drop-shadow(0 0 2px rgba(255, 255, 255, .95)) drop-shadow(0 0 6px #FF4DD2) drop-shadow(0 0 12px rgba(255, 77, 210, .55)); animation: prismGlow 3.2s linear infinite; }
@keyframes prismGlow {
  from { filter: drop-shadow(0 0 2px rgba(255, 255, 255, .95)) drop-shadow(0 0 6px #FF4DD2) drop-shadow(0 0 12px rgba(255, 77, 210, .55)) hue-rotate(0deg); }
  to { filter: drop-shadow(0 0 2px rgba(255, 255, 255, .95)) drop-shadow(0 0 6px #FF4DD2) drop-shadow(0 0 12px rgba(255, 77, 210, .55)) hue-rotate(360deg); }
}
.cat-card.tier-admin { background: linear-gradient(135deg, rgba(255, 77, 109, .14), rgba(255, 228, 92, .14), rgba(76, 217, 123, .14), rgba(63, 167, 255, .14), rgba(166, 107, 255, .16)); border-color: #C9A8FF; }
@media (prefers-reduced-motion: reduce) { .cat-prism { animation: none; } }

/* ---------- Home: Premium card (hidden once the player has Premium) ---------- */
.premium-home { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px 16px;
  background: radial-gradient(120% 140% at 100% 0%, var(--lavender-soft, var(--primary-soft)) 0%, transparent 60%), var(--surface); }
.premium-home .ph-art { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 18px; background: var(--bg-2); }
.premium-home h3 { margin: 2px 0 4px; }
.premium-home .ph-body p { margin: 0; }
@media (max-width: 640px) { .premium-home { grid-template-columns: auto 1fr; } .premium-home .ph-cta { grid-column: 1 / -1; justify-content: center; } }

/* ---------- "Coming soon" modes ---------- */
.soon-chip { display: inline-block; margin-left: 6px; padding: 2px 8px; border-radius: 999px; font: 800 .66rem/1.4 var(--ui); font-style: normal; letter-spacing: .02em;
  color: var(--lavender-deep, var(--primary)); background: var(--lavender-soft, var(--primary-soft)); vertical-align: middle; white-space: nowrap; }
.mw-soon { opacity: .85; }
.pm-soon { opacity: .75; }
.coming-soon .lm-lock-art { display: inline-grid; place-items: center; }

/* Premium page: each mode card opens the mode */
a.pm-mode { color: inherit; text-decoration: none; transition: transform .12s ease, box-shadow .12s ease; }
a.pm-mode:hover { transform: translateY(-2px); }
.pm-play { display: inline-block; margin-top: 6px; font: 800 .82rem var(--ui); color: var(--lavender-deep, var(--primary)); }

/* ---------- desktop gameplay: centred, comfortable size ----------
   The sidebar is hidden while playing, so the game gets the whole width (a later `.shell` column rule used to
   squeeze it into the 224px sidebar column). The play area sits in the middle of the screen, both ways. */
.fine > span { white-space: nowrap; }
@media (min-width: 900px) {
  .shell.focus-mode { grid-template-columns: minmax(0, 1fr); }
  .shell.focus-mode #view { width: 100%; max-width: 760px; margin: 0 auto; min-height: 100vh; min-height: 100dvh;
    display: flex; flex-direction: column; justify-content: center; padding: 32px 32px 40px; }
  .shell.focus-mode #view > * { width: 100%; }
  .shell.focus-mode .play { max-width: 680px; }
  .shell.focus-mode .play .q-text, .shell.focus-mode .play .question { font-size: clamp(1.25rem, 1.6vw, 1.5rem); }
}

/* yarn scene: "% away" counter in the yarn's own colour, riding above the ball */
.yarn-away { position: absolute; left: 0; top: 0; pointer-events: none; display: flex; flex-direction: column; align-items: center; gap: 2px;
  opacity: 0; transition: opacity .15s steps(2); will-change: transform; }
.yarn-away.on { opacity: 1; }
.yarn-away b { font: 400 clamp(1.1rem, 3.4vw, 1.9rem)/1 var(--arcade); color: var(--yc);
  text-shadow: 3px 0 0 #1B1426, -3px 0 0 #1B1426, 0 3px 0 #1B1426, 0 -3px 0 #1B1426, 3px 3px 0 #1B1426, -3px -3px 0 #1B1426, 3px -3px 0 #1B1426, -3px 3px 0 #1B1426; }
.yarn-away small { font: 400 clamp(.5rem, 1.4vw, .7rem)/1 var(--arcade); color: #fff; background: var(--yd); padding: 3px 6px; border-radius: 4px; letter-spacing: .04em; }

/* ---------- My cats ---------- */
.mc-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0 0 14px; }
.mc-tab { display: flex; align-items: center; justify-content: center; gap: 8px; min-width: 0; padding: 10px 12px; border-radius: 14px; border: 2px solid var(--line);
  background: var(--surface); color: var(--ink); font: 800 .92rem/1.2 var(--ui); cursor: pointer; }
.mc-tab:hover { border-color: var(--primary-soft, #C9B2E2); }
.mc-tab.on { border-color: var(--primary); background: var(--surface-2); box-shadow: 0 3px 0 var(--primary); }
.mc-tab > small { color: var(--muted); font-weight: 800; }
.mc-tab > small.soon-chip { margin-left: 0; color: inherit; }
.mc-tab .cat-img, .mc-tab .mc-tab-cat { width: 28px; height: auto; flex: none; }
.mc-tab-ic { width: 32px; height: auto; flex: none; image-rendering: pixelated; }
.mc-tab-room { width: 30px; border: 2px solid var(--px-ink, #2A2238); border-radius: 3px; }
@media (max-width: 520px) { .mc-tab { flex-direction: column; gap: 4px; padding: 8px 6px; font-size: .8rem; } }
button.cat-card { font: inherit; color: inherit; text-align: inherit; cursor: pointer; width: 100%; }
button.cat-card:hover { transform: translateY(-2px); }
.mc-meter-card { padding-block: 12px; }
.chip-premium { background: linear-gradient(90deg, #FFE7A3, #FFD0E4); color: #6B4A00; }
.mc-chips { display: inline-flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.mc-chips .soon-chip { margin-left: 0; }
.ok-text { color: var(--ok, #2E9E6B); font-weight: 700; }
.bg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-bottom: 14px; }
.bg-card { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 16px; background: var(--surface); border: 2px solid var(--line); min-width: 0; }
.bg-card.bg-ready { border-color: var(--primary); }
.wip-chip { background: #FFE9A8; color: #6B4A00; }
.bg-thumb { width: 100%; height: auto; aspect-ratio: 96 / 60; image-rendering: pixelated; border-radius: 8px; border: 3px solid var(--px-ink, #2A2238); }
.bg-info { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.bg-info .soon-chip { margin-left: 0; }
.btn .mc-tab-ic, .collar-count .mc-tab-ic { width: 22px; vertical-align: middle; margin: -4px 2px -2px 0; }
/* pages keep one width on desktop instead of shrinking to their content */
@media (min-width: 900px) { .shell > #view { width: 100%; } }

/* game-mode icons: crisp 8-bit art on bright tiles (no dull system emoji) */
.mode-pix { width: 32px; height: 32px; image-rendering: pixelated; filter: drop-shadow(2px 2px 0 rgba(27, 20, 38, .18)); }
.mode-ic .mode-pix { width: 34px; height: 34px; }
.more-way .mw-ic, .mode-ic { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--mw-ink, #7C5CFF) 30%, transparent); }
.more-way[href="#/archive"], .mode-card[href="#/archive"], .mode-card[data-go="archive"], .more-way[data-go="archive"] { --mw: #FFF0C7; --mw-ink: #F08A24; }
.more-way[href="#/categories"], .mode-card[href="#/categories"], .more-way[data-go="categories"], .mode-card[data-go="categories"] { --mw: #DCEBFF; --mw-ink: #3B7BF6; }
.mw-lm, .mode-card[href="#/limitless"], .mode-card[data-go="limitless"] { --mw: #FFE0EE; --mw-ink: #FF5FA2; }
.mode-daily { --mw: #EFE6FF; --mw-ink: #7C5CFF; }
.pm-ic.mode-pix, .pm-ic { image-rendering: pixelated; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .more-way .mw-ic, :root:not([data-theme="light"]) .mode-ic { background: var(--mw); } }
:root[data-theme="dark"] .more-way .mw-ic, :root[data-theme="dark"] .mode-ic { background: var(--mw); }
/* Premium page + locked-mode art: bright tiles in light and dark themes so the pixel outlines pop */
.pm-mode[href="#/categories"] .pm-art { background: #DCEBFF; box-shadow: inset 0 0 0 2px rgba(59, 123, 246, .3); }
.pm-mode[href="#/limitless"] .pm-art { background: #FFE0EE; box-shadow: inset 0 0 0 2px rgba(255, 95, 162, .3); }
.pm-mode[href="#/archive"] .pm-art { background: #FFF0C7; box-shadow: inset 0 0 0 2px rgba(240, 138, 36, .3); }
.pm-soon .pm-art { opacity: 1; }
.lm-lock-art { background: #F4EEFF; }

/* ==========================================================================
   Premium 8-bit theme (html.theme-8bit). Purely visual: same text, same sizes, same layout as normal mode.
   It only swaps soft corners and shadows for squarer corners, inky pixel outlines and hard pixel drop shadows.
   (Never change fonts, border widths, padding or --px-b here: the game must keep exactly its normal proportions.)
   ========================================================================== */
html.theme-8bit {
  --px-ink: var(--lavender-deep);
  --card-border: 1.5px solid var(--px-ink);
  --card-shadow: 4px 4px 0 var(--px-ink);
  --shadow-sm: none;
}
@media (prefers-color-scheme: dark) { html.theme-8bit:not([data-theme="light"]) { --px-ink: #0E0A14; } }
html.theme-8bit[data-theme="dark"] { --px-ink: #0E0A14; }
html.theme-8bit body {
  background-image: linear-gradient(rgba(139, 104, 172, .06) 1px, transparent 1px), linear-gradient(90deg, rgba(139, 104, 172, .06) 1px, transparent 1px);
  background-size: 8px 8px; }
html.theme-8bit :is(.card, .hero-card, .qcard, .reveal, .more-way, .mode-card, .cm-card, .pm-mode, .bg-card, .cat-card, .collar-tile, .mc-tab, .lm-run-row, .starter-card, .modal, .side-me, .toast, .banner) { border-radius: 6px !important; }
html.theme-8bit :is(.btn, .fine-btn, .chip, .pill, .soon-chip, .streak-pill, .seg-btn, .mw-ic, .mode-ic, .pm-art, .cust-stage, .cat-tile, .rank-box, .form input, .form select, .form textarea) { border-radius: 4px !important; }
html.theme-8bit .sidenav .nav-link { border-radius: 4px; }
html.theme-8bit .btn:not(.btn-link) { box-shadow: 0 3px 0 var(--px-ink); }
html.theme-8bit .btn:not(.btn-link):active { box-shadow: 0 1px 0 var(--px-ink); }
html.theme-8bit img, html.theme-8bit canvas { image-rendering: pixelated; }
html.theme-8bit .mc-tab.on { box-shadow: 4px 4px 0 var(--primary); }
.toggle-locked { opacity: .7; } .toggle-locked input { cursor: not-allowed; }

.pp-extras-title { margin: 6px 0 10px; }
@media (min-width: 760px) { .pm-extras { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pm-extra-theme8 .pm-art { background: #E9E2FF; box-shadow: inset 0 0 0 2px rgba(124, 92, 255, .3); }
.pm-extra-backgrounds .pm-art { background: #FFE9D6; box-shadow: inset 0 0 0 2px rgba(240, 138, 36, .3); }
.pm-room { width: 40px !important; height: auto !important; border: 2px solid #1B1426; border-radius: 3px; }
.badge[hidden], .badge:empty { display: none !important; } /* the phone tab badge used to show as an empty pill */
/* customise stage: the blinking idle cat (eyes open, blinks now and then); a hop when a collar goes on or comes off */
.cust-hop { display: inline-block; position: relative; z-index: 1; }
.cust-stage.equipped-anim .cust-hop { animation: catHop .5s steps(5) 2; }
