/* Pet the Pet: Rogue
   Game window mirrors the original 360×640 pet window (light glass); the dev panel stays dark. */

@font-face {
    font-family: 'Nunito';
    src: url('../../assets/fonts/Nunito-VariableFont_wght.woff2') format('woff2');
    font-weight: 200 1000;
    font-display: swap;
}

:root {
    /* Dev panel palette (dark) */
    --ink: #f4f1ff;
    --ink-dim: #a9a1cc;
    --line: rgba(196, 181, 253, 0.16);
    --surface: #251e47;
    --surface-2: #2f2759;
    --accent: #a78bfa;
    --accent-2: #c4b5fd;
    --good: #4ade80;
    --bad: #f87171;
    --warn: #fbbf24;
    --points: #60a5fa;
    --mult: #fb7185;
    --xp: #8fb0dc;
    --friend: #f472b6;

    /* Original meter colors */
    --food: #ea580c;
    --water: #0369a1;
    --energy: #15803d;
    --friendship: #db2777;

    --win-w: 360px;
    --win-h: 640px;
    --dev-w: 580px;
    --font: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --mono: ui-monospace, SFMono-Regular, Menlo, monospace;

    /* Between-days cutscene (themeable) */
    --night: #000;
    --night-ink: #f4f1ff;
    --dawn: #fff;

    /* Page behind the window (themeable). --chrome is Safari's status/home-indicator bars and overscroll. */
    --page-bg: #1a1033;
    --page-tint: linear-gradient(rgba(18, 12, 40, 0.28), rgba(18, 12, 40, 0.42));
    --chrome: #fff;
    --yard-art: url('../../assets/backgrounds/basebg_grass.jpg');

    /* Theme-independent scales. */
    --r-xs: 6px;
    --r-sm: 8px;
    --r-md: 10px;
    --r-card: 12px;
    --card-ratio: 5 / 7;
    --card-art-ratio: 9 / 10;
    --r-lg: 14px;
    --r-sheet: 16px;
    --r-pill: 999px;
    --r-ticket: 8px 8px 0 0;
    --t-fast: 160ms;
    --t-med: 280ms;
    --t-slow: 560ms;
    --ease-out: cubic-bezier(0.33, 1, 0.68, 1);
    --ease-spring: cubic-bezier(0.25, 0.8, 0.35, 1.1);
    --ease-snap: cubic-bezier(0.3, 0.7, 0.3, 1);
    --z-chrome: 3;
    --z-float: 6;
    --z-tip: 20;
    --z-zoom: 30;
    --z-modal: 50;
    --z-dev: 60;
    --z-fx: 10000;
    --z-cutscene: 20000;

    /* Coins stay gold in every theme so they never read as the pink friendship bowl. */
    --coin-chrome: linear-gradient(145deg, #fde68a 0%, #fbbf24 22%, #f59e0b 48%, #d97706 78%, #92400e 100%);
    --on-coin: #fff;
}

/* Player themes: <body data-theme="…"> picks one. Every theme must define the full token set in this block
   (the dev panel and page keep the :root palette). Text tokens (--ink*, *-ink, --good/--bad/--warn/--mult/--kind-*,
   and interaction colours --food/--water/--energy/--friendship) must keep ≥4.5:1 on --card / --surface.
   Fills that carry --on-color text (--*-fill, --grade-*, --xp-strong/--primary/--points/--accent, --water-fill)
   must keep ≥4.5:1 against it. Moods and care tools stay on-theme (analogous or complementary), not a shared rainbow.
   Add a theme by copying this block as :where([data-theme="name"]) :where(…same hosts…). */
:where([data-theme="light"]) :where(.window, .modal-back, #particle-layer, #mood-cover-host, .tip, #drag-ghost, .drag-ghost, #dev-panel, #dev-toggle),
:where([data-theme="sky"]) :where(.window, .modal-back, #particle-layer, #mood-cover-host, .tip, #drag-ghost, .drag-ghost, #dev-panel, #dev-toggle),
:where([data-theme="sheet"]) :where(.window, .modal-back, #particle-layer, #mood-cover-host, .tip, #drag-ghost, .drag-ghost, #dev-panel, #dev-toggle),
.theme-showcase[data-theme="light"],
.theme-showcase[data-theme="sky"],
.theme-showcase[data-theme="sheet"] {
    --ink: #0f172a;
    --ink-dim: #526073;
    --line: rgba(148, 163, 184, 0.38);
    --glass: rgba(255, 255, 255, 0.86);
    --glass-strong: rgba(255, 255, 255, 0.94);
    --card: #fff;
    --surface: #f1f5f9;
    --surface-2: #e2e8f0;
    --pip-idle: #94a3b8;
    --glint-good: #4ade80;
    --glint-bad: #ef4444;
    --gold: #eab308;
    --gold-grad: linear-gradient(135deg, #fde68a, #f59e0b 55%, #d97706);
    --on-gold: #451a03;
    --track: rgba(15, 23, 42, 0.12);
    --scrim: rgba(15, 23, 42, 0.45);
    --overlay: rgba(0, 0, 0, 0.4);
    --shadow-rgb: 15 23 42;
    --shadow-1: 0 1px 3px rgb(var(--shadow-rgb) / 0.2);
    --shadow-2: 0 3px 8px rgb(var(--shadow-rgb) / 0.22);
    --shadow-3: 0 6px 18px rgb(var(--shadow-rgb) / 0.3);
    --on-color: #fff;
    --on-core: #fff;
    --food: #c2410c;
    --water: #0369a1;
    --energy: #166534;
    --friendship: #be185d;
    --good: #166534;
    --bad: #b91c1c;
    --warn: #b45309;
    --mult: #be123c;
    --friend: var(--friendship);
    --loss: #ef4444;
    --food-ink: #c2410c;
    --friendship-ink: #be185d;
    --fp: var(--friendship);
    --on-fp: var(--on-color);
    --fp-ink: var(--friendship-ink);
    --water-ink: #0369a1;
    --energy-ink: #166534;
    --good-fill: #166534;
    --bad-fill: #b91c1c;
    --warn-fill: #b45309;
    --mult-fill: #be123c;
    --water-fill: #0369a1;
    --friendship-fill: #be185d;
    --xp-soft: #38bdf8;
    --xp-strong: #4d6fa8;
    --xp: var(--xp-strong);
    --xp-grad: linear-gradient(to bottom, var(--xp-soft), var(--xp-strong));
    --xp-bar-grad: var(--xp-grad);
    --xp-pill-grad: var(--xp-grad);
    --points: var(--xp-strong);
    --accent: var(--xp-strong);
    --primary: var(--xp-strong);
    --points-grad: var(--xp-strong);
    --side-tint: color-mix(in srgb, var(--xp-strong) 12%, transparent);
    --mult-grad: linear-gradient(135deg, #be123c 0%, #9f1239 100%);
    --temper-love: var(--friendship-ink);
    --temper-like: var(--food-ink);
    --temper-neutral: var(--ink-dim);
    --temper-dislike: var(--bad);
    --grade-f: #1e1b2e;
    --grade-d: #b91c1c;
    --grade-c: #b45309;
    --grade-b: #166534;
    --grade-a: #4d6fa8;
    --grade-s: linear-gradient(135deg, var(--grade-a), var(--accent));
    --sheen: linear-gradient(135deg, rgb(255 255 255 / 0.14), rgb(0 0 0 / 0.14));
    --kind-charm: #0f766e;
    --kind-perk: #b45309;
    --kind-treat: var(--accent);
    --kind-boost: var(--points);
    --kind-snack: var(--food-ink);
    --spend-edge: 0 2px 0 color-mix(in srgb, #d97706 65%, #92400e), 0 3px 6px rgb(var(--shadow-rgb) / 0.15);
    --glass-highlight: rgb(255 255 255 / 0.5);
    --glint-spec: #fff;
    --scrim-soft: rgb(0 0 0 / 0.22);
    /* Stage tints per weather (from above) and whim (from below); alpha sets how strongly they colour the scene. */
    --tint-clear: rgb(125 211 252 / 0.38);
    --tint-rainy: rgb(59 110 168 / 0.68);
    --tint-sunny: rgb(217 119 6 / 0.5);
    --tint-lazy: rgb(99 102 241 / 0.5);
    --tint-zoomies: rgb(190 18 60 / 0.52);
    --tint-hungry: rgb(194 65 12 / 0.52);
    --tint-grumpy: rgb(100 116 139 / 0.65);
    --overlay: rgba(15, 23, 42, 0.55);
    color: var(--ink);
}
:where([data-theme="sky"]) :where(.window, .modal-back, #particle-layer, #mood-cover-host, .tip, #drag-ghost, .drag-ghost, #dev-panel, #dev-toggle),
.theme-showcase[data-theme="sky"] {
    --xp-soft: #38bdf8;
    --xp-strong: #0369a1;
    --food: #c2410c;
    --water: #0369a1;
    --energy: #0f766e;
    --friendship: #be185d;
    --food-ink: #c2410c;
    --water-ink: #0369a1;
    --energy-ink: #0f766e;
    --friendship-ink: #be185d;
    --good: #0f766e;
    --good-fill: #0f766e;
    --water-fill: #0369a1;
    --kind-charm: #0f766e;
    --grade-b: #0f766e;
    --grade-a: #0369a1;
    --tint-clear: rgb(56 189 248 / 0.42);
    --tint-rainy: rgb(3 105 161 / 0.72);
    --tint-sunny: rgb(217 119 6 / 0.48);
    --tint-lazy: rgb(14 116 144 / 0.5);
    --tint-zoomies: rgb(190 18 60 / 0.5);
    --tint-hungry: rgb(194 65 12 / 0.5);
    --tint-grumpy: rgb(51 65 85 / 0.62);
}
:where([data-theme="sheet"]) :where(.window, .modal-back, #particle-layer, #mood-cover-host, .tip, #drag-ghost, .drag-ghost, #dev-panel, #dev-toggle),
.theme-showcase[data-theme="sheet"] {
    --card: #fffaf3;
    --surface: #f3eee4;
    --surface-2: #e8dfd0;
    --glass: rgba(255, 250, 243, 0.9);
    --glass-strong: rgba(255, 250, 243, 0.96);
    --xp-soft: #fbbf24;
    --xp-strong: #9a3412;
    --shadow-rgb: 60 40 20;
    --food: #9a3412;
    --water: #0f766e;
    --energy: #854d0e;
    --friendship: #9f1239;
    --food-ink: #9a3412;
    --water-ink: #0f766e;
    --energy-ink: #854d0e;
    --friendship-ink: #9f1239;
    --good: #3f6212;
    --bad: #9f1239;
    --warn: #9a3412;
    --mult: #9f1239;
    --good-fill: #3f6212;
    --bad-fill: #9f1239;
    --warn-fill: #9a3412;
    --mult-fill: #9f1239;
    --water-fill: #0f766e;
    --friendship-fill: #9f1239;
    --kind-charm: #0f766e;
    --kind-perk: #854d0e;
    --kind-snack: var(--food-ink);
    --grade-f: #1c1410;
    --grade-d: #9f1239;
    --grade-c: #9a3412;
    --grade-b: #3f6212;
    --grade-a: #9a3412;
    --mult-grad: linear-gradient(135deg, #9f1239 0%, #9a3412 100%);
    --tint-clear: rgb(253 230 138 / 0.4);
    --tint-rainy: rgb(15 118 110 / 0.55);
    --tint-sunny: rgb(217 119 6 / 0.55);
    --tint-lazy: rgb(120 53 15 / 0.45);
    --tint-zoomies: rgb(159 18 57 / 0.5);
    --tint-hungry: rgb(154 52 18 / 0.55);
    --tint-grumpy: rgb(87 83 78 / 0.6);
}

:where([data-theme="dark"]) :where(.window, .modal-back, #particle-layer, #mood-cover-host, .tip, #drag-ghost, .drag-ghost, #dev-panel, #dev-toggle),
.theme-showcase[data-theme="dark"] {
    --ink: #f1f5f9;
    --ink-dim: #94a3b8;
    --line: rgba(148, 163, 184, 0.18);
    --glass: rgba(18, 22, 30, 0.94);
    --glass-strong: rgba(26, 31, 40, 0.96);
    --card: #1a1f28;
    --surface: #12161d;
    --surface-2: #242b36;
    --pip-idle: #64748b;
    --glint-good: #4ade80;
    --glint-bad: #f87171;
    --gold: #eab308;
    --gold-grad: linear-gradient(135deg, #fde68a, #f59e0b 55%, #d97706);
    --on-gold: #451a03;
    --track: rgba(241, 245, 249, 0.14);
    --scrim: rgba(2, 6, 15, 0.72);
    --overlay: rgba(0, 0, 0, 0.55);
    --shadow-rgb: 0 0 0;
    --shadow-1: 0 1px 3px rgb(var(--shadow-rgb) / 0.45);
    --shadow-2: 0 3px 8px rgb(var(--shadow-rgb) / 0.5);
    --shadow-3: 0 6px 18px rgb(var(--shadow-rgb) / 0.55);
    --on-color: #fff;
    --on-core: #fff;
    --food: #fdba74;
    --water: #7dd3fc;
    --energy: #86efac;
    --friendship: #f9a8d4;
    --good: #4ade80;
    --bad: #f87171;
    --warn: #fbbf24;
    --mult: #fb7185;
    --friend: var(--friendship);
    --loss: #f87171;
    --food-ink: #fdba74;
    --friendship-ink: #f9a8d4;
    --fp: var(--friendship);
    --on-fp: var(--on-color);
    --fp-ink: var(--friendship-ink);
    --water-ink: #7dd3fc;
    --energy-ink: #86efac;
    --good-fill: #166534;
    --bad-fill: #b91c1c;
    --warn-fill: #b45309;
    --mult-fill: #9f1239;
    --water-fill: #1e3a8a;
    --friendship-fill: #9f1239;
    --xp-soft: #38bdf8;
    --xp-strong: #1e3a8a;
    --xp: var(--xp-strong);
    --xp-grad: linear-gradient(to bottom, var(--xp-soft), var(--xp-strong));
    --xp-bar-grad: var(--xp-grad);
    --xp-pill-grad: var(--xp-grad);
    --points: var(--xp-strong);
    --accent: var(--xp-strong);
    --primary: var(--xp-strong);
    --points-grad: var(--xp-strong);
    --side-tint: color-mix(in srgb, var(--xp-strong) 12%, transparent);
    --mult-grad: linear-gradient(135deg, #9f1239 0%, #be123c 100%);
    --temper-love: var(--friendship-ink);
    --temper-like: var(--food-ink);
    --temper-neutral: var(--ink-dim);
    --temper-dislike: var(--bad);
    --grade-f: #0c0f14;
    --grade-d: #9f1239;
    --grade-c: #b45309;
    --grade-b: #166534;
    --grade-a: #1e3a8a;
    --grade-s: linear-gradient(135deg, var(--grade-a), var(--accent));
    --sheen: linear-gradient(135deg, rgb(255 255 255 / 0.08), rgb(0 0 0 / 0.28));
    --kind-charm: #2dd4bf;
    --kind-perk: #fbbf24;
    --kind-treat: var(--accent);
    --kind-boost: var(--points);
    --kind-snack: var(--food-ink);
    --spend-edge: 0 2px 0 color-mix(in srgb, #d97706 65%, #92400e), 0 3px 6px rgb(var(--shadow-rgb) / 0.35);
    --glass-highlight: rgb(255 255 255 / 0.1);
    --glint-spec: #fff;
    --scrim-soft: rgb(0 0 0 / 0.45);
    --tint-clear: rgb(56 189 248 / 0.4);
    --tint-rainy: rgb(30 58 138 / 0.72);
    --tint-sunny: rgb(251 191 36 / 0.5);
    --tint-lazy: rgb(99 102 241 / 0.5);
    --tint-zoomies: rgb(251 113 133 / 0.5);
    --tint-hungry: rgb(253 186 116 / 0.45);
    --tint-grumpy: rgb(100 116 139 / 0.65);
    color: var(--ink);
}

:where([data-theme="win98"]) :where(.window, .modal-back, #particle-layer, #mood-cover-host, .tip, #drag-ghost, .drag-ghost, #dev-panel, #dev-toggle),
.theme-showcase[data-theme="win98"] {
    --ink: #1a1a1a;
    --ink-dim: #3d3d3d;
    --line: #808080;
    --glass: #d4d0c8;
    --glass-strong: #d4d0c8;
    --card: #d4d0c8;
    --surface: #c0c0c0;
    --surface-2: #b8b4ac;
    --pip-idle: #808080;
    --glint-good: #22c55e;
    --glint-bad: #dc2626;
    --gold: #eab308;
    --gold-grad: linear-gradient(135deg, #fde68a, #f59e0b 55%, #d97706);
    --on-gold: #451a03;
    --track: rgba(0, 0, 0, 0.2);
    --scrim: rgba(0, 0, 0, 0.45);
    --overlay: rgba(0, 0, 0, 0.4);
    --shadow-rgb: 0 0 0;
    --shadow-1: 1px 1px 0 #404040;
    --shadow-2: 2px 2px 0 #000;
    --shadow-3: 3px 3px 0 #000;
    --on-color: #fff;
    --on-core: #fff;
    --food: #6b2d00;
    --water: #000080;
    --energy: #004d00;
    --friendship: #6b0038;
    --good: #004d00;
    --bad: #800000;
    --warn: #5c4d00;
    --mult: #6b0038;
    --friend: var(--friendship);
    --loss: #c00000;
    --food-ink: #6b2d00;
    --friendship-ink: #6b0038;
    --fp: var(--friendship);
    --on-fp: var(--on-color);
    --fp-ink: var(--friendship-ink);
    --water-ink: #000080;
    --energy-ink: #004d00;
    --good-fill: #004d00;
    --bad-fill: #800000;
    --warn-fill: #5c4d00;
    --mult-fill: #6b0038;
    --water-fill: #000080;
    --friendship-fill: #6b0038;
    --xp-soft: #1084d0;
    --xp-strong: #000080;
    --xp: var(--xp-strong);
    --xp-grad: linear-gradient(to bottom, var(--xp-soft), var(--xp-strong));
    --xp-bar-grad: var(--xp-grad);
    --xp-pill-grad: var(--xp-grad);
    --points: var(--xp-strong);
    --accent: var(--xp-strong);
    --primary: var(--xp-strong);
    --points-grad: var(--xp-strong);
    --side-tint: color-mix(in srgb, var(--xp-strong) 12%, transparent);
    --mult-grad: linear-gradient(135deg, #6b0038 0%, #4a0028 100%);
    --temper-love: var(--friendship-ink);
    --temper-like: var(--food-ink);
    --temper-neutral: var(--ink-dim);
    --temper-dislike: var(--bad);
    --grade-f: #1a1a1a;
    --grade-d: #800000;
    --grade-c: #5c4d00;
    --grade-b: #004d00;
    --grade-a: #000080;
    --grade-s: linear-gradient(135deg, var(--grade-a), var(--accent));
    --sheen: linear-gradient(135deg, rgb(255 255 255 / 0.35), rgb(0 0 0 / 0.18));
    --kind-charm: #004040;
    --kind-perk: #5c4d00;
    --kind-treat: var(--accent);
    --kind-boost: var(--points);
    --kind-snack: var(--food-ink);
    --spend-edge: 0 2px 0 color-mix(in srgb, #d97706 65%, #92400e), 0 3px 6px rgb(var(--shadow-rgb) / 0.15);
    --glass-highlight: rgb(255 255 255 / 0.7);
    --glint-spec: #fff;
    --scrim-soft: rgb(0 0 0 / 0.22);
    --tint-clear: rgb(0 128 128 / 0.4);
    --tint-rainy: rgb(0 0 128 / 0.55);
    --tint-sunny: rgb(128 128 0 / 0.45);
    --tint-lazy: rgb(128 0 128 / 0.4);
    --tint-zoomies: rgb(128 0 0 / 0.45);
    --tint-hungry: rgb(107 45 0 / 0.45);
    --tint-grumpy: rgb(64 64 64 / 0.55);
    --r-xs: 0;
    --r-sm: 0;
    --r-md: 0;
    --r-card: 0;
    --r-lg: 0;
    --r-sheet: 0;
    --r-pill: 0;
    --r-ticket: 0;
    --font: Tahoma, 'MS Sans Serif', 'Segoe UI', sans-serif;
    color: var(--ink);
}

:where([data-theme="purplite"]) :where(.window, .modal-back, #particle-layer, #mood-cover-host, .tip, #drag-ghost, .drag-ghost, #dev-panel, #dev-toggle),
.theme-showcase[data-theme="purplite"] {
    --ink: #f1eef8;
    --ink-dim: #b4a8c4;
    --line: rgba(196, 181, 230, 0.22);
    --glass: rgba(26, 18, 40, 0.96);
    --glass-strong: rgba(32, 22, 50, 0.98);
    --card: #2a1f3d;
    --surface: #1a1228;
    --surface-2: #3a2b52;
    --pip-idle: #7a6b90;
    --glint-good: #5eead4;
    --glint-bad: #f87171;
    --gold: #eab308;
    --gold-grad: linear-gradient(135deg, #fde68a, #f59e0b 55%, #d97706);
    --on-gold: #451a03;
    --track: rgba(241, 238, 248, 0.14);
    --scrim: rgba(10, 6, 18, 0.72);
    --overlay: rgba(0, 0, 0, 0.55);
    --shadow-rgb: 8 4 16;
    --shadow-1: 0 1px 3px rgb(var(--shadow-rgb) / 0.45);
    --shadow-2: 0 3px 8px rgb(var(--shadow-rgb) / 0.5);
    --shadow-3: 0 6px 18px rgb(var(--shadow-rgb) / 0.55);
    --on-color: #fff;
    --on-core: #fff;
    --food: #fdba74;
    --water: #5eead4;
    --energy: #fde68a;
    --friendship: #d8b4fe;
    --good: #5eead4;
    --bad: #f87171;
    --warn: #fde68a;
    --mult: #f9a8d4;
    --friend: var(--friendship);
    --loss: #f87171;
    --food-ink: #fdba74;
    --friendship-ink: #d8b4fe;
    --fp: var(--friendship);
    --on-fp: var(--on-color);
    --fp-ink: var(--friendship-ink);
    --water-ink: #5eead4;
    --energy-ink: #fde68a;
    --good-fill: #0f766e;
    --bad-fill: #9f1239;
    --warn-fill: #92400e;
    --mult-fill: #6b21a8;
    --water-fill: #0f766e;
    --friendship-fill: #6b21a8;
    --xp-soft: #7dd3c8;
    --xp-strong: #5b4a82;
    --xp: var(--xp-strong);
    --xp-grad: linear-gradient(to bottom, var(--xp-soft), var(--xp-strong));
    --xp-bar-grad: var(--xp-grad);
    --xp-pill-grad: var(--xp-grad);
    --points: var(--xp-strong);
    --accent: var(--xp-strong);
    --primary: var(--xp-strong);
    --points-grad: var(--xp-strong);
    --side-tint: color-mix(in srgb, var(--xp-strong) 12%, transparent);
    --mult-grad: linear-gradient(135deg, #6b21a8 0%, #5b4a82 100%);
    --temper-love: var(--friendship-ink);
    --temper-like: var(--food-ink);
    --temper-neutral: var(--ink-dim);
    --temper-dislike: var(--bad);
    --grade-f: #140e1f;
    --grade-d: #9f1239;
    --grade-c: #92400e;
    --grade-b: #0f766e;
    --grade-a: #5b4a82;
    --grade-s: linear-gradient(135deg, var(--grade-a), var(--accent));
    --sheen: linear-gradient(135deg, rgb(255 255 255 / 0.08), rgb(0 0 0 / 0.28));
    --kind-charm: #5eead4;
    --kind-perk: #fde68a;
    --kind-treat: var(--accent);
    --kind-boost: var(--points);
    --kind-snack: var(--food-ink);
    --spend-edge: 0 2px 0 color-mix(in srgb, #d97706 65%, #92400e), 0 3px 6px rgb(var(--shadow-rgb) / 0.35);
    --glass-highlight: rgb(255 255 255 / 0.1);
    --glint-spec: #fff;
    --scrim-soft: rgb(0 0 0 / 0.45);
    --tint-clear: rgb(94 234 212 / 0.38);
    --tint-rainy: rgb(91 74 130 / 0.7);
    --tint-sunny: rgb(253 230 138 / 0.45);
    --tint-lazy: rgb(107 33 168 / 0.5);
    --tint-zoomies: rgb(253 230 138 / 0.48);
    --tint-hungry: rgb(253 186 116 / 0.48);
    --tint-grumpy: rgb(76 58 92 / 0.65);
    color: var(--ink);
}

body[data-theme="light"],
.theme-showcase[data-theme="light"] {
    --chrome: #fff;
    --page-bg: #e8eeed;
    --page-tint: linear-gradient(rgba(241, 245, 249, 0.55), rgba(226, 232, 240, 0.7));
}
body[data-theme="sky"],
.theme-showcase[data-theme="sky"] {
    --chrome: #f0f9ff;
    --page-bg: #e0f2fe;
    --page-tint: linear-gradient(rgba(224, 242, 254, 0.55), rgba(186, 230, 253, 0.65));
}
body[data-theme="sheet"],
.theme-showcase[data-theme="sheet"] {
    --chrome: #faf6f0;
    --page-bg: #f3eee4;
    --page-tint: linear-gradient(rgba(250, 246, 240, 0.55), rgba(232, 223, 208, 0.7));
}
body[data-theme="dark"],
.theme-showcase[data-theme="dark"] {
    --chrome: #0c0f14;
    --page-bg: #0c0f14;
    --page-tint: linear-gradient(rgba(8, 12, 20, 0.5), rgba(8, 12, 20, 0.68));
}
body[data-theme="win98"],
.theme-showcase[data-theme="win98"] {
    --chrome: #c0c0c0;
    --page-bg: #008080;
    --page-tint: linear-gradient(rgba(0, 80, 80, 0.12), rgba(0, 40, 40, 0.28));
    --font: Tahoma, 'MS Sans Serif', 'Segoe UI', sans-serif;
    --r-xs: 0;
    --r-sm: 0;
    --r-md: 0;
    --r-card: 0;
    --r-lg: 0;
    --r-sheet: 0;
    --r-pill: 0;
    --r-ticket: 0;
}
body[data-theme="purplite"],
.theme-showcase[data-theme="purplite"] {
    --chrome: #1a1228;
    --page-bg: #140e1f;
    --page-tint: linear-gradient(rgba(20, 14, 32, 0.45), rgba(26, 18, 40, 0.7));
}

body[data-theme="win98"] .window,
body[data-theme="win98"] .modal,
body[data-theme="win98"] .icon-btn,
body[data-theme="win98"] .nav-menu-btn,
body[data-theme="win98"] .home-shop-btn,
body[data-theme="win98"] .tip,
body[data-theme="win98"] .home-menu,
body[data-theme="win98"] .home-menu.open {
    border-radius: 0;
}
body[data-theme="win98"] .window,
body[data-theme="win98"] .modal {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: 2px solid;
    border-color: #ffffff #404040 #404040 #ffffff;
    box-shadow: 2px 2px 0 #000000;
}
body[data-theme="win98"] .btn:not(.primary) {
    border-color: #ffffff #404040 #404040 #ffffff;
    background: #c0c0c0;
}
body[data-theme="win98"] .btn:not(.primary):active:not(:disabled) {
    border-color: #404040 #ffffff #ffffff #404040;
    transform: none;
}
body[data-theme="win98"] .btn.primary {
    background: #000080;
    border-color: #1084d0 #000040 #000040 #1084d0;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
    font-family: var(--font);
    color: var(--ink);
    background: var(--page-bg);
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
}
body::before {
    content: ''; position: fixed; inset: -60px; z-index: -1; pointer-events: none;
    background:
        var(--page-tint),
        var(--yard-art) center / cover;
    filter: blur(22px) saturate(110%);
    transition: opacity 0.7s ease;
}
button { font-family: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.45; }
.hidden { display: none !important; }

/* ---------- Window ---------- */
.window {
    position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%);
    width: var(--win-w); height: var(--win-h); max-width: 92vw; max-height: 92vh;
    background: var(--glass); border: 1px solid var(--line); border-radius: 14px;
    box-shadow: 0 18px 50px rgb(var(--shadow-rgb) / 0.35);
    backdrop-filter: saturate(120%) blur(16px); -webkit-backdrop-filter: saturate(120%) blur(16px);
    overflow: hidden; user-select: none; -webkit-user-select: none;
}
#window.nighting {
    border-color: var(--night); box-shadow: none; background: var(--night);
    transition: border-color 0.7s ease, box-shadow 0.7s ease, background 0.7s ease;
}
#window.nighting.dawning { border-color: var(--dawn); background: var(--dawn); }
body.dev-open .window { display: none; }
.screen { display: flex; flex-direction: column; height: 100%; }

.btn {
    border: 1px solid var(--line); background: var(--glass-strong); border-radius: var(--r-card);
    padding: 10px 14px; font-weight: 800; font-size: 15px; transition: transform 0.08s ease;
}
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn.primary { background: var(--primary); color: var(--on-core); border-color: transparent; }
.btn.small { padding: 5px 10px; font-size: 13px; }
.icon-btn .material-icons { font-size: 18px; color: var(--ink-dim); }
.icon-btn {
    width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line);
    background: var(--glass-strong); font-size: 20px; line-height: 1; display: grid; place-items: center; padding: 0;
}

/* ---------- Title + status ---------- */
.titlebar {
    display: flex; align-items: center; justify-content: flex-start; gap: 8px;
    padding: 8px 12px 10px; position: relative; z-index: 8; min-height: 0; width: 100%;
}
.pet-head {
    flex: 1 1 auto; width: 100%; min-width: 0; padding-right: 88px;
    display: flex; align-items: center; justify-content: flex-start; gap: 8px; min-height: 42px;
}
.pet-title {
    margin: 0; text-align: left; border: 0; background: none; padding: 10px 0 0;
    display: inline-flex; flex-direction: column; align-items: flex-start; justify-content: center;
    gap: 2px; min-height: 0; height: auto; white-space: nowrap;
}
.pet-name {
    position: relative;
    display: inline-flex;
    align-items: flex-start;
    gap: 4px;
    font-weight: 800;
    font-size: 16px;
    line-height: 1.05;
    color: var(--ink);
}
.pet-lv-sup {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    margin-top: -3px;
    border-radius: var(--r-pill);
    background: var(--ink);
    color: var(--surface);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.pet-form {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-style: normal;
    font-weight: 700;
    line-height: 1.15;
    color: var(--ink-dim);
    text-transform: none;
}
.pet-form .day-pips {
    display: inline-flex;
    align-items: center;
    width: max-content;
}
.lv-badge {
    display: inline-flex; align-items: center; justify-content: center;
    height: 20px; padding: 0 7px; border-radius: var(--r-pill);
    background: var(--ink); color: var(--surface);
    font-size: 11px; font-weight: 900; letter-spacing: 0.02em; line-height: 1;
    flex: none;
}
.pet-head .lv-badge {
    height: 16px; margin-top: 1px; padding: 0; border-radius: 0; background: none; color: inherit;
    align-items: center; gap: 0.22em; letter-spacing: 0;
}
.pet-head .lv-badge small {
    font-size: 10px; font-weight: 650; letter-spacing: 0.04em; color: var(--ink-dim);
}
.pet-head .lv-badge b {
    font-size: 13px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums;
}
#toolbar.is-focus .tool:not(.selected) { opacity: 0.38; }
#window.fx-busy #toolbar .tool {
    opacity: 0.38; pointer-events: none;
}
#toolbar.is-focus .tool.selected { opacity: 1; }
.statusbar { display: flex; flex-direction: column; align-items: stretch; gap: 0; padding: 0 12px; font-size: 12px; font-weight: 800; }
.xp-block { display: flex; flex-direction: column; gap: 2px; width: 100%; }
.xp-shell {
    display: flex; align-items: center; gap: 8px; width: 100%;
    padding: 3px 8px 3px 3px; border-radius: var(--r-pill);
    background: var(--glass-strong); box-sizing: border-box;
}
.xp-shell > .goal-nums { flex: none; font-size: 10px; line-height: 1; }
.xp-under { display: flex; justify-content: flex-end; align-items: baseline; gap: 8px; width: 100%; font-size: 11px; font-weight: 800; }
.day-end .xp-under, .modal.game-over .xp-under { justify-content: space-between; }
.xp-need { color: var(--ink-dim); min-width: 0; }
.roadmap-hit {
    display: inline-flex; align-items: center; gap: 8px; margin: 0; padding: 1px 4px 1px 0;
    border: 0; border-radius: 8px; background: transparent; color: inherit; font: inherit; cursor: pointer;
}
.roadmap-hit:hover, .roadmap-hit:focus-visible { background: var(--surface); }
.ch-label { font-size: 11px; font-weight: 900; color: var(--ink); line-height: 1; }
.modal.roadmap { position: relative; }
.rm-map { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.rm-ch { padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r-card); background: color-mix(in srgb, var(--surface) 45%, var(--card)); }
.rm-ch.now { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); background: color-mix(in srgb, var(--accent) 10%, var(--card)); }
.rm-ch.next { opacity: 0.55; }
.rm-ch-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.rm-ch-head img { width: 32px; height: 32px; object-fit: contain; }
.rm-ch-head img.locked { filter: brightness(0) opacity(0.18); }
.rm-ch-head b { display: block; font-size: 12px; font-weight: 900; }
.rm-ch-head span { font-size: 11px; font-weight: 700; color: var(--ink-dim); }
.rm-levels { display: flex; flex-wrap: wrap; gap: 6px 10px; }
.rm-days, .day-pips-wrap {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-start;
    gap: 8px 10px; width: 100%;
}
.rm-lv { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 800; color: var(--ink-dim); }
.rm-lv.now { color: var(--ink); }
.rm-lv.done { color: var(--ink); }
.goal-nums { color: var(--ink-dim); font-variant-numeric: tabular-nums; white-space: nowrap; display: inline-flex; align-items: baseline; gap: 1px; }
.goal-nums b { color: var(--ink); }
.goal-nums .goal-now { color: var(--xp); font-weight: 800; margin-left: 2px; display: inline-flex; align-items: baseline; }
.goal-nums .odo { height: 1em; }
.goal-nums .odo-sign { font-weight: 800; }
.goal-nums #xp-tgt, .goal-nums #de-xp-tgt, .goal-nums #go-xp-tgt { font-size: inherit; font-weight: 800; color: var(--ink-dim); }
.goal-nums #xp-total, .goal-nums #de-xp-total { color: var(--ink); font-weight: 1000; }
.day-pips {
    display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: flex-start;
    gap: 4px; flex: none; max-width: 100%;
}
.day-pips i {
    display: inline-grid; place-items: center; width: 22px; height: 14px; border-radius: 3px;
    font-size: 8px; font-weight: 900; font-style: normal; line-height: 1; color: var(--on-color);
    background: var(--track);
    font-variant-numeric: tabular-nums; transition: background 0.3s ease, box-shadow 0.3s ease;
}
.day-pips i.done, .day-pips i.now {
    background: var(--mood-bg, var(--ink));
    box-shadow: 0 1px 2px rgb(var(--shadow-rgb) / 0.28);
}
.day-pips i.now {
    color: var(--ink);
    background: #fff;
}
.day-pips i.future {
    color: transparent;
    background: color-mix(in srgb, var(--surface) 10%, transparent);
    box-shadow: none;
}
.day-pips i.now {
    box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--ink) 35%, transparent), 0 1px 2px rgb(var(--shadow-rgb) / 0.28);
}
.modal.roadmap .day-pips i.now { animation: pipPulse 1.6s ease-in-out infinite; }
@keyframes pipPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.14); opacity: 0.72; }
}
.coin, .wallet {
    --coin-size: 32px;
    position: relative; display: inline-flex; align-items: center; justify-content: center;
    width: var(--coin-size); height: var(--coin-size); min-width: var(--coin-size); padding: 0;
    border: 0; border-radius: 50%;
    background: var(--coin-chrome); color: var(--on-coin);
    font-size: calc(var(--coin-size) * 0.56); font-weight: 900; font-variant-numeric: tabular-nums; line-height: 1;
    box-shadow: 0 1px 2px rgb(0 0 0 / 0.18), inset 0 1px 0 rgb(255 255 255 / 0.45), inset 0 -2px 3px rgb(120 53 0 / 0.28);
    text-shadow: 0 1px 1px rgb(0 0 0 / 0.28);
    flex: none; box-sizing: border-box;
}
.coin.sm, .fp-pill { --coin-size: 26px; }
.coin.xs { --coin-size: 22px; }
.coin.wide, .wallet.wide { --coin-size: 36px; }
.coin.sm.wide, .fp-pill.wide { --coin-size: 28px; }
.coin.xs.wide { --coin-size: 24px; }
.wallet {
    cursor: pointer; transition: box-shadow 0.2s ease;
}
.wallet #wallet-num {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    width: 100%; height: 100%; margin: 0;
}
.bag-pill {
    display: inline-flex; align-items: center; gap: 2px; height: 20px; padding: 0 8px 0 6px; border-radius: var(--r-pill);
    background: var(--accent); color: var(--on-core); font-size: 12px; font-weight: 900; font-variant-numeric: tabular-nums;
    box-shadow: 0 1px 2px rgb(var(--shadow-rgb) / 0.15);
}
.bag-pill .material-icons { font-size: 13px; color: inherit; }
.wallet::after { content: ''; position: absolute; inset: -6px; }
.wallet .material-icons { display: none; }
.wallet small, .wallet .wallet-max { display: none; }
#wallet-num.odo { width: 100%; min-width: 0; height: 100%; }
.wallet.bump { animation: walletBump 0.32s cubic-bezier(0.33, 1, 0.68, 1); }
@keyframes walletBump { 40% { transform: scale(1.22); } }
.wallet.coin-gain { animation: coinGain 0.56s cubic-bezier(0.22, 0.9, 0.32, 1) both; }
.wallet.coin-loss { animation: coinLoss 0.56s cubic-bezier(0.22, 0.9, 0.32, 1) both; }
@keyframes coinGain {
    0%, 100% { transform: scale(1); }
    28%, 48% { transform: scale(0.94); }
    74% { transform: scale(1.04); }
}
@keyframes coinLoss {
    0%, 100% { transform: scale(1); }
    28%, 48% { transform: scale(0.94); }
    78% { transform: scale(1.03); }
}
.xp-bar {
    position: relative; flex: none; width: 100%; height: 12px; border-radius: var(--r-pill); background: var(--track);
    overflow: hidden; display: flex; align-items: stretch; gap: 0; padding: 3px; box-sizing: border-box;
}
.statusbar .xp-bar {
    flex: 1 1 auto; width: auto; min-width: 0; height: 10px; padding: 0;
    background: transparent; overflow: visible;
}
.xp-track {
    position: relative; display: block; width: 100%; height: 100%;
    min-width: 0; max-width: 100%; flex: none; box-sizing: border-box;
    overflow: hidden; border-radius: inherit;
    background: var(--track);
}
.statusbar .xp-bar .xp-track { background: var(--track); }
.xp-pill {
    position: absolute; top: 0; bottom: 0; left: 0; height: auto; min-width: 0;
    border-radius: inherit;
    box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.28);
    transition: width 0.35s ease;
}
.xp-pill.done, .xp-pill.now { background: var(--xp-grad); }
.xp-cut {
    position: absolute; top: 1px; bottom: 1px; width: 1px; margin-left: -0.5px;
    background: color-mix(in srgb, var(--card) 42%, transparent);
    z-index: 3; pointer-events: none;
}
.xp-rest { display: none; }

/* ---------- Pet area ---------- */
/* Sun position, glow, tint and shadow offset are set per turn by UI.renderSun; registered so they glide between turns. */
@property --sun-x { syntax: '<percentage>'; inherits: true; initial-value: -12%; }
@property --sun-y { syntax: '<percentage>'; inherits: true; initial-value: 42%; }
@property --sun-glow { syntax: '<color>'; inherits: true; initial-value: transparent; }
@property --sun-tint { syntax: '<color>'; inherits: true; initial-value: transparent; }
@property --shx { syntax: '<length>'; inherits: true; initial-value: 0px; }
@property --shy { syntax: '<length>'; inherits: true; initial-value: 8px; }
/* The day's weather colours the stage from above, a whim from below (UI.renderWhim sets data-whim). */
@property --wx-top { syntax: '<color>'; inherits: true; initial-value: transparent; }
@property --wx-bottom { syntax: '<color>'; inherits: true; initial-value: transparent; }
#window[data-whim="clear"] { --wx-top: var(--tint-clear); }
#window[data-whim="rainy"] { --wx-top: var(--tint-rainy); --whim-cloud: #60a5fa; }
#window[data-whim="sunny"] { --wx-top: var(--tint-sunny); --whim-cloud: #fbbf24; }
#window[data-whim="breezy"] { --wx-top: rgb(125 211 252 / 0.25); --whim-cloud: #38bdf8; }
#window[data-whim="cozy_drizzle"] { --wx-top: rgb(45 212 191 / 0.24); --whim-cloud: #2dd4bf; }
#window[data-whim="heatwave"] { --wx-top: rgb(251 146 60 / 0.28); --whim-cloud: #fb923c; }
#window[data-whim="lazy"] { --wx-bottom: var(--tint-lazy); --whim-cloud: #a78bfa; }
#window[data-whim="zoomies"] { --wx-bottom: var(--tint-zoomies); --whim-cloud: #34d399; }
#window[data-whim="hungry"] { --wx-bottom: var(--tint-hungry); --whim-cloud: #f97316; }
#window[data-whim="grumpy"] { --wx-bottom: var(--tint-grumpy); --whim-cloud: #f43f5e; }
#window[data-whim="show_off"] { --wx-bottom: rgb(232 121 249 / 0.25); --whim-cloud: #e879f9; }
#window[data-whim="picky"] { --wx-bottom: rgb(245 158 11 / 0.22); --whim-cloud: #f59e0b; }
#window[data-boss]:not([data-boss=""]) { --whim-cloud: #e11d48; }
#window[data-grade="S"] { --mood-cloud: #f59e0b; }
#window[data-grade="A"] { --mood-cloud: #22c55e; }
#window[data-grade="B"] { --mood-cloud: #38bdf8; }
#window[data-grade="C"] { --mood-cloud: #a78bfa; }
#window[data-grade="D"] { --mood-cloud: #fb923c; }
#window[data-grade="F"] { --mood-cloud: #ef4444; }
#window { transition: --sun-x 1.2s ease, --sun-y 1.2s ease, --sun-glow 1.2s ease, --sun-tint 1.2s ease, --shx 1.2s ease, --shy 1.2s ease, --wx-top 1.2s ease, --wx-bottom 1.2s ease; }
.pet-area, .zoom-card.sunlit, .cutscene.xform {
    --stage-bg:
        radial-gradient(circle at var(--sun-x) var(--sun-y), var(--sun-glow), transparent 75%),
        linear-gradient(var(--sun-tint), var(--sun-tint)),
        linear-gradient(to bottom, var(--wx-top), transparent 75%),
        linear-gradient(to top, var(--wx-bottom), transparent 75%),
        var(--yard-art) center / cover;
}
.pet-area {
    position: relative; flex: 1; z-index: 2; margin: 12px;
    border-radius: var(--r-card); overflow: hidden;
    background: var(--stage-bg);
    background-blend-mode: screen, soft-light, color, color, normal;
    display: grid; place-items: center;
}
.pet-area > :not(.stage-clouds) { z-index: 1; }
.stage-clouds {
    --cloud-a: var(--whim-cloud, var(--mood-cloud, var(--accent)));
    --cloud-b: var(--mood-cloud, var(--whim-cloud, var(--accent)));
    position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
    border-radius: inherit;
    opacity: 1;
    transition: opacity 1s ease;
    animation: fadeIn 0.9s ease both;
}
.pet-area.zooming .stage-clouds {
    opacity: 0;
    transition: none;
    animation: none;
}
.stage-clouds::before,
.stage-clouds::after,
.stage-clouds > i {
    content: '';
    position: absolute;
    display: block;
    pointer-events: none;
    inset: -32%;
    transition: opacity 1.2s ease;
    will-change: transform, opacity;
}
.stage-clouds::before {
    background:
        radial-gradient(ellipse 46% 36% at 28% 36%, color-mix(in srgb, var(--cloud-a) 34%, transparent) 0%, transparent 72%),
        radial-gradient(ellipse 38% 32% at 68% 28%, color-mix(in srgb, var(--cloud-a) 22%, transparent) 0%, transparent 70%);
    animation: cloudMorphA 22s ease-in-out infinite alternate;
}
.stage-clouds::after {
    background:
        radial-gradient(ellipse 48% 38% at 72% 68%, color-mix(in srgb, var(--cloud-b) 32%, transparent) 0%, transparent 72%),
        radial-gradient(ellipse 36% 30% at 30% 72%, color-mix(in srgb, var(--cloud-b) 20%, transparent) 0%, transparent 70%);
    animation: cloudMorphB 28s ease-in-out infinite alternate;
}
.stage-clouds > i {
    background:
        radial-gradient(ellipse 44% 34% at 52% 48%, color-mix(in srgb, var(--cloud-a) 22%, transparent) 0%, transparent 74%),
        radial-gradient(ellipse 32% 28% at 40% 62%, color-mix(in srgb, var(--cloud-b) 18%, transparent) 0%, transparent 72%);
    animation: cloudMorphC 19s ease-in-out infinite alternate;
}
@keyframes cloudMorphA {
    0%   { transform: translate3d(-6%, -4%, 0) rotate(-6deg) scale(1); opacity: 0.88; }
    50%  { transform: translate3d(7%, 4%, 0) rotate(5deg) scale(1.08, 1.03); opacity: 1; }
    100% { transform: translate3d(2%, 9%, 0) rotate(-3deg) scale(0.96, 1.07); opacity: 0.82; }
}
@keyframes cloudMorphB {
    0%   { transform: translate3d(6%, 5%, 0) rotate(5deg) scale(1.02); opacity: 0.84; }
    50%  { transform: translate3d(-8%, -5%, 0) rotate(-6deg) scale(1.1, 1.04); opacity: 1; }
    100% { transform: translate3d(-3%, 4%, 0) rotate(4deg) scale(0.95, 1.06); opacity: 0.88; }
}
@keyframes cloudMorphC {
    0%   { transform: translate3d(-5%, 4%, 0) rotate(4deg) scale(0.96); opacity: 0.78; }
    50%  { transform: translate3d(6%, -6%, 0) rotate(-7deg) scale(1.09, 1.02); opacity: 0.96; }
    100% { transform: translate3d(1%, 3%, 0) rotate(6deg) scale(1.03, 0.97); opacity: 0.84; }
}
@media (prefers-reduced-motion: reduce) {
    .stage-clouds::before, .stage-clouds::after, .stage-clouds > i { animation: none; }
}
.pet-img {
    position: relative;
    /* Width is set in JS from --grow (0 → 1): 20% of the stage up to 96%. */
    width: 20%; height: auto; aspect-ratio: 1; object-fit: contain; max-height: 92%; margin-bottom: 0;
    transition: width 0.4s ease, height 0.4s ease, max-height 0.2s ease, margin 0.2s ease;
    filter: drop-shadow(var(--shx) var(--shy) 8px rgb(var(--shadow-rgb) / 0.3));
    touch-action: none; cursor: grab; user-select: none;
}
.pet-img:active { cursor: grabbing; }
.pet-img.tug { animation: none; cursor: grabbing; }
.pet-img { animation: breathing 6s ease-in-out infinite; }
.pet-img.react { animation: hop 0.38s ease-out 1, breathing 6s ease-in-out infinite; }
.pet-img.sad { animation: petShake 1s ease, breathing 6s ease-in-out infinite; }
@keyframes petShake {
    0%, 100% { transform: none; }
    10% { transform: translateX(-8px) rotate(-3deg); }
    20% { transform: translateX(8px) rotate(3deg); }
    30% { transform: translateX(-8px) rotate(-3deg); }
    40% { transform: translateX(8px) rotate(3deg); }
    50% { transform: translateX(-6px) rotate(-2deg); }
    60% { transform: translateX(6px) rotate(2deg); }
    70% { transform: translateX(-4px) rotate(-1deg); }
    80% { transform: translateX(4px) rotate(1deg); }
    90% { transform: translateX(-2px); }
}
@keyframes breathing {
    0%, 100% { translate: 0 0; rotate: 0deg; }
    25% { translate: 0 -8px; rotate: 4deg; }
    50% { translate: 0 0; rotate: 0deg; }
    75% { translate: 0 -8px; rotate: -4deg; }
}
@keyframes hop { 0%,100% { transform: translateY(0); } 45% { transform: translateY(-14px); } }
/* Mood pill: dark pill + letter grade, top-center of the pet card */
.mood-pill {
    position: absolute; top: 8px; bottom: auto; left: 50%; transform: translateX(-50%); z-index: var(--z-chrome);
    display: flex; align-items: center; gap: 6px; padding: 4px 4px 4px 9px; border-radius: var(--r-pill);
    background: var(--overlay); color: var(--on-color); font-size: 12px; font-weight: 800; white-space: nowrap;
    box-shadow: var(--shadow-1); font-variant-numeric: tabular-nums;
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    transition: opacity 0.15s ease, top 0.18s ease, box-shadow 0.38s ease;
}
.mood-pill::before {
    content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
    background: var(--xp-grad); opacity: 0; transition: opacity 0.32s ease;
}
.mood-pill > * { position: relative; z-index: 1; }
.mood-pill.mult-pop { animation: moodCapsulePop 0.38s cubic-bezier(0.2, 1.15, 0.32, 1); }
#mood-cover-host {
    position: fixed; inset: 0; pointer-events: none; z-index: calc(var(--z-fx) + 2);
}
.mood-cover-pop {
    position: fixed; z-index: 1; transform-origin: 50% 50%;
}
.mood-cover-pop.mult-pop { animation: moodCoverPop 0.38s cubic-bezier(0.2, 1.15, 0.32, 1); }
@keyframes moodCoverPop {
    0%, 100% { transform: translateY(0) scale(1); }
    40% { transform: translateY(7px) scale(1.12); }
}
.mood-cover {
    position: absolute !important; inset: 0; left: 0 !important; top: 0 !important;
    width: 100% !important; height: 100% !important;
    transform: none !important; margin: 0; z-index: 1; pointer-events: none;
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
@keyframes moodCapsulePop {
    0%, 100% { transform: translateX(-50%) translateY(0) scale(1); }
    40% { transform: translateX(-50%) translateY(7px) scale(1.12); }
}
.mood-pill .mname { padding-right: 1px; }
.mood-pill .grade { position: relative; overflow: hidden; width: auto; min-width: 20px; padding: 0; border-radius: var(--r-pill); transition: min-width 0.25s ease, padding 0.25s ease; }
.mood-pill .grade.num { min-width: 44px; padding: 0 6px; font-size: 11px; font-weight: 900; }
.odo {
    display: inline-flex; align-items: stretch; height: 1em; line-height: 1;
    vertical-align: baseline; font-variant-numeric: tabular-nums;
}
.odo-d {
    position: relative; overflow: hidden; display: inline-grid; place-items: center;
    width: 1ch; height: 1em; flex: none;
}
.odo-d.sym { width: auto; min-width: 0.4em; }
.odo-d.blank { width: 0; min-width: 0; }
.gface { display: block; }
.odo-d .gface { display: grid; place-items: center; width: 100%; }
.gface.out { position: absolute; inset: 0; display: grid; place-items: center; }
.gface.in-up { animation: odoInUp 0.28s cubic-bezier(0.3, 0.7, 0.3, 1); }
.gface.in-down { animation: odoInDown 0.28s cubic-bezier(0.3, 0.7, 0.3, 1); }
.gface.out-up { animation: odoOutUp 0.28s cubic-bezier(0.3, 0.7, 0.3, 1) forwards; }
.gface.out-down { animation: odoOutDown 0.28s cubic-bezier(0.3, 0.7, 0.3, 1) forwards; }
@keyframes odoInUp { from { transform: translateY(100%); } }
@keyframes odoInDown { from { transform: translateY(-100%); } }
@keyframes odoOutUp { to { transform: translateY(-100%); } }
@keyframes odoOutDown { to { transform: translateY(100%); } }
.mood-pill .mdelta { display: none; }
.mood-pill .mdelta.show {
    display: inline-flex; align-items: center; padding: 1px 6px; border-radius: var(--r-pill); color: var(--on-color);
    font-size: 11px; font-weight: 900; font-variant-numeric: tabular-nums; animation: fadeIn 0.15s ease;
}
.mood-pill .mdelta.up { background: var(--good-fill); }
.mood-pill .mdelta.down { background: var(--bad-fill); }
.mood-pill .mdelta.loves { animation: lovesGlow 1.4s ease-in-out infinite; }
.grade {
    display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%;
    font-size: 12px; font-weight: 900; color: var(--on-color); box-shadow: 0 2px 4px rgb(var(--shadow-rgb) / 0.3);
}
.grade-F { background: var(--grade-f); }
.grade-D { background: var(--grade-d); }
.grade-C { background: var(--grade-c); }
.grade-B { background: var(--grade-b); }
.grade-A { background: var(--grade-a); }
.grade-S { background: var(--grade-s); }
.charm-row {
    position: absolute; top: 8px; left: 8px; right: auto; z-index: var(--z-chrome);
    display: flex; flex-direction: column; justify-content: flex-start; align-items: flex-start; gap: 5px;
    pointer-events: none;
}
.charm-row .build-col { display: flex; flex-direction: column; gap: 5px; pointer-events: auto; }
.charm-chip {
    position: relative; width: 24px; height: 32px; display: inline-grid; place-items: center;
    flex: none; padding: 0; border: 0; overflow: hidden; box-sizing: border-box;
    background: var(--glass-strong); border-radius: 5px; cursor: pointer;
    box-shadow: 0 1px 3px rgb(var(--shadow-rgb) / 0.14);
}
.charm-chip.perk { border: 1.5px solid color-mix(in srgb, var(--kind-perk) 72%, transparent); }
.charm-chip.charm { border: 1.5px solid color-mix(in srgb, var(--kind-charm) 72%, transparent); }
.charm-chip.combo { border: 1.5px solid color-mix(in srgb, var(--kind-boost) 65%, transparent); cursor: pointer; }
.charm-chip.empty {
    background: color-mix(in srgb, var(--card) 18%, transparent);
    border: 1px dashed color-mix(in srgb, var(--ink) 24%, transparent);
    box-shadow: none;
    opacity: 0.42;
    cursor: default;
    pointer-events: none;
}
.charm-chip.perk.empty { border-color: color-mix(in srgb, var(--kind-perk) 48%, transparent); }
.charm-chip.charm.empty { border-color: color-mix(in srgb, var(--kind-charm) 48%, transparent); }
.charm-chip .mi { font-size: 15px; line-height: 1; }
.charm-chip img { width: 15px; height: 15px; object-fit: contain; display: block; }
.charm-chip .chip-lv {
    position: absolute; right: 1px; bottom: 1px; z-index: 1;
    min-width: 12px; height: 12px; padding: 0 3px; border-radius: 6px;
    background: var(--ink); color: var(--card);
    font-size: 8px; font-weight: 900; line-height: 12px; text-align: center;
    font-variant-numeric: tabular-nums;
}
.charm-chip.lg { width: 34px; height: 34px; border-radius: 8px; background: var(--card); }
.charm-chip.lg .mi { font-size: 22px; }
.whim-pill {
    position: absolute; top: auto; right: 8px; bottom: 8px; z-index: var(--z-chrome);
    display: grid; place-items: center; width: 40px; height: 40px; padding: 0;
    border: 0; border-radius: 50%; background: var(--glass-strong); color: var(--ink);
    font: inherit; cursor: pointer;
}
.whim-pill .material-icons { font-size: 22px; color: var(--water); }
.whim-pill.is-boss {
    width: 44px; height: 44px;
    background: none; border-radius: 0; box-shadow: none;
}
.whim-pill.is-boss .material-icons {
    font-size: 36px; line-height: 1;
    background: linear-gradient(135deg, #fecaca 0%, #ef4444 32%, #b91c1c 62%, #fca5a5 85%, #ef4444 100%);
    background-size: 240% 240%;
    -webkit-background-clip: text; background-clip: text;
    color: transparent;
    filter: drop-shadow(0 2px 6px rgb(220 38 38 / 0.55));
    animation: bossShine 3.4s ease-in-out infinite;
}
@keyframes bossShine {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}
@media (prefers-reduced-motion: reduce) {
    .whim-pill.is-boss .material-icons,
    .tw-slice.is-boss .material-icons { animation: none; }
}
.whim-pill.hidden { display: none; }
.tip .whim-ic { font-size: 16px; vertical-align: -3px; margin-right: 4px; color: var(--water); }
.float-layer { position: absolute; inset: 0; pointer-events: none; z-index: calc(var(--z-chrome) + 1); }
.floater {
    position: absolute; font-weight: 900; font-size: 15px; white-space: nowrap;
    text-shadow: 0 0 3px var(--card), 0 0 6px var(--card); animation: floatUp 1.1s ease-out forwards;
}
.combo-banner {
    position: absolute; left: -18px; right: -18px; top: var(--top, 18%); z-index: 2;
    display: flex; justify-content: center; align-items: center; gap: 8px;
    padding: 3px 12px; border-radius: 0;
    background: var(--card); color: var(--ink);
    box-shadow: 0 2px 10px rgb(var(--shadow-rgb) / 0.18);
    transform-origin: 50% 50%;
    animation: bannerIn 0.14s cubic-bezier(0.2, 1.35, 0.32, 1) both;
    pointer-events: none;
}
.combo-banner.out { animation: bannerOut 0.15s ease-in both; }
.cb-seq { display: inline-flex; align-items: center; gap: 3px; }
.cb-ic {
    width: 18px; height: 18px; flex: none; display: inline-grid; place-items: center;
    border-radius: 50%; background: var(--c, var(--ink));
}
.combo-steps {
    display: inline-flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 4px;
}
.combo-step {
    width: 22px; height: 22px; flex: none; display: inline-grid; place-items: center;
    border-radius: 50%; background: var(--c, var(--ink));
}
.combo-step .mi { font-size: 13px; color: var(--on-color) !important; }
.offer .ds .combo-steps { justify-content: center; margin: 0 0 6px; }
.combo-banner .cb-ic .mi { font-size: 11px; color: var(--on-color) !important; }
.cb-name { font-size: 12px; font-weight: 800; letter-spacing: 0.01em; }
@keyframes bannerIn {
    from { opacity: 0; transform: rotate(var(--tilt, 0deg)) scaleY(0.18); }
    to { opacity: 1; transform: rotate(var(--tilt, 0deg)) scaleY(1); }
}
@keyframes bannerOut {
    from { opacity: 1; transform: rotate(var(--tilt, 0deg)) scaleY(1); }
    to { opacity: 0; transform: rotate(var(--tilt, 0deg)) scaleY(0.18); }
}
.pts-fly, .xp-stub {
    position: absolute; left: 0; top: 0; display: flex; align-items: center; justify-content: center;
    box-sizing: border-box; height: 12px; padding: 0;
    border-radius: var(--r-ticket); background: var(--points); color: var(--on-color); font-family: var(--font); font-size: 11px; font-weight: 1000;
    font-variant-numeric: tabular-nums; letter-spacing: 0.02em; box-shadow: 0 2px 8px rgb(var(--shadow-rgb) / 0.25);
    will-change: transform; white-space: nowrap; line-height: 1; overflow: hidden; pointer-events: none;
}
.xp-stub.pill, .pts-fly.pill {
    border-radius: var(--r-pill); padding: 0 8px; background: var(--xp-grad);
}
.pts-fly small { font-size: 10px; font-weight: 800; }
.xp-stub.tally, .pts-fly.tally { overflow: visible; }
.statusbar .xp-pill.now.bump { animation: barBump 0.35s cubic-bezier(0.33, 1, 0.68, 1); transform-origin: center center; }
@keyframes barBump { 40% { transform: scaleY(1.35); } }
.floater.refuse {
    padding: 4px 11px; border-radius: var(--r-pill); background: var(--bad-fill); color: var(--on-color); font-size: 13px;
    text-shadow: none; box-shadow: 0 3px 10px rgb(var(--shadow-rgb) / 0.35); animation-duration: 1.8s;
}
/* Grade circle glint when the grade changes: green up, red down. The class sits on the pill because syncGrade rewrites the circle's classes. */
.mood-pill { --glint: transparent; }
.mood-pill.glint-good { --glint: var(--glint-good); }
.mood-pill.glint-bad { --glint: var(--glint-bad); }
.mood-pill.glint-good .grade, .mood-pill.glint-bad .grade { animation: glintGlow 1.2s ease-out; }
.mood-pill.glint-good .grade::after, .mood-pill.glint-bad .grade::after {
    content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
    background: linear-gradient(var(--glint-angle, 105deg), transparent 34%, color-mix(in srgb, var(--glint-spec) 70%, transparent) 47%, var(--glint-spec) 50%, color-mix(in srgb, var(--glint-spec) 70%, transparent) 53%, transparent 66%);
    background-size: 250% 100%; mix-blend-mode: screen; animation: glintSweep 0.75s ease-out forwards;
}
.mood-pill.glint-bad .grade::after { --glint-angle: -105deg; animation-name: glintSweepBack; }
@keyframes glintSweep { from { background-position: 120% 0; } to { background-position: -40% 0; } }
@keyframes glintSweepBack { from { background-position: -40% 0; } to { background-position: 120% 0; } }
/* Speech pill over the pet's head: green cheer, red grumble. The tail points down at the pet. */
.say {
    position: absolute; left: 0; top: 0; padding: 4px 11px; border-radius: var(--r-pill);
    color: var(--on-color); font-family: var(--font); font-size: 14px; font-weight: 900; font-style: italic; white-space: nowrap;
    filter: drop-shadow(0 3px 8px rgb(var(--shadow-rgb) / 0.22)); will-change: transform; pointer-events: none;
}
.say::after {
    content: ''; position: absolute; left: 50%; bottom: -5px; width: 12px; height: 8px; margin-left: -6px;
    background: inherit; clip-path: polygon(0 0, 100% 0, 50% 100%);
}
.say.good { background: var(--good-fill); }
.say.bad { background: var(--bad-fill); }
.say.done { background: color-mix(in srgb, #0f172a 78%, var(--card)); }
body:has(#active-modal) .say { display: none; }
@keyframes glintGlow {
    0% { box-shadow: 0 0 0 0 transparent; }
    20% { box-shadow: 0 0 0 2px var(--glint), 0 0 8px 2px color-mix(in srgb, var(--glint) 70%, transparent); }
    100% { box-shadow: 0 0 0 0 transparent; }
}
@keyframes glintCue {
    from { box-shadow: 0 0 0 0 transparent; }
    to { box-shadow: 0 0 0 2px var(--glint), 0 0 8px 2px color-mix(in srgb, var(--glint) 70%, transparent); }
}
.mood-pill.glint-cue.glint-good .grade,
.mood-pill.glint-cue.glint-bad .grade {
    animation: glintCue 0.2s ease-out forwards;
}
.mood-pill.glint-cue .grade::after { content: none; animation: none; }
.speed-opts { display: grid; gap: 8px; margin: 10px 0 4px; }
.speed-opt {
    display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 10px 12px;
    border-radius: var(--r-card); border: 1px solid var(--line); background: var(--card);
}
.speed-opt b { font-size: 15px; }
.speed-opt span { font-size: 12px; color: var(--ink-dim); font-weight: 700; }
.speed-opt.on { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 25%, transparent); }
.modal.menu { display: flex; flex-direction: column; max-width: 360px; max-height: min(88dvh, 640px); padding: 12px 0 14px; overflow: hidden; }
.menu-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 12px 2px; }
.menu-head-lead { display: flex; align-items: center; gap: 8px; min-width: 0; }
.menu-head h2 { margin: 0; }
.menu-head .tip-x { position: static; }
.menu-back { width: 32px; height: 32px; border: 0; background: none; }
.menu-back .material-icons { font-size: 20px; }
.menu-tab {
    position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    min-height: 52px; padding: 6px 4px; border: 0; border-radius: var(--r-sheet); background: none;
    color: var(--ink-dim); font: inherit; font-size: 11px; font-weight: 800; cursor: pointer;
}
.menu-tab .material-icons { font-size: 22px; color: inherit; }
.menu-tab.on { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.menu-badge {
    position: absolute; top: 4px; right: calc(50% - 22px); min-width: 16px; height: 16px; padding: 0 4px; border-radius: var(--r-pill);
    display: grid; place-items: center; background: var(--accent); color: var(--on-color);
    font-size: 10px; font-weight: 900; font-style: normal; line-height: 1;
}
.menu-pane { flex: 1; min-height: 0; overflow: auto; padding: 8px 14px 0; }
.modal.menu:not(:has(.sh-subs, .set-tog)) .menu-pane { padding-top: 4px; }
.mp-stats { display: flex; justify-content: space-between; gap: 8px; margin: 2px 0 10px; font-size: 12px; font-weight: 800; color: var(--ink-dim); }
.mp-stats b { color: var(--ink); }
.set-h { margin: 14px 0 6px; font-size: 11px; font-weight: 900; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-dim); }
.menu-pane > .set-h:first-child { margin-top: 4px; }
.set-seg { display: grid; grid-template-columns: repeat(auto-fit, minmax(88px, 1fr)); gap: 6px; margin-bottom: 8px; }
.set-chip {
    display: flex; flex-direction: column; align-items: flex-start; gap: 1px; text-align: left; padding: 8px 10px;
    border-radius: var(--r-card); border: 1px solid var(--line); background: var(--surface); font-family: inherit; color: inherit; cursor: pointer;
}
.set-chip b { font-size: 13px; font-weight: 900; }
.set-chip span { font-size: 11px; color: var(--ink-dim); font-weight: 700; line-height: 1.25; }
.set-chip.on { border-color: var(--accent); background: var(--card); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 25%, transparent); }
.set-tog {
    display: flex; gap: 2px; margin-bottom: 10px; padding: 3px; border-radius: var(--r-pill);
    background: var(--surface); border: 1px solid var(--line);
}
.set-toggle {
    flex: 1; border: 0; border-radius: var(--r-pill); background: none; padding: 7px 6px;
    font: inherit; font-size: 13px; font-weight: 800; color: var(--ink-dim); cursor: pointer;
}
.set-toggle.on { background: var(--card); color: var(--accent); box-shadow: var(--shadow-1); }
.sh-bal { display: flex; align-items: center; gap: 6px; margin: 2px 0 8px; font-size: 13px; font-weight: 800; }
.sh-bal img { width: 22px; height: 22px; object-fit: contain; }
.sh-subs { display: flex; gap: 4px; margin-bottom: 10px; }
.sh-sub {
    flex: 1; border: 0; border-radius: var(--r-pill); background: var(--surface); padding: 6px 4px;
    font: inherit; font-size: 11px; font-weight: 800; color: var(--ink-dim); cursor: pointer;
}
.sh-sub.on { background: color-mix(in srgb, var(--accent) 14%, var(--card)); color: var(--accent); }
.lib-pick {
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
    padding: 6px 2px 8px;
}
.lib-pick .offer {
    position: relative; left: auto; top: auto; width: 100%; height: auto; aspect-ratio: var(--card-ratio); min-height: 0;
    margin: 0; padding: 0 0 6px; transform: none; cursor: pointer; overflow: hidden;
    font: inherit; color: inherit; text-align: center;
    display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
    box-shadow: 0 6px 14px rgb(var(--shadow-rgb) / 0.12);
}
.lib-pick .offer .art-wrap { width: 100%; flex: none; aspect-ratio: var(--card-art-ratio); min-height: 0; margin: 0; }
.lib-pick .offer .art,
.lib-pick .offer.charm .art,
.lib-pick .offer.perk .art {
    width: 100%; height: 100%; aspect-ratio: auto; border-radius: 0;
    border-bottom: 1px solid color-mix(in srgb, var(--ink) 7%, transparent);
}
.lib-pick .offer .art img, .lib-pick .offer .art .sh-pet, .lib-pick .offer .art .sh-preview, .lib-pick .offer .art .sh-swatch {
    width: 100%; height: 100%; border-radius: 0;
}
.lib-pick .offer .art img { object-fit: contain; padding: 14px; }
.lib-pick .offer .art .sh-preview img { padding: 0; object-fit: cover; }
.lib-pick .offer .nm { font-size: 13px; padding: 0 8px; margin: auto 0 0; }
.lib-pick .offer .ds { font-size: 10px; max-height: none; overflow: visible; padding: 0 8px; margin: 2px 0 auto; }
.lib-pick .offer:has(.ds:empty) .nm { margin: auto 0; }
.lib-pick .offer .tp { font-size: 9px; }
.lib-pick .offer .art .material-icons { font-size: 32px; }
.lib-pick .offer:hover { transform: translateY(-2px); }
.lib-pick .offer.locked { opacity: 0.7; }
.oc-open {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 64px; height: 26px; padding: 0 10px; border-radius: var(--r-pill);
    background: var(--surface-2); color: var(--ink); font-size: 11px; font-weight: 900;
}
.lib-pick .offer.locked .oc-open { color: var(--ink-dim); }
.lib-pick-min .offer.lib-min {
    display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
    padding: 0 0 6px; gap: 0;
}
.lib-pick-min .offer.lib-min .art-wrap { width: 100%; flex: none; aspect-ratio: var(--card-art-ratio); margin: 0; }
.lib-pick-min .offer.lib-min .art { width: 100%; height: 100%; }
.lib-pick-min .offer.lib-min .tp,
.lib-pick-min .offer.lib-min .offer-foot { display: none; }
.lib-pick-min .offer.lib-min .nm { font-size: 13px; margin: auto 0 0; }
.lib-pick-min .offer.lib-min .ds {
    font-size: 11px; font-weight: 800; color: var(--ink-dim); margin: 2px 0 auto;
}
.lib-pick-min .offer.lib-min .ds:empty { display: none; }
.lib-pick-min .offer.lib-min:has(.ds:empty) .nm { margin: auto 0; }

/* Settings: tappable stats, audio volume/mute, speed note */
.about-stats .stat-btn {
    cursor: pointer; font: inherit; color: inherit;
    transition: border-color var(--t-fast), background var(--t-fast), transform var(--t-fast);
}
.about-stats .stat-btn:hover { border-color: var(--accent); }
.about-stats .stat-btn:active { transform: scale(0.97); }
.about-stats .stat-btn.on {
    border-color: var(--accent); background: var(--card);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 22%, transparent);
}
.stat-explain {
    margin: -6px 0 12px; padding: 8px 10px;
    border-radius: var(--r-card); border: 1px solid var(--line);
    background: var(--card); color: var(--ink);
    font-size: 12px; font-weight: 700; line-height: 1.4;
}
.set-audio { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.audio-row {
    display: grid; grid-template-columns: 32px 46px 1fr 36px; align-items: center; gap: 8px;
    padding: 6px 10px 6px 6px;
    border-radius: var(--r-card); border: 1px solid var(--line); background: var(--surface);
}
.audio-mute-btn {
    width: 32px; height: 32px; border: 0; border-radius: var(--r-md);
    display: grid; place-items: center;
    background: var(--card); color: var(--accent);
    box-shadow: var(--shadow-1);
}
.audio-mute-btn .material-icons { font-size: 18px; }
.audio-row.is-muted .audio-mute-btn { color: var(--ink-dim); background: var(--surface-2); box-shadow: none; }
.audio-lbl { font-size: 12px; font-weight: 800; color: var(--ink); }
.audio-slider {
    width: 100%; margin: 0; accent-color: var(--accent); cursor: pointer;
}
.audio-row.is-muted .audio-slider { opacity: 0.45; }
.audio-pct {
    font-size: 11px; font-weight: 800; color: var(--ink-dim); text-align: right;
    font-variant-numeric: tabular-nums;
}
.set-speed-note {
    margin: -4px 0 10px; text-align: center;
    font-size: 11px; font-weight: 700; color: var(--ink-dim);
}

/* Inline keyword highlighting in tooltips, quirks, forecasts, and card notes */
.kw { font-weight: 800; }
.kw-food { color: var(--food-ink, var(--food)); }
.kw-water { color: var(--water-ink, var(--water)); }
.kw-energy { color: var(--energy-ink, var(--energy)); }
.kw-friendship { color: var(--friendship-ink, var(--friendship)); }
.kw-points, .kw-xp {
    display: inline-flex; align-items: center;
    padding: 1px 6px; margin: 0 1px; border-radius: var(--r-pill);
    color: var(--on-color); font-weight: 900; font-size: 0.92em; line-height: 1.25;
    font-variant-numeric: tabular-nums; white-space: nowrap;
}
.kw-points { background: var(--points); }
.kw-mult { color: var(--mult); }
.kw-xp { background: var(--xp-strong); }
.kw-combo { color: var(--kind-boost, var(--points)); }
.kw-coins { color: var(--warn); }
.kw-term { color: var(--ink); font-weight: 800; }

/* Theme showcase cards: each card is a miniature living preview of that theme */
.offer.theme-showcase {
    padding: 0; overflow: hidden; display: flex; flex-direction: column;
    background: var(--page-bg); color: var(--ink);
    font-family: var(--font);
    border: 1.5px solid var(--line);
    border-radius: var(--r-card);
    box-shadow: 0 10px 26px rgb(var(--shadow-rgb) / 0.24);
}
.offer.theme-showcase.on {
    box-shadow: 0 0 0 2px var(--accent), 0 10px 26px rgb(var(--shadow-rgb) / 0.28);
}
.offer.theme-showcase .ts-stage {
    flex: none; width: 100%; aspect-ratio: var(--card-art-ratio);
    display: flex; align-items: stretch; justify-content: center;
    padding: 9px; overflow: hidden; box-sizing: border-box;
    background: var(--page-tint), var(--page-bg);
}
.offer.theme-showcase .ts-win {
    width: 100%; height: 100%; display: flex; flex-direction: column; justify-content: space-between; gap: 6px;
    padding: 8px; box-sizing: border-box;
    background: var(--glass);
    border: 1px solid var(--line);
    border-radius: var(--r-card);
    box-shadow: 0 6px 16px rgb(var(--shadow-rgb) / 0.2);
}
.offer.theme-showcase .ts-bar {
    display: flex; align-items: center; justify-content: space-between; gap: 4px; flex: none;
}
.offer.theme-showcase .ts-title {
    display: inline-flex; align-items: center; gap: 4px; min-width: 0;
}
.offer.theme-showcase .ts-title b {
    font-size: 11px; font-weight: 900; color: var(--ink);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.offer.theme-showcase .ts-title i {
    flex: none; font-style: normal; font-size: 8.5px; font-weight: 900;
    padding: 1.5px 5px; border-radius: var(--r-pill);
    background: var(--ink); color: var(--card); line-height: 1.1;
}
.offer.theme-showcase .ts-grade {
    flex: none; display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px;
    border-radius: var(--r-pill);
    background: var(--grade-s, var(--accent)); color: var(--on-color);
    font-size: 9.5px; font-weight: 900;
}
.offer.theme-showcase .ts-xp {
    flex: none; height: 6px; border-radius: var(--r-pill); background: var(--track); overflow: hidden;
}
.offer.theme-showcase .ts-xp i {
    display: block; height: 100%; border-radius: inherit;
    background: linear-gradient(90deg, var(--xp-soft), var(--xp-strong));
}
.offer.theme-showcase .ts-mid {
    flex: 1 1 auto; min-height: 0;
    display: grid; grid-template-columns: 1fr auto; gap: 7px; align-items: center;
    padding: 6px 7px; border-radius: var(--r-md);
    background: var(--surface); border: 1px solid var(--line);
}
.offer.theme-showcase .ts-meters {
    display: flex; flex-direction: column; justify-content: center; gap: 5px;
}
.offer.theme-showcase .ts-m {
    display: block; height: 5px; border-radius: var(--r-pill);
    background: var(--track); overflow: hidden;
}
.offer.theme-showcase .ts-m i { display: block; height: 100%; border-radius: inherit; }
.offer.theme-showcase .ts-chips {
    display: flex; flex-direction: column; align-items: flex-end; justify-content: center; gap: 4px;
}
.offer.theme-showcase .ts-pill {
    font-size: 8.5px; font-weight: 900; line-height: 1; padding: 2.5px 5px;
    border-radius: var(--r-pill); color: var(--on-color);
}
.offer.theme-showcase .ts-pill.pts { background: var(--points, var(--accent)); }
.offer.theme-showcase .ts-pill.mult { background: var(--mult-grad, var(--mult)); }
.offer.theme-showcase .ts-coin {
    display: inline-grid; place-items: center; min-width: 17px; height: 17px; padding: 0 4px;
    border-radius: 999px; background: var(--coin-chrome); color: var(--on-coin);
    font-size: 8.5px; font-weight: 900; box-shadow: 0 1px 2px rgb(0 0 0 / 0.25);
}
.offer.theme-showcase .ts-tools {
    flex: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px;
}
.offer.theme-showcase .ts-tool {
    display: grid; place-items: center; height: 24px;
    border-radius: var(--r-sm); background: var(--card);
    border: 1px solid var(--line); box-shadow: var(--shadow-1);
}
.offer.theme-showcase .ts-tool .material-icons { font-size: 14px; color: var(--c); }
.offer.theme-showcase .ts-foot {
    flex: 1 1 auto; min-height: 0;
    display: flex; align-items: center; justify-content: center; gap: 6px;
    width: 100%; padding: 0 10px; box-sizing: border-box;
    background: var(--card); border-top: 1px solid var(--line);
}
.offer.theme-showcase .ts-name {
    font-size: 13px; font-weight: 900; color: var(--ink);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.offer.theme-showcase .ts-foot .btn {
    border-radius: var(--r-pill);
}
.offer.theme-showcase .ts-foot .btn.primary {
    background: var(--primary); color: var(--on-color); border-color: transparent;
}
.offer.theme-showcase .ts-foot .btn:not(.primary) {
    background: var(--surface-2); color: var(--ink); border: 1px solid var(--line);
}
/* Win98 authentic bevels & blue titlebar inside its showcase card */
.offer.theme-showcase[data-theme="win98"] {
    border: 2px solid; border-color: #ffffff #404040 #404040 #ffffff;
    box-shadow: 2px 2px 0 #000;
}
.offer.theme-showcase[data-theme="win98"] .ts-win {
    border: 2px solid; border-color: #ffffff #404040 #404040 #ffffff;
    box-shadow: 2px 2px 0 #000; padding: 6px;
}
.offer.theme-showcase[data-theme="win98"] .ts-bar {
    background: linear-gradient(90deg, #000080, #1084d0);
    padding: 3px 5px; margin: -3px -3px 0;
}
.offer.theme-showcase[data-theme="win98"] .ts-title b { color: #fff; }
.offer.theme-showcase[data-theme="win98"] .ts-title i { background: #c0c0c0; color: #000; }
.offer.theme-showcase[data-theme="win98"] .ts-tool,
.offer.theme-showcase[data-theme="win98"] .ts-foot .btn:not(.primary) {
    background: #c0c0c0;
    border: 2px solid; border-color: #ffffff #404040 #404040 #ffffff;
    box-shadow: none;
}
.offer.theme-showcase[data-theme="win98"] .ts-foot .btn.primary {
    background: #000080; color: #fff;
    border: 2px solid; border-color: #1084d0 #000040 #000040 #1084d0;
}
.modal.menu.menu-deck .menu-pane { overflow: hidden; padding: 4px 0 0; }
.modal.menu .shop-flow { flex: none; }
.modal.menu .sh-bal { padding: 0 14px; }
.modal.menu .shop-dots { padding-bottom: 8px; }
.lib-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; align-items: stretch; }
.lib-card {
    display: grid; grid-template-rows: 1fr auto; aspect-ratio: 2 / 3; min-width: 0; min-height: 0;
    gap: 4px; padding: 6px 5px 7px; overflow: hidden; contain: paint;
    border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface);
    font: inherit; color: inherit; cursor: pointer; text-align: center;
}
.lib-card:disabled { cursor: default; opacity: 1; }
.lib-art {
    display: grid; place-items: center; min-height: 0; overflow: hidden; border-radius: 8px;
    background: color-mix(in srgb, var(--accent) 8%, var(--surface-2));
}
.lib-art > img {
    width: 100%; height: 100%; object-fit: contain; padding: 4px;
    filter: drop-shadow(0 3px 3px rgb(var(--shadow-rgb) / 0.25));
}
.lib-art .material-icons { display: grid; place-items: center; width: 100%; height: 100%; font-size: 28px; color: var(--accent); }
.lib-info { display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 0; }
.lib-info b {
    font-size: 11px; font-weight: 900; line-height: 1.2; max-width: 100%;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lib-info span { font-size: 10px; font-weight: 800; color: var(--ink-dim); }
.lib-card.locked .lib-art > img, .lib-card.locked .sh-pet img { filter: brightness(0) opacity(0.28); }
.lib-card.locked b, .lib-card.locked span { color: var(--ink-dim); }
.lib-card.on { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 25%, transparent); }
.lib-card.poor { opacity: 0.55; }
.sh-preview { position: relative; width: 100%; height: 100%; overflow: hidden; background: var(--surface-2); border-radius: 8px; }
.sh-preview img {
    display: block; width: 100%; height: 100%; object-fit: cover;
    filter: blur(10px) saturate(1.1); transform: scale(1.18);
}
.lib-card.locked .sh-preview img { filter: blur(10px) saturate(0.5) brightness(0.88); }
.sh-pet {
    position: relative; width: 100%; height: 100%; overflow: hidden; border-radius: 8px;
    background: color-mix(in srgb, var(--accent) 10%, var(--surface));
}
.sh-pet img {
    position: absolute; inset: 0; width: 100%; height: 100%;
    object-fit: contain; object-position: center; padding: 6px; pointer-events: none;
}
.sh-theme-fan {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: color-mix(in srgb, var(--surface) 65%, var(--card));
    overflow: hidden;
}
.sh-tf-card {
    position: absolute;
    width: 58px;
    height: 76px;
    padding: 7px 6px;
    border-radius: 9px;
    background: var(--card);
    border: 1.5px solid var(--line);
    box-shadow: 0 4px 10px rgb(0 0 0 / 0.18);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 5px;
    box-sizing: border-box;
    transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.sh-tf-card:nth-child(1) { transform: translate(-22px, 5px) rotate(-11deg); z-index: 1; }
.sh-tf-card:nth-child(2) { transform: translate(0, -3px) rotate(0deg); z-index: 3; }
.sh-tf-card:nth-child(3) { transform: translate(22px, 5px) rotate(11deg); z-index: 2; }
.offer:hover .sh-tf-card:nth-child(1) { transform: translate(-26px, 6px) rotate(-14deg); }
.offer:hover .sh-tf-card:nth-child(2) { transform: translate(0, -6px) rotate(0deg); }
.offer:hover .sh-tf-card:nth-child(3) { transform: translate(26px, 6px) rotate(14deg); }
.sh-tf-card:nth-child(1):nth-last-child(2) { transform: translate(-15px, 2px) rotate(-8deg); z-index: 1; }
.sh-tf-card:nth-child(2):nth-last-child(1) { transform: translate(15px, 2px) rotate(8deg); z-index: 2; }
.sh-tf-card:only-child { transform: none; z-index: 2; width: 68px; height: 88px; }
.sh-tf-bar {
    display: block; height: 10px; border-radius: 4px;
    background: var(--primary);
}
.sh-tf-xp {
    display: block; height: 6px; width: 78%; border-radius: 99px;
    background: var(--xp-grad);
}
.sh-tf-dots {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px;
    margin-top: auto;
}
.sh-tf-dots i {
    display: block; height: 9px; border-radius: 99px;
}
.sh-swatch {
    position: relative; width: 100%; height: 100%; overflow: hidden; background: var(--surface-2); border-radius: 8px;
}
.sh-swatch::before {
    content: ''; position: absolute; inset: 22% 14% 18%; border-radius: 7px;
    background: var(--face, #fff); box-shadow: 0 2px 8px rgb(0 0 0 / 0.16);
}
.sh-swatch::after {
    content: ''; position: absolute; left: 22%; right: 46%; bottom: 26%; height: 7px; border-radius: 4px;
    background: var(--chip, #0f766e);
}
.sh-swatch[data-swatch="light"] { --face: #fff; --chip: #0f766e; background: #e8eeed; }
.sh-swatch[data-swatch="dark"] { --face: #1a1f28; --chip: #3b82f6; background: #0c0f14; }
.sh-swatch[data-swatch="win98"] { --face: #d4d0c8; --chip: #000080; background: #008080; border-radius: 0; }
.sh-swatch[data-swatch="win98"]::before, .sh-swatch[data-swatch="win98"]::after { border-radius: 0; }
.sh-swatch[data-swatch="purplite"] { --face: #2a1f3d; --chip: #5eead4; background: #1a1228; }
.sh-swatch[data-swatch="sky"] { --face: #fff; --chip: #0369a1; background: #bae6fd; }
.sh-swatch[data-swatch="sheet"] { --face: #fffaf3; --chip: #b45309; background: #e8dfd0; }
.menu-tab { min-height: 48px; }
.set-lbl { margin: 10px 0 4px; font-size: 11px; font-weight: 900; color: var(--ink-dim); text-transform: uppercase; letter-spacing: 0.04em; }
.set-lbl .set-sub {
    display: block; margin-top: 2px; font-size: 11px; font-weight: 700; line-height: 1.3;
    text-transform: none; letter-spacing: 0; color: var(--ink-dim);
}
.sg-row { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.sg-row:last-of-type { border-bottom: 0; }
.sg-body { flex: 1; min-width: 0; }
.sg-text { font-size: 13px; font-weight: 800; }
.sg-bar { height: 5px; border-radius: var(--r-pill); background: var(--track); margin-top: 5px; overflow: hidden; }
.sg-bar i { display: block; height: 100%; background: var(--primary); }
.sg-meta { font-size: 11px; font-weight: 800; color: var(--ink-dim); white-space: nowrap; }
.sg-done { font-size: 11px; font-weight: 900; color: var(--good); }
.sg-claim { display: inline-flex; align-items: center; gap: 2px; flex: none; padding: 4px 8px; }
.sg-claim .material-icons { font-size: 14px; }
.sg-row.ready { background: color-mix(in srgb, var(--accent) 10%, transparent); margin: 0 -8px; padding-inline: 8px; border-radius: var(--r-card); }
.sg-row.claimed { opacity: 0.55; }
.set-legal {
    margin: 18px 0 6px; font-size: 11px; font-weight: 700; color: var(--ink-dim);
    text-align: left; line-height: 1.4;
}
.set-legal a { color: var(--ink-dim); font-weight: 800; }
#mood-pill, #wallet { cursor: pointer; }
.tip {
    position: absolute; z-index: var(--z-tip); width: 250px; padding: 10px 12px; border-radius: var(--r-card);
    background: var(--card); border: 1px solid var(--line); box-shadow: 0 10px 28px rgb(var(--shadow-rgb) / 0.25);
    font-size: 12px; font-weight: 700; line-height: 1.4; color: var(--ink); animation: tipIn 0.14s ease-out;
}
.tip b { font-weight: 900; }
.tip-x {
    position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 50%;
    display: grid; place-items: center; background: var(--surface); color: var(--ink-dim);
}
.tip-x .material-icons { font-size: 16px; color: inherit; }
.tip .tip-title, .tip-mood-head { padding-right: 26px; }
.tip .tip-title { font-size: 14px; }
.tip p { margin: 6px 0 0; }
.tip.wide { width: 300px; }
.tip-mood-head { display: flex; align-items: center; gap: 10px; }
.tip-mood-head .grade.mood-mark {
    width: 52px; height: 52px; min-width: 52px; border-radius: 50%;
    display: grid; place-items: center; align-content: center; gap: 1px; line-height: 1;
}
.tip-mood-head .grade.mood-mark b { font-size: 22px; font-weight: 1000; color: var(--on-color); line-height: 1; }
.tip-mood-head .grade.mood-mark small { font-size: 9px; font-weight: 500; color: var(--on-color); opacity: 0.88; line-height: 1; }
.tip-mood-name { display: flex; flex-direction: column; font-size: 16px; font-weight: 900; line-height: 1.15; min-width: 0; }
.tip-eyebrow { font-size: 10px; font-weight: 800; color: var(--ink-dim); text-transform: uppercase; letter-spacing: 0.05em; }
.tip-cols { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.tip-cols p, .tip.wide > p:not(.tip-mood-sum) { margin-top: 5px; font-size: 11px; color: var(--ink-dim); }
.tip-mood-sum { margin: 8px 0 0; font-size: 13px; font-weight: 900; color: var(--ink); line-height: 1.35; }
.tip-pill { padding: 1px 7px; border-radius: var(--r-pill); background: var(--surface-2); color: var(--ink); font-size: 12px; font-variant-numeric: tabular-nums; }
.tip .tip-sep { height: 1px; background: var(--line); margin: 9px 0 7px; }
.xp-eq {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    margin: 10px 0 2px; padding-right: 0;
}
.xp-eq-card {
    flex: none; width: 52px; height: 60px; box-sizing: border-box;
    display: flex; flex-direction: column; overflow: hidden;
    border-radius: 10px; background: var(--card); border: 1px solid var(--line);
    box-shadow: 0 4px 10px rgb(var(--shadow-rgb) / 0.18);
}
.xp-eq-band {
    display: flex; align-items: center; justify-content: center;
    height: 16px; background: var(--xp-strong); color: var(--on-color);
    font-size: 10px; font-weight: 1000; font-variant-numeric: tabular-nums; letter-spacing: 0.02em; line-height: 1;
}
.xp-eq-ic { flex: 1; display: grid; place-items: center; }
.xp-eq-ic .mi { font-size: 22px; }
.xp-eq-mood {
    flex: none; display: inline-flex; align-items: center; justify-content: center;
    min-width: 36px; height: 28px; padding: 0 8px; border-radius: var(--r-pill);
    color: var(--on-color);
    font-size: 12px; font-weight: 1000; line-height: 1; font-variant-numeric: tabular-nums;
    box-shadow: 0 2px 6px rgb(var(--shadow-rgb) / 0.18);
}
.xp-eq-eq { flex: none; font-size: 16px; font-weight: 1000; color: var(--ink-dim); line-height: 1; }
.xp-eq-xp {
    flex: none; display: inline-flex; align-items: center; justify-content: center;
    min-width: 44px; height: 22px; padding: 0 10px; border-radius: var(--r-pill);
    background: var(--xp-grad); color: var(--on-color);
    font-size: 12px; font-weight: 1000; font-variant-numeric: tabular-nums; line-height: 1;
    box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.28), 0 2px 6px rgb(var(--shadow-rgb) / 0.16);
}
.tip.weather, .tip.fp { width: 268px; }
.tip.weather { padding: 0; overflow: visible; background: var(--card); }
.tip.weather::after { z-index: 0; }
.tip.weather .tw-slice { position: relative; z-index: 1; }
.tip.weather .tip-x { z-index: 2; }
.tip.weather.below::after { top: -6px; background: var(--card); }
.tip.weather.above::after { bottom: -6px; background: color-mix(in srgb, var(--surface) 60%, var(--card)); }
.tip.weather.above:has(.tw-slice.today:last-of-type)::after { background: var(--card); }
.tip .tf-hero {
    display: flex; align-items: center; gap: 10px; margin: -10px -12px 10px; padding: 12px 36px 12px 12px;
}
.tw-slice {
    display: flex; align-items: flex-start; gap: 9px; padding: 8px 12px;
    border-radius: 0;
}
.tw-slice:first-of-type { padding-right: 34px; border-radius: calc(var(--r-card) - 1px) calc(var(--r-card) - 1px) 0 0; }
.tw-slice:last-of-type { border-radius: 0 0 calc(var(--r-card) - 1px) calc(var(--r-card) - 1px); }
.tw-slice:first-of-type:last-of-type { border-radius: calc(var(--r-card) - 1px); }
.tw-slice.today { background: var(--card); }
.tw-slice.today + .tw-slice.today { border-top: 1px solid var(--line); }
.tw-slice.tomorrow {
    border-top: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface) 60%, var(--card));
}
.tw-body { min-width: 0; flex: 1 1 auto; }
.tw-head { font-size: 13px; line-height: 1.2; }
.tw-when { font-weight: 800; color: var(--ink-dim); }
.tw-name { font-weight: 900; color: var(--ink); }
.tw-ic, .tf-ic, .tw-next-ic {
    flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; color: var(--on-color);
    margin-top: 1px;
    box-shadow: 0 2px 6px rgb(var(--shadow-rgb) / 0.16);
}
.tf-ic { width: 40px; height: 40px; }
.tw-ic { background: var(--water-fill); }
.tw-slice.today.whim .tw-ic { background: var(--accent); }
.tf-ic { background: var(--fp); color: var(--on-fp); }
.tip.fp .tf-ic { background: var(--coin-chrome); color: var(--on-coin); }
.tip.fp .tf-bar i { background: var(--coin-chrome); }
.tw-ic .material-icons { font-size: 16px; color: inherit; }
.tf-ic .material-icons { font-size: 22px; color: inherit; }
.tw-next-ic .material-icons { font-size: 15px; color: inherit; }
.tip .tw-slice .tip-title, .tip .tf-hero .tip-title { display: block; font-size: 16px; line-height: 1.15; padding-right: 0; }
.tip .tf-hero .tip-title small { font-size: 12px; font-weight: 800; color: var(--ink-dim); margin-left: 2px; }
.tw-slice p { margin: 2px 0 0; font-size: 11.5px; font-weight: 700; color: var(--ink-dim); line-height: 1.28; }
.tw-next-ic { width: 28px; height: 28px; background: var(--surface-2); color: var(--ink-dim); box-shadow: none; }
.tw-slice.is-boss { background: color-mix(in srgb, var(--bad) 10%, var(--card)); }
.tw-slice.is-boss .tw-when { color: var(--bad); }
.tw-slice.is-boss .tw-ic,
.tw-slice.is-boss .tw-next-ic {
    width: 32px; height: 32px;
    background: none; border-radius: 0; box-shadow: none;
}
.tw-slice.is-boss .tw-ic .material-icons,
.tw-slice.is-boss .tw-next-ic .material-icons {
    font-size: 28px; line-height: 1;
    background: linear-gradient(135deg, #fecaca 0%, #ef4444 32%, #b91c1c 62%, #fca5a5 85%, #ef4444 100%);
    background-size: 240% 240%;
    -webkit-background-clip: text; background-clip: text;
    color: transparent;
    filter: drop-shadow(0 1px 4px rgb(220 38 38 / 0.45));
    animation: bossShine 3.4s ease-in-out infinite;
}
.tf-bar { height: 8px; border-radius: var(--r-pill); background: var(--track); overflow: hidden; margin: 0 0 8px; }
.tf-bar i { display: block; height: 100%; background: var(--fp); border-radius: var(--r-pill); }
.tip.fp p { margin: 0; font-size: 12px; font-weight: 700; color: var(--ink-dim); line-height: 1.35; }
.tf-note { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 11px; font-weight: 800; color: var(--ink-dim); }
.tf-note .coin, .tf-note .wallet { --coin-size: 24px; }
.tip::after {
    content: ''; position: absolute; left: calc(var(--arrow-x, 50%) - 6px); width: 12px; height: 12px; background: var(--card);
    border: 1px solid var(--line); transform: rotate(45deg);
}
.tip.above::after { bottom: -7px; border-top: 0; border-left: 0; }
.tip.below::after { top: -7px; border-bottom: 0; border-right: 0; }
@keyframes tipIn { from { opacity: 0; transform: scale(0.94); } }
#drag-ghost, .drag-ghost {
    position: fixed; left: 0; top: 0; z-index: calc(var(--z-fx) + 1); pointer-events: none;
    width: 104px; height: 120px; box-sizing: border-box; padding: 0 0 8px; border-radius: var(--r-card); overflow: hidden;
    display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 0;
    background: var(--card); box-shadow: 0 8px 20px rgb(var(--shadow-rgb) / 0.3); font-family: var(--font);
    transition: box-shadow 0.12s ease; will-change: transform;
}
#drag-ghost .ghost-ic, .drag-ghost .ghost-ic {
    flex: 1 1 auto; min-height: 0; display: grid; place-items: center; line-height: 1;
    padding: 4px 8px 0;
}
#drag-ghost .ghost-ic .mi, .drag-ghost .ghost-ic .mi { font-size: 34px; }
#drag-ghost .ghost-extra, .drag-ghost .ghost-extra {
    flex: none; display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: center;
    gap: 5px; min-height: 28px; padding: 6px 8px 4px;
}
#drag-ghost .ghost-extra:empty, .drag-ghost .ghost-extra:empty { display: none; min-height: 0; padding: 0; }
#drag-ghost .g-xp, .drag-ghost .g-xp {
    display: inline-flex; align-items: center; padding: 0 7px; border-radius: var(--r-pill); color: var(--on-color);
    font-size: 12px; font-weight: 900; font-variant-numeric: tabular-nums; line-height: 1; white-space: nowrap;
}
#drag-ghost .g-xp, .drag-ghost .g-xp {
    position: relative; z-index: 1; flex: none; width: 100%;
    height: 28px; padding: 0 8px; border-radius: 0;
    justify-content: center; gap: 7px;
    font-size: 13px; letter-spacing: 0.02em;
    background: var(--xp-strong);
}
#drag-ghost .g-pts, .drag-ghost .g-pts {
    font-size: 14px; font-weight: 1000; color: var(--on-color);
}
#drag-ghost .g-mult, .drag-ghost .g-mult {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 0; height: 18px; padding: 0 7px;
    border-radius: var(--r-pill); font-size: 10px; font-weight: 900; line-height: 1; color: var(--on-color);
    box-shadow: 0 0 3px var(--card);
}
#drag-ghost .g-fp, .drag-ghost .g-fp {
    --coin-size: 28px;
    font-size: calc(var(--coin-size) * 0.46);
}
#drag-ghost .ghost-fill, .drag-ghost .ghost-fill {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 1.5em; height: 20px; font-size: 14px; font-weight: 1000;
    font-variant-numeric: tabular-nums; line-height: 1;
}
#drag-ghost.drop-in, .drag-ghost.drop-in {
    z-index: calc(var(--z-fx) + 1);
    transition: transform 0.28s cubic-bezier(0.33, 1, 0.68, 1);
    opacity: 1;
}
#drag-ghost.drop-in.eaten, .drag-ghost.drop-in.eaten {
    z-index: calc(var(--z-fx) - 1);
    transition: transform 0.48s cubic-bezier(0.45, 0.05, 0.85, 0.2), opacity 0.4s ease;
    opacity: 0;
}
#drag-ghost.ghost-torn, .drag-ghost.ghost-torn {
    height: 92px; border-radius: 0 0 12px 12px;
}
#drag-ghost.ghost-torn .g-xp, .drag-ghost.ghost-torn .g-xp {
    visibility: hidden; height: 0 !important; overflow: hidden; padding: 0;
}
#drag-ghost.return, .drag-ghost.return { transition: transform 0.22s cubic-bezier(0.33, 1, 0.68, 1), opacity 0.22s ease; opacity: 0; }
#particle-layer { position: fixed; inset: 0; pointer-events: none; z-index: var(--z-fx); overflow: visible; }
@keyframes floatUp { 0% { opacity: 0; transform: translate(-50%, 0); } 15% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -50px); } }

/* ---------- Effect card (grows out of the tapped tool) ---------- */
.effect-card {
    position: absolute; bottom: 8px; z-index: var(--z-float); width: 268px; max-width: calc(100% - 12px);
    background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card); padding: 9px 10px;
    box-shadow: 0 10px 28px rgb(var(--shadow-rgb) / 0.22);
    transform-origin: var(--origin-x, 50%) 100%;
    animation: grow 0.16s cubic-bezier(0.33, 1, 0.68, 1);
}
@keyframes grow { from { transform: scale(0.55) translateY(20px); opacity: 0; } }
.ec-main { display: flex; gap: 10px; align-items: stretch; }
.ec-side {
    flex: 0 0 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    margin: -9px 0 -9px -10px; padding: 9px 6px 9px 8px; border-radius: var(--r-card) 0 0 12px;
    background: var(--side-tint);
}
.ec-side .mi { font-size: 34px; }
.ec-side img, .ec-side .glyph { width: 38px; height: 38px; object-fit: contain; font-size: 28px; display: grid; place-items: center; }
.ec-pills {
    display: flex; flex-direction: row; flex-wrap: wrap; justify-content: flex-start; align-items: center;
    gap: 5px; flex: none;
}
.ec-pills .coin { --coin-size: 24px; }
.ec-xp {
    display: inline-flex; align-items: center; justify-content: center; height: 22px; padding: 0 8px; border-radius: var(--r-pill);
    background: var(--xp-strong); color: var(--on-color); font-size: 12px; font-weight: 900;
    font-variant-numeric: tabular-nums; line-height: 1; box-shadow: 0 1px 2px rgb(var(--shadow-rgb) / 0.15);
}
.ec-side .ec-feel { font-size: 10px; text-align: center; line-height: 1.1; }
.ec-body { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 7px; }
.ec-body .ec-warn { margin: 0; }
.ec-feel { font-size: 11px; font-weight: 900; }
.ec-cols { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; }
.ec-col { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ec-col-top { display: flex; align-items: center; gap: 1px; font-size: 12px; font-weight: 900; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ec-col-top .mi { font-size: 16px; }
.ec-col-top .up { color: var(--good); } .ec-col-top .down { color: var(--bad); } .ec-col-top .zero { color: var(--ink-dim); }
.ec-col .meter { height: 5px; border-radius: var(--r-pill); background: var(--track); position: relative; overflow: hidden; }
.ec-col .meter i { position: absolute; top: 0; bottom: 0; left: 0; border-radius: var(--r-pill); }
.ec-col .meter i.ghost-up {
    background: repeating-linear-gradient(-45deg, color-mix(in srgb, var(--c) 80%, transparent) 0 1.5px, color-mix(in srgb, var(--c) 25%, transparent) 1.5px 3px);
    border-radius: 0 99px 99px 0; animation: stripeCrawl 1.6s linear infinite;
}
.ec-col .meter i.ghost-down {
    background: var(--loss); animation: lossPulse 1s ease-in-out infinite;
    border-radius: 0 99px 99px 0;
}
.ec-prime { margin-top: -2px; font-size: 12px; font-weight: 600; color: var(--ink-dim); line-height: 1.35; }
.ec-prime-label { font-size: 12px; font-weight: 600; color: var(--ink-dim); margin-right: 5px; }
.ec-prime .bolt { font-size: 15px; color: var(--warn); margin: 0 -2px; vertical-align: -3px; }
.ec-patience { display: flex; align-items: center; margin-top: 2px; }
.pat-pips { display: inline-flex; gap: 3px; --pat: var(--pip-idle); }
.pat-pips i {
    width: 8px; height: 8px; border-radius: 50%;
    border: 1.5px solid color-mix(in srgb, var(--pat) 42%, var(--track));
    background: transparent;
}
.pat-pips i.full { background: var(--pat); border-color: var(--pat); }
.pat-pips i.next { background: color-mix(in srgb, var(--pat) 38%, var(--card)); border-color: var(--pat); }
.pat-pips i.over { background: var(--bad-fill); border-color: var(--bad-fill); }
.ec-combos { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
@keyframes lovesGlow {
    0%, 100% { box-shadow: 0 0 0 0 transparent, 0 0 6px 1px color-mix(in srgb, var(--friendship) 45%, transparent); }
    50% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--friendship) 25%, transparent), 0 0 14px 4px color-mix(in srgb, var(--friendship) 60%, transparent); }
}
.ec-warn { font-size: 12px; font-weight: 800; color: var(--warn); margin-top: 3px; }
.ec-warn small { display: block; font-size: 11px; font-weight: 700; color: var(--ink-dim); }
.ec-use {
    width: auto; align-self: flex-end; margin-top: 0; padding: 8px 16px;
    border: 0; border-radius: var(--r-pill);
    background: var(--use, var(--primary)); color: var(--on-color);
}
.ec-use-row { display: flex; gap: 6px; margin-top: 6px; justify-content: flex-end; }
.ec-use-row .btn { flex: none; width: auto; border-radius: var(--r-pill); padding: 8px 16px; }
.ec-copy { margin: 0 0 2px; font-size: 12px; font-weight: 700; color: var(--ink-dim); line-height: 1.35; }
.ec-again {
    margin: 2px 0 0; font-size: 12px; font-weight: 600; font-style: italic;
    color: var(--ink-dim); text-align: center; line-height: 1.3;
}
.effect-card.is-again { cursor: pointer; }
.ec-treats { display: flex; gap: 6px; flex-wrap: wrap; }
.ec-treat { width: 48px; height: 48px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); padding: 4px; display: grid; place-items: center; }
.ec-treat img { width: 100%; height: 100%; object-fit: contain; }
.ec-treat .mi { font-size: 28px; }
.ec-empty { font-size: 12px; color: var(--ink-dim); font-weight: 700; line-height: 1.35; }

/* ---------- Run dock: turns, then cards ---------- */
.run-dock {
    display: flex; flex-direction: column; flex: none;
    position: relative; z-index: 1;
    background: var(--glass-strong); border-top: 0;
}
.dayrow { display: flex; align-items: center; gap: 8px; padding: 8px 12px 2px; }
.dayrow.can-skip { cursor: pointer; }
.dayrow.can-skip:hover .int-pips i:not(.used) { filter: brightness(1.12); }
.int-pips { display: flex; gap: 3px; flex: 1; }
.int-pips i { flex: 1; height: 8px; border-radius: 3px; background: var(--track); transition: background 0.2s ease; }
.int-pips i.long { border-radius: 3px; min-width: 12px; }
.int-pips i.next { background: var(--c); opacity: 0.8; }
.int-pips i.pop { animation: pipPop 0.28s cubic-bezier(0.3, 0.7, 0.3, 1.4); }
@keyframes pipPop { 40% { transform: scaleY(1.5) scaleX(1.12); } }
.int-left { font-size: 12px; font-weight: 800; color: var(--ink-dim); white-space: nowrap; }
.int-left { display: flex; align-items: baseline; gap: 0; }
.int-left small { font-size: 11px; font-weight: 800; color: var(--ink-dim); }
.int-left b { color: var(--ink); font-size: 18px; font-weight: 900; line-height: 1; margin: 0 0 0 4px; font-variant-numeric: tabular-nums; }
#turn-n.odo { height: 1em; }

/* ---------- Toolbar (tool = action + its meter, like the original) ---------- */
.toolbar {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 4px 8px 10px;
    background: none; border: 0;
}
.tool {
    touch-action: none;
    position: relative; border: 0; background: none; border-radius: 10px; padding: 7px 4px 6px;
    display: flex; flex-direction: column; align-items: center; gap: 5px; min-height: 56px;
    transition: transform 0.15s cubic-bezier(0.33, 1, 0.68, 1), background 0.15s ease, box-shadow 0.15s ease, opacity 0.18s ease;
}
.tool:hover:not(:disabled) { background: var(--glass); }
.tool.selected { transform: translateY(-6px) scale(1.12); background: var(--card); box-shadow: 0 6px 16px rgb(var(--shadow-rgb) / 0.18); z-index: 2; }
.tool.blocked { opacity: 0.5; }
.mi { font-size: 26px; line-height: 1; }
.tool .meter-slot {
    position: relative; width: 100%; border-radius: var(--r-pill); line-height: 0;
}
.tool.danger .meter-slot {
    animation: drainGlow 1.4s ease-in-out infinite;
}
.tool .meter {
    display: block; width: 100%; height: 4px; border-radius: var(--r-pill); position: relative; overflow: hidden;
    background: var(--track);
}
@keyframes drainGlow {
    0%, 100% {
        box-shadow:
            0 0 0 1px color-mix(in srgb, var(--bad) calc(var(--drain) * 16%), transparent),
            0 0 1px color-mix(in srgb, var(--bad) calc(var(--drain) * 40%), transparent);
    }
    50% {
        box-shadow:
            0 0 0 1px color-mix(in srgb, var(--bad) calc(var(--drain) * 27%), transparent),
            0 0 1px color-mix(in srgb, var(--bad) calc(var(--drain) * 55%), transparent);
    }
}
.tool .meter i { position: absolute; top: 0; bottom: 0; left: 0; border-radius: var(--r-pill); transition: width 0.3s ease, left 0.3s ease; }
.tool .meter i.ghost-up {
    background: repeating-linear-gradient(-45deg, color-mix(in srgb, var(--c) 80%, transparent) 0 1.5px, color-mix(in srgb, var(--c) 25%, transparent) 1.5px 3px);
    border-radius: 0 99px 99px 0; animation: stripeCrawl 1.6s linear infinite;
}
/* One stripe period along x for a 3px stripe at 45deg, so the loop is seamless. */
@keyframes stripeCrawl { to { background-position: calc(3px * 1.41421) 0; } }
.tool .meter i.ghost-down {
    background: var(--loss); animation: lossPulse 1s ease-in-out infinite;
    border-radius: 0 99px 99px 0;
}
.tool .val { font-size: 12px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; }
.tool .val.pat.odo { min-width: 0.9em; height: 1em; }
.tool .val.pat.out { color: var(--bad); }
.tool .val.pat.inf { color: var(--ink-dim); font-size: 13px; }
.prime-ring { width: 26px; height: 26px; display: block; }
.prime-ring svg { display: block; width: 26px; height: 26px; overflow: visible; }
.prime-ring .ball { fill: var(--energy); }
.prime-ring .stitch { fill: none; stroke: var(--card); stroke-width: 1.1; stroke-linecap: round; }
.prime-ring .seg { fill: none; stroke-width: 2.4; stroke-linecap: butt; transition: stroke 0.2s ease, opacity 0.2s ease; }
.prime-ring .seg.off { stroke: var(--track); }
.prime-ring .seg.on { stroke: var(--warn); }
.prime-ring .seg.gain { stroke: var(--warn); opacity: 0.45; }
.prime-ring .seg.loss { stroke: var(--loss); animation: lossPulse 1s ease-in-out infinite; }
@keyframes lossPulse { 50% { opacity: 0.35; } }
.love { color: var(--temper-love); } .like { color: var(--temper-like); } .neutral { color: var(--temper-neutral); } .dislike { color: var(--temper-dislike); }

/* ---------- Home ---------- */
/* On home the window itself is the yard image: no glass, no frame. */
.window.home-mode {
    background: var(--yard-art) center / cover; border-color: transparent;
    backdrop-filter: none; -webkit-backdrop-filter: none;
}
#screen-home { position: relative; }
.home-menu {
    --menu-top: 12px;
    --menu-right: 12px;
    position: absolute; top: var(--menu-top); right: var(--menu-right); z-index: calc(var(--z-modal) + 1);
    display: flex; flex-direction: column; align-items: stretch;
    width: auto; min-width: 0; height: auto; padding: 2px;
    background: var(--glass-strong); border: 1px solid var(--line); border-radius: var(--r-pill);
    box-shadow: var(--shadow-2);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    overflow: visible;
}
.home-menu.open { overflow: hidden; }
.home-menu-row {
    display: flex; align-items: center; justify-content: space-between; gap: 0;
    height: 36px; min-height: 36px;
}
.wallet-box, .egg-box {
    display: none; align-items: center; justify-content: center; gap: 0; min-height: 36px; min-width: 36px; cursor: pointer;
}
.home-menu.has-wallet .wallet-box { display: inline-flex; }
.home-menu.has-eggs .egg-box { display: inline-flex; }
.wallet-max { display: none !important; }
.home-menu .wallet {
    --coin-size: 28px; cursor: pointer; font-size: 13px;
}
.home-menu .wallet.wide { --coin-size: 30px; }
.home-menu .wallet b, .home-menu .wallet #wallet-num { font-size: 13px; font-weight: 800; }
.home-menu .wallet::after { inset: 0; }
.egg-gem {
    --egg-h: 26px;
    position: relative;
    display: inline-block;
    width: calc(var(--egg-h) * 0.78);
    height: var(--egg-h);
    flex: none;
    border-radius: 50% 50% 46% 46% / 60% 60% 40% 40%;
    background-image:
        radial-gradient(circle at 32% 28%, rgb(255 255 255 / 0.88) 0%, transparent 38%),
        radial-gradient(circle at 50% 50%, #fbcfe8 0%, transparent 58%),
        radial-gradient(circle at 50% 50%, #bae6fd 0%, transparent 60%),
        radial-gradient(circle at 50% 50%, #ddd6fe 0%, transparent 60%),
        radial-gradient(circle at 50% 50%, #bbf7d0 0%, transparent 58%),
        linear-gradient(135deg, #fff7ed 0%, #f5d0fe 35%, #cffafe 70%, #fef3c7 100%);
    background-size: 100% 100%, 230% 230%, 250% 250%, 210% 210%, 240% 240%, 100% 100%;
    animation: holoDogEar 9.5s ease-in-out infinite;
    box-shadow:
        inset 0 2px 3px rgb(255 255 255 / 0.78),
        inset 0 -3px 5px rgb(99 102 241 / 0.24),
        0 1px 3px rgb(var(--shadow-rgb) / 0.26);
    border: 1px solid rgb(255 255 255 / 0.72);
    pointer-events: none;
}
.sh-bal .egg-gem { --egg-h: 22px; }
.egg-chip {
    position: relative; display: inline-flex; align-items: center; justify-content: center;
    width: 28px; height: 28px; padding: 0;
    color: #1e1b4b;
}
.egg-chip .egg-gem {
    --egg-h: 26px;
    position: absolute;
}
.egg-chip b {
    position: relative; z-index: 1;
    font-size: 12px; font-weight: 900; font-variant-numeric: tabular-nums; line-height: 1;
    color: #1e1b4b;
    text-shadow: 0 1px 2px rgb(255 255 255 / 0.85);
}
.home-menu:not(.open) .home-menu-row { height: 36px; }
.home-menu:not(.open):not(.has-wallet):not(.has-eggs) .home-menu-row { justify-content: flex-end; }
.home-menu:not(.open) .home-menu-btn { width: 36px; height: 36px; }
.titlebar .home-menu,
.home-menu.in-run {
    --menu-top: 8px;
    --menu-right: 12px;
    position: absolute; flex: none; z-index: calc(var(--z-modal) + 1);
}
#window:has(#active-modal) .home-menu:not(.open) #btn-settings-home,
#window:has(#active-modal) .home-menu:not(.open) .egg-box {
    pointer-events: none;
}
#window:has(#active-modal) .home-menu:not(.open) #btn-settings-home { display: none; }
#window:has(#active-modal) .home-menu:not(.open).has-wallet .wallet-box {
    display: inline-flex; width: 30px; height: 30px; min-width: 30px; min-height: 30px;
    pointer-events: none;
}
#window:has(#active-modal) .home-menu:not(.open) .wallet {
    --coin-size: 24px; font-size: 10px;
}
#window:has(#active-modal) .home-menu:not(.open) .wallet b,
#window:has(#active-modal) .home-menu:not(.open) .wallet #wallet-num { font-size: 10px; }
#window:has(#active-modal) .home-menu:not(.open):is(.has-wallet, .has-eggs) {
    width: 30px; height: 30px; box-sizing: border-box; padding: 0; border: 1px solid var(--line); border-radius: 50%;
    background: var(--glass-strong);
    box-shadow: var(--shadow-2); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    display: grid; place-items: center; gap: 0; overflow: hidden;
}
#window:has(#active-modal) .home-menu:not(.open):is(.has-wallet, .has-eggs) .home-menu-row,
#window:has(#active-modal) .home-menu:not(.open):is(.has-wallet, .has-eggs) :is(.wallet-box, .egg-box) {
    width: 28px; height: 28px; min-width: 28px; min-height: 28px; box-sizing: border-box;
    margin: 0; padding: 0; justify-content: center;
}
#window:has(#active-modal) .home-menu:not(.open):is(.has-wallet, .has-eggs) .home-menu-row {
    display: grid; place-items: center; place-self: center;
}
#window:has(#active-modal) .home-menu:not(.open):is(.has-wallet, .has-eggs) :is(.wallet-box, .egg-box) {
    flex: none;
}
#window:has(#active-modal) .home-menu:not(.open).in-run.has-wallet:not(.has-eggs) .wallet {
    margin: 0;
}
#window:has(#active-modal) .home-menu:not(.open).has-eggs {
    width: 42px; height: 42px;
}
#window:has(#active-modal) .home-menu:not(.open).has-eggs :is(.home-menu-row, .egg-box) {
    width: 36px; height: 36px; min-width: 36px; min-height: 36px;
}
#window:has(.modal.game-over) .home-menu.in-run { display: none !important; }
#window:has(.home-menu.in-run):has(#active-modal) #active-modal .modal-head {
    min-height: 36px;
    box-sizing: border-box;
}
.home-menu.open {
    width: min(268px, calc(100% - 24px));
    height: auto;
    border-radius: 24px;
    padding: 6px;
    box-shadow: 0 8px 32px rgb(var(--shadow-rgb) / 0.18);
}
.home-menu.open .home-menu-row {
    display: flex; align-items: center; justify-content: flex-start; gap: 4px; height: 36px;
    padding: 0;
}
.home-menu.open .home-menu-btn { display: flex; }
.home-menu-exit {
    display: none; align-items: center; justify-content: center;
    width: 36px; height: 36px; margin: 0; padding: 0; border: 0; border-radius: var(--r-pill);
    background: none; color: var(--ink-dim); cursor: pointer;
}
.home-menu-exit .material-icons { font-size: 24px; transform: scaleX(-1); }
.home-menu:not(.open) .home-menu-exit,
.home-menu:not(.open) .home-menu-tab { display: none; }
.home-menu:not(.in-run) #btn-settings-home,
.home-menu.in-run #btn-home-shop { display: none; }
.home-menu:not(.in-run) { cursor: pointer; }
.home-menu:not(.in-run):not(.open) #btn-home-shop {
    display: flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; flex: 0 0 36px; margin: 0;
}
#window:has(#active-modal) .home-menu:not(.open) #btn-home-shop { display: none; }

