/* Purrcade app shell. Tokens from brand/BRAND.md. */
:root {
  --pc-amber: #F2B134; --pc-tiger: #E8913A; --pc-mint: #7DBE4F; --pc-rose: #E8B4B0; --pc-coral: #FF6B6B;
  --pc-sky: #5D8FD6; --pc-gold: #C9BE5A;
  --pc-cream: #FFF8EE; --pc-sand: #E4D6C2; --pc-mist: #8C96A8; --pc-slate: #5E6778;
  --pc-ink: #1B1B22; --pc-night: #15121C; --pc-night-2: #221D2E;
  --pc-font-display: ui-rounded, "SF Pro Rounded", "Nunito", "Varela Round", system-ui, sans-serif;
  --pc-font-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px); --sar: env(safe-area-inset-right, 0px);
  --pop: cubic-bezier(.2, .9, .3, 1.2);
  color-scheme: dark;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; background: var(--pc-night); color: var(--pc-cream); font-family: var(--pc-font-body); -webkit-text-size-adjust: 100%; }
body { overscroll-behavior-y: none; -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
[hidden] { display: none !important; }
h1, h2, h3, .num { font-family: var(--pc-font-display); letter-spacing: -0.02em; }
.num { font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Layout: header, scrolling view, bottom tabs */
.app { min-height: 100dvh; display: flex; flex-direction: column; }
.top {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(10px + var(--sat)) calc(16px + var(--sar)) 10px calc(16px + var(--sal));
  background: linear-gradient(var(--pc-night) 70%, rgba(21, 18, 28, 0));
}
.brand { display: flex; align-items: center; gap: 10px; min-height: 48px; }
.brand img { width: 34px; height: 34px; }
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-text b { font-family: var(--pc-font-display); font-weight: 900; font-size: 20px; letter-spacing: -0.02em; }
.brand-text small { font-size: 11px; color: var(--pc-mist); margin-top: 3px; font-weight: 600; }
.streak { display: flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: 999px; background: var(--pc-night-2); font-weight: 700; font-size: 14px; }
.streak .flame { color: var(--pc-tiger); font-size: 16px; }
.streak.zero { color: var(--pc-mist); font-weight: 600; }

.view { flex: 1; padding: 4px calc(16px + var(--sar)) calc(96px + var(--sab)) calc(16px + var(--sal)); outline: none; }
.view > * + * { margin-top: 18px; }

.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: flex; justify-content: space-around;
  padding: 6px calc(8px + var(--sar)) calc(8px + var(--sab)) calc(8px + var(--sal));
  background: rgba(34, 29, 46, 0.92); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255, 248, 238, 0.08);
}
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 52px; padding: 6px 0; border-radius: 14px; color: var(--pc-mist); font-size: 12px; font-weight: 700; }
.tab .ico { font-size: 18px; line-height: 1.2; }
.tab.on { color: var(--pc-amber); }
.tab:active { transform: scale(0.95); }

/* Cards */
.card { background: var(--pc-night-2); border-radius: 20px; padding: 16px; }
.eyebrow { font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--pc-mist); }
.quote { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; line-height: 1.4; }
.quote b { font-family: var(--pc-font-display); flex: none; }
.quote.tula b { color: var(--pc-sky); }
.quote.baghi b { color: var(--pc-gold); }

/* Today */
.today { position: relative; overflow: hidden; border-radius: 24px; background: var(--pc-night-2); }
.today .cover { position: relative; aspect-ratio: 9 / 13; background: var(--accent, var(--pc-amber)); overflow: hidden; }
.today .cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.today .cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(rgba(21, 18, 28, 0) 50%, rgba(21, 18, 28, 0.96)); }
.today .cover-fallback { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--pc-font-display); font-weight: 900; font-size: 36px; color: var(--pc-ink); padding: 24px; text-align: center; }
.today .body { position: relative; margin-top: -120px; padding: 0 18px 18px; }
.today .label { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--pc-cream); color: var(--pc-ink); font-size: 12px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.today .label.done { background: var(--pc-mint); }
.today h1 { font-size: 34px; line-height: 1.05; margin-top: 12px; font-weight: 900; }
.today .tagline { margin-top: 6px; font-size: 17px; color: var(--pc-cream); font-weight: 600; }
.today .desc { margin-top: 8px; font-size: 15px; line-height: 1.45; color: var(--pc-mist); }
.today .meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; background: rgba(255, 248, 238, 0.1); font-size: 12px; font-weight: 700; color: var(--pc-cream); }
.chip.tula { color: var(--pc-sky); } .chip.baghi { color: var(--pc-gold); }
.play {
  display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 16px; min-height: 56px; border-radius: 999px;
  background: var(--pc-amber); color: var(--pc-ink); font-family: var(--pc-font-display); font-weight: 900; font-size: 20px;
  box-shadow: 0 10px 30px rgba(242, 177, 52, 0.25); transition: transform .15s var(--pop);
}
.play:active { transform: scale(0.97); }
.play.again { background: var(--pc-cream); box-shadow: none; }
.stars { font-size: 18px; letter-spacing: 2px; color: var(--pc-amber); }
.stars .off { color: rgba(255, 248, 238, 0.25); }
.cats-row { display: flex; gap: 12px; }
.cats-row .card { flex: 1; }