/* Homepage menu: Continue Run preview card */
.nav-continue-wrap {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.nav-continue-lbl {
    font-size: 10.5px;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-dim);
    padding-left: 2px;
}
.nav-continue-card {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    margin-bottom: 0;
    border-radius: var(--r-card);
    border: 1.5px solid var(--line);
    background: var(--card);
    color: var(--ink);
    text-align: left;
    font: inherit;
    cursor: pointer;
    box-shadow: 0 6px 14px rgb(var(--shadow-rgb) / 0.1);
    transition: transform var(--t-fast) ease, border-color var(--t-fast) ease, box-shadow var(--t-fast) ease;
}
.nav-continue-card:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
}
.nav-continue-card:active { transform: scale(0.98); }
.switch-choices {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 12px 0;
}
.nc-new-sub {
    font-size: 11px;
    font-weight: 800;
    color: var(--ink-dim);
}
.nc-go.is-new {
    background: var(--surface);
    color: var(--ink);
    border: 1px solid var(--line);
}
.nc-art {
    flex: none;
    width: 46px;
    height: 46px;
    border-radius: 10px;
    background: var(--surface);
    border: 1px solid var(--line);
    display: grid;
    place-items: center;
    overflow: hidden;
}
.nc-art img { width: 84%; height: 84%; object-fit: contain; display: block; }
.nc-body {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.nc-head {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}
.nc-head b {
    font-size: 14px;
    font-weight: 900;
    color: var(--ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.nc-lv {
    flex: none;
    padding: 3px 8px;
    border-radius: var(--r-pill);
    background: var(--ink);
    color: var(--card);
    font-size: 10.5px;
    font-weight: 900;
    letter-spacing: 0.02em;
    line-height: 1.1;
}
.pi-title-row {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
}
.pi-title-row h2 { margin: 0; }
.pi-story-h { margin: 8px 0 4px; text-align: left; }
.pi-h .pi-story-day {
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
    color: var(--ink-dim);
}
.nc-sub {
    display: inline-flex;
    align-items: center;
    margin-top: 2px;
}
.nc-sub .day-pips { width: max-content; }
.nc-slots {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 2px;
}
.nc-slot {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 10.5px;
    font-weight: 700;
    color: var(--ink-dim);
}
.nc-slot .material-icons { font-size: 12.5px; line-height: 1; }
.nc-slot.perk .material-icons { color: var(--kind-perk); }
.nc-slot.charm .material-icons { color: var(--kind-charm); }
.nc-slot b { color: var(--ink); font-weight: 900; font-variant-numeric: tabular-nums; }
.nc-go {
    flex: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--on-color);
    display: grid;
    place-items: center;
}
.nc-go .material-icons { font-size: 20px; line-height: 1; }
.home-menu.open.in-run .home-menu-exit { display: flex; }
.home-menu.open .home-menu-tab,
.home-menu.open.in-run .home-menu-exit {
    flex: 0 0 36px; width: 36px; max-width: 36px; height: 36px; min-height: 36px; min-width: 36px;
    display: flex; align-items: center; justify-content: center; margin: 0;
}
.home-menu-spacer { flex: 1 1 auto; min-width: 10px; }
.home-menu.open.in-run .home-menu-shop { display: none; }
.home-menu:not(.open) .home-menu-spacer { display: none; }
.home-menu.open.has-wallet .wallet-box,
.home-menu.open.has-eggs .egg-box {
    flex: 0 0 36px; width: 36px; max-width: 36px; height: 36px; min-height: 36px; min-width: 36px;
    display: flex; align-items: center; justify-content: center; margin: 0;
}
.home-menu-btn {
    position: relative; z-index: 1; flex: none;
    width: 36px; height: 36px; margin: 0; padding: 0;
    border: 0; border-radius: var(--r-pill); background: none;
    color: var(--ink-dim); display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.home-menu-btn .material-icons {
    font-size: 24px; line-height: 1; width: 1em; height: 1em;
    color: inherit; display: block; transform: translateY(-0.5px);
}
.home-menu-panel { display: none; width: auto; align-self: stretch; }
.home-menu.open .home-menu-panel { display: flex; flex-direction: column; gap: 8px; margin: 8px 2px 2px; }
.home-menu-tab {
    position: relative; height: 36px; min-width: 36px; padding: 0; border: 0; border-radius: var(--r-pill);
    background: none; color: var(--ink-dim); display: grid; place-items: center; cursor: pointer;
}
.home-menu-tab .material-icons { font-size: 24px; color: inherit; }
.home-menu-tab.on, .home-menu-tab[aria-current="true"] {
    background: var(--card); color: var(--accent); box-shadow: var(--shadow-1);
}
.home-menu-libraries { display: none; flex-direction: column; gap: 4px; }
.home-menu.has-libraries .home-menu-play,
.home-menu.has-libraries .home-bag,
.home-menu.has-libraries .home-now-playing { display: none; }
.home-menu.has-libraries .home-menu-libraries { display: flex; }
.home-menu.has-bag .home-menu-play,
.home-menu.has-bag .home-menu-libraries,
.home-menu.has-bag .home-now-playing { display: none; }
.home-menu.has-bag .home-bag { display: flex; }
.home-menu-library {
    display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 6px 10px;
    border: 0; border-radius: var(--r-card); background: transparent; color: var(--ink);
    font: inherit; font-weight: 800; text-align: left; cursor: pointer;
}
.home-menu-library .material-icons { font-size: 22px; color: var(--ink-dim); }
.home-menu-library:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.home-menu-exit,
.home-menu-tab,
.home-menu-btn {
    transition: background-color var(--t-fast) ease, color var(--t-fast) ease, transform var(--t-fast) ease, box-shadow var(--t-fast) ease;
}
.home-menu-exit:hover,
.home-menu-tab:hover,
.home-menu-btn:hover,
.home-menu-exit:focus-visible,
.home-menu-tab:focus-visible,
.home-menu-btn:focus-visible {
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    color: var(--ink);
}
.home-menu-exit:active,
.home-menu-tab:active,
.home-menu-btn:active { transform: scale(0.94); }
.home-menu-exit:focus-visible,
.home-menu-tab:focus-visible,
.home-menu-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.home-menu-tab[aria-expanded="true"],
.home-menu.open:not(.has-libraries) .home-menu-btn {
    background: var(--card); color: var(--accent); box-shadow: var(--shadow-1);
}
.home-menu-play {
    display: none; align-items: center; gap: 10px; width: 100%;
    min-height: 52px; margin: 0; padding: 8px 12px 8px 10px;
    border: 0; border-radius: var(--r-card); background: color-mix(in srgb, var(--accent) 12%, transparent);
    color: var(--ink); font: inherit; cursor: pointer; text-align: left;
}
.home-menu.open.has-run:not(.in-run):not(.has-bag) .home-menu-play { display: flex; }
.home-menu.open.has-run:not(.in-run):not(.has-bag) .home-bag { display: none; }
.home-menu-play .material-icons { font-size: 26px; color: var(--accent); }
.home-menu-play-copy { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.home-menu-play-label { font-size: 14px; font-weight: 900; line-height: 1.15; }
.home-menu-play-info {
    font-size: 11px; font-weight: 700; color: var(--ink-dim); line-height: 1.25;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.home-menu-play:hover { background: color-mix(in srgb, var(--accent) 18%, transparent); }
.home-bag {
    display: flex; flex-wrap: wrap; align-content: flex-start; gap: 6px;
    min-height: 76px; padding: 8px;
    border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface);
}
.home-bag.is-empty { align-items: center; align-content: center; justify-content: center; }
.home-bag-empty { font-size: 13px; font-weight: 700; color: var(--ink-dim); }
.bag-treat {
    width: 40px; height: 40px; padding: 4px; border: 1px solid var(--line); border-radius: var(--r-card);
    background: var(--card); display: grid; place-items: center; cursor: grab; touch-action: none;
}
.bag-treat.selected { box-shadow: 0 0 0 2px var(--accent); }
.bag-treat img, .bag-treat .mi, .bag-treat .material-icons { width: 26px; height: 26px; font-size: 22px; object-fit: contain; }
.home-menu-badge {
    position: absolute; top: -4px; left: -4px; right: auto; min-width: 14px; height: 14px; padding: 0 3px;
    border-radius: var(--r-pill); background: var(--accent); color: var(--on-core);
    font-size: 9px; font-weight: 900; font-style: normal; line-height: 14px; text-align: center; pointer-events: none;
    box-shadow: 0 1px 3px rgb(var(--shadow-rgb) / 0.28);
}
.home-now-playing {
    display: flex; align-items: stretch; min-height: 44px; margin-top: 0;
    border-radius: var(--r-card); background: color-mix(in srgb, var(--accent) 8%, transparent); overflow: hidden;
}
.home-audio-mute, .home-play-pause, .home-now-meta {
    border: 0; background: none; color: inherit; font: inherit; cursor: pointer;
}
.home-audio-mute {
    flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    min-height: 48px; padding: 4px 10px; color: var(--accent); font-size: 12px; font-weight: 800;
}
.home-audio-mute .material-icons { font-size: 22px; color: inherit; }
.home-play-pause {
    width: 44px; flex: none; display: grid; place-items: center; color: var(--accent);
}
.home-play-pause .material-icons { font-size: 24px; color: inherit; }
.home-now-meta {
    flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; justify-content: center;
    gap: 1px; padding: 6px 10px 6px 2px; text-align: left;
}
.home-now-kicker {
    font-size: 10px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-dim);
}
.home-now-title {
    width: 100%; font-size: 12px; font-weight: 800; color: var(--ink);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.home-audio-mute:hover, .home-play-pause:hover, .home-now-meta:hover {
    background: color-mix(in srgb, var(--accent) 10%, transparent);
}
/* Popout pill "..." button on the left of .home-menu-row when open */
.home-menu.open .home-menu-more {
    display: flex;
    background: var(--card);
    color: var(--ink);
    box-shadow: var(--shadow-1);
}
#window.has-modal .home-menu:not(.in-run),
#window.has-modal .home-shop-btn { display: none; }

/* Upper-left opaque Egg Shop button matching top-right home-menu */
.home-shop-btn {
    position: absolute;
    top: var(--menu-top, 12px);
    left: 12px;
    z-index: calc(var(--z-modal) + 1);
    width: 42px; height: 42px; padding: 0;
    border-radius: var(--r-pill);
    border: 1px solid var(--line);
    background: var(--glass-strong);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    color: var(--ink);
    box-shadow: var(--shadow-2);
    display: grid; place-items: center;
    transition: transform var(--t-fast) ease, background-color var(--t-fast) ease;
}
.home-shop-btn .material-icons { font-size: 22px; }
.home-shop-btn:hover { background: var(--card); }
.home-shop-btn:active { transform: scale(0.94); }

/* "..." Menu hub modal — 5:7 card grid for Pets / Cards / Themes */
.nav-hub {
    display: flex; flex-direction: column; gap: 14px; padding: 4px 0 8px;
}
.nav-hub-grid {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px;
}
.nav-hub-card {
    aspect-ratio: var(--card-ratio);
    display: flex; flex-direction: column; align-items: center; justify-content: space-between;
    width: 100%; padding: 0; border-radius: var(--r-card); overflow: hidden;
    border: 1.5px solid var(--line); background: var(--card);
    color: var(--ink); font: inherit; text-align: center;
    box-shadow: 0 6px 14px rgb(var(--shadow-rgb) / 0.1);
    transition: border-color var(--t-fast) ease, background-color var(--t-fast) ease, transform var(--t-fast) ease;
}
.nav-hub-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.nav-hub-card:active { transform: scale(0.97); }
.nav-hub-ic {
    flex: 1 1 auto; display: grid; place-items: center; width: 100%; min-height: 0;
    border-radius: 0;
    background: color-mix(in srgb, var(--accent) 12%, var(--card));
    border-bottom: 1px solid color-mix(in srgb, var(--ink) 7%, transparent);
    color: var(--accent);
}
.nav-hub-ic .material-icons { font-size: 28px; }
.nav-hub-copy {
    display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 0; width: 100%;
    padding: 8px 6px 10px;
}
.nav-hub-copy b { font-size: 13px; font-weight: 900; line-height: 1.2; }
.nav-hub-copy small { font-size: 10px; font-weight: 800; color: var(--ink-dim); }
.nav-hub-foot {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px;
}
.nav-hub-audio {
    width: 100%;
    padding: 0;
    border-radius: var(--r-card);
    border: 1px solid var(--line);
    background: var(--surface);
    overflow: hidden;
    gap: 0;
}
.nav-hub-audio .home-audio-mute {
    min-height: 44px;
    border-radius: 0;
    padding: 8px 14px;
}
.nav-hub-audio .home-play-pause {
    width: 44px;
    height: 44px;
    border-radius: 0;
}
.nav-hub-audio .home-now-meta {
    min-height: 44px;
    padding: 6px 10px;
}
.nav-hub-foot-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    min-height: 44px; padding: 8px 12px; border-radius: var(--r-card);
    border: 1px solid var(--line); background: var(--surface);
    color: var(--ink); font: inherit; font-size: 13px; font-weight: 800;
    transition: border-color var(--t-fast) ease, background-color var(--t-fast) ease, transform var(--t-fast) ease;
}
.nav-hub-foot-btn .material-icons { font-size: 19px; }
.nav-hub-foot-btn:hover { background: var(--card); border-color: var(--accent); }
.nav-hub-foot-btn:active { transform: scale(0.97); }
.nav-hub-foot-btn.is-quit { color: var(--bad); }
.nav-hub-foot-btn.is-quit:hover { border-color: var(--bad); }
.nav-hub-foot-btn.is-primary { background: var(--primary); color: var(--on-color); border-color: transparent; }
.modal.menu:has(.nav-hub-legal) { padding-bottom: 0; }
.nav-hub-legal {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    margin: 0 -14px 0;
    padding: 6px 12px 7px;
    border-top: 1px solid var(--line);
    background: var(--surface);
    text-align: center;
}
.nav-hub-copy-line {
    font-size: 9.5px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--ink-dim);
    opacity: 0.78;
}
.nav-hub-legal-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}
.nav-hub-legal a {
    color: var(--ink-dim);
    font-size: 10px;
    font-weight: 800;
    line-height: 1.2;
    text-decoration: none;
    transition: color var(--t-fast);
}
.nav-hub-legal a:hover {
    color: var(--ink);
    text-decoration: underline;
}

/* Keyboard focus visibility */
:is(button, [role="button"], input, a):focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.home-head { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 62px 12px 0; pointer-events: none; }
.home-title {
    margin: 0; color: var(--on-color); font-size: 30px; font-weight: 1000; letter-spacing: -0.01em; line-height: 1;
    text-shadow: 0 2px 10px rgb(var(--shadow-rgb) / 0.45);
}
.rogue-tag {
    display: inline-block; padding: 2px 9px; border-radius: var(--r-pill); color: var(--on-color); background: var(--primary);
    font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.08em; box-shadow: 0 2px 6px rgb(var(--shadow-rgb) / 0.3);
}
.yard { position: relative; flex: 1; overflow: hidden; isolation: isolate; }
.yard-pet {
    position: absolute; width: var(--yard-px, 90px); text-align: center; cursor: pointer;
    touch-action: none;
    transition: left 1.6s ease-in-out, top 1.6s ease-in-out;
}
.yard-pet.tug {
    cursor: grabbing; transition: none; z-index: 40 !important;
}
.yard-pet img { width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; display: block; filter: drop-shadow(0 6px 5px rgb(var(--shadow-rgb) / 0.3)); }
.yard-pet.hopping img { animation: hop 0.4s ease-out 4; }
.yard-pet .lv-badge {
    position: absolute; top: 2px; right: 0;
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--r-pill); pointer-events: none;
    background: var(--ink); color: var(--card); border: 0;
    font-size: 11px; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; white-space: nowrap;
    box-shadow: 0 0 0 2px var(--surface), 0 2px 6px rgb(var(--shadow-rgb) / 0.28);
}
.yard-pet.no { animation: petShake 0.6s ease; }
/* After the pick jump the run screen's chrome eases in around the pet. */
.screen.entering > .titlebar, .screen.entering > .statusbar, .screen.entering > .run-dock,
.screen.entering .pet-area > :not(.pet-img) { animation: uiIn 0.3s ease-out both; }
.screen.entering > .titlebar { animation-delay: 0.04s; }
.screen.entering > .statusbar { animation-delay: 0.08s; }
.screen.entering .pet-area > :not(.pet-img) { animation-delay: 0.2s; }
.screen.entering > .run-dock { animation-delay: 0.14s; }
@keyframes uiIn { from { opacity: 0; translate: 0 6px; } }
.screen.leaving > .titlebar, .screen.leaving > .statusbar, .screen.leaving > .run-dock { animation: uiOut 0.2s ease-in forwards; }
@keyframes uiOut { to { opacity: 0; translate: 0 6px; } }
#screen-home.returning > .home-head, #screen-home.returning > .home-menu, #screen-home.returning > .home-stats { animation: uiIn 0.35s ease-out both; }
#screen-home.returning > .home-head, #screen-home.returning > .home-menu { animation-delay: 0.04s; }
#screen-home.returning .yard-pet:not(.stay), #screen-home.returning .yard-pet.stay .lv-badge { animation: fadeIn 0.35s ease-out both; animation-delay: 0.1s; }
#screen-home.returning > .home-stats { animation-delay: 0.16s; }
/* Pick transition: img starts in window coordinates, then moves into card coordinates as the card shrinks. */
.zoom-card {
    position: absolute; z-index: var(--z-zoom); overflow: hidden; pointer-events: none; border-radius: 0; opacity: 0;
    background: var(--yard-art) center / cover; transition: opacity 0.15s ease-out;
}
.zoom-card.shown { opacity: 1; }
.zoom-card img { position: absolute; object-fit: contain; filter: drop-shadow(0 6px 5px rgb(var(--shadow-rgb) / 0.3)); }
.zoom-card.sunlit {
    background: var(--stage-bg);
    background-blend-mode: screen, soft-light, color, color, normal;
}
.zoom-card.at-stage img { filter: drop-shadow(var(--shx) var(--shy) 8px rgb(var(--shadow-rgb) / 0.3)); }
.zoom-card.go, .zoom-card.go img {
    --ease: cubic-bezier(0.25, 0.8, 0.25, 1);
    transition: left 0.45s var(--ease), top 0.45s var(--ease), width 0.45s var(--ease), height 0.45s var(--ease), border-radius 0.45s var(--ease), filter 0.45s var(--ease);
}
.zoom-card.go img { animation: zoomHop 0.45s cubic-bezier(0.3, 0, 0.3, 1); }
@keyframes zoomHop { 35% { translate: 0 -30px; } }
.pet-area.zooming .pet-img { opacity: 0; animation: none; transition: none; }

.home-stats { display: grid; grid-template-columns: 1fr; gap: 0; padding: 8px 10px 10px; }
.about-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 0 0 12px; }
.about-stats .stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 8px 6px; text-align: center; }
.about-stats .stat b { display: block; font-size: 18px; font-weight: 900; }
.about-stats .stat span { font-size: 11px; color: var(--ink-dim); font-weight: 700; }
.stat { background: var(--glass-strong); border: 1px solid var(--line); border-radius: var(--r-card); padding: 7px; text-align: center; }
.stat b { display: block; font-size: 18px; font-weight: 900; }
.stat span { font-size: 11px; color: var(--ink-dim); font-weight: 700; }
.stat.wide { grid-column: 1 / -1; text-align: left; font-size: 12px; color: var(--ink-dim); font-weight: 700; }
.stat.wide .goal-lbl { display: inline; font-size: inherit; color: var(--ink); }
.unlock-bar { height: 6px; border-radius: var(--r-pill); background: var(--track); margin-top: 5px; overflow: hidden; }
.unlock-bar i { display: block; height: 100%; background: var(--primary); }
#screen-home .home-stats {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    z-index: 4;
    grid-template-columns: 1fr;
    gap: 0; margin: 0; padding: 46px 16px 14px; overflow: visible;
    border: 0; border-radius: 0;
    background: linear-gradient(
        to top,
        color-mix(in srgb, var(--card) 92%, transparent) 0%,
        color-mix(in srgb, var(--card) 66%, transparent) 38%,
        color-mix(in srgb, var(--card) 22%, transparent) 72%,
        transparent 100%
    );
    backdrop-filter: none; -webkit-backdrop-filter: none;
    box-shadow: none;
    pointer-events: none;
}
#screen-home .stat { background: none; border: 0; border-radius: 0; padding: 0; }
#screen-home .stat.wide { padding: 0; box-shadow: none; color: var(--ink); font-size: 12px; font-weight: 800; text-align: center; }
#screen-home .stat.wide + .stat.wide { box-shadow: inset 0 1px 0 color-mix(in srgb, var(--ink) 12%, transparent); }
#screen-home .stat b { font-size: 15px; font-variant-numeric: tabular-nums; }
#screen-home .stat span { font-size: 10px; }
#screen-home .stat.wide.run { color: var(--ink); font-weight: 800; }
#screen-home .unlock-bar { height: 4px; margin-top: 4px; }