.cats { padding: 0; overflow: hidden; background: var(--pc-cream); color: var(--pc-ink); }
.cats img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; object-position: center 30%; }
.cats-quotes { padding: 14px 16px; display: grid; gap: 8px; }
.cats .quote.tula b { color: #3E6FB5; } .cats .quote.baghi b { color: #8A7F2A; }

/* Archive */
.list { display: grid; gap: 12px; }
.row { display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; align-items: center; min-height: 72px; padding: 10px; border-radius: 18px; background: var(--pc-night-2); }
.row .icon { width: 64px; height: 64px; border-radius: 16px; background: var(--accent, var(--pc-amber)); overflow: hidden; display: grid; place-items: center; font-family: var(--pc-font-display); font-weight: 900; color: var(--pc-ink); }
.row .icon img { width: 100%; height: 100%; object-fit: cover; }
.row h3 { font-size: 17px; font-weight: 800; }
.row p { font-size: 13px; color: var(--pc-mist); margin-top: 2px; }
.row .right { text-align: right; font-size: 12px; color: var(--pc-mist); font-weight: 700; }
.row .right .stars { display: block; font-size: 14px; }
.row.missed .icon { filter: saturate(0.4); opacity: 0.8; }
.row:active { transform: scale(0.99); }
.month { margin-top: 8px; }

/* Collection */
.shelf { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.item { aspect-ratio: 1; border-radius: 18px; background: var(--pc-night-2); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 10px; text-align: center; position: relative; overflow: hidden; }
.item .glyph { font-size: 34px; line-height: 1; }
.item .name { font-size: 12px; font-weight: 700; line-height: 1.2; }
.item .from { font-size: 10px; color: var(--pc-mist); }
.item.locked { background: rgba(34, 29, 46, 0.6); color: var(--pc-mist); }
.item.locked .glyph { filter: grayscale(1); opacity: 0.35; }
.item.new::after { content: "New"; position: absolute; top: 8px; right: 8px; padding: 2px 7px; border-radius: 999px; background: var(--pc-mint); color: var(--pc-ink); font-size: 10px; font-weight: 800; }
.progress { height: 8px; border-radius: 999px; background: rgba(255, 248, 238, 0.1); overflow: hidden; margin-top: 10px; }
.progress b { display: block; height: 100%; background: var(--pc-amber); border-radius: 999px; transition: width .4s ease-out; }

.empty { text-align: center; color: var(--pc-mist); padding: 40px 20px; font-size: 15px; line-height: 1.5; }
.hint { font-size: 13px; color: var(--pc-mist); line-height: 1.45; }
.offline { padding: 10px 14px; border-radius: 14px; background: rgba(140, 150, 168, 0.15); font-size: 13px; font-weight: 600; color: var(--pc-cream); }
.update { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 10px 10px 14px; border-radius: 14px; background: rgba(125, 190, 79, 0.18); font-size: 14px; font-weight: 600; }
.update button { padding: 8px 14px; border-radius: 999px; background: var(--pc-mint); color: var(--pc-ink); font-weight: 800; }

.toast { position: fixed; left: 50%; bottom: calc(100px + var(--sab)); transform: translateX(-50%); padding: 12px 18px; border-radius: 999px; background: var(--pc-cream); color: var(--pc-ink); font-weight: 700; font-size: 14px; box-shadow: 0 8px 24px rgba(0, 0, 0, .35); z-index: 20; }

/* Desktop page */
.desktop { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 40px 24px; gap: 14px; background: var(--pc-cream); color: var(--pc-ink); }
.desktop .lockup { width: min(640px, 90vw); }
.desktop h1 { font-size: 32px; font-weight: 900; }
.desktop p { font-size: 17px; color: var(--pc-slate); }
.desktop .qr { width: 220px; height: 220px; padding: 12px; background: #fff; border-radius: 20px; border: 2px solid var(--pc-sand); }
.desktop .url { font-family: var(--pc-font-display); font-weight: 800; color: var(--pc-ink); font-size: 18px; }
.desktop .small { font-size: 13px; line-height: 1.6; }
.desktop a { color: var(--pc-tiger); font-weight: 700; }
.noscript { padding: 40px; text-align: center; }

/* Motion */
.pop-in { animation: pop .35s var(--pop) both; }
@keyframes pop { from { transform: scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .pop-in { animation: none; } * { transition: none !important; } }
@media (min-width: 520px) { .app { max-width: 480px; margin: 0 auto; } .tabs { left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px; border-radius: 20px 20px 0 0; } }