/* ---------- Modals ---------- */
.modal-back {
    position: absolute; inset: 0; z-index: var(--z-modal); background: var(--scrim);
    backdrop-filter: blur(4px); display: grid; place-items: center; padding: 16px; animation: fadeIn 0.15s ease;
    transition: opacity 0.6s ease;
}
.modal-back.night-out {
    animation: none;
    opacity: 0;
    pointer-events: none;
}
.modal-back.night-out .modal {
    opacity: 0;
    transform: scale(0.98);
    transition: opacity 0.5s ease, transform 0.5s ease;
}
.modal-back.fail { background: color-mix(in srgb, var(--bad) 42%, var(--scrim)); }
@keyframes fadeIn { from { opacity: 0; } }
.modal {
    width: 100%; max-width: 340px; max-height: 88dvh; overflow-x: hidden; overflow-x: clip; overflow-y: auto;
    background: var(--glass-strong); border: 1px solid var(--line); border-radius: var(--r-sheet); padding: 14px;
    box-shadow: 0 8px 32px rgb(var(--shadow-rgb) / 0.18);
    backdrop-filter: saturate(120%) blur(16px); -webkit-backdrop-filter: saturate(120%) blur(16px);
    animation: pop 0.18s ease-out;
}
@keyframes pop { from { transform: scale(0.95); opacity: 0; } }
.modal h2 { margin: 0 0 2px; font-size: 20px; font-weight: 900; }
.modal .sub { color: var(--ink-dim); font-weight: 700; font-size: 12px; margin: 0 0 10px; }
.skip-beads.int-pips { flex: none; width: 100%; margin: 2px 0 14px; }
.modal .sub.center { text-align: center; }
.modal .sub.spaced { margin-top: 10px; }
.boost-note { color: var(--warn); }
.modal-actions { display: flex; gap: 8px; margin-top: 12px; }
.modal-actions .btn { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 4px; }
.modal-actions .btn .material-icons { font-size: 18px; }
.goal-row { display: flex; justify-content: space-between; font-size: 12px; font-weight: 800; margin-bottom: 4px; }
.modal .xp-bar { height: 9px; padding: 2px; flex: none; }
.modal.is-swap { animation: none; }
.result-banner { text-align: center; font-size: 18px; font-weight: 900; margin: 10px 0 4px; }
.result-banner.good { color: var(--good); }
.lvl-badge {
    display: inline-flex; align-items: center; gap: 8px; margin: 12px 0 4px; padding: 4px 4px 4px 14px; border-radius: var(--r-pill);
    background: var(--xp-grad); color: var(--on-color); font-size: 16px; font-weight: 1000;
    box-shadow: 0 4px 12px rgb(var(--shadow-rgb) / 0.2);
}
.lvl-tag {
    display: inline-flex; align-items: center; gap: 5px; padding: 2px 2px 2px 9px; border-radius: var(--r-pill);
    background: var(--scrim-soft); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em;
}
.lvl-tag b {
    display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
    background: var(--card); color: var(--xp); font-size: 14px; font-weight: 1000; box-shadow: 0 2px 4px rgb(var(--shadow-rgb) / 0.3);
} .result-banner.bad { color: var(--bad); }
.transform-art { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 6px 0; }
.transform-art img { width: 84px; height: 84px; object-fit: contain; background: radial-gradient(circle, color-mix(in srgb, var(--accent) 12%, var(--card)) 0%, transparent 70%); border-radius: 50%; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 2px; }
.modal-head h2 { margin: 0; }
.wallet.lg { --coin-size: 32px; }

/* Day end: a short "beat the day" sequence. Each .slap / .rise waits for its --d delay. */
.modal.day-end { padding: 18px 14px 14px; animation: none; }
.day-end { text-align: center; padding-top: 0; }
.de-xphead {
    display: flex; flex-direction: column; align-items: stretch; gap: 4px;
    margin: 2px 0 4px; padding: 0;
    font-size: 14px; font-weight: 800;
}
.de-xphead-row { display: flex; flex-direction: column; align-items: stretch; gap: 4px; }
.day-end .de-xp-shell { padding-right: 3px; }
.day-end .de-xphead .xp-bar {
    flex: 1 1 auto; min-width: 0; width: auto; height: 10px; padding: 0;
    background: transparent; overflow: visible;
}
.day-end .de-xphead .xp-under { font-size: 12px; }
.day-end .de-xphead .goal-nums {
    flex: none; align-self: auto; font-size: 12px; font-weight: 700; color: var(--ink);
}
.day-end .goal-nums #de-xp-total { font-weight: 600; color: var(--ink); }
.day-end .goal-nums #de-xp-tgt { font-size: inherit; font-weight: 800; color: var(--ink); }
.de-coins {
    display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px 12px;
    margin: 6px 0 2px; font-size: 12px; font-weight: 800;
}
.de-cointable {
    display: flex; flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 0;
    margin: 10px 0 4px; padding: 0; text-align: left;
    background: color-mix(in srgb, var(--surface) 60%, var(--card));
    border: 1px solid var(--line); border-radius: var(--r-card);
    box-shadow: none;
    max-height: 224px;
    overflow-y: auto;
}
.de-coinrow {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    min-height: 40px;
    padding: 6px 12px; font-size: 12.5px; font-weight: 900; color: var(--ink);
}
.de-coinrow + .de-coinrow { border-top: 1px solid var(--line); }
.de-coinwhy { min-width: 0; text-align: left; }
.de-why-item { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.de-why-art { display: inline-flex; align-items: center; gap: 1px; flex: none; }
.de-why-art .mi { font-size: 16px; line-height: 1; }
.de-why-art .combo-steps {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    padding: 0;
    gap: 0;
    color: var(--kind-boost, var(--points));
}
.de-why-art .combo-thread {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: visible;
    pointer-events: none;
}
.de-why-art .combo-thread polyline {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
}
.de-why-art .combo-step {
    position: relative;
    z-index: 1;
    flex: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--card);
    border: 1.5px solid var(--kind-boost, var(--points));
    box-shadow: var(--shadow-1);
}
.de-why-art .combo-step .mi { font-size: 10px; color: var(--c, var(--ink)) !important; }
.de-why-art .combo-steps[data-n="2"] { width: 44px; height: 18px; }
.de-why-art .combo-steps[data-n="2"] .combo-step { width: 18px; height: 18px; }
.de-why-art .combo-steps[data-n="3"] { width: 62px; height: 34px; }
.de-why-art .combo-steps[data-n="3"] .combo-step { width: 17px; height: 17px; }
.de-why-art .combo-steps[data-n="3"] .combo-step:nth-of-type(1) { transform: translateY(8.5px); }
.de-why-art .combo-steps[data-n="3"] .combo-step:nth-of-type(2) { transform: translateY(0); }
.de-why-art .combo-steps[data-n="3"] .combo-step:nth-of-type(3) { transform: translateY(-8.5px); }
.de-why-art .combo-steps[data-n="4"] { width: 75px; height: 27px; }
.de-why-art .combo-steps[data-n="4"] .combo-step { width: 16px; height: 16px; }
.de-why-art .combo-steps[data-n="4"] .combo-step:nth-of-type(odd) { transform: translateY(5.5px); }
.de-why-art .combo-steps[data-n="4"] .combo-step:nth-of-type(even) { transform: translateY(-5.5px); }
.de-why-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.de-cointable .coin { --coin-size: 24px; flex: none; }
.de-coinstack {
    display: inline-flex;
    align-items: center;
    flex: none;
    isolation: isolate;
}
.de-coinstack .coin {
    box-shadow: 1.5px 0 0 rgb(120 53 0 / 0.55), 2px 1px 2px rgb(0 0 0 / 0.18), inset 0 1px 0 rgb(255 255 255 / 0.55), inset -1px -2px 2px rgb(120 53 0 / 0.35);
}
.de-coinstack .de-coin-top {
    z-index: var(--stack-n, 1);
}
.de-coinstack .de-coin-rim {
    margin-left: -20px;
}
.de-why-mood {
    gap: 6px;
}
.de-why-mood .grade {
    width: 20px;
    height: 20px;
    font-size: 11px;
    flex: none;
}
.de-wait { opacity: 0; pointer-events: none; }
.de-wait.in { opacity: 1; animation: rise 0.3s ease-out both; pointer-events: auto; }
.day-end .de-mood-cap.mood-pill {
    position: absolute; left: 50%; bottom: 0; top: auto; transform: translate(-50%, 60%); z-index: 2;
    display: inline-flex; margin: 0; pointer-events: none;
}
.day-end .de-mood-cap .mdelta { display: none; }
.de-dayfx {
    display: flex; flex-wrap: wrap; justify-content: center; gap: 6px;
    margin: 0 0 8px;
}
.de-fx {
    display: inline-flex; align-items: baseline; gap: 6px;
    padding: 5px 10px; border-radius: var(--r-pill);
    background: var(--overlay); color: var(--ink); font-size: 12px; font-weight: 800;
}
.de-fx small { color: var(--xp); font-weight: 900; font-variant-numeric: tabular-nums; }
.de-head + .de-xphead { margin-top: 6px; }
.de-levelup {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin: 8px 0 26px;
}
.de-level-sub {
    margin: 0;
    font-size: 14px;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ink);
}
.de-pet-frame {
    position: relative;
    width: 108px;
    height: 108px;
    border-radius: var(--r-card);
    border: 1px solid var(--line);
    background: var(--stage-bg, var(--yard-art) center / cover);
    background-blend-mode: screen, soft-light, color, color, normal;
    box-shadow: inset 0 1px 3px rgb(var(--shadow-rgb) / 0.08);
    display: grid;
    place-items: center;
    overflow: visible;
}
.de-pet-pic {
    width: 80px;
    height: 80px;
    margin-bottom: 6px;
    display: grid;
    place-items: center;
}
.de-pet-pic img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 6px 10px rgb(var(--shadow-rgb) / 0.22));
}
.day-end .modal-actions, .modal.game-over .modal-actions { margin-top: 10px; }
.day-end .de-actions {
    opacity: 0; pointer-events: none;
    transition: opacity 0.45s ease;
}
.day-end .de-actions.in { opacity: 1; pointer-events: auto; }
.day-end .de-next:disabled { opacity: 1; }
.cutscene {
    position: fixed; inset: 0; z-index: var(--z-cutscene); display: grid; place-items: center; cursor: default;
    pointer-events: auto; background: transparent; opacity: 1;
    transition: opacity 0.7s ease, background-color 0.9s ease;
    overflow: hidden;
}
.cutscene.hold { cursor: pointer; }
.window > .cutscene { position: absolute; inset: 0; border-radius: inherit; }
body.nighting { background: var(--night); }
body.nighting::before { opacity: 0; }
body.nighting.dawning { background: var(--dawn); }
.window:has(.cutscene) .screen { pointer-events: none; }
.cutscene .cut-copy {
    display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
}
.cutscene p {
    margin: 0; color: var(--night-ink); font-family: var(--font); font-size: 22px; font-weight: 800; letter-spacing: 0.01em;
    opacity: 0; transform: translateY(6px); transition: opacity 0.8s ease, transform 0.8s ease;
}
.cutscene .cut-level {
    font-size: 13px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase;
}
.cutscene .cut-title {
    display: flex; align-items: baseline; justify-content: center; gap: 0.28em;
    font-size: 28px; font-weight: 1000; letter-spacing: 0.01em;
}
.cutscene .cut-title .odo, .cutscene .cut-level .odo { height: 1em; }
.cutscene .cut-left-lbl { font-weight: 1000; }
.cutscene .cut-sub { font-size: 15px; font-weight: 700; }
.cutscene-days {
    display: flex; align-items: center; justify-content: center;
    width: min(100%, 380px);
    min-height: 14px; opacity: 0; transform: translateY(6px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}
.cutscene-days .day-pips { justify-content: center; width: max-content; max-width: 100%; }
.cutscene-days .day-pips i.future, .cutscene-days .day-pips i:not(.done):not(.now) {
    background: color-mix(in srgb, var(--night-ink) 22%, transparent);
}
.cutscene.text .cutscene-days { opacity: 1; transform: none; }
.cutscene.black { background: var(--night); }
.cutscene.text p { opacity: 1; transform: none; color: var(--night-ink); }
.cutscene.text p.cut-sub { color: color-mix(in srgb, var(--night-ink) 74%, transparent); }
.cutscene.white .cutscene-days { opacity: 0; transform: translateY(-4px); }
.cutscene.white { background: var(--dawn); }
.cutscene.white p { opacity: 0; transform: translateY(-4px); transition-duration: 0.7s; }
.cutscene.out { opacity: 0; pointer-events: none; transition: opacity 0.9s ease; }
.cutscene.quick { transition-duration: 0.25s; }
.cutscene.xform {
    background: var(--stage-bg);
    background-blend-mode: screen, soft-light, color, color, normal;
    opacity: 0; transition: opacity 0.4s ease;
}
.window > .cutscene.xform { position: absolute; inset: 0; border-radius: inherit; }
.cutscene.xform.in { opacity: 1; }
.cutscene.xform.out { opacity: 0; transition: opacity 0.8s ease; }
.xf-curtain {
    position: absolute; inset: 0; z-index: 1; pointer-events: none;
    background: #000; transition: opacity 0.8s ease;
}
.cutscene.xform.reveal .xf-curtain { opacity: 0; }
.cutscene.xform .xf-level {
    position: relative; z-index: 2; color: #fff;
    font-size: 30px; font-weight: 1000; letter-spacing: 0.04em;
    transition: opacity 0.5s ease, transform 0.5s ease;
}
.cutscene.xform.text .xf-level { opacity: 1; transform: none; color: #fff; }
.cutscene.xform.text-out .xf-level { opacity: 0; transform: translateY(-4px); }
.xf-stage {
    position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none;
}
.xf-pet {
    position: relative; display: grid; place-items: center;
    width: min(44vw, 170px); aspect-ratio: 1; max-height: 34vh;
    animation: breathing 6s ease-in-out infinite;
}
.xf-pet img {
    grid-area: 1 / 1; width: 100%; height: 100%; object-fit: contain;
    filter: drop-shadow(var(--shx, 0) var(--shy, 6px) 8px rgb(0 0 0 / 0.3)) blur(0);
}
.xf-pet .xf-old { opacity: 1; transition: opacity 3.75s ease, filter 4.5s ease; }
.xf-pet .xf-new {
    opacity: 0; transition: opacity 3s ease, filter 4.5s ease;
    filter: drop-shadow(var(--shx, 0) var(--shy, 6px) 8px rgb(0 0 0 / 0.3)) blur(10px);
}
.cutscene.xform.cross .xf-old {
    opacity: 0; filter: drop-shadow(var(--shx, 0) var(--shy, 6px) 8px rgb(0 0 0 / 0.3)) blur(10px);
}
.cutscene.xform.cross .xf-new {
    opacity: 1; filter: drop-shadow(var(--shx, 0) var(--shy, 6px) 8px rgb(0 0 0 / 0.3)) blur(0);
}
.de-head { display: flex; flex-direction: column; align-items: center; margin-bottom: 4px; }
.de-head .de-hint { margin: 6px 0 0; }
.de-head .de-fail-banner { margin: 8px 0 0; width: 100%; text-align: center; }
.day-end .de-title { display: inline-flex; align-items: center; gap: 8px; font-size: 26px; margin: 0; }
.day-end .de-title.fail { color: var(--bad); }
.de-mark {
    display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: var(--on-color);
    box-shadow: 0 2px 6px rgb(var(--shadow-rgb) / 0.25); rotate: -8deg;
}
.de-mark .material-icons { font-size: 20px; font-weight: 900; }
.de-mark.good { background: var(--good-fill); } .de-mark.bad { background: var(--bad-fill); }
.de-mark.slap { animation-name: markSlap; animation-duration: 0.34s; }
@keyframes markSlap {
    0% { opacity: 0; transform: scale(2.2); }
    60% { opacity: 1; transform: scale(0.9); }
    100% { opacity: 1; transform: none; }
}
.de-fail-banner {
    margin: 0 0 10px; padding: 8px 10px; border-radius: var(--r-card);
    background: color-mix(in srgb, var(--bad) 16%, var(--surface)); color: var(--bad);
    font-size: 15px; font-weight: 1000; letter-spacing: -0.01em;
}
.slice { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding: 8px 4px 10px; color: var(--on-color); }
.slice:first-child { border-radius: var(--r-sheet) 0 0 16px; } .slice:last-child { border-radius: 0 16px 16px 0; }
.slice + .slice { box-shadow: inset 1px 0 0 var(--card); }
.slice.pts { background: var(--points); }
.slice.mult { background: var(--sheen), var(--mood-bg, var(--mult-grad)); } .slice.xp { background: var(--xp-grad); flex: 1.15; }
.slice .lbl {
    height: 16px; display: flex; align-items: center; justify-content: center; gap: 4px;
    font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; line-height: 1;
}
.slice.mult .lbl { display: inline-flex; align-items: center; text-transform: none; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.slice.mult .lbl b { font-size: 12px; font-weight: 1000; line-height: 1; }
.slice .val {
    height: 32px; display: flex; align-items: flex-end; justify-content: center;
    font-size: 22px; font-weight: 1000; font-variant-numeric: tabular-nums; line-height: 0.92; margin-top: 2px;
}
.slice .val.big { font-size: 32px; line-height: 0.92; }
.slice .val.bump { animation: ptsBump 0.3s ease-out; }
@keyframes ptsBump { 35% { transform: scale(1.3); } }
.slice-sub { font-size: 11px; font-weight: 600; line-height: 1.2; font-variant-numeric: tabular-nums; }
.slice-sub b { font-weight: 1000; margin-right: 2px; }
.slice .op {
    position: absolute; right: -12px; top: calc(50% - 12px); z-index: 2; width: 24px; height: 24px; border-radius: 50%;
    display: grid; place-items: center; background: var(--card); color: var(--ink);
    font-style: normal; font-size: 14px; font-weight: 1000; line-height: 1; box-shadow: 0 1px 3px rgb(var(--shadow-rgb) / 0.2);
}
.bp-val { padding: 1px 7px; border-radius: var(--r-pill); background: var(--card); font-size: 11px; font-variant-numeric: tabular-nums; }
.bp-val.pts { color: var(--points); } .bp-val.mult { color: var(--ink); } .bp-val.xp { color: var(--xp); }
.de-xp { margin-top: 6px; text-align: left; }
.day-end .xp-pill { transition: width var(--fill, 0.85s) cubic-bezier(0.33, 1, 0.68, 1); }
.day-end.skip .xp-pill { transition: none; }
.day-end .fade-in { animation-duration: 0.45s; }
.de-hint { font-size: 13px; font-weight: 700; color: var(--ink-dim); margin: 8px 0 0; }
.de-hint b { color: var(--ink); }
.de-next { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.de-extras { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; margin-top: 10px; }
.de-chip { display: inline-flex; align-items: center; gap: 3px; padding: 2px 9px; border-radius: var(--r-pill); background: var(--surface-2); font-size: 11px; font-weight: 800; }
.de-chip .material-icons { font-size: 13px; }
.de-chip.fp .material-icons { color: var(--fp-ink); }
.di-plus { font-weight: 900; color: var(--ink-dim); }
.de-chip.bad { background: var(--bad-fill); color: var(--on-color); }
.de-chip.gold { background: var(--gold-grad); color: var(--on-gold); }
.modal.game-over { overflow: hidden; padding: 18px 14px 14px; }
.modal.game-over .de-fail-banner {
    margin: 0 0 8px; padding: 8px 10px; border-radius: var(--r-card);
    background: color-mix(in srgb, var(--bad) 16%, var(--surface)); color: var(--bad);
    font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; font-weight: 1000; text-align: center;
}
.go-hero { display: flex; align-items: center; gap: 12px; text-align: left; margin: 0 0 8px; }
.go-pet {
    flex: none; width: 72px; height: 72px; border-radius: var(--r-card); overflow: hidden;
    display: grid; place-items: center; border: 1px solid var(--line);
    background: var(--stage-bg, var(--yard-art) center / cover);
    background-blend-mode: screen, soft-light, color, color, normal;
    box-shadow: inset 0 1px 3px rgb(var(--shadow-rgb) / 0.08);
}
.go-hero img, .go-pet img { width: 58px; height: 58px; object-fit: contain; }
.go-hero h2 { margin: 0; font-size: 20px; }
.go-hero .sub { margin: 2px 0 0; }
.go-days-lived { font-weight: 800; }
.go-need { margin: 0 0 8px; text-align: left; }
.go-need .go-need-row { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; font-weight: 800; margin-bottom: 5px; }
.go-short { color: var(--bad); }
.go-last {
    display: flex; align-items: center; gap: 8px; margin-top: 6px; padding: 5px 8px;
    border-radius: var(--r-card); font-size: 12px; font-weight: 800;
    background: color-mix(in srgb, var(--mood-bg, var(--surface)) 38%, var(--surface));
}
.go-stats, .go-week {
    margin: 0 0 6px; border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden;
    background: color-mix(in srgb, var(--surface) 45%, var(--card));
    box-shadow: inset 0 1px 3px rgb(var(--shadow-rgb) / 0.08), inset 0 -1px 0 var(--glass-highlight);
}
.go-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; }
.go-stats .stat { background: none; border: 0; border-radius: 0; padding: 8px 2px 7px; }
.go-stats .stat + .stat { box-shadow: inset 1px 0 0 var(--line); }
.go-stats .stat b { font-size: 15px; font-variant-numeric: tabular-nums; }
.go-stats .stat span { font-size: 10px; }
.go-week { display: flex; align-items: stretch; padding: 8px 4px 7px; }
.go-day {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 0 2px;
    border: 0; background: none; border-radius: 0;
}
.go-day .grade { width: 18px; height: 18px; font-size: 10px; box-shadow: none; }
.go-day small { font-size: 10px; color: var(--ink-dim); font-weight: 800; font-variant-numeric: tabular-nums; }
.go-seed { margin: 4px 0 0; font-size: 11px; font-weight: 700; color: var(--ink-dim); text-align: center; }
.modal.game-over .modal-actions .btn { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.modal.win h2 { text-align: center; }
.modal.win .transform-art { margin: 10px 0 4px; }
.modal.win .modal-actions .btn { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }

/* Go to Sleep: a fixed night sky that ignores themes on purpose. */
.sleep-btn {
    position: relative; overflow: hidden; border: 0; color: #fff; font-size: 13px;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    background: linear-gradient(135deg, #000 0%, #0b1433 55%, #1e3a8a 100%);
    box-shadow: 0 4px 14px rgba(11, 20, 51, 0.45);
}
.shop-actions {
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: stretch;
}
.shop-actions .btn {
    flex: none; height: 44px; min-height: 44px; padding: 0 10px; margin: 0;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    font-size: 13px; font-weight: 900; line-height: 1; box-sizing: border-box;
    border-radius: var(--r-card);
}
.shop-actions .sleep-btn { border: 0; }
.shop-actions .sleep-btn .material-icons { font-size: 18px; line-height: 1; }
.shop-actions #m-reroll { padding: 0 8px 0 12px; }
.shop-actions .coin { --coin-size: 24px; }
.sleep-btn:hover { filter: brightness(1.12); }
.sleep-btn .moon { color: #fde68a; text-shadow: 0 0 8px rgba(253, 230, 138, 0.55); position: relative; }
.sleep-btn .stars { position: absolute; inset: 0; pointer-events: none; }
.sleep-btn .stars i {
    position: absolute; width: 2px; height: 2px; border-radius: 50%; background: #fff;
    box-shadow: 0 0 3px 1px rgba(255, 255, 255, 0.6); animation: twinkle 2.6s ease-in-out infinite;
}
.sleep-btn .stars i:nth-child(1) { left: 6%; top: 28%; animation-delay: 0s; }
.sleep-btn .stars i:nth-child(2) { left: 14%; top: 68%; animation-delay: 1.1s; width: 1.5px; height: 1.5px; }
.sleep-btn .stars i:nth-child(3) { left: 24%; top: 22%; animation-delay: 0.5s; }
.sleep-btn .stars i:nth-child(4) { left: 33%; top: 74%; animation-delay: 1.8s; width: 1.5px; height: 1.5px; }
.sleep-btn .stars i:nth-child(5) { left: 68%; top: 24%; animation-delay: 0.9s; }
.sleep-btn .stars i:nth-child(6) { left: 76%; top: 72%; animation-delay: 2.2s; width: 1.5px; height: 1.5px; }
.sleep-btn .stars i:nth-child(7) { left: 85%; top: 30%; animation-delay: 1.4s; }
.sleep-btn .stars i:nth-child(8) { left: 92%; top: 64%; animation-delay: 0.3s; width: 1.5px; height: 1.5px; }
.sleep-btn .stars i:nth-child(9) { left: 52%; top: 14%; animation-delay: 2s; width: 1.5px; height: 1.5px; }
@keyframes twinkle { 0%, 100% { opacity: 0.15; transform: scale(0.6); } 50% { opacity: 1; transform: scale(1.2); } }
.de-next .material-icons { font-size: 20px; color: inherit; }
.slap { animation: slap 0.26s cubic-bezier(0.25, 0.8, 0.35, 1.1) both; animation-delay: var(--d, 0ms); }
.rise { animation: rise 0.3s ease-out both; animation-delay: var(--d, 0ms); }
.fade-in { animation: fadeIn 0.9s ease both; animation-delay: var(--d, 0ms); }
@keyframes slap {
    0% { opacity: 0; transform: scale(1.25); }
    60% { opacity: 1; transform: scale(0.98); }
    100% { opacity: 1; transform: none; }
}
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.day-end.skip .slap, .day-end.skip .rise, .day-end.skip .fade-in { animation-delay: 0ms !important; animation-duration: 0.01ms !important; }
.day-end.skip .de-wait { opacity: 1; animation: none; pointer-events: auto; }
.day-end.skip .de-actions { opacity: 1; transition: none; pointer-events: auto; }
.day-end.skip .xp-bar { transition: none; }
.shop-sub { margin: -4px 0 8px; font-size: 12px; font-weight: 700; color: var(--ink-dim); }
.shop-head-copy { min-width: 0; flex: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.shop-head-copy h2 { margin: 0; }
.shop-hold-hint { margin: 0; }
.modal.shop { overflow: hidden; }
.modal.shop.shop-grid-view { position: relative; overflow-x: hidden; overflow-y: auto; }
.modal.shop.shop-floating { overflow: hidden; }
.modal.shop .shop-head { align-items: center; margin-bottom: 8px; }
.modal.shop .shop-head-lead { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
.modal.shop .shop-head-lead h2 { flex: none; margin: 0; }
.modal.shop .shop-mode {
    width: auto; flex: none; margin: 0; padding: 2px;
}
.modal.shop .shop-mode button { flex: none; padding: 4px 10px; }
.modal.shop.shop-out { pointer-events: none; }
.modal.shop .shop-fade { display: flex; flex-direction: column; min-height: 0; }
.modal.shop.shop-out .shop-fade { animation: shopFadeOut 0.16s ease forwards; }
.modal.shop.shop-in .shop-fade { animation: shopFadeIn 0.18s ease; }
@keyframes shopFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes shopFadeOut { from { opacity: 1; } to { opacity: 0; } }
.shop-head-lead { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.shop-head-lead h2 { flex: none; }
.shop-mode {
    display: flex; gap: 2px; flex: none; width: 100%; margin: 0 0 8px; padding: 2px; border-radius: var(--r-pill);
    background: var(--surface); border: 1px solid var(--line);
}
.shop-mode button {
    border: 0; border-radius: var(--r-pill); background: none; padding: 5px 8px; flex: 1;
    font: inherit; font-size: 12px; font-weight: 800; color: var(--ink-dim); cursor: pointer;
}
.shop-mode button.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow-1); }
.shop-flow {
    position: relative; height: 308px; margin: 0; padding: 12px 8px; box-sizing: border-box;
    perspective: 920px; overflow: hidden; touch-action: pan-y; user-select: none; cursor: grab;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 48px, #000 calc(100% - 48px), transparent);
    mask-image: linear-gradient(90deg, transparent, #000 48px, #000 calc(100% - 48px), transparent);
}
.shop-flow.dragging { cursor: grabbing; }
.shop-stage { position: relative; height: 100%; transform-style: preserve-3d; }
.shop-flow .offer {
    --kind: var(--ink-dim);
    --hold: 0%;
    position: absolute; left: 50%; top: 8px; width: 180px; height: 252px; aspect-ratio: var(--card-ratio); margin-left: 0;
    padding: 0 0 6px; gap: 0; border-radius: var(--r-sheet); overflow: hidden;
    background: var(--card); border: 2px solid var(--line);
    display: flex; flex-direction: column; align-items: center; text-align: center;
    transform-origin: center center;
    transform: translateX(-50%);
    transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.32s ease, filter 0.28s ease;
    will-change: transform;
    box-shadow: 0 8px 18px rgb(var(--shadow-rgb) / 0.14);
}
.shop-flow .offer.pick-tile .offer-foot:empty { display: none; }
.shop-flow .offer { pointer-events: none; }
.shop-flow .offer.front,
.shop-flow .offer.side { pointer-events: auto; }
.shop-flow .offer::after {
    content: ''; position: absolute; inset: -2px; border-radius: inherit; pointer-events: none;
    padding: 2px;
    background: linear-gradient(90deg, #fde68a, var(--gold) 55%, #d97706) 0 0 / var(--hold) 100% no-repeat;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
}
.shop-flow .offer.chosen, .shop-flow .offer.locked { --hold: 100%; }
.shop-hold-cost {
    display: inline-flex; align-items: center; justify-content: center; min-height: 28px;
    font-size: 13px; font-weight: 900; color: var(--ink-dim);
}
.shop-hold-cost.sold, .shop-hold-cost.blocked { opacity: 0.45; }
.shop-flow .offer.front { box-shadow: 0 10px 20px rgb(var(--shadow-rgb) / 0.18); cursor: pointer; }
.shop-flow .offer.on {
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 40%, transparent), 0 10px 20px rgb(var(--shadow-rgb) / 0.18);
}
.shop-flow .offer .art .sh-swatch,
.shop-flow .offer .art .sh-preview,
.shop-flow .offer .art .sh-pet,
.lib-pick .offer .art .sh-swatch,
.lib-pick .offer .art .sh-preview,
.lib-pick .offer .art .sh-pet {
    width: 100%; height: 100%; border-radius: inherit;
}
.shop-flow .offer .art .sh-pet,
.lib-pick .offer .art .sh-pet {
    display: grid; place-items: center;
}
.shop-flow .offer .art .sh-pet img,
.lib-pick .offer .art .sh-pet img {
    position: relative; inset: auto; width: 78%; height: 78%;
    max-width: none; max-height: none; margin: 0; padding: 0;
    object-fit: contain; object-position: center;
}
.shop-flow .offer .art .sh-preview img,
.lib-pick .offer .art .sh-preview img {
    width: 100%; height: 100%; max-width: none; max-height: none;
    object-fit: cover; display: block; filter: none; transform: none;
}
.shop-flow .offer.locked { opacity: 1; }
.shop-flow .offer.locked .tp, .lib-pick .offer.locked .tp { display: none; }
.sh-pet.is-lock img {
    filter: blur(7px) saturate(0.55) brightness(0.94);
    transform: scale(1.12);
}
.sh-lock {
    position: absolute; inset: 0; display: grid; place-items: center;
    font-size: 34px; color: var(--ink); pointer-events: none;
    text-shadow: 0 1px 0 var(--card), 0 0 10px var(--card);
}
.shop-flow .offer.side { cursor: pointer; }
.shop-flow .offer:not(.front) .price, .shop-flow .offer:not(.front) .oc-pay { pointer-events: none; }
.shop-dots { display: flex; justify-content: center; gap: 8px; padding: 4px 0 14px; margin: 0; }
.deck-actions {
    display: flex; justify-content: center; align-items: center;
    min-height: 36px; margin: 0 0 8px;
}
.deck-act { display: none; justify-content: center; }
.deck-act.on { display: flex; }
.deck-act .btn {
    min-width: 120px; height: 34px; padding: 0 16px;
    border-radius: var(--r-pill); font-size: 13px;
}
.shop-dot {
    width: 7px; height: 7px; padding: 0; border: 0; border-radius: 50%;
    background: color-mix(in srgb, var(--ink) 22%, transparent); cursor: pointer;
}
.shop-dot.on { background: var(--ink); transform: scale(1.25); }
.offer {
    --kind: var(--ink-dim);
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 7px;
    display: flex; flex-direction: column; gap: 3px;
}
.offer.charm { --kind: var(--kind-charm); } .offer.perk { --kind: var(--kind-perk); } .offer.treat { --kind: var(--kind-treat); } .offer.boost { --kind: var(--kind-boost); } .offer.music { --kind: var(--kind-boost); } .offer.snack { --kind: var(--kind-snack); } .offer.slot { --kind: var(--kind-charm); }
.offer .art { height: 48px; display: grid; place-items: center; background: color-mix(in srgb, var(--kind) 12%, var(--card)); border-radius: 8px; color: var(--kind); }
.offer.charm .art { border-radius: 50%; width: 48px; justify-self: center; align-self: center; }
.offer .art img { height: 42px; width: 42px; object-fit: contain; }
.shop-flow .offer .nm { font-size: 13px; line-height: 1.15; max-width: 100%; padding: 0 8px; margin: auto 0 0; }
.shop-flow .offer .art-wrap { position: relative; width: 100%; flex: none; aspect-ratio: var(--card-art-ratio); margin: 0 0 4px; }
.shop-flow .offer .art,
.shop-flow .offer.charm .art,
.shop-flow .offer.perk .art {
    width: 100%; height: 100%; aspect-ratio: auto; flex: none; border-radius: 0;
    border-bottom: 1px solid color-mix(in srgb, var(--ink) 7%, transparent);
}
.shop-flow .offer .art .sh-pet,
.shop-flow .offer .art .sh-preview,
.shop-flow .offer .art .sh-swatch { border-radius: 0; }
.shop-flow .offer .art img { width: 64%; height: 64%; max-width: 74px; max-height: 74px; }
.shop-flow .offer .art .mi, .shop-flow .offer .art .offer-seq .mi,
.shop-flow .offer .art .material-icons { font-size: 38px; }
.shop-flow .offer .tp {
    position: absolute; left: 50%; bottom: 0; transform: translate(-50%, 50%);
    z-index: 1; background: var(--card); border: 1px solid color-mix(in srgb, var(--kind) 40%, var(--line));
    border-radius: var(--r-pill); padding: 2px 8px 2px 6px; box-shadow: var(--shadow-1); white-space: nowrap;
}
.shop-flow .offer .ds { flex: none; font-size: 11px; line-height: 1.2; max-height: 2.5em; overflow: hidden; margin: 2px 0 auto; padding: 0 10px; }
.shop-flow .offer:has(.ds:empty) .nm,
.shop-flow .offer:not(:has(.ds)) .nm { margin: auto 0; }
.shop-flow .offer .stat-meter { display: none; }
.shop-flow.lib-flow { height: 276px; }
.shop-flow.lib-flow .offer { width: 180px; height: 252px; aspect-ratio: var(--card-ratio); }
.shop-flow.lib-flow .offer .ds { max-height: 2.5em; overflow: hidden; }
.shop-flow.lib-flow .offer .stat-meter { display: block; }
.shop-flow .offer .offer-foot { width: 100%; margin-top: auto; padding: 0 10px; display: flex; justify-content: center; }
.shop-flow .offer .offer-foot:empty { display: none; }
.shop-flow .offer .offer-foot .btn { min-width: 108px; padding: 8px 14px; }
.shop-flow .offer.armed {
    box-shadow: 0 14px 26px rgb(var(--shadow-rgb) / 0.22);
}
.shop-flow .offer.empty {
    pointer-events: none; cursor: default; opacity: 0.88;
}
.shop-flow .offer.empty .nm { color: var(--ink-dim); }
.shop-flow .offer.empty .art { background: var(--surface); color: var(--ink-dim); }
.shop-grid {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 10px;
    align-items: start; padding: 8px 4px 10px;
}
.shop-grid.is-empty { grid-template-columns: 1fr; justify-items: center; }
.shop-grid.is-empty .offer { width: 100%; max-width: 168px; min-height: 148px; }
.shop-grid .offer {
    position: relative; left: auto; top: auto; width: 100%; height: auto; aspect-ratio: var(--card-ratio); min-height: 0;
    margin: 0; padding: 0; gap: 0; border-radius: var(--r-sheet); overflow: visible;
    background: var(--card); border: 2px solid var(--line);
    display: flex; flex-direction: column; align-items: center; text-align: center;
    transform: none; pointer-events: auto; cursor: pointer;
    box-shadow: var(--shadow-1);
    transition: box-shadow 0.2s ease, padding 0.2s ease, min-height 0.2s ease;
}
.shop-grid .offer .art-wrap {
    position: relative; width: 100%; flex: none; aspect-ratio: var(--card-art-ratio); min-height: 0; margin: 0;
    overflow: hidden;
    border-radius: calc(var(--r-sheet) - 2px) calc(var(--r-sheet) - 2px) 0 0;
}
.shop-grid .offer .art,
.shop-grid .offer.charm .art,
.shop-grid .offer.perk .art {
    width: 100%; height: 100%; border-radius: 0;
    border-bottom: 1px solid color-mix(in srgb, var(--ink) 7%, transparent);
}
.shop-grid .offer .art img { width: 60%; height: 60%; max-width: 38px; max-height: 38px; }
.shop-grid .offer .art .mi,
.shop-grid .offer .art .material-icons,
.shop-grid .offer .art .offer-seq .mi { font-size: 24px; }
.shop-grid .offer .nm {
    font-size: 10px; line-height: 1.08; padding: 0 3px; margin: auto 0;
    max-width: 100%; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.shop-grid .offer .ds,
.shop-grid .offer .why { display: none; }
.shop-grid .offer .tp {
    position: absolute; left: 50%; bottom: 0; z-index: 1;
    font-size: 8px; padding: 1px 5px 1px 4px; transform: translate(-50%, 42%);
    background: var(--card); border: 1px solid color-mix(in srgb, var(--kind) 40%, var(--line));
    border-radius: var(--r-pill); white-space: nowrap; box-shadow: var(--shadow-1);
}
.shop-grid .offer .offer-foot,
.shop-grid .offer.pack .offer-foot {
    position: absolute; left: -7px; top: -7px; right: auto; bottom: auto; transform: none; z-index: 6;
    width: auto; margin: 0; padding: 0;
    display: flex; justify-content: center;
    pointer-events: none;
}
.shop-grid .offer .shop-hold-cost { min-height: 0; }
.shop-grid .offer .coin.sm {
    --coin-size: 22px; font-size: 11px;
    box-shadow: 0 0 0 2px var(--card), 0 2px 6px rgb(var(--shadow-rgb) / 0.28);
}
.shop-grid .offer .shop-hold-cost.sold {
    padding: 2px 6px; border-radius: var(--r-pill);
    background: var(--surface); border: 1px solid var(--line);
    font-size: 9px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.04em;
    box-shadow: 0 0 0 2px var(--card);
}
.shop-grid .offer.picked,
.pick-list .pick-row.picked { visibility: hidden; }
.shop-float .pick-tile {
    position: absolute; left: 50%; top: 50%;
    width: 180px; height: 252px; min-height: 252px; aspect-ratio: var(--card-ratio); overflow: hidden; margin: 0;
    padding: 0 0 6px; gap: 0;
    transform: translate(-50%, -50%); transform-origin: center center;
    z-index: 1;
    box-shadow: 0 16px 32px rgb(var(--shadow-rgb) / 0.28);
    transition: transform 0.34s cubic-bezier(0.33, 1, 0.4, 1);
}
.shop-float.leaving {
    pointer-events: none;
    background: rgb(15 23 42 / 0);
    transition: background 0.26s ease;
}
.shop-float.build-float {
    z-index: var(--z-modal);
    border-radius: inherit;
}
.shop-float.build-float .pick-tile {
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.22s ease;
}
.shop-float.build-float.leaving .pick-tile {
    opacity: 0;
}
.shop-float .pick-tile.chosen {
    transition: none;
    animation: pickFloatOut 0.42s cubic-bezier(0.22, 0.8, 0.36, 1) forwards;
}
@keyframes pickFloatOut {
    from { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    to { transform: translate(-50%, calc(-50% - 40px)) scale(0.98); opacity: 0; }
}
.shop-float .pick-tile .pick-hero-wrap,
.shop-float .pick-tile.armed .pick-hero-wrap {
    flex: none; width: 100%; aspect-ratio: var(--card-art-ratio); min-height: 0; margin: 0 0 4px;
}
.shop-float .pick-tile .nm { font-size: 13px; line-height: 1.15; margin: auto 0 0; }
.shop-float .pick-tile .pick-pay { min-height: 0; margin: 3px 0 auto; }
.shop-float .pick-tile .pick-pay:empty { display: none; margin: 0; }
.shop-float .pick-tile:has(.pick-pay:empty) .nm { margin: auto 0; }
.shop-float .pick-tile .pick-foot,
.shop-float .pick-tile .offer-foot:empty,
.shop-float .offer .offer-foot:empty { display: none; }
.shop-float-actions {
    position: absolute;
    left: 50%;
    top: calc(50% + 136px);
    transform: translateX(-50%);
    z-index: 3;
    display: flex;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease 0.08s;
}
.shop-float-actions .offer-confirm {
    display: inline-flex;
    align-items: stretch;
    gap: 8px;
}
.shop-float-actions .offer-confirm .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 36px;
    padding: 0 14px;
    border-radius: var(--r-pill);
    font-size: 13px;
    line-height: 1;
    white-space: nowrap;
}
.shop-float.on .shop-float-actions { opacity: 1; }
.shop-float.leaving .shop-float-actions,
.shop-float.slicing .shop-float-actions { opacity: 0; pointer-events: none; }
.shop-float .card-info { padding-bottom: 18px; }
.shop-float .pick-tile .pick-note { display: none; }
.shop-float .pick-tile,
.shop-float .offer.pack {
    cursor: pointer;
}
.card-info-pip {
    position: absolute;
    top: 7px;
    right: 7px;
    left: auto;
    z-index: 9;
    width: 20px;
    height: 20px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: var(--ink-dim);
    border: 0;
    pointer-events: none;
    transition: color 150ms ease, opacity 150ms ease;
}
/* Item & boost cards with a dog-ear: tuck the little i icon right inside the upper-right fold */
:is(.pick-tile, .offer:not(.lib-min):not(.pack):not(.theme-showcase):not(.empty)):is(.boost, .rar-common, .rar-uncommon, .rar-rare, .rar-gold, .rar-pearl) > .card-info-pip {
    top: 3px;
    right: 3px;
    left: auto;
    width: 18px;
    height: 18px;
}
:is(.pick-tile, .offer:not(.lib-min)).boost > .card-info-pip { color: #eff6ff; }
.rar-common > .card-info-pip { color: var(--ink-dim); }
.rar-uncommon > .card-info-pip { color: var(--good); }
.rar-rare > .card-info-pip { color: #ecfdf5; }
.rar-gold > .card-info-pip { color: #78350f; }
.rar-pearl > .card-info-pip { color: #312e81; }
.is-info:has(> .card-rar-bar) > .card-info-pip {
    top: 12px;
    right: 10px;
    left: auto;
    width: 20px;
    height: 20px;
}
.is-info:has(> .card-rar-bar) > .card-info { padding-top: 52px; }
.card-info-pip .material-icons { font-size: 16px; line-height: 1; }
.is-info:not(:has(> .card-rar-bar)) > .card-info-pip {
    color: var(--ink);
}
.card-info {
    position: absolute;
    inset: 0;
    z-index: 6;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 32px 14px 56px;
    text-align: center;
    background: var(--card);
    color: var(--ink);
    border-radius: inherit;
    overflow-y: auto;
    opacity: 0;
    transform: scale(0.96);
    pointer-events: none;
    transition: opacity 200ms cubic-bezier(0.2, 0.8, 0.2, 1), transform 200ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.is-info > .card-info {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}
.card-info-title {
    font-size: 14px;
    font-weight: 900;
    line-height: 1.2;
    color: var(--ink);
}
.card-info-text {
    margin: 0;
    font-size: 11.5px;
    font-weight: 700;
    line-height: 1.4;
    color: var(--ink-dim);
}
.card-info-meta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 10.5px;
    font-weight: 800;
    color: var(--accent);
}
.card-info-meta-ic {
    font-size: 14px;
    line-height: 1;
}
/* Booster pack "pick 1 of X" animated card cue (adapts cleanly to 2, 3, 4, 5+ cards) */
.pack-pick-cue {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
    perspective: 220px;
}
.pack-pick-cue[data-n="2"] { gap: 10px; }
.pack-pick-cue[data-n="4"] { gap: 6px; }
.pack-pick-cue[data-n="5"],
.pack-pick-cue[data-n="6"] { gap: 4px; }
.ppc-card {
    position: relative;
    display: block;
    width: 20px;
    height: 28px;
    border-radius: 5px;
    font-style: normal;
    transform-style: preserve-3d;
}
.pack-pick-cue[data-n="2"] .ppc-card { width: 22px; height: 31px; }
.pack-pick-cue[data-n="4"] .ppc-card { width: 18px; height: 25px; border-radius: 4px; }
.pack-pick-cue[data-n="5"] .ppc-card,
.pack-pick-cue[data-n="6"] .ppc-card { width: 15px; height: 21px; border-radius: 3.5px; }
/* Subtle staggered cascade when fading out in 4+ card hands */
.pack-pick-cue[data-n="4"] .ppc-card.is-side:nth-child(2),
.pack-pick-cue[data-n="5"] .ppc-card.is-side:nth-child(2),
.pack-pick-cue[data-n="6"] .ppc-card.is-side:nth-child(2) { animation-delay: 40ms; }
.pack-pick-cue[data-n="4"] .ppc-card.is-side:nth-child(3),
.pack-pick-cue[data-n="5"] .ppc-card.is-side:nth-child(3),
.pack-pick-cue[data-n="6"] .ppc-card.is-side:nth-child(3) { animation-delay: 80ms; }
.pack-pick-cue[data-n="4"] .ppc-card.is-side:nth-child(4),
.pack-pick-cue[data-n="5"] .ppc-card.is-side:nth-child(4),
.pack-pick-cue[data-n="6"] .ppc-card.is-side:nth-child(4) { animation-delay: 120ms; }
.pack-pick-cue[data-n="5"] .ppc-card.is-side:nth-child(5),
.pack-pick-cue[data-n="6"] .ppc-card.is-side:nth-child(5) { animation-delay: 150ms; }
.pack-pick-cue[data-n="6"] .ppc-card.is-side:nth-child(6) { animation-delay: 180ms; }
.ppc-front,
.ppc-back {
    position: absolute;
    inset: 0;
    display: block;
    border-radius: inherit;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}
.ppc-front {
    background: linear-gradient(150deg, color-mix(in srgb, var(--accent) 82%, #ffffff), var(--accent));
    border: 1.5px solid color-mix(in srgb, var(--accent) 78%, var(--ink));
    box-shadow: 0 2px 6px color-mix(in srgb, var(--accent) 28%, transparent);
}
.ppc-back {
    transform: rotateY(180deg);
    background: var(--surface);
    border: 1.5px solid color-mix(in srgb, var(--ink) 24%, transparent);
    box-shadow: 0 3px 8px rgb(var(--shadow-rgb) / 0.14);
}
.ppc-card.is-side {
    animation: ppcFade 3s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    animation-play-state: paused;
}
.ppc-card.is-pick {
    animation: ppcFlip 3s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    animation-play-state: paused;
}
.is-info .ppc-card.is-side,
.is-info .ppc-card.is-pick {
    animation-play-state: running;
}
@keyframes ppcFlip {
    0%, 14%   { transform: translate3d(0, 0, 0) rotateY(0deg) scale(1); }
    34%, 64%  { transform: translate3d(0, -3px, 0) rotateY(180deg) scale(1.1); }
    82%, 100% { transform: translate3d(0, 0, 0) rotateY(0deg) scale(1); }
}
@keyframes ppcFade {
    0%, 14%   { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
    32%, 64%  { opacity: 0; transform: translate3d(0, 3px, 0) scale(0.86); }
    82%, 100% { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
    .ppc-card.is-side { opacity: 0.3; }
    .ppc-card.is-pick { transform: rotateY(180deg) scale(1.06); }
}
.shop-float .pick-tile .stat-meter { display: block; width: 72px; }
.shop-float .pick-tile .pick-pay { min-height: 0; }
.shop-grid .offer.empty {
    pointer-events: none; cursor: default; opacity: 0.28; min-height: 128px;
    background: var(--surface); box-shadow: none;
}
.shop-grid .offer.empty .nm { color: var(--ink-dim); }
/* Booster Packs: unified foil-pack layout across shop grid, carousel, float, seal, and card sheet */
:is(.shop-grid, .shop-flow, .shop-float, .sheet-grid) .offer.pack {
    --kind: var(--kind-boost);
    justify-content: flex-end;
    padding: 0;
    overflow: hidden;
    background: transparent;
    border: 0;
}
.shop-grid .offer.pack {
    overflow: visible;
}
:is(.shop-grid, .shop-flow, .shop-float, .sheet-grid) .offer.pack .art-wrap {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
    margin: 0;
    overflow: hidden;
    border-radius: var(--r-sheet);
    background: var(--card);
}
:is(.shop-grid, .shop-flow, .shop-float, .sheet-grid) .offer.pack .art {
    position: absolute;
    inset: 0;
    width: 100%; height: 100%;
    border-radius: inherit;
    border: 0;
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 10%, transparent);
    display: grid;
    place-items: center;
    background: var(--surface);
    overflow: hidden;
}
:is(.shop-grid, .shop-flow, .shop-float, .sheet-grid) .offer.pack .art::after {
    display: none;
}
:is(.shop-grid, .shop-flow, .shop-float, .sheet-grid) .offer.pack .art .mi,
:is(.shop-grid, .shop-flow, .shop-float, .sheet-grid) .offer.pack .art .material-icons {
    position: relative; z-index: 1;
    width: 54px; height: 54px; border-radius: 50%;
    display: grid; place-items: center;
    background: var(--surface);
    font-size: 26px; opacity: 1;
    box-shadow: 0 3px 10px rgb(var(--shadow-rgb) / 0.16), inset 0 0 0 1px color-mix(in srgb, var(--ink) 8%, transparent);
    transform: translateY(-34px);
}
.shop-grid .offer.pack .art .mi,
.shop-grid .offer.pack .art .material-icons {
    width: 34px; height: 34px; font-size: 18px; transform: translateY(-24px);
}
:is(.shop-grid, .shop-flow, .shop-float, .sheet-grid) .offer.pack .nm {
    position: absolute; left: 0; right: 0; bottom: 32px; z-index: 2;
    margin: 0;
    padding: 0 10px;
    font-family: Impact, 'Arial Black', 'Haettenschweiler', sans-serif;
    font-size: 22px; font-weight: 400; line-height: 1.04;
    letter-spacing: 0.02em; text-transform: uppercase;
    white-space: normal;
    text-wrap: balance;
    text-align: center;
    color: var(--card);
    opacity: 1;
    pointer-events: none;
}
.shop-grid .offer.pack .nm {
    bottom: 28px;
    padding: 0 6px;
    font-size: 14px;
    line-height: 1.04;
}
.shop-flow .offer.pack .offer-foot {
    position: relative; z-index: 8; margin-top: auto; padding: 0 10px 8px;
}
.shop-float .offer .offer-foot { display: none; }
.shop-grid .offer.pack .pack-perf { display: none; }

/* COMBO PACK: blue nebulous holographic center + surface circle with combo icon */
:is(.shop-grid, .shop-flow, .shop-float, .sheet-grid) .offer.pack.pack-combo .art,
.pack-open-card.pack-combo .art {
    background-image:
        radial-gradient(circle at 50% 50%, #a5f3fc 0%, transparent 56%),
        radial-gradient(circle at 50% 50%, #a78bfa 0%, transparent 60%),
        radial-gradient(circle at 50% 50%, #38bdf8 0%, transparent 58%),
        linear-gradient(135deg, #1d4ed8, #2563eb, #0284c7);
    background-size: 220% 220%, 250% 250%, 200% 200%, 100% 100%;
    animation: holoDogEar 11.5s ease-in-out infinite;
}
:is(.shop-grid, .shop-flow, .shop-float, .sheet-grid) .offer.pack.pack-combo .art .material-icons,
.pack-open-card.pack-combo .art .material-icons {
    color: #1d4ed8;
}
:is(.shop-grid, .shop-flow, .shop-float, .sheet-grid) .offer.pack.pack-combo .nm,
.pack-open-card.pack-combo .nm {
    text-shadow: 0 2px 6px rgb(29 78 216 / 0.36), 0 1px 0 rgb(29 78 216 / 0.26);
}

/* METER BOOSTS (Interaction pack): subtle diagonal (+) designer grid + surface circle */
:is(.shop-grid, .shop-flow, .shop-float, .sheet-grid) .offer.pack.pack-interact,
.pack-open-card.pack-interact {
    --kind: var(--kind-perk);
}
:is(.shop-grid, .shop-flow, .shop-float, .sheet-grid) .offer.pack.pack-interact .art,
.pack-open-card.pack-interact .art {
    background: color-mix(in srgb, var(--kind-perk) 10%, var(--card));
}
:is(.shop-grid, .shop-flow, .shop-float, .sheet-grid) .offer.pack.pack-interact .art::before,
.pack-open-card.pack-interact .art::before {
    content: '';
    position: absolute; inset: 0; z-index: 0; pointer-events: none;
    background: color-mix(in srgb, var(--kind-perk) 12%, transparent);
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath d='M3.5 1.5v4M1.5 3.5h4M10.5 8.5v4M8.5 10.5h4' stroke='%23000' stroke-width='0.9' stroke-linecap='round'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath d='M3.5 1.5v4M1.5 3.5h4M10.5 8.5v4M8.5 10.5h4' stroke='%23000' stroke-width='0.9' stroke-linecap='round'/%3E%3C/svg%3E");
    -webkit-mask-size: 14px 14px;
    mask-size: 14px 14px;
}
:is(.shop-grid, .shop-flow, .shop-float, .sheet-grid) .offer.pack.pack-interact .art .material-icons,
.pack-open-card.pack-interact .art .material-icons {
    color: var(--kind-perk);
}
:is(.shop-grid, .shop-flow, .shop-float, .sheet-grid) .offer.pack.pack-interact .nm,
.pack-open-card.pack-interact .nm {
    text-shadow: 0 2px 6px color-mix(in srgb, var(--kind-perk) 34%, transparent), 0 1px 0 color-mix(in srgb, var(--kind-perk) 24%, transparent);
}

/* ITEM PACK (Gear pack): clean foil pack with soft emerald center + surface circle with emerald icon */
:is(.shop-grid, .shop-flow, .shop-float, .sheet-grid) .offer.pack.pack-gear .art,
.pack-open-card.pack-gear .art {
    background-image:
        radial-gradient(circle at 50% 50%, #a7f3d0 0%, transparent 58%),
        radial-gradient(circle at 50% 50%, #2dd4bf 0%, transparent 60%),
        radial-gradient(circle at 50% 50%, #6ee7b7 0%, transparent 58%),
        linear-gradient(135deg, #065f46, #047857, #0f766e);
    background-size: 220% 220%, 250% 250%, 200% 200%, 100% 100%;
    animation: holoDogEar 12.5s ease-in-out infinite;
}
:is(.shop-grid, .shop-flow, .shop-float, .sheet-grid) .offer.pack.pack-gear .art .material-icons,
.pack-open-card.pack-gear .art .material-icons {
    color: #047857;
}
:is(.shop-grid, .shop-flow, .shop-float, .sheet-grid) .offer.pack.pack-gear .nm,
.pack-open-card.pack-gear .nm {
    text-shadow: 0 2px 6px rgb(4 120 87 / 0.36), 0 1px 0 rgb(4 120 87 / 0.26);
}
.shop-float {
    position: absolute; inset: 0; z-index: 8;
    background: rgb(15 23 42 / 0);
    transition: background 0.22s ease;
}
.shop-float.on {
    background: rgb(15 23 42 / 0.32);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}
.shop-float .offer {
    --kind: var(--ink-dim);
    position: absolute; left: 50%; top: 50%;
    width: 180px; height: 252px; min-height: 252px; aspect-ratio: var(--card-ratio); overflow: hidden; margin: 0;
    padding: 10px 12px; gap: 5px; border-radius: var(--r-sheet);
    background: var(--card); border: 2px solid var(--line);
    display: flex; flex-direction: column; align-items: center; text-align: center;
    transform: translate(-50%, -50%); transform-origin: center center;
    box-shadow: 0 16px 32px rgb(var(--shadow-rgb) / 0.28);
    transition: transform 0.34s cubic-bezier(0.33, 1, 0.4, 1);
}
.shop-float .offer:not(.pack) .art-wrap {
    position: relative; flex: 1 1 0; min-height: 52px; max-height: 108px;
    width: auto; aspect-ratio: 1 / 1; margin: 2px 0 6px;
    display: grid; place-items: center;
}
.shop-float .offer:not(.pack) .art,
.shop-float .offer:not(.pack).charm .art,
.shop-float .offer:not(.pack).perk .art {
    width: 100%; height: 100%; max-width: 108px; max-height: 108px;
    aspect-ratio: 1 / 1; border-radius: var(--r-card);
}
.shop-float .offer:not(.pack) .art img { width: 70%; height: 70%; max-width: none; max-height: none; }
.shop-float .offer .art .mi,
.shop-float .offer .art .material-icons,
.shop-float .offer .art .offer-seq .mi { font-size: 36px; }
.shop-float .offer .nm { flex: none; max-width: 100%; font-size: 15px; line-height: 1.2; }
.shop-float .offer .ds { display: block; flex: none; min-height: 0; font-size: 10px; line-height: 1.25; max-height: none; overflow: visible; margin-top: 2px; }
.shop-float .offer .ds .stat-block { gap: 3px; }
.shop-float .offer .ds .stat-rows { gap: 4px; }
.shop-float .offer .ds .stat-pill { height: 18px; padding: 0 6px; font-size: 10px; }
.shop-float .offer .ds .stat-pill .mi { font-size: 12px; width: 12px; height: 12px; }
.shop-float .offer .ds .stat-stack-lbl { font-size: 9px; }
.shop-float .offer .ds .stat-note { font-size: 9px; }
.stat-rows > .ec-cols { flex: 1 1 100%; width: 100%; }
.shop-float .offer .ec-cols,
.shop-float .pick-tile .ec-cols,
.pick-pay .ec-cols {
    width: 100%; gap: 6px;
    justify-content: center;
    grid-auto-columns: minmax(44px, 72px);
}
.shop-float .offer .ec-col-top,
.shop-float .pick-tile .ec-col-top { font-size: 11px; }
.shop-float .offer .ec-col-top .mi,
.shop-float .pick-tile .ec-col-top .mi { font-size: 15px; }
.shop-float .offer .ec-col .meter,
.shop-float .pick-tile .ec-col .meter { height: 4px; }
.pick-pay .ec-col-top { font-size: 10px; }
.pick-pay .ec-col-top .mi { font-size: 13px; }
.pick-pay .ec-col .meter { height: 3px; }
.shop-float .boost-val { font-size: 13px; }
.shop-float .offer .art .offer-seq .mi { font-size: 20px; }
.shop-float .offer .why { display: block; }
.shop-float .offer .stat-meter { display: none; }
.shop-float .offer .tp {
    position: absolute; left: 50%; bottom: 0; z-index: 1;
    font-size: 10px; padding: 2px 8px 2px 6px; transform: translate(-50%, 50%);
    background: var(--card); border: 1px solid color-mix(in srgb, var(--kind) 40%, var(--line));
    border-radius: var(--r-pill); white-space: nowrap; box-shadow: var(--shadow-1);
}
.shop-float .offer .offer-foot { width: 100%; margin-top: auto; display: flex; justify-content: center; }
.shop-float .offer-confirm { flex-direction: row; gap: 8px; }
.shop-float .offer-confirm .btn { width: auto; font-size: 13px; }
.shop-float.slicing { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; }
.shop-float.slicing .pack-open-card {
    position: relative; left: auto; top: auto; width: 180px; height: 252px; --pack-h: 252px; aspect-ratio: var(--card-ratio);
    transform: none; flex: none;
}
.shop-float .pack-hint { margin: 0; pointer-events: none; color: #fff; text-shadow: 0 1px 2px rgb(15 23 42 / 0.4); }
.modal.shop.shop-slicing { overflow: visible; touch-action: none; }
#active-modal:has(.shop-slicing),
#active-modal:has(.shop-seal) {
    touch-action: none;
    user-select: none;
}
.offer-confirm {
    display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
}
.offer-confirm .oc-cancel { flex: none; padding: 5px 10px; }
.offer-confirm .oc-pay { min-width: 0; }
.shop-flow .offer .price, .shop-flow .offer .oc-pay { min-width: 0; height: auto; font-size: 13px; align-self: center; }
.offer .nm { font-weight: 900; font-size: 13px; text-align: center; }
.offer .tp { display: inline-flex; align-items: center; justify-content: center; gap: 3px; font-size: 10px; font-weight: 900; text-transform: uppercase; color: var(--kind); letter-spacing: 0.5px; }
.offer .tp .material-icons { font-size: 12px; }
.offer .ds { font-size: 11px; color: var(--ink-dim); font-weight: 700; flex: 1; text-align: center; width: 100%; }
.stat-stack {
    display: inline-flex; flex-direction: column; align-items: center; gap: 3px;
}
.stat-stack-face {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.stat-stack-lbl {
    font-size: 10px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase;
    color: var(--ink-dim); line-height: 1;
}
.stat-block {
    display: flex; flex-direction: column; align-items: center; gap: 5px; width: 100%;
}
.stat-rows {
    display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-end; gap: 6px 8px; width: 100%;
}
.stat-row {
    display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 52px;
}
.stat-line {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 5px; width: 100%;
}
.stat-line.stat-cap { flex-wrap: nowrap; white-space: nowrap; gap: 4px; }
.stat-ctx {
    font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-dim);
}
.stat-arrow { font-size: 12px; font-weight: 900; color: var(--ink-dim); line-height: 1; }
.stat-pill {
    display: inline-flex; align-items: center; justify-content: center; gap: 3px;
    height: 22px; padding: 0 8px; border-radius: var(--r-pill); border: 0;
    background: var(--pill); color: var(--on-color);
    font-weight: 900; font-size: 11px; font-variant-numeric: tabular-nums; line-height: 1; white-space: nowrap;
    box-shadow: 0 1px 2px rgb(var(--shadow-rgb) / 0.15);
}
.stat-pill .mi { font-size: 14px; width: 14px; height: 14px; line-height: 1; color: inherit; }
.stat-pill b { font-weight: 900; color: inherit; }
.stat-pill.points { --pill: var(--points); }
.stat-pill.xp { --pill: var(--xp-strong); }
.stat-pill.mood { --pill: var(--mult-fill); }
.stat-pill.coins { --pill: var(--gold); color: var(--on-coin); }
.stat-meter { display: block; width: 64px; }
.stat-meter .meter {
    display: block; width: 100%; height: 5px; border-radius: var(--r-pill);
    position: relative; overflow: hidden; background: var(--track);
}
.stat-meter .meter i { position: absolute; top: 0; bottom: 0; left: 0; border-radius: var(--r-pill); }
.stat-meter .meter i.ghost-up {
    background: repeating-linear-gradient(-45deg, color-mix(in srgb, var(--c) 80%, transparent) 0 1.5px, color-mix(in srgb, var(--c) 25%, transparent) 1.5px 3px);
    border-radius: 0 99px 99px 0; animation: stripeCrawl 1.6s linear infinite;
}
.stat-meter .meter i.ghost-down {
    background: var(--loss); animation: lossPulse 1s ease-in-out infinite;
    border-radius: 0 99px 99px 0;
}
.stat-note { display: block; font-size: 11px; font-weight: 700; color: var(--ink-dim); line-height: 1.3; }
.tip-stats { margin-top: 8px; }
.tip-stats .stat-block { align-items: flex-start; }
.tip-stats .stat-rows { justify-content: flex-start; }
.shop-flow.lib-flow .offer .stat-row { flex-direction: row; align-items: center; }
.offer .ds .stat-note { font-size: 10px; }
.offer .ds .coin { --coin-size: 22px; }
.offer .why { font-size: 10px; font-weight: 800; color: var(--bad); text-align: center; }
.offer .lib-src { font-size: 10px; font-weight: 800; color: var(--ink-dim); text-align: center; }
.offer .price, .deal-actions .price {
    display: inline-flex; align-items: center; justify-content: center; gap: 3px; align-self: center; min-width: 64px; height: 28px;
    padding: 0 12px 0 9px; border: 0; border-radius: var(--r-pill); cursor: pointer; font-family: var(--font);
    background: var(--coin-chrome); color: var(--on-coin); font-size: 15px; font-weight: 1000; font-variant-numeric: tabular-nums;
    box-shadow: var(--spend-edge);
    transition: transform 0.1s ease;
}
.offer .price .material-icons, .deal-actions .price .material-icons { font-size: 17px; color: inherit; }
.offer .price:not(:disabled):hover, .deal-actions .price:not(:disabled):hover { transform: translateY(-1px) scale(1.04); }
.offer .price:not(:disabled):active, .deal-actions .price:not(:disabled):active { transform: translateY(1px); box-shadow: 0 1px 0 color-mix(in srgb, #d97706 70%, #92400e); }
.offer .price:disabled, .deal-actions .price:disabled { background: var(--surface-2); color: var(--ink-dim); box-shadow: none; cursor: default; }
.offer.sold { opacity: 0.4; transition: opacity 0.6s ease, box-shadow 0.6s ease; }
.shop-flow .offer.sold-out { pointer-events: none; z-index: 4; }
.offer.sold.just-bought {
    opacity: 1; transition: none;
    box-shadow: 0 0 0 2px var(--points), 0 0 18px color-mix(in srgb, var(--points) 45%, transparent);
}
.boost-val { display: inline-block; font-size: 17px; font-weight: 1000; color: var(--points); font-variant-numeric: tabular-nums; }
.just-bought .boost-val { animation: boostCount 0.95s ease-out; }
.boost-val.landed { animation: boostLand 0.45s cubic-bezier(0.25, 0.8, 0.35, 1.3); text-shadow: 0 0 10px color-mix(in srgb, var(--points) 55%, transparent); }
@keyframes boostCount { 0%, 25% { transform: scale(1); } 100% { transform: scale(1.25); } }
@keyframes boostLand { 0% { transform: scale(1.25); } 50% { transform: scale(0.92); } 100% { transform: none; } }
.boost-lv { display: inline-block; }
.just-bought .boost-lv { padding: 0 5px; border-radius: var(--r-pill); background: var(--points); color: var(--on-color); animation: slap 0.3s cubic-bezier(0.25, 0.8, 0.35, 1.1) both; }
.buy-fly {
    position: absolute; left: 0; top: 0; display: grid; place-items: center; width: 46px; height: 46px; border-radius: var(--r-card);
    background: var(--card); box-shadow: 0 6px 16px rgb(var(--shadow-rgb) / 0.35); will-change: transform;
}
.buy-fly img { width: 38px; height: 38px; object-fit: contain; }
.buy-fly .mi { font-size: 28px; }
.bag-pill.bump, .owned-charm.bump { animation: walletBump 0.32s cubic-bezier(0.33, 1, 0.68, 1); }
.offer .art .mi { font-size: 30px; }
.offer .nm small { font-size: 10px; color: var(--ink-dim); font-weight: 800; }
.offer .ds b { color: var(--ink); }
.offer .ds .stat-pill { color: var(--on-color); }
.offer .ds .stat-pill.coins { color: var(--on-coin); }
.offer .ds .stat-pill b { color: inherit; }
.pack-perf, .pack-guide {
    display: none;
}
.pack-open {
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    padding: 24px 0 8px; overflow: visible;
}
.pack-open-card {
    --kind: var(--kind-boost);
    --pack-h: 280px;
    --cut-y: 0.1;
    --cut-yl: 0.1;
    --cut-yr: 0.1;
    --cut-deg: 0deg;
    --cut-span: 100%;
    --sep-x: 0px;
    --sep-y: -20px;
    position: relative; width: min(100%, 200px); height: var(--pack-h); aspect-ratio: var(--card-ratio);
    touch-action: none; user-select: none; cursor: pointer;
    background: none; border: 0; box-shadow: none; overflow: visible;
}
.pack-open-card.pack-interact { --kind: var(--kind-perk); }
.pack-open-card.pack-gear { --kind: var(--kind-treat); }
.pack-open-card::after {
    content: ''; position: absolute; inset: 0; z-index: 6;
    border-radius: var(--r-sheet); border: 1px solid var(--line);
    box-shadow: 0 8px 16px rgb(var(--shadow-rgb) / 0.14);
    pointer-events: none;
}
.pack-open-card.split::after { opacity: 0; }
.pack-top, .pack-bot {
    position: absolute; inset: 0; overflow: hidden;
    background: var(--card); border: 0; box-shadow: none;
    transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}
.pack-top {
    z-index: 4; border-radius: var(--r-sheet) var(--r-sheet) 0 0;
    clip-path: polygon(0 0, 100% 0, 100% 10%, 0 10%);
}
.pack-bot {
    z-index: 3; border-radius: 0 0 var(--r-sheet) var(--r-sheet);
    clip-path: polygon(0 10%, 100% 10%, 100% 100%, 0 100%);
}
.pack-open-card.split .pack-top,
.pack-open-card.split .pack-bot {
    filter: drop-shadow(0 8px 14px rgb(var(--shadow-rgb) / 0.22));
}
.pack-open-card .art {
    position: absolute; inset: 0; width: 100%; height: 100%;
    display: grid; place-items: center;
    background: var(--surface);
    border: 0;
    overflow: hidden;
}
.pack-open-card .art::after {
    display: none;
}
.pack-open-card .art .mi,
.pack-open-card .art .material-icons {
    position: relative; z-index: 1;
    width: 68px; height: 68px; border-radius: 50%;
    display: grid; place-items: center;
    background: var(--surface);
    font-size: 34px; opacity: 1;
    box-shadow: 0 4px 12px rgb(var(--shadow-rgb) / 0.18), inset 0 0 0 1px color-mix(in srgb, var(--ink) 8%, transparent);
    transform: translateY(-24px);
}
.pack-open-card .nm {
    position: absolute; left: 0; right: 0; bottom: 32px; z-index: 2;
    padding: 0 12px;
    font-family: Impact, 'Arial Black', 'Haettenschweiler', sans-serif;
    font-size: 26px; font-weight: 400; line-height: 1.04;
    letter-spacing: 0.02em; text-transform: uppercase;
    white-space: normal;
    text-wrap: balance;
    text-align: center;
    color: var(--card);
    opacity: 1;
}
.pack-cut {
    position: absolute; left: 0; top: calc(var(--cut-yl, 0.1) * 100%);
    width: var(--cut-span, 100%); height: 3px; margin-top: -1.5px; z-index: 7;
    background: #fff; border-radius: 2px;
    box-shadow: 0 0 7px 1px #fff, 0 0 0 1px rgb(255 255 255 / 0.9);
    transform-origin: 0 50%;
    transform: rotate(var(--cut-deg, 0deg));
    clip-path: inset(0 calc((1 - var(--cut, 0)) * 100%) 0 0);
    pointer-events: none; opacity: 0;
}
.pack-slash {
    position: absolute; left: 0; top: 0; z-index: 40;
    width: 0; height: 3px; margin-top: -1.5px;
    background: #fff; border-radius: 2px;
    box-shadow: 0 0 8px 1px #fff, 0 0 0 1px rgb(255 255 255 / 0.85);
    transform-origin: 0 50%;
    pointer-events: none; opacity: 0;
}
.pack-slash.on { opacity: 1; }
.pack-slash.flash { animation: packCutFlash 0.24s ease-out forwards; }
.pack-ghost {
    position: absolute; z-index: 12; margin: 0; pointer-events: none;
}
.modal.shop.shop-pick.pick-landing { overflow: hidden; }
.modal.shop.shop-pick.pick-landing .pick-hand { pointer-events: none; }
.modal.shop.shop-pick.pick-landing .modal-head,
.modal.shop.shop-pick.pick-landing .pick-chip {
    animation: fadeIn 0.4s ease 0.12s both;
}
.pack-open-card.slash .pack-cut { opacity: 1; }
.pack-open-card.cut-rtl .pack-cut { clip-path: inset(0 0 0 calc((1 - var(--cut, 0)) * 100%)); }
.pack-open-card.slash .pack-cut { transition: clip-path 0.19s ease-out; }
.pack-open-card.cut-gone .pack-cut {
    animation: packCutFlash 0.24s ease-out forwards;
}
@keyframes packCutFlash {
    0%, 35% { opacity: 1; }
    100% { opacity: 0; }
}
.pack-open-card.slicing { cursor: grabbing; }
.pack-open-card.torn { pointer-events: none; }
.pack-open-card.split .pack-top,
.pack-open-card.split .pack-bot { transition: none; }
.pack-open-card.split .pack-top { animation: packHalfFallTop 0.62s cubic-bezier(0.22, 0.9, 0.45, 1) forwards; }
.pack-open-card.split .pack-bot { animation: packHalfFallBot 0.68s cubic-bezier(0.22, 0.9, 0.45, 1) forwards; }
@keyframes packHalfFallTop {
    0% { transform: translate(0, 0) rotate(0deg); opacity: 1; }
    24% { transform: translate(-10px, -24px) rotate(-6deg); opacity: 1; }
    100% { transform: translate(-36px, -68px) rotate(-18deg); opacity: 0; }
}
@keyframes packHalfFallBot {
    0% { transform: translate(0, 0) rotate(0deg); opacity: 1; }
    24% { transform: translate(8px, 16px) rotate(4deg); opacity: 1; }
    100% { transform: translate(32px, 96px) rotate(14deg); opacity: 0; }
}
.modal.shop.shop-seal { overflow: visible; touch-action: none; user-select: none; }
.pack-fly {
    position: absolute; left: 50%; top: 50%;
    z-index: 8; width: 0; height: 0;
    pointer-events: none;
}
.pack-reveal { position: relative; }
.modal.shop.shop-seal.washing .pack-reveal::after {
    content: ''; position: absolute; inset: -4px -4px -8px; z-index: 20;
    background: var(--card); pointer-events: none;
    animation: packWash 0.32s ease forwards;
}
@keyframes packWash { from { opacity: 0; } to { opacity: 1; } }
.modal.shop.shop-seal .pack-open .sub { margin: 4px 0 0; }
.pack-hint { text-align: center; max-width: 16em; }
.modal.shop.shop-pick {
    display: flex; flex-direction: column; overflow: hidden;
    height: auto; max-height: min(88dvh, 720px);
}
.modal.shop.shop-pick .shop-fade {
    flex: 1; min-height: 0; display: flex; flex-direction: column;
}
.modal.shop.shop-pick.picked-lock { overflow: visible; }
.modal.shop.shop-pick .modal-head { margin: 0 0 8px; align-items: flex-start; }
.modal.shop.shop-seal .modal-head { align-items: center; }
.pick-head-copy {
    display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
    min-width: 0; flex: 1;
}
.pick-head-copy h2 { margin: 0; }
.pick-head-tools { display: flex; align-items: center; gap: 8px; flex: none; }
.pick-hint { margin: 0; }
.shop-skip {
    flex: none; display: inline-flex; align-items: center; gap: 2px;
    margin: 0; padding: 6px 10px 6px 8px; font-size: 13px; font-weight: 800;
}
.shop-skip .material-icons { font-size: 18px; color: inherit; }
.pick-chip {
    display: inline-flex; align-items: center; gap: 6px; flex: none;
    max-width: 100%; margin: 0 0 8px; padding: 4px 10px 4px 6px;
    border-radius: 999px; border: 1px solid var(--line);
    background: color-mix(in srgb, var(--accent) 10%, var(--surface));
    color: var(--ink-dim); font-size: 11px; font-weight: 800; line-height: 1.2;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pick-chip .material-icons { font-size: 16px; color: var(--accent); }
.pick-chip.weather { background: color-mix(in srgb, var(--water) 10%, var(--surface)); }
.pick-chip.weather .material-icons { color: var(--water); }
.pick-hand, .pick-list {
    flex: 0 1 auto; min-height: 0;
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: auto;
    align-content: center; align-items: start;
    gap: 10px; padding: 2px 2px 6px;
    overflow-y: auto;
}
.pick-tile, .pick-row {
    --hold: 0%;
    --kind: var(--ink-dim);
    position: relative;
    display: flex; flex-direction: column; align-items: center;
    width: 100%; min-width: 0; height: auto; aspect-ratio: var(--card-ratio); min-height: 0;
    padding: 0 0 6px; border-radius: var(--r-sheet);
    background: var(--card); border: 2px solid var(--line);
    box-shadow: var(--shadow-1);
    cursor: pointer; touch-action: manipulation;
    -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
    overflow: hidden; text-align: center;
    transition: box-shadow 0.18s ease, opacity 0.28s ease;
}
.pick-tile .nm { margin: auto 0 0; }
.pick-tile .pick-pay { min-height: 0; margin: 3px 0 auto; }
.pick-tile .pick-pay:empty { display: none; margin: 0; }
.pick-tile:has(.pick-pay:empty) .nm { margin: auto 0; }
.pick-hero-wrap {
    position: relative; flex: none; width: 100%; aspect-ratio: var(--card-art-ratio); min-height: 0;
    margin: 0 0 4px;
}
.pick-tile.armed .pick-hero-wrap, .pick-row.armed .pick-hero-wrap { min-height: 0; }
.pick-hero {
    width: 100%; height: 100%; min-height: 0;
    display: grid; place-items: center;
    border-radius: 0;
    background: color-mix(in srgb, var(--kind) 16%, var(--card));
    border-bottom: 1px solid color-mix(in srgb, var(--ink) 7%, transparent);
    color: var(--kind);
}
.pick-hero-wrap > small,
.shop-flow .offer .tp,
.shop-grid .offer .tp,
.shop-float .offer .tp {
    display: none;
}

/* Living nebulous liquid holographic shift (layered radial blobs drifting asynchronously) */
@keyframes holoLiquid {
    0%   { background-position: 0% 50%, 10% 15%, 85% 80%, 50% 20%, 0% 50%; }
    25%  { background-position: 0% 50%, 88% 30%, 20% 90%, 15% 65%, 0% 50%; }
    50%  { background-position: 0% 50%, 70% 92%, 12% 18%, 90% 45%, 0% 50%; }
    75%  { background-position: 0% 50%, 18% 72%, 82% 12%, 45% 95%, 0% 50%; }
    100% { background-position: 0% 50%, 10% 15%, 85% 80%, 50% 20%, 0% 50%; }
}
@keyframes holoDogEar {
    0%   { background-position: 10% 15%, 90% 85%, 50% 20%, 0% 50%; }
    33%  { background-position: 92% 35%, 15% 75%, 80% 90%, 0% 50%; }
    66%  { background-position: 25% 92%, 85% 15%, 10% 45%, 0% 50%; }
    100% { background-position: 10% 15%, 90% 85%, 50% 20%, 0% 50%; }
}

/* Upper-right dog-ear corner slices on normal cards:
   - Combo (.boost): animated blue holo + level badge
   - Item rarities (.rar-*): dog-ear on front; switches to full top rarity slice bar when detail (.is-info) is open */
:is(.pick-tile, .offer:not(.lib-min):not(.pack):not(.theme-showcase):not(.empty)):is(.boost, .rar-common, .rar-uncommon, .rar-rare, .rar-gold, .rar-pearl)::before {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 44px; height: 44px;
    z-index: 3;
    pointer-events: none;
    clip-path: polygon(0 0, 100% 0, 100% 100%);
    filter: drop-shadow(-1px 1px 1px rgb(var(--shadow-rgb) / 0.16));
}
:is(.pick-tile, .offer:not(.lib-min):not(.pack):not(.theme-showcase):not(.empty)):is(.boost, .rar-common, .rar-uncommon, .rar-rare, .rar-gold, .rar-pearl)::after {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 44px; height: 44px;
    z-index: 3;
    pointer-events: none;
    background: linear-gradient(45deg, transparent calc(50% - 0.6px), color-mix(in srgb, var(--ink) 16%, transparent) 50%, transparent calc(50% + 0.6px));
}
:is(.pick-tile, .offer).is-info::before,
:is(.pick-tile, .offer).is-info::after,
:is(.pick-tile, .offer).is-info > .dog-ear-lv {
    display: none;
}
.dog-ear-lv {
    position: absolute;
    top: 6px; left: 6px; right: auto;
    z-index: 4;
    min-width: 20px; height: 20px; padding: 0 5px;
    border-radius: 999px;
    display: inline-grid; place-items: center;
    background: rgb(255 255 255 / 0.94);
    color: #1d4ed8;
    border: 1px solid color-mix(in srgb, #1d4ed8 22%, transparent);
    font-size: 10.5px; font-weight: 900; line-height: 1;
    font-variant-numeric: tabular-nums;
    box-shadow: 0 1px 3px rgb(0 0 0 / 0.14);
    pointer-events: none;
}
.shop-grid .offer:not(.lib-min):not(.pack):not(.theme-showcase):not(.empty):is(.boost, .rar-common, .rar-uncommon, .rar-rare, .rar-gold, .rar-pearl)::before,
.shop-grid .offer:not(.lib-min):not(.pack):not(.theme-showcase):not(.empty):is(.boost, .rar-common, .rar-uncommon, .rar-rare, .rar-gold, .rar-pearl)::after {
    width: 26px; height: 26px;
    border-top-right-radius: calc(var(--r-sheet) - 2px);
}
.shop-grid .offer .dog-ear-lv {
    top: 2px; right: 2px; left: auto;
    min-width: 14px; width: 14px; height: 14px; padding: 0; border: 0;
    font-size: 8px;
}
:is(.pick-tile, .offer:not(.lib-min):not(.pack):not(.theme-showcase):not(.empty)).boost::before,
.boost > .card-rar-bar {
    background-image:
        radial-gradient(circle at 50% 50%, #a5f3fc 0%, transparent 56%),
        radial-gradient(circle at 50% 50%, #a78bfa 0%, transparent 60%),
        radial-gradient(circle at 50% 50%, #38bdf8 0%, transparent 58%),
        linear-gradient(135deg, #1d4ed8, #2563eb, #0284c7);
    background-size: 210% 210%, 240% 240%, 190% 190%, 100% 100%;
    animation: holoDogEar 11.5s ease-in-out infinite;
    animation-delay: var(--holo-delay, 0s);
}
.boost > .card-rar-bar {
    color: #eff6ff;
    text-shadow: 0 1px 2px rgb(0 0 0 / 0.25);
}
:is(.pick-tile, .offer:not(.lib-min):not(.pack):not(.theme-showcase):not(.empty)).rar-common::before {
    clip-path: none;
    filter: none;
    background: none;
}
:is(.pick-tile, .offer:not(.lib-min):not(.pack):not(.theme-showcase):not(.empty)).rar-uncommon::before,
.rar-uncommon > .card-rar-bar {
    background: color-mix(in srgb, var(--good) 22%, var(--surface));
}
:is(.pick-tile, .offer:not(.lib-min):not(.pack):not(.theme-showcase):not(.empty)).rar-rare::before,
.rar-rare > .card-rar-bar {
    background-image:
        radial-gradient(circle at 50% 50%, #a7f3d0 0%, transparent 56%),
        radial-gradient(circle at 50% 50%, #2dd4bf 0%, transparent 60%),
        radial-gradient(circle at 50% 50%, #6ee7b7 0%, transparent 58%),
        linear-gradient(135deg, #065f46, #047857, #0f766e);
    background-size: 220% 220%, 250% 250%, 200% 200%, 100% 100%;
    animation: holoDogEar 12.5s ease-in-out infinite;
    animation-delay: var(--holo-delay, 0s);
}
:is(.pick-tile, .offer:not(.lib-min):not(.pack):not(.theme-showcase):not(.empty)).rar-gold::before,
.rar-gold > .card-rar-bar {
    background-image:
        radial-gradient(circle at 50% 50%, #fefce8 0%, transparent 56%),
        radial-gradient(circle at 50% 50%, #fcd34d 0%, transparent 60%),
        radial-gradient(circle at 50% 50%, #fef08a 0%, transparent 58%),
        linear-gradient(135deg, #fde68a, #fbbf24, #fef08a);
    background-size: 220% 220%, 250% 250%, 200% 200%, 100% 100%;
    animation: holoDogEar 12s ease-in-out infinite;
    animation-delay: var(--holo-delay, 0s);
}
:is(.pick-tile, .offer:not(.lib-min):not(.pack):not(.theme-showcase):not(.empty)).rar-pearl::before,
.rar-pearl > .card-rar-bar,
:is(.pick-tile, .offer:not(.lib-min):not(.pack):not(.theme-showcase):not(.empty)).rar-pearl {
    background-image:
        radial-gradient(circle at 50% 50%, #fbcfe8 0%, transparent 56%),
        radial-gradient(circle at 50% 50%, #bae6fd 0%, transparent 58%),
        radial-gradient(circle at 50% 50%, #ddd6fe 0%, transparent 58%),
        radial-gradient(circle at 50% 50%, #bbf7d0 0%, transparent 56%),
        linear-gradient(135deg, #fff7ed 0%, #f5d0fe 35%, #cffafe 70%, #fef3c7 100%);
    background-size: 230% 230%, 250% 250%, 210% 210%, 240% 240%, 100% 100%;
    animation: holoDogEar 10.5s ease-in-out infinite;
    animation-delay: var(--holo-delay, 0s);
}

/* Full-width top rarity slice bar — revealed when detail/info view (.is-info) is opened */
.card-rar-bar {
    display: none;
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 44px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    text-transform: uppercase;
    line-height: 1;
    border-bottom: 1px solid color-mix(in srgb, var(--ink) 14%, transparent);
    z-index: 8;
    pointer-events: none;
}
.crb-kind {
    font-size: 12.5px;
    font-weight: 900;
    letter-spacing: 0.06em;
    line-height: 1;
}
.crb-rar {
    font-size: 8.5px;
    font-weight: 800;
    letter-spacing: 0.1em;
    line-height: 1;
    opacity: 0.82;
}
.is-info > .card-rar-bar {
    display: flex;
}
.rar-common > .card-rar-bar {
    background: transparent;
    color: var(--ink-dim);
}
.rar-uncommon > .card-rar-bar {
    color: var(--good);
}
.rar-rare > .card-rar-bar {
    color: #ecfdf5;
    text-shadow: 0 1px 2px rgb(0 0 0 / 0.25);
}
.rar-gold > .card-rar-bar {
    color: #78350f;
}
.rar-pearl > .card-rar-bar {
    color: #312e81;
}
:is(.pick-tile, .offer:not(.lib-min):not(.pack):not(.theme-showcase):not(.empty)).rar-pearl .nm {
    color: #1e1b4b;
}

/* Care cards: subtle tightly-knit diagonal (+) designer grid background, clean hairline */
.pick-tile.care .pick-hero,
.pick-tile.boost .pick-hero {
    position: relative;
}
.pick-tile.care .pick-hero > *,
.pick-tile.boost .pick-hero > * {
    position: relative;
    z-index: 1;
}
.pick-tile.care .pick-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: color-mix(in srgb, var(--kind) 7%, transparent);
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath d='M3.5 1.5v4M1.5 3.5h4M10.5 8.5v4M8.5 10.5h4' stroke='%23000' stroke-width='0.9' stroke-linecap='round'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath d='M3.5 1.5v4M1.5 3.5h4M10.5 8.5v4M8.5 10.5h4' stroke='%23000' stroke-width='0.9' stroke-linecap='round'/%3E%3C/svg%3E");
    -webkit-mask-size: 14px 14px;
    mask-size: 14px 14px;
}

/* Combo cards: 1:1 scale lattice of combo circles aligned directly under the featured combo steps */
.pick-tile.boost .pick-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: color-mix(in srgb, var(--points) 13%, transparent);
    -webkit-mask-position: center;
    mask-position: center;
    /* Default / 2-step: straight 44×44 grid of 30px circles (featured circles at ±22px from center) */
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='44' viewBox='0 0 44 44'%3E%3Cg fill='none' stroke='%23000' stroke-width='1.8'%3E%3Ccircle cx='0' cy='22' r='14'/%3E%3Ccircle cx='44' cy='22' r='14'/%3E%3C/g%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='44' viewBox='0 0 44 44'%3E%3Cg fill='none' stroke='%23000' stroke-width='1.8'%3E%3Ccircle cx='0' cy='22' r='14'/%3E%3Ccircle cx='44' cy='22' r='14'/%3E%3C/g%3E%3C/svg%3E");
    -webkit-mask-size: 44px 44px;
    mask-size: 44px 44px;
}
/* 3-step: diagonal 114×42 lattice of 28px circles matching exact (-38,+14), (0,0), (+38,-14) centers */
.pick-tile.boost .pick-hero:has(.combo-steps[data-n="3"])::after {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='114' height='42' viewBox='0 0 114 42'%3E%3Cg fill='none' stroke='%23000' stroke-width='1.8'%3E%3Ccircle cx='57' cy='21' r='13'/%3E%3Ccircle cx='19' cy='35' r='13'/%3E%3Ccircle cx='19' cy='-7' r='13'/%3E%3Ccircle cx='95' cy='7' r='13'/%3E%3Ccircle cx='95' cy='49' r='13'/%3E%3C/g%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='114' height='42' viewBox='0 0 114 42'%3E%3Cg fill='none' stroke='%23000' stroke-width='1.8'%3E%3Ccircle cx='57' cy='21' r='13'/%3E%3Ccircle cx='19' cy='35' r='13'/%3E%3Ccircle cx='19' cy='-7' r='13'/%3E%3Ccircle cx='95' cy='7' r='13'/%3E%3Ccircle cx='95' cy='49' r='13'/%3E%3C/g%3E%3C/svg%3E");
    -webkit-mask-size: 114px 42px;
    mask-size: 114px 42px;
}
/* 4-step: staggered 66×36 diamond grid of 26px circles matching exact (±16.5, ±9) & (±49.5, ∓9) centers */
.pick-tile.boost .pick-hero:has(.combo-steps[data-n="4"])::after {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='66' height='36' viewBox='0 0 66 36'%3E%3Cg fill='none' stroke='%23000' stroke-width='1.8'%3E%3Ccircle cx='16.5' cy='9' r='12'/%3E%3Ccircle cx='16.5' cy='45' r='12'/%3E%3Ccircle cx='49.5' cy='27' r='12'/%3E%3Ccircle cx='49.5' cy='-9' r='12'/%3E%3C/g%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='66' height='36' viewBox='0 0 66 36'%3E%3Cg fill='none' stroke='%23000' stroke-width='1.8'%3E%3Ccircle cx='16.5' cy='9' r='12'/%3E%3Ccircle cx='16.5' cy='45' r='12'/%3E%3Ccircle cx='49.5' cy='27' r='12'/%3E%3Ccircle cx='49.5' cy='-9' r='12'/%3E%3C/g%3E%3C/svg%3E");
    -webkit-mask-size: 66px 36px;
    mask-size: 66px 36px;
}

/* Desynchronize holographic phases and durations across sibling cards */
:is(.pick-tile, .offer):nth-child(5n+1) { --holo-delay: -1.7s; }
:is(.pick-tile, .offer):nth-child(5n+2) { --holo-delay: -4.9s; }
:is(.pick-tile, .offer):nth-child(5n+3) { --holo-delay: -8.3s; }
:is(.pick-tile, .offer):nth-child(5n+4) { --holo-delay: -11.1s; }
:is(.pick-tile, .offer):nth-child(5n+5) { --holo-delay: -6.4s; }
:is(.pick-tile, .offer):nth-child(3n+2):is(.boost, .rar-rare, .rar-gold, .rar-pearl)::before,
:is(.pick-tile, .offer):nth-child(3n+2):is(.boost, .rar-rare, .rar-gold, .rar-pearl) > .card-rar-bar,
:is(.pick-tile, .offer):nth-child(3n+2).rar-pearl { animation-duration: 13.8s; }
:is(.pick-tile, .offer):nth-child(3n+3):is(.boost, .rar-rare, .rar-gold, .rar-pearl)::before,
:is(.pick-tile, .offer):nth-child(3n+3):is(.boost, .rar-rare, .rar-gold, .rar-pearl) > .card-rar-bar,
:is(.pick-tile, .offer):nth-child(3n+3).rar-pearl { animation-duration: 9.7s; }
:is(.pick-tile, .offer):nth-child(2n):is(.boost, .rar-rare, .rar-gold, .rar-pearl)::before,
:is(.pick-tile, .offer):nth-child(2n):is(.boost, .rar-rare, .rar-gold, .rar-pearl) > .card-rar-bar,
:is(.pick-tile, .offer):nth-child(2n).rar-pearl { animation-direction: alternate-reverse; }

@media (prefers-reduced-motion: reduce) {
    :is(.pick-tile, .offer):is(.boost, .rar-rare, .rar-gold, .rar-pearl)::before,
    :is(.pick-tile, .offer):is(.boost, .rar-rare, .rar-gold, .rar-pearl) > .card-rar-bar,
    :is(.pick-tile, .offer).rar-pearl {
        animation: none;
    }
}
.pick-tile .nm {
    flex: none; margin: 2px 0 0; max-width: 100%; padding: 0 8px;
    font-size: 13px; font-weight: 900; color: var(--ink); line-height: 1.15;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden;
}
.pick-hero .combo-steps {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    padding: 0;
    gap: 0;
    color: var(--kind, var(--points));
}
.pick-hero .combo-thread {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: visible;
    pointer-events: none;
}
.pick-hero .combo-thread polyline {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.pick-hero .combo-step {
    position: relative;
    z-index: 1;
    flex: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--card);
    border: 2px solid var(--kind, var(--points));
    box-shadow: var(--shadow-1);
}
.pick-hero .combo-step .mi { font-size: 16px; color: var(--c, var(--ink)) !important; }
.pick-hero .combo-steps[data-n="2"] { width: 74px; height: 30px; }
.pick-hero .combo-steps[data-n="2"] .combo-step { width: 30px; height: 30px; }
.pick-hero .combo-steps[data-n="3"] { width: 104px; height: 56px; }
.pick-hero .combo-steps[data-n="3"] .combo-step { width: 28px; height: 28px; }
.pick-hero .combo-steps[data-n="3"] .combo-step:nth-of-type(1) { transform: translateY(14px); }
.pick-hero .combo-steps[data-n="3"] .combo-step:nth-of-type(2) { transform: translateY(0); }
.pick-hero .combo-steps[data-n="3"] .combo-step:nth-of-type(3) { transform: translateY(-14px); }
.pick-hero .combo-steps[data-n="4"] { width: 125px; height: 44px; }
.pick-hero .combo-steps[data-n="4"] .combo-step { width: 26px; height: 26px; }
.pick-hero .combo-steps[data-n="4"] .combo-step .mi { font-size: 15px; }
.pick-hero .combo-steps[data-n="4"] .combo-step:nth-of-type(odd) { transform: translateY(9px); }
.pick-hero .combo-steps[data-n="4"] .combo-step:nth-of-type(even) { transform: translateY(-9px); }
.pick-hero .pick-care {
    width: auto; height: auto; background: none;
}
.pick-hero .pick-care .mi,
.pick-hero > .mi, .pick-hero > .material-icons {
    font-size: 36px; color: var(--kind) !important;
}
.pick-hero img { width: 52px; height: 52px; object-fit: contain; }
.pick-care {
    width: 36px; height: 36px; display: grid; place-items: center;
    border-radius: 50%; background: var(--c, var(--ink));
}
.pick-care .mi { font-size: 20px; color: var(--on-color) !important; }
.pick-buff {
    display: inline-flex; align-items: center; justify-content: center; gap: 5px;
}
.pick-buff-ic {
    display: inline-grid; place-items: center;
}
.pick-buff-ic .mi {
    font-size: 32px; color: var(--c, var(--kind)) !important;
}
.pick-buff-pill {
    display: inline-flex; align-items: center; gap: 1px;
    padding: 3px 7px 3px 4px; border-radius: var(--r-pill);
    background: var(--c, var(--kind)); color: var(--on-color);
    font-size: 12px; font-weight: 900; line-height: 1;
    font-variant-numeric: tabular-nums;
    box-shadow: 0 2px 6px rgb(var(--shadow-rgb) / 0.18);
}
.pick-buff-pill .mi {
    font-size: 14px !important; color: var(--on-color) !important;
}
.shop-flow .offer .art .pick-buff-ic .mi { font-size: 26px; }
.shop-flow .offer .art .pick-buff-pill { font-size: 11px; padding: 2px 6px 2px 3px; }
.shop-flow .offer .art .pick-buff-pill .mi { font-size: 12px !important; }
.pick-super {
    width: 68px; height: 68px; border-radius: 50%;
    background: var(--c, var(--kind)); color: var(--on-color);
    display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    box-shadow: 0 3px 10px rgb(var(--shadow-rgb) / 0.22);
}
.pick-super-icons {
    display: inline-flex; align-items: center; justify-content: center; gap: 1px;
}
.pick-super-icons .mi {
    font-size: 21px !important; color: var(--on-color) !important; line-height: 1;
}
.pick-super-icons .mi:nth-child(2) { opacity: 0.7; }
.pick-super-mult {
    font-size: 12px; font-weight: 900; line-height: 1;
    color: var(--on-color); font-variant-numeric: tabular-nums;
}
.shop-flow .offer .art .pick-super { width: 62px; height: 62px; gap: 2px; }
.shop-flow .offer .art .pick-super-icons .mi { font-size: 18px !important; }
.shop-flow .offer .art .pick-super-mult { font-size: 11px; }
.pick-buff.is-patience {
    flex-direction: column; gap: 5px;
}
.pick-pat-pill { padding: 5px 8px; }
.pat-dots {
    display: inline-flex; align-items: center; gap: 3px;
}
.pat-dot {
    display: block; width: 11px; height: 5px; border-radius: var(--r-pill);
    background: currentColor;
}
.pick-fx-chip .pat-dots { gap: 2px; margin-left: 2px; }
.pick-fx-chip .pat-dot { width: 8px; height: 4px; }
.pick-fill {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
    width: 100%; padding: 0 12px;
}
.pick-fill-ic .mi {
    font-size: 30px !important; color: var(--c, var(--kind)) !important; line-height: 1;
}
.pick-fill-meter {
    width: 100%; max-width: 78px;
}
.pick-fill-meter .meter {
    display: block; height: 6px; width: 100%;
    border-radius: var(--r-pill); background: var(--track);
    position: relative; overflow: hidden;
}
.pick-fill-meter .meter i {
    position: absolute; top: 0; bottom: 0; left: 0; border-radius: 0;
}
.pick-fill-meter .meter i:first-child:last-child {
    border-radius: var(--r-pill);
}
.pick-fill-meter .meter i.ghost-up {
    border-radius: 0 var(--r-pill) var(--r-pill) 0;
    background: repeating-linear-gradient(-45deg, color-mix(in srgb, var(--c) 82%, transparent) 0 2px, color-mix(in srgb, var(--c) 26%, transparent) 2px 4px);
}
.pick-fill-amt {
    font-size: 13px; font-weight: 900; line-height: 1;
    color: var(--c, var(--kind)); font-variant-numeric: tabular-nums;
}
.shop-flow .offer .art .pick-fill { gap: 4px; padding: 0 10px; }
.shop-flow .offer .art .pick-fill-ic .mi { font-size: 26px !important; }
.shop-flow .offer .art .pick-fill-amt { font-size: 12px; }
.pick-item-hero {
    display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px;
    width: 100%; height: 100%; padding: 6px 6px 11px;
}
.pick-item-art {
    flex: 1 1 auto; display: grid; place-items: center;
}
.pick-item-art img { width: 34px !important; height: 34px !important; object-fit: contain; }
.pick-item-art .mi, .pick-item-art .material-icons { font-size: 26px !important; line-height: 1; }
.pick-meter-pills {
    display: flex; flex-direction: column; align-items: stretch; gap: 3px;
    width: 100%; max-width: 118px;
}
.pick-meter-pill {
    display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: 3px;
    padding: 2px 6px; border-radius: var(--r-pill);
    background: var(--card); border: 1px solid color-mix(in srgb, var(--c) 32%, var(--line));
    box-shadow: var(--shadow-1);
}
.pick-meter-pill .pmp-val {
    font-size: 10px; font-weight: 900; line-height: 1;
    color: var(--c); font-variant-numeric: tabular-nums; white-space: nowrap;
}
.pick-meter-pill.is-down .pmp-val { color: var(--bad); }
.pick-meter-pill .pmp-ic {
    display: inline-grid; place-items: center;
}
.pick-meter-pill .pmp-ic .mi {
    font-size: 12px !important; color: var(--c) !important; line-height: 1;
}
.pick-meter-pill .meter {
    display: block; height: 5px; width: 100%; min-width: 26px;
    border-radius: var(--r-pill); background: var(--track);
    position: relative; overflow: hidden;
}
.pick-meter-pill .meter i {
    position: absolute; top: 0; bottom: 0; left: 0; border-radius: 0;
}
.pick-meter-pill .meter i:first-child:last-child {
    border-radius: var(--r-pill);
}
.pick-meter-pill .meter i.ghost-up {
    border-radius: 0 var(--r-pill) var(--r-pill) 0;
    background: repeating-linear-gradient(-45deg, color-mix(in srgb, var(--c) 82%, transparent) 0 2px, color-mix(in srgb, var(--c) 26%, transparent) 2px 4px);
}
.pick-meter-pill .meter i.ghost-down {
    border-radius: 0 var(--r-pill) var(--r-pill) 0;
    background: var(--loss);
}
.pick-cap {
    display: inline-flex; align-items: center; justify-content: center; gap: 3px;
    color: var(--gold, var(--warn));
}
.pick-cap-ic {
    display: inline-grid; place-items: center;
}
.pick-cap-ic .mi, .pick-cap-ic .material-icons {
    font-size: 32px !important; line-height: 1;
}
.pick-cap-val {
    font-size: 20px; font-weight: 900; line-height: 1;
    color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: -0.02em;
}
.pick-fx-hero {
    display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px;
    width: 100%; height: 100%; padding: 6px 6px 11px;
}
.pick-fx-art {
    flex: 1 1 auto; display: grid; place-items: center;
}
.pick-fx-art img { width: 38px !important; height: 38px !important; object-fit: contain; }
.pick-fx-art .mi, .pick-fx-art .material-icons { font-size: 32px !important; line-height: 1; }
.pick-fx-chips {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 3px;
    width: 100%;
}
.pick-fx-chip {
    display: inline-flex; align-items: center; justify-content: center; gap: 2px;
    padding: 2px 6px; border-radius: var(--r-pill);
    background: var(--card); color: var(--c, var(--ink));
    border: 1px solid color-mix(in srgb, var(--c, var(--ink)) 30%, var(--line));
    font-size: 10px; font-weight: 900; line-height: 1.1;
    font-variant-numeric: tabular-nums; white-space: nowrap;
    box-shadow: var(--shadow-1);
}
.pick-fx-chip.is-solid {
    background: var(--c, var(--accent)); color: var(--on-color); border-color: transparent;
}
.pick-fx-chip .mi {
    font-size: 12px !important; line-height: 1; color: inherit !important;
}
.pick-fx-chip small { font-size: 9px; opacity: 0.85; font-weight: 800; }
.pick-fx-chip .fx-beads {
    display: inline-flex; align-items: center; gap: 2px; margin-left: 1px;
}
.pick-fx-chip .fx-bead {
    display: block; width: 7px; height: 4px; border-radius: var(--r-pill);
    background: currentColor; opacity: 0.9;
}
.pick-pay:empty { display: none; }
.pick-pay {
    flex: none; min-height: 22px; margin-top: 2px; padding: 0 8px;
    display: flex; align-items: center; justify-content: center;
}
.pick-pay .stat-stack-face { transform: scale(0.92); transform-origin: center; }
.pick-foot {
    flex: none; width: 100%; padding: 0 8px;
    display: flex; flex-direction: column; justify-content: flex-end; gap: 4px;
    max-height: 0; margin: 0; overflow: hidden;
    opacity: 0; pointer-events: none;
    transition: max-height 0.2s ease, margin 0.2s ease, opacity 0.16s ease;
}
.pick-tile.armed .pick-foot, .pick-row.armed .pick-foot {
    max-height: 72px; margin-top: 6px;
    opacity: 1; pointer-events: auto;
}
.pick-note {
    margin: 0; min-height: 0;
    font-size: 10px; font-weight: 700; line-height: 1.3; color: var(--ink-dim);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pick-note:empty { display: none; }
.pick-row::after {
    content: ''; position: absolute; inset: -2px; border-radius: inherit; pointer-events: none;
    padding: 2px;
    background: linear-gradient(90deg, #fde68a, var(--gold) 55%, #d97706) 0 0 / var(--hold) 100% no-repeat;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
}
.pick-row.holding { touch-action: none; }
.pick-row.locked, .pick-row.chosen { --hold: 100%; cursor: default; }
.pick-row.chosen {
    z-index: 3;
    box-shadow: 0 8px 22px rgb(var(--shadow-rgb) / 0.2);
    animation: pickLockGrow 1s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes pickLockGrow {
    0% { transform: scale(1); }
    16% { transform: scale(1.07); }
    100% { transform: scale(1.07); }
}
.pick-hand.picked, .pick-list.picked {
    display: flex; align-items: center; justify-content: center;
    overflow: visible; min-height: 0;
}
.pick-hand.picked .pick-tile.chosen, .pick-list.picked .pick-row.chosen {
    width: min(156px, 70%); height: auto; min-height: 176px; overflow: visible;
}
.pick-hand.picked .pick-tile:not(.chosen), .pick-list.picked .pick-row:not(.chosen) {
    display: none;
}
.pick-top {
    display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 10px; align-items: center;
}
.pick-tag {
    flex: none; height: 16px; display: grid; place-items: center;
    background: var(--points); color: var(--on-color);
    font-size: 9px; font-weight: 1000; letter-spacing: 0.02em; line-height: 1;
}
.pick-tag.is-new { background: var(--accent); }
.pick-ic { flex: 1; display: grid; place-items: center; min-height: 0; }
.pick-row.armed, .pick-tile.armed {
    z-index: 2;
    box-shadow: 0 10px 20px rgb(var(--shadow-rgb) / 0.16);
}
.pick-slice {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    flex: none; width: 100%;
    margin: 0; padding: 0; border: 0; background: none;
}
.pick-row.chosen .pick-slice, .pick-tile.chosen .pick-slice,
.pick-row.chosen .pick-note, .pick-tile.chosen .pick-note { opacity: 0; pointer-events: none; }
.pick-slice .btn { flex: 1; min-width: 0; padding: 5px 6px; }
.pick-row .offer-confirm { margin-top: 6px; padding-bottom: 2px; }
.pick-act .offer-confirm, .pick-act {
    display: flex; flex-direction: column; align-items: flex-end; justify-content: center; gap: 6px;
}
.pick-act .oc-cancel, .pick-act .oc-pay { width: auto; min-width: 64px; }
.pick-act { display: flex; flex-direction: column; align-items: flex-end; justify-content: center; min-width: 52px; }
.pick-delta { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; line-height: 1.05; }
.pick-delta small {
    font-size: 9px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-dim);
}
.pick-delta b { font-size: 15px; font-weight: 1000; font-variant-numeric: tabular-nums; color: var(--ink); white-space: nowrap; }
.pick-stat {
    display: inline-flex; align-items: baseline; gap: 1px;
    color: inherit; font-size: 16px; font-weight: 1000; font-variant-numeric: tabular-nums;
}
#pick-stat.odo { height: 1em; }
.shop-forecast {
    display: flex; align-items: center; gap: 10px; margin: -14px -14px 12px; padding: 11px 14px; text-align: left;
    border-radius: var(--r-sheet) var(--r-sheet) 0 0; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--accent) 8%, var(--card));
}
.shop-forecast.weather { background: color-mix(in srgb, var(--water) 9%, var(--card)); }
.sf-ic { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; color: var(--on-color); background: var(--accent); }
.shop-forecast.weather .sf-ic { background: var(--water-fill); }
.sf-ic .material-icons { font-size: 21px; }
.sf-head { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; line-height: 1.2; }
.sf-label { font-size: 13px; font-weight: 700; color: var(--ink-dim); }
.shop-forecast b { font-size: 14px; font-weight: 900; }
.sf-boss-badge {
    display: inline-flex; align-items: center; padding: 2px 6px; border-radius: var(--r-pill);
    background: var(--bad-fill, var(--bad)); color: var(--on-color);
    font-size: 9px; font-weight: 900; letter-spacing: 0.06em; text-transform: uppercase; line-height: 1;
}
.shop-forecast p { margin: 2px 0 0; font-size: 11.5px; font-weight: 700; color: var(--ink-dim); line-height: 1.3; }
.offer-seq, .pi-seq { display: inline-flex; align-items: center; flex-wrap: wrap; justify-content: center; gap: 1px; }
.offer .art .offer-seq .mi { font-size: 17px; }
.seq-arrow { font-style: normal; font-weight: 900; color: var(--ink-dim); font-size: 12px; }
.owned-charms { display: flex; flex-direction: column; gap: 5px; }
.owned-charm { display: flex; align-items: center; gap: 9px; padding: 6px 6px 6px 8px; border-radius: var(--r-card); background: var(--surface); border: 1px solid var(--line); }
.oc-name { flex: 1; font-size: 13px; font-weight: 900; }
.fp-pill .material-icons { display: none; }
button:disabled .coin, button:disabled .fp-pill { opacity: 0.45; }
.btn.oc-pay {
    display: inline-flex; align-items: center; justify-content: center; gap: 5px;
    padding: 6px 12px; min-height: 34px; border-radius: var(--r-card);
    font-size: 13px; font-weight: 800; line-height: 1.2;
}
.btn.oc-pay:has(.coin) {
    padding: 3px 3px 3px 11px; min-height: 0; border-radius: var(--r-pill); font-weight: 900; line-height: 1;
}
.btn.oc-pay .coin { flex: none; }
.shop-flow.confirming { cursor: default; }
.shop-flow .offer.picking {
    cursor: default;
    box-shadow: 0 12px 22px rgb(var(--shadow-rgb) / 0.22);
}
.deal-over {
    position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; padding: 16px;
    background: rgb(15 23 42 / 0.28); backdrop-filter: blur(2px); animation: fadeIn 0.15s ease;
}
.deal-sheet, .modal.deal-sheet {
    width: 214px; max-width: 100%; padding: 0; overflow: visible;
    background: transparent; border: 0; box-shadow: none;
    display: flex; flex-direction: column; align-items: stretch;
}
.modal.deal-sheet { animation: pop 0.18s ease-out; }
.deal-sheet .offer, .modal.deal-sheet .offer {
    position: relative; left: auto; top: auto; width: 188px; min-height: 246px; margin: 0;
    padding: 10px 12px; gap: 5px; border-radius: var(--r-sheet);
    background: var(--card); border: 1px solid var(--line);
    display: flex; flex-direction: column; align-items: center; text-align: center;
    box-shadow: 0 14px 28px rgb(var(--shadow-rgb) / 0.26);
    transform: none;
}
.deal-sheet .offer .nm { font-size: 15px; }
.deal-sheet .offer .art-wrap { position: relative; width: 108px; flex: none; margin: 2px 0 12px; }
.deal-sheet .offer .art { width: 108px; height: 108px; aspect-ratio: 1 / 1; flex: none; border-radius: var(--r-card); }
.deal-sheet .offer.charm .art, .deal-sheet .offer.perk .art { width: 108px; height: 108px; border-radius: var(--r-card); }
.deal-sheet .offer .art img { width: 70%; height: 70%; max-width: 76px; max-height: 76px; }
.deal-sheet .offer .art .mi, .deal-sheet .offer .art .offer-seq .mi { font-size: 36px; }
.deal-sheet .offer .tp {
    position: absolute; left: 50%; bottom: 0; transform: translate(-50%, 50%);
    z-index: 1; background: var(--card); border: 1px solid color-mix(in srgb, var(--kind) 40%, var(--line));
    border-radius: var(--r-pill); padding: 2px 8px 2px 6px; box-shadow: var(--shadow-1); white-space: nowrap;
}
.deal-sheet .offer .ds { flex: none; font-size: 11px; line-height: 1.25; max-height: none; overflow: visible; }
.deal-sheet .offer .offer-foot { width: 100%; margin-top: auto; }
.deal-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; margin-top: auto; }
.deal-actions .btn {
    height: 36px; margin: 0; border-radius: var(--r-card); font-size: 14px;
    display: inline-flex; align-items: center; justify-content: center; gap: 4px;
}
.deal-actions .deal-pay {
    border: 0; background: var(--primary); color: var(--on-color);
}
.deal-actions .deal-pay .coin { --coin-size: 24px; }
#m-reroll {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    white-space: nowrap;
}
.modal.shop .modal-head { margin-bottom: 10px; }
.modal.shop .wallet.lg { --coin-size: 32px; }
/* Pet details */
.modal.pet-info { position: relative; }
.modal.lib-pet-info { padding-inline: 16px; }
.modal.lib-pet-info .pi-hero { flex-direction: column; align-items: flex-start; gap: 3px; }
.modal.lib-pet-info .pi-feelings { margin-top: 0; }
.modal-x { top: 10px; right: 10px; z-index: 1; }
.pi-feelings, .pi-combos, .pi-quirks {
    background: color-mix(in srgb, var(--surface) 45%, var(--card)); border: 1px solid var(--line); border-radius: var(--r-card);
    box-shadow: inset 0 1px 3px rgb(var(--shadow-rgb) / 0.08), inset 0 -1px 0 var(--glass-highlight); overflow: hidden;
}
.pi-feelings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 12px; }
.pi-feel-col + .pi-feel-col { border-left: 1px solid var(--line); }
.pi-feel-col { min-width: 0; }
.pi-feel-label { padding: 7px 10px 5px; font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-dim); }
.pi-row { display: flex; align-items: center; gap: 7px; padding: 6px 10px; border-top: 1px solid var(--line); font-size: 12px; font-weight: 800; }
.pi-row-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pi-row b { font-size: 12px; font-weight: 900; }
.pi-row .pi-empty { font-size: 11px; }
.pi-ic, .pi-seq .mi, .pi-seq .q {
    width: 22px; height: 22px; flex: none; display: inline-grid; place-items: center; border-radius: 50%;
    background: var(--card); box-shadow: 0 1px 2px rgb(var(--shadow-rgb) / 0.12);
}
.pi-ic .mi { font-size: 14px; }
.pi-ic img { width: 16px; height: 16px; object-fit: contain; }
.pi-hero { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.pi-hero.stacked { flex-direction: column; align-items: flex-start; gap: 3px; }
.modal.pet-info .pi-hero, .modal.lib-pet-info .pi-hero, .modal.roadmap .pi-hero { padding-right: 30px; }
.pi-hero h2 { margin: 0; }
.pi-hero span:not(.nc-lv) { font-size: 12px; font-weight: 700; color: var(--ink-dim); }
.pi-formline {
    margin: 0; font-size: 13px; font-style: italic; font-weight: 600; line-height: 1.2;
    color: var(--ink-dim); text-transform: capitalize;
}
.pi-story {
    display: flex; justify-content: flex-start; align-items: center;
    width: 100%; margin: 8px 0 2px; padding: 8px 12px;
    border: 1px solid var(--line); border-radius: var(--r-pill);
    background: color-mix(in srgb, var(--surface) 45%, var(--card));
    box-shadow: inset 0 1px 3px rgb(var(--shadow-rgb) / 0.08), inset 0 -1px 0 var(--glass-highlight);
    cursor: pointer;
}
.pi-story .day-pips-wrap { width: 100%; max-width: none; gap: 8px 10px; }
.pi-story .day-pips { gap: 4px; }
.pi-story .day-pips i { width: 22px; font-size: 9px; }
.pi-story:hover { opacity: 0.92; }
.pi-forms { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 6px; margin-bottom: 4px; }
.pi-form { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 5px 2px 4px; border-radius: var(--r-card); border: 1px solid transparent; }
.pi-form img { width: 36px; height: 36px; object-fit: contain; }
.pi-form span { font-size: 10px; font-weight: 800; color: var(--ink-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.pi-form.now { background: var(--surface); border-color: var(--line); }
.pi-form.now span { color: var(--ink); }
.pi-form.next img { filter: brightness(0) opacity(0.18); }
.pi-h { margin: 14px 0 6px; font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-dim); }
.pi-quirks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.pi-quirks li { padding: 7px 10px; font-size: 12px; font-weight: 600; color: var(--ink-dim); line-height: 1.35; }
.pi-quirks b { color: var(--ink); font-weight: 900; }
.pi-quirks b::after { content: ':'; }
.pi-combos { display: flex; flex-direction: column; }
.pi-combo { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 10px; }
.pi-combo + .pi-combo, .pi-quirks li + li { border-top: 1px solid var(--line); }
.pi-cl { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; }
.pi-cl b { font-size: 12.5px; font-weight: 900; }
.pi-combo .pi-seq { position: relative; justify-content: flex-start; gap: 2px; }
.pi-combo .pi-seq .mi { font-size: 14px; }
.pi-lv {
    margin-left: 4px; padding: 0 6px; border-radius: var(--r-pill); background: var(--points); color: var(--on-color);
    font-size: 10px; font-weight: 1000; line-height: 1.6; font-variant-numeric: tabular-nums;
}
.pi-cr { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex: none; text-align: right; }
.pi-op { font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-dim); }
.pi-op.fav { color: var(--friendship-ink); } .pi-op.dislike { color: var(--bad); }
.pi-eff { font-size: 13px; font-weight: 1000; color: var(--points); font-variant-numeric: tabular-nums; }
.pi-eff.dislike { color: var(--bad); }
.pi-combo.unknown { opacity: 0.6; }
/* Tabs are the top edge of the card they switch; the open tab shares the card's fill. */
.pi-tabcard {
    margin-top: 14px; border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden;
    background: color-mix(in srgb, var(--surface) 45%, var(--card));
    box-shadow: inset 0 1px 3px rgb(var(--shadow-rgb) / 0.08), inset 0 -1px 0 var(--glass-highlight);
}
.pi-tabs { display: flex; background: var(--surface-2); }
.pi-tab {
    flex: 1; padding: 8px 4px; border: 0; border-bottom: 1px solid var(--line); background: none; font: inherit; font-size: 12px; font-weight: 900;
    color: var(--ink-dim); transition: background 0.15s ease, color 0.15s ease;
}
.pi-tab + .pi-tab { border-left: 1px solid var(--line); }
.pi-tab.on { background: color-mix(in srgb, var(--surface) 45%, var(--card)); border-bottom-color: transparent; color: var(--ink); }
.pi-tabcard .pi-feelings, .pi-tabcard .pi-quirks, .pi-tabcard .pi-combos { margin: 0; border: 0; border-radius: 0; background: none; box-shadow: none; }
.pi-tabcard .pi-feel-label { padding-top: 9px; }
.pi-build { display: grid; grid-template-columns: 1fr; gap: 14px; margin-top: 14px; }
.pi-build .pi-h { margin: 0; display: flex; justify-content: space-between; align-items: baseline; }
.pi-build .pi-h span { font-variant-numeric: tabular-nums; color: var(--ink); }
.pi-h-sub { margin: 2px 0 0; font-size: 11px; font-weight: 650; color: var(--ink-dim); line-height: 1.35; }
.pi-charm-row { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 8px; margin-top: 8px; }
.pi-care-ups { margin-top: 10px; }
.pi-care-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.pi-care-chip {
    display: inline-flex; align-items: center; padding: 4px 8px; border-radius: var(--r-pill);
    background: var(--surface); border: 1px solid var(--line);
    font-size: 11px; font-weight: 800; color: var(--ink);
}
.shop-slots-bar {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: calc(100% + 28px);
    margin: 2px -14px 10px;
    padding: 0;
    background: var(--surface);
    border: 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    font: inherit;
    cursor: pointer;
    transition: background 120ms ease;
}
.shop-slots-bar:hover,
.shop-slots-bar.is-sell {
    background: color-mix(in srgb, var(--ink) 6%, var(--surface));
}
.shop-slots-bar:active {
    background: color-mix(in srgb, var(--ink) 10%, var(--surface));
}
.ss-pill {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px 4px;
    font-size: 10.5px;
    font-weight: 700;
    color: var(--ink-dim);
    white-space: nowrap;
}
.ss-pill + .ss-pill { border-left: 1px solid var(--line); }
.ss-pill .material-icons { font-size: 13px; line-height: 1; }
.ss-pill b { color: var(--ink); font-weight: 900; font-variant-numeric: tabular-nums; }
.ss-pill.perk .material-icons { color: var(--kind-perk); }
.ss-pill.charm .material-icons { color: var(--kind-charm); }
.ss-pill.bag .material-icons { color: var(--accent); }
.ss-pill.full b { color: var(--bad); }
.pi-charm-slot {
    width: 36px; height: 36px; display: grid; place-items: center; flex: none;
    padding: 0; border-radius: var(--r-card); background: var(--glass-strong); border: 1px solid var(--line); cursor: pointer;
}
.pi-charm-slot.perk { border-color: color-mix(in srgb, var(--kind-perk) 55%, var(--line)); }
.pi-charm-slot img { width: 26px; height: 26px; object-fit: contain; }
.pi-charm-slot .mi { font-size: 20px; }
.pi-charm-slot.empty { background: var(--surface); border-style: dashed; opacity: 0.5; }
.pet-info .pi-actions { margin-top: 14px; justify-content: space-between; }
.pi-actions .btn { flex: 1; }
.pi-exit { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.pi-exit .material-icons { font-size: 18px; transform: scaleX(-1); }
.pi-seq .q { font-size: 11px; font-weight: 900; color: var(--ink-dim); }
.pi-empty { margin: 0; font-size: 12px; font-weight: 600; color: var(--ink-dim); }
.quirks { margin: 8px 0 0; padding-left: 18px; font-size: 12px; color: var(--ink-dim); font-weight: 700; }
.modal .home-stats { padding: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
    body.dev-open .window { left: 50%; }
    #dev-panel { width: 100vw; }
}
@media (max-width: 420px) {
    html, body { background: var(--chrome); }
    body::before { display: none; }
    .window {
        left: 0; top: 0; transform: none; width: 100%; max-width: none; max-height: none; border-radius: 0; border: 0;
        height: 100%; height: 100dvh; height: -webkit-fill-available;
    }
    body.dev-open .window { left: 0; }
    .titlebar { padding-top: calc(env(safe-area-inset-top) + 8px); }
    .home-head { padding-top: calc(env(safe-area-inset-top) + 62px); }
    .home-menu, .home-shop-btn { --menu-top: calc(env(safe-area-inset-top) + 12px); }
    .titlebar .home-menu,
    .home-menu.in-run { --menu-top: calc(env(safe-area-inset-top) + 8px); }
    .home-stats { padding-bottom: calc(env(safe-area-inset-bottom) + 10px); }
    #screen-home .home-stats { padding-bottom: calc(env(safe-area-inset-bottom) + 14px); margin-bottom: 0; }
    .run-dock { padding-bottom: calc(env(safe-area-inset-bottom) + 8px); }
    #dev-toggle { top: calc(env(safe-area-inset-top) + 1px); bottom: auto; right: auto; left: 50%; transform: translateX(-50%); padding: 1px 6px; font-size: 9px; opacity: 0.5; }
}

.btn.cash-in {
    display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin-top: 10px;
    border: 0; background: var(--primary); color: var(--on-color);
}
.btn.cash-in .coin { --coin-size: 24px; }
.btn.cash-in:disabled { background: var(--surface-2); color: var(--ink-dim); box-shadow: none; }
.tip-note { margin: 6px 0 0; font-size: 11px; color: var(--ink-dim); }

/* Reduced motion: loops and flourishes stop; sequenced reveals keep their delays but appear without movement.
   The JS skips flying particles and zooms separately (reducedMotion()). */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
