/* Goldman Stacks. Mobile first (390x844, fine down to 360). Each era is a world: the custom properties
   on [data-era] set the palette, the card frame and the display face, and the three backdrops
   cross-fade. Gold is the constant. Pictures come from art.js; their moving parts (a-*) are animated
   at the end of this file, and all of it stops for prefers-reduced-motion. */
@font-face { font-family: "Playfair Display"; font-style: normal; font-weight: 800; font-display: swap; src: url("../fonts/playfair-display-latin-800-normal.woff2") format("woff2"); }
@font-face { font-family: "Cinzel"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/cinzel-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Orbitron"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/orbitron-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Exo 2"; font-style: italic; font-weight: 800; font-display: swap; src: url("../fonts/exo-2-latin-800-italic.woff2") format("woff2"); }

* { box-sizing: border-box; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
:root {
  --gold-1: #fff3b0; --gold-2: #f6c445; --gold-3: #d9971a; --gold-4: #8f5a06;
  --gold-grad: linear-gradient(180deg, var(--gold-1) 0%, var(--gold-2) 48%, var(--gold-3) 100%);
  --gutter: 14px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --round: "Baloo 2", ui-rounded, system-ui, -apple-system, "Segoe UI", sans-serif;
  --tabs-h: 62px;
}
[data-era="0"] {
  --ink: #3f2412; --soft: #8c5e3c; --card: #fffaf0; --card-2: #fcefd7; --edge: #efd29a; --edge-2: #d9a85a;
  --bar-bg: rgba(110, 62, 26, .13); --bar-a: #f08a2e; --bar-b: #ffd36e; --bar-ink: #4a2a08;
  --hud-a: #5c331b; --hud-b: #2d190e; --hud-glow: rgba(255, 190, 90, .45);
  --disk-a: #fff8e4; --disk-b: #f5cf8f; --accent: #fbe6bd; --tab-bg: rgba(45, 25, 14, .95);
  --display: var(--round); --display-w: 800; --display-ls: 0; --display-case: none;
  --card-shadow: 0 1px 0 rgba(255, 255, 255, .9) inset, 0 -3px 0 rgba(150, 90, 30, .12) inset, 0 0 0 1.5px var(--edge), 0 8px 18px -6px rgba(90, 45, 10, .35);
}
[data-era="1"] {
  --ink: #eaf7ef; --soft: #9cc4b1; --card: rgba(9, 52, 42, .94); --card-2: rgba(6, 38, 31, .94); --edge: rgba(214, 178, 92, .55); --edge-2: #d6b25c;
  --bar-bg: rgba(0, 0, 0, .38); --bar-a: #15a873; --bar-b: #f2d06a; --bar-ink: #fff;
  --hud-a: #0f3d30; --hud-b: #04140f; --hud-glow: rgba(70, 230, 160, .3);
  --disk-a: #2f8a6c; --disk-b: #0b3a2d; --accent: #11473a; --tab-bg: rgba(3, 18, 14, .95);
  --display: "Playfair Display", Georgia, "Times New Roman", serif; --display-w: 800; --display-ls: 0; --display-case: none;
  --card-shadow: 0 1px 0 rgba(255, 255, 255, .12) inset, 0 0 0 1px var(--edge), 0 0 0 4px rgba(4, 20, 15, .55), 0 0 0 5px rgba(214, 178, 92, .22), 0 10px 22px -8px rgba(0, 0, 0, .7);
  --frame: linear-gradient(90deg, transparent, rgba(214, 178, 92, .28), transparent);
}
[data-era="2"] {
  --ink: #f4ecff; --soft: #bba8ea; --card: rgba(40, 20, 84, .93); --card-2: rgba(28, 12, 62, .93); --edge: rgba(196, 160, 255, .5); --edge-2: #e3c26e;
  --bar-bg: rgba(0, 0, 0, .4); --bar-a: #8a5cf5; --bar-b: #ffd36e; --bar-ink: #fff;
  --hud-a: #341872; --hud-b: #12062c; --hud-glow: rgba(176, 130, 255, .4);
  --disk-a: #7a55d0; --disk-b: #2a1356; --accent: #3b1e7a; --tab-bg: rgba(16, 6, 38, .95);
  --display: "Cinzel", "Trajan Pro", Georgia, serif; --display-w: 700; --display-ls: .02em; --display-case: none;
  --card-shadow: 0 1px 0 rgba(255, 255, 255, .14) inset, 0 0 0 1px var(--edge), 0 0 18px -4px rgba(150, 100, 255, .45), 0 10px 24px -8px rgba(0, 0, 0, .7);
}
/* Space: mission control at night, cyan readouts on deep blue */
[data-era="3"] {
  --ink: #e8f6ff; --soft: #93b9d6; --card: rgba(10, 30, 62, .94); --card-2: rgba(6, 18, 42, .94); --edge: rgba(90, 210, 235, .45); --edge-2: #45d0e6;
  --bar-bg: rgba(0, 0, 0, .4); --bar-a: #2a8fd8; --bar-b: #7df0ff; --bar-ink: #fff;
  --hud-a: #0d2a55; --hud-b: #050d22; --hud-glow: rgba(80, 200, 255, .35);
  --disk-a: #2c5d9a; --disk-b: #0a1d3d; --accent: #10305a; --tab-bg: rgba(4, 10, 26, .95);
  --display: "Orbitron", "Baloo 2", system-ui, sans-serif; --display-w: 700; --display-ls: .02em; --display-case: none;
  --card-shadow: 0 1px 0 rgba(255, 255, 255, .12) inset, 0 0 0 1px var(--edge), 0 0 16px -6px rgba(69, 208, 230, .55), 0 10px 22px -8px rgba(0, 0, 0, .75);
}
/* Cosmic: the edge of everything, violet dark with nebula pink and teal */
[data-era="4"] {
  --ink: #fff0fb; --soft: #d0a9d8; --card: rgba(34, 12, 52, .93); --card-2: rgba(18, 6, 32, .93); --edge: rgba(232, 120, 220, .45); --edge-2: #e75fc8;
  --bar-bg: rgba(0, 0, 0, .42); --bar-a: #c43fb0; --bar-b: #6ff2d6; --bar-ink: #fff;
  --hud-a: #2a0c46; --hud-b: #0b0318; --hud-glow: rgba(230, 100, 220, .38);
  --disk-a: #6a2a86; --disk-b: #1c0832; --accent: #3a1452; --tab-bg: rgba(10, 3, 20, .95);
  --display: "Exo 2", "Baloo 2", system-ui, sans-serif; --display-w: 800; --display-ls: .01em; --display-case: none;
  --card-shadow: 0 1px 0 rgba(255, 255, 255, .13) inset, 0 0 0 1px var(--edge), 0 0 20px -5px rgba(231, 95, 200, .5), 0 10px 24px -8px rgba(0, 0, 0, .75);
}
html, body { margin: 0; height: 100%; overflow: hidden; overscroll-behavior: none; }
body {
  font-family: var(--round); font-weight: 500; color: var(--ink); background: var(--hud-b); line-height: 1.25;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; transition: color .8s;
}
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; }
[hidden] { display: none !important; }
.glyph { display: block; width: 100%; height: 100%; }

/* ---------- Worlds ---------- */
.bg { position: fixed; inset: 0; opacity: 0; transition: opacity 1.4s ease; z-index: 0; overflow: hidden; pointer-events: none; }
body[data-era="0"] .bg-0, body[data-era="1"] .bg-1, body[data-era="2"] .bg-2, body[data-era="3"] .bg-3, body[data-era="4"] .bg-4 { opacity: 1; }
.bg i { position: absolute; display: block; }
/* Cats: a sunny room, pawprints drifting, paper grain */
.bg-0 { background: radial-gradient(120% 70% at 85% 0%, #fff8e6 0%, transparent 60%), linear-gradient(180deg, #fff1d6 0%, #f9d9a2 55%, #eeb46c 100%); }
.bg-0::after { content: ""; position: absolute; inset: 0; opacity: .5; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .28 0 0 0 0 .1 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E"); }
.bg-0 .sun { right: -30%; top: -22%; width: 130%; height: 80%; background: repeating-conic-gradient(from 200deg at 70% 25%, rgba(255, 255, 255, .34) 0 5deg, transparent 5deg 14deg); -webkit-mask: radial-gradient(closest-side at 70% 25%, #000, transparent); mask: radial-gradient(closest-side at 70% 25%, #000, transparent); animation: sunbeam 9s ease-in-out infinite alternate; }
@keyframes sunbeam { from { opacity: .55; } }
.bg-0 .paws { inset: -150px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='150' height='150'%3E%3Cg fill='%238a5a24' fill-opacity='.1'%3E%3Cg transform='translate(10 14) rotate(-14 30 30)'%3E%3Cellipse cx='30' cy='40' rx='10' ry='8'/%3E%3Ccircle cx='18' cy='27' r='4.4'/%3E%3Ccircle cx='27' cy='21' r='4.4'/%3E%3Ccircle cx='36' cy='21' r='4.4'/%3E%3Ccircle cx='44' cy='27' r='4.4'/%3E%3C/g%3E%3Cg transform='translate(86 84) rotate(22 30 30)'%3E%3Cellipse cx='30' cy='40' rx='10' ry='8'/%3E%3Ccircle cx='18' cy='27' r='4.4'/%3E%3Ccircle cx='27' cy='21' r='4.4'/%3E%3Ccircle cx='36' cy='21' r='4.4'/%3E%3Ccircle cx='44' cy='27' r='4.4'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E"); animation: drift 90s linear infinite; }
/* Finance: a trading floor at night, a ticker line and a skyline with lit windows */
.bg-1 { background: radial-gradient(90% 50% at 50% 0%, #135a45 0%, transparent 70%), linear-gradient(180deg, #082a21 0%, #0a3529 55%, #03110d 100%); }
.bg-1 .grid { inset: -44px; background-image: linear-gradient(rgba(242, 207, 99, .06) 1px, transparent 1px), linear-gradient(90deg, rgba(242, 207, 99, .06) 1px, transparent 1px); background-size: 44px 44px; animation: drift44 40s linear infinite; }
.bg-1 .ticker { left: 0; right: 0; bottom: 24%; height: 34%; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 200' preserveAspectRatio='none'%3E%3Cpath d='M0 170 L40 150 L70 160 L110 120 L150 132 L190 90 L230 104 L270 62 L310 76 L350 34 L400 18 L400 200 L0 200Z' fill='%23f2cf63' fill-opacity='.07'/%3E%3Cpath d='M0 170 L40 150 L70 160 L110 120 L150 132 L190 90 L230 104 L270 62 L310 76 L350 34 L400 18' fill='none' stroke='%23f2cf63' stroke-opacity='.35' stroke-width='2.5' stroke-linejoin='round' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E") bottom / 100% 100% no-repeat; }
.bg-1 .skyline { left: 0; right: 0; bottom: 0; height: 30%; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 120' preserveAspectRatio='xMidYMax slice'%3E%3Cpath d='M0 120 V70 H22 V52 H40 V78 H58 V30 H66 V20 H74 V30 H82 V64 H104 V44 H126 V84 H140 V36 L152 24 L164 36 V72 H184 V54 H206 V86 H220 V16 H232 V6 H238 V16 H250 V62 H270 V48 H292 V80 H306 V40 H330 V70 H350 V58 H372 V82 H400 V120Z' fill='%23021009'/%3E%3Cg fill='%23f6d36a' fill-opacity='.55'%3E%3Crect x='62' y='36' width='3' height='4'/%3E%3Crect x='70' y='44' width='3' height='4'/%3E%3Crect x='110' y='52' width='3' height='4'/%3E%3Crect x='146' y='44' width='3' height='4'/%3E%3Crect x='156' y='56' width='3' height='4'/%3E%3Crect x='224' y='26' width='3' height='4'/%3E%3Crect x='226' y='46' width='3' height='4'/%3E%3Crect x='240' y='36' width='3' height='4'/%3E%3Crect x='312' y='50' width='3' height='4'/%3E%3Crect x='320' y='62' width='3' height='4'/%3E%3Crect x='28' y='60' width='3' height='4'/%3E%3Crect x='276' y='58' width='3' height='4'/%3E%3C/g%3E%3C/svg%3E") bottom / cover no-repeat; }
/* Fantasy: twilight, stars, a big moon and drifting mist */
.bg-2 { background: radial-gradient(90% 55% at 20% 0%, #5a2aa0 0%, transparent 70%), radial-gradient(70% 50% at 100% 100%, #7a2a78 0%, transparent 70%), linear-gradient(180deg, #170a34 0%, #2a1258 60%, #14082c 100%); }
.bg-2 .stars { inset: -220px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cg fill='%23ffe9a8'%3E%3Ccircle cx='20' cy='30' r='1.6' fill-opacity='.8'/%3E%3Ccircle cx='96' cy='12' r='1' fill-opacity='.6'/%3E%3Ccircle cx='160' cy='58' r='2' fill-opacity='.7'/%3E%3Ccircle cx='60' cy='96' r='1.2' fill-opacity='.5'/%3E%3Ccircle cx='128' cy='132' r='1.7' fill-opacity='.8'/%3E%3Ccircle cx='200' cy='150' r='1' fill-opacity='.6'/%3E%3Ccircle cx='30' cy='176' r='2' fill-opacity='.7'/%3E%3Ccircle cx='90' cy='200' r='1.2' fill-opacity='.5'/%3E%3C/g%3E%3C/svg%3E"); animation: drift 160s linear infinite, twinkle 5s ease-in-out infinite alternate; }
.bg-2 .moon { right: -40px; top: 52%; width: 170px; height: 170px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, rgba(255, 246, 214, .5), rgba(255, 233, 168, .16) 60%, transparent 70%); box-shadow: inset -30px 10px 0 0 rgba(255, 233, 168, .14); }
.bg-2 .mist { left: -20%; right: -20%; bottom: -6%; height: 34%; background: radial-gradient(50% 60% at 30% 70%, rgba(200, 170, 255, .2), transparent 70%), radial-gradient(40% 50% at 75% 80%, rgba(255, 170, 230, .14), transparent 70%); animation: mist 24s ease-in-out infinite alternate; }
/* Space: low orbit at night, stars drifting past, a blue planet's edge and a slow satellite sweep */
.bg-3 { background: radial-gradient(80% 45% at 80% 0%, #164a86 0%, transparent 70%), linear-gradient(180deg, #040b1e 0%, #081a3a 60%, #030714 100%); }
.bg-3 .stars { inset: -260px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='260'%3E%3Cg fill='%23dff6ff'%3E%3Ccircle cx='14' cy='22' r='1.3' fill-opacity='.9'/%3E%3Ccircle cx='70' cy='60' r='.9' fill-opacity='.6'/%3E%3Ccircle cx='130' cy='18' r='1.6' fill-opacity='.8'/%3E%3Ccircle cx='200' cy='80' r='1' fill-opacity='.5'/%3E%3Ccircle cx='40' cy='140' r='1.4' fill-opacity='.7'/%3E%3Ccircle cx='160' cy='150' r='.8' fill-opacity='.6'/%3E%3Ccircle cx='236' cy='190' r='1.5' fill-opacity='.8'/%3E%3Ccircle cx='96' cy='220' r='1.1' fill-opacity='.6'/%3E%3Ccircle cx='180' cy='240' r='.9' fill-opacity='.5'/%3E%3C/g%3E%3C/svg%3E"); animation: drift260 120s linear infinite, twinkle 4s ease-in-out infinite alternate; }
.bg-3 .planet { left: -35%; right: -35%; bottom: -78%; height: 100%; border-radius: 50%; background: radial-gradient(circle at 50% 8%, #66c8ff 0%, #1f6ac2 22%, #0c2f66 48%, transparent 70%); box-shadow: 0 -8px 60px rgba(100, 210, 255, .35); opacity: .75; }
.bg-3 .orbit { left: -10%; right: -10%; top: 18%; height: 40%; border-radius: 50%; border: 1.5px dashed rgba(125, 240, 255, .22); transform: rotate(-12deg); animation: orbitSpin 60s linear infinite; }
/* Cosmic: deep space, nebula clouds of pink and teal, a slow galaxy turning */
.bg-4 { background: radial-gradient(70% 50% at 15% 10%, #6a1f7a 0%, transparent 70%), radial-gradient(60% 45% at 95% 70%, #0f6a6a 0%, transparent 70%), linear-gradient(180deg, #0b0318 0%, #1b0830 55%, #07020f 100%); }
.bg-4 .stars { inset: -220px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cg fill='%23ffe6fb'%3E%3Ccircle cx='20' cy='30' r='1.5' fill-opacity='.8'/%3E%3Ccircle cx='96' cy='12' r='1' fill-opacity='.6'/%3E%3Ccircle cx='160' cy='58' r='1.9' fill-opacity='.7'/%3E%3Ccircle cx='60' cy='96' r='1.1' fill-opacity='.5'/%3E%3Ccircle cx='128' cy='132' r='1.6' fill-opacity='.8'/%3E%3Ccircle cx='200' cy='150' r='1' fill-opacity='.6'/%3E%3Ccircle cx='30' cy='176' r='1.8' fill-opacity='.7'/%3E%3C/g%3E%3C/svg%3E"); animation: drift 200s linear infinite reverse, twinkle 6s ease-in-out infinite alternate; }
.bg-4 .galaxy { right: -30%; top: 6%; width: 110vmin; height: 110vmin; border-radius: 50%; background: repeating-conic-gradient(from 0deg, rgba(255, 190, 245, .16) 0 10deg, transparent 10deg 30deg); -webkit-mask: radial-gradient(circle, #000 0%, rgba(0, 0, 0, .5) 30%, transparent 62%); mask: radial-gradient(circle, #000 0%, rgba(0, 0, 0, .5) 30%, transparent 62%); animation: spin 140s linear infinite; }
.bg-4 .nebula { left: -20%; right: -20%; bottom: -8%; height: 42%; background: radial-gradient(45% 55% at 30% 65%, rgba(231, 95, 200, .22), transparent 70%), radial-gradient(40% 50% at 75% 75%, rgba(80, 230, 210, .16), transparent 70%); animation: mist 30s ease-in-out infinite alternate; }
@keyframes drift260 { to { transform: translate(260px, 260px); } }
@keyframes orbitSpin { to { transform: rotate(348deg); } }
@keyframes drift { to { transform: translate(150px, 150px); } }
@keyframes drift44 { to { transform: translate(44px, 44px); } }
@keyframes twinkle { from { opacity: .55; } to { opacity: 1; } }
@keyframes mist { to { transform: translateX(8%); } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Layout ---------- */
.app { position: relative; z-index: 1; height: 100dvh; display: flex; flex-direction: column; max-width: 520px; margin: 0 auto; }
/* The header is the game's title screen too: the shared top bar, the cat big and centred, and behind them the
   place the player has reached (one of 25, a baked canvas; see game.js "The places"). */
.hud {
  flex: none; position: relative; z-index: 3; color: #fff3dc; overflow: hidden; isolation: isolate;
  --cat: clamp(108px, 19dvh, 164px);
  padding: calc(var(--sg-corner-top) - 4px) var(--gutter) 10px; /* the top bar's All games on the corner spot (shared/menu.css) */
  background: radial-gradient(120% 90% at 20% 0%, var(--hud-glow), transparent 60%), linear-gradient(180deg, var(--hud-a), var(--hud-b));
  border-radius: 0 0 26px 26px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .38);
}
/* the gold edge sits over the scene */
.hud::after { content: ""; position: absolute; inset: 0; z-index: 2; border-radius: inherit; pointer-events: none; box-shadow: inset 0 -3px 0 rgba(246, 196, 69, .85), inset 0 -5px 0 rgba(0, 0, 0, .25), inset 0 1px 0 rgba(255, 255, 255, .08); }
.hud > :not(.scene) { position: relative; z-index: 1; }
.scene { position: absolute; inset: 0 0 auto 0; z-index: 0; pointer-events: none; }
.scene-c { position: absolute; left: 0; top: 0; display: block; opacity: 0; transition: opacity 1.4s ease; will-change: opacity; }
.scene-c.on { opacity: 1; }
.scene-c.instant { transition: none; }
/* the shared title screen's top bar, moved in (colours only: cream buttons, gold icons) */
.hud-top { height: 52px; margin-left: calc(var(--sg-corner-left) - var(--gutter)); --sg-card: rgba(255, 250, 240, .94); --sg-card-ink: #3f2412; --sg-accent: #a86a08; --sg-line: rgba(63, 36, 18, .2); }
.hud-top .sg-top { height: 52px; min-height: 52px; gap: 8px; }

.hud-stage { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; margin-top: 2px; }
.side-btn {
  position: relative; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, rgba(60, 34, 14, .78), rgba(20, 10, 4, .78));
  box-shadow: inset 0 0 0 1.5px rgba(246, 196, 69, .75), inset 0 1px 0 rgba(255, 255, 255, .18), 0 4px 12px rgba(0, 0, 0, .4);
}
#ach-btn { justify-self: start; }
#place-btn { justify-self: end; }
.side-btn:active { transform: scale(.94); }
.side-btn > i { width: 28px; height: 28px; display: block; }
.side-btn .count { position: absolute; left: 50%; bottom: -8px; transform: translateX(-50%); min-width: 22px; height: 20px; padding: 0 6px; border-radius: 10px; font-size: 11.5px; font-weight: 800; line-height: 20px; color: #4a2a08; background: var(--gold-grad); box-shadow: 0 1px 3px rgba(0, 0, 0, .4); font-variant-numeric: tabular-nums; white-space: nowrap; }

.cat-wrap { display: grid; justify-items: center; }
.cat-btn { position: relative; flex: none; width: var(--cat); height: var(--cat); border-radius: 50%; -webkit-touch-callout: none; }
.cat-rays {
  position: absolute; inset: -16%; border-radius: 50%; opacity: .75; pointer-events: none;
  background: repeating-conic-gradient(from 0deg, rgba(255, 224, 130, .5) 0 7deg, transparent 7deg 22deg);
  -webkit-mask: radial-gradient(circle, transparent 46%, #000 52%, transparent 74%); mask: radial-gradient(circle, transparent 46%, #000 52%, transparent 74%);
  animation: spin 40s linear infinite;
}
.cat-face {
  position: absolute; inset: 0; border-radius: 50%; display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(circle at 35% 28%, var(--disk-a), var(--disk-b) 80%);
  box-shadow: 0 0 0 4px var(--gold-3), 0 0 0 6px var(--gold-1), 0 0 0 8px var(--gold-4), 0 10px 26px rgba(0, 0, 0, .55), 0 0 30px var(--hud-glow);
  transition: transform .14s var(--spring);
}
.cat-face svg { width: 96%; height: 96%; display: block; margin-top: 6%; pointer-events: none; }
.cat-btn.pop .cat-face { transform: scale(.9) rotate(-3deg); transition-duration: .06s; }
.cat-btn.purr .cat-rays { animation-duration: 3s; opacity: 1; background: repeating-conic-gradient(from 0deg, rgba(255, 236, 150, .9) 0 7deg, transparent 7deg 18deg); }
.cat-hint {
  position: absolute; left: 50%; top: -10px; transform: translateX(-50%); white-space: nowrap;
  padding: 1px 12px; border-radius: 99px; background: var(--gold-grad); color: #4a2a08; font-weight: 800; font-size: 14px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .35); animation: bob 1.4s ease-in-out infinite;
}
@keyframes bob { 50% { transform: translateX(-50%) translateY(-4px); } }
/* the place's name, a plate on the medallion's lower rim: a label only, so a quick tap on the cat never opens the
   places (Heika, 2026-11-26); taps go through it, and the frame button on the right opens them */
.place-plate { pointer-events: none; position: relative; z-index: 2; display: grid; place-items: center; min-height: 44px; max-width: min(230px, 62vw); margin-top: -24px; padding: 0 4px; }
.place-plate span {
  display: block; max-width: 100%; padding: 3px 14px 4px; border-radius: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-weight: 800; font-size: 13.5px; line-height: 1.2; color: var(--gold-1);
  background: linear-gradient(180deg, #4a2e14, #1f1006); box-shadow: 0 0 0 1.5px var(--gold-2), 0 0 0 3px rgba(0, 0, 0, .3), 0 4px 10px rgba(0, 0, 0, .45);
}

.money { min-width: 0; text-align: center; margin-top: -2px; text-shadow: 0 1px 4px rgba(0, 0, 0, .55); }
.cash {
  display: flex; justify-content: center; align-items: baseline; font-size: 44px; line-height: 1; font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; text-shadow: none;
  background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 0 rgba(80, 45, 0, .6)) drop-shadow(0 0 14px rgba(246, 196, 69, .28));
}
.cash .cur { font-size: .62em; margin-right: 1px; }
.cash .u { font-size: .6em; margin-left: 2px; }
.cash.tick { animation: tick .22s var(--spring); }
@keyframes tick { 40% { transform: scale(1.05); } }
.ips { display: flex; justify-content: center; align-items: baseline; gap: 4px; margin-top: 2px; font-size: 18px; font-weight: 800; color: #fff3dc; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ips small { font-size: 13px; opacity: .7; font-weight: 700; }
.ips .mult { margin-left: 4px; padding: 0 8px; border-radius: 99px; font-size: 12.5px; line-height: 20px; color: #4a2a08; background: var(--gold-grad); box-shadow: 0 1px 3px rgba(0, 0, 0, .4); }
.worth { display: flex; justify-content: center; align-items: center; gap: 5px; font-size: 13px; font-weight: 700; color: rgba(255, 240, 200, .78); white-space: nowrap; overflow: hidden; }
.worth > i { width: 18px; height: 18px; flex: none; }
.worth > span:first-of-type { font-family: var(--display); font-weight: var(--display-w); letter-spacing: .03em; color: var(--gold-1); overflow: hidden; text-overflow: ellipsis; }
.worth .dot { opacity: .6; }
.worth b { color: var(--gold-1); font-weight: 800; }

.hud-bar { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.seg { flex: none; display: flex; padding: 3px; border-radius: 14px; background: rgba(0, 0, 0, .32); box-shadow: inset 0 0 0 1.5px rgba(246, 196, 69, .35); }
.seg button { min-width: 44px; height: 44px; padding: 0 8px; border-radius: 11px; font-weight: 800; font-size: 15.5px; color: rgba(255, 240, 200, .8); }
.seg button[aria-pressed="true"] { background: var(--gold-grad); color: #4a2a08; box-shadow: 0 2px 6px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .6); }
#buy-cycle { min-width: 64px; height: 48px; padding: 0 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; background: var(--gold-grad); color: #4a2a08; box-shadow: 0 2px 6px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .6); }
#buy-cycle small { font-size: 9.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; opacity: .75; line-height: 1; }
#buy-cycle b { font-size: 17px; font-weight: 800; line-height: 1; }
#buy-cycle.pop { animation: countPop .3s var(--spring); }
.goal {
  position: relative; flex: 1; min-width: 0; height: 50px; border-radius: 14px; overflow: hidden; display: flex; align-items: center; gap: 7px; padding: 0 10px 0 6px; text-align: left;
  background: rgba(0, 0, 0, .32); box-shadow: inset 0 0 0 1.5px rgba(246, 196, 69, .35);
}
.goal-fill { position: absolute; inset: 0; transform-origin: 0 50%; transform: scaleX(0); background: linear-gradient(90deg, rgba(246, 196, 69, .14), rgba(246, 196, 69, .42)); transition: transform .3s linear; }
.goal-ic { position: relative; width: 30px; height: 30px; flex: none; border-radius: 9px; overflow: hidden; background: radial-gradient(circle at 35% 30%, var(--disk-a), var(--disk-b)); box-shadow: 0 0 0 1.5px var(--gold-3); }
.goal-ic .art, .goal-ic .glyph { width: 100%; height: 100%; display: block; }
.goal-ic .glyph { padding: 3px; }
.goal-words { position: relative; min-width: 0; flex: 1; display: flex; flex-direction: column; line-height: 1.05; }
.goal-words small { font-size: 10.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--gold-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.goal-words span { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.goal-eta { position: relative; flex: none; font-size: 15px; font-weight: 800; color: var(--gold-1); font-variant-numeric: tabular-nums; }
.goal.ready { box-shadow: inset 0 0 0 1.5px var(--gold-2), 0 0 14px rgba(246, 196, 69, .45); }
.goal:active { transform: scale(.98); }

.boost {
  position: relative; display: flex; align-items: center; gap: 8px; margin: 8px 0 0; padding: 0 12px; height: 34px; border-radius: 12px; overflow: hidden;
  background: linear-gradient(90deg, #ffe48a, #f6c445 60%, #ffd56a); color: #4a2a08; font-weight: 800; font-size: 15px; white-space: nowrap;
  box-shadow: 0 0 0 1.5px #fff3b0, 0 0 22px rgba(255, 210, 80, .7); animation: boostIn .4s var(--spring);
}
.boost-what { font-weight: 700; opacity: .8; overflow: hidden; text-overflow: ellipsis; }
.boost b { margin-left: auto; font-variant-numeric: tabular-nums; }
.boost-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(74, 42, 8, .18); }
.boost-bar b { display: block; height: 100%; width: 100%; transform-origin: 0 50%; background: #8f5a06; }
@keyframes boostIn { from { transform: scale(.8); opacity: 0; } }
body.boosting .panes::after { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 2; box-shadow: inset 0 0 60px 10px rgba(255, 200, 60, .45); animation: glow 1.2s ease-in-out infinite alternate; }
@keyframes glow { from { opacity: .45; } }

/* ---------- Panes and tabs ---------- */
.panes { position: relative; flex: 1; min-height: 0; display: flex; }
.pane {
  flex: 1; min-width: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  padding: 14px var(--gutter) 24px; display: flex; flex-direction: column; gap: 12px;
}
.pane > * { flex-shrink: 0; }
.tabs {
  flex: none; position: relative; z-index: 4; display: flex; gap: 6px; padding: 6px 10px calc(env(safe-area-inset-bottom, 0px) + 6px);
  background: var(--tab-bg); box-shadow: 0 -1px 0 rgba(246, 196, 69, .45), 0 -10px 24px rgba(0, 0, 0, .25); border-radius: 22px 22px 0 0; transition: background .8s;
}
.tabs button {
  position: relative; flex: 1; height: 50px; border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  font-weight: 800; font-size: 13px; color: rgba(255, 240, 200, .7);
}
.tabs button i { width: 24px; height: 24px; display: block; opacity: .8; filter: saturate(.6); transition: transform .2s var(--spring); }
.tabs button[aria-pressed="true"] { color: #fff6d8; background: rgba(246, 196, 69, .14); box-shadow: inset 0 0 0 1.5px rgba(246, 196, 69, .5); }
.tabs button[aria-pressed="true"] i { opacity: 1; filter: none; transform: translateY(-1px) scale(1.08); }
.tabs button:active { transform: scale(.96); }
.badge {
  position: absolute; top: 3px; right: calc(50% - 30px); min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  font-size: 12px; font-weight: 800; line-height: 20px; color: #fff; background: #e5523f; box-shadow: 0 0 0 2px var(--tab-bg), 0 2px 4px rgba(0, 0, 0, .4); font-variant-numeric: tabular-nums;
}
.badge.gold { color: #4a2a08; background: var(--gold-grad); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.12); } }

/* ---------- Ventures ---------- */
.era-head { display: flex; align-items: center; gap: 10px; margin: 4px 4px 0; font-family: var(--display); font-weight: var(--display-w); font-size: 15px; letter-spacing: .1em; text-transform: uppercase; color: var(--soft); }
.era-head::before, .era-head::after { content: ""; flex: 1; height: 2px; border-radius: 2px; background: linear-gradient(90deg, transparent, var(--gold-3), transparent); opacity: .7; }
.v {
  position: relative; display: grid; grid-template-columns: 66px 1fr; gap: 7px 12px; padding: 12px; border-radius: 22px;
  background: linear-gradient(180deg, var(--card), var(--card-2)); box-shadow: var(--card-shadow);
  transition: background .8s, box-shadow .8s, opacity .3s; content-visibility: auto; contain-intrinsic-size: auto 172px;
}
.v::before { content: ""; position: absolute; pointer-events: none; }
/* Card frames: Finance a gold hairline across the top, Fantasy filigree in both top corners. */
[data-era="1"] .v::before { left: 22px; right: 22px; top: 0; height: 1px; background: var(--frame); }
[data-era="2"] .v::before { inset: 3px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='38' height='38'%3E%3Cg fill='none' stroke='%23e3c26e' stroke-opacity='.6' stroke-width='1.3'%3E%3Cpath d='M3 22 V3 H22'/%3E%3Cpath d='M7 16 Q7 7 16 7'/%3E%3Ccircle cx='7' cy='7' r='2'/%3E%3C/g%3E%3C/svg%3E") top left / 30px 30px no-repeat, url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='38' height='38'%3E%3Cg fill='none' stroke='%23e3c26e' stroke-opacity='.6' stroke-width='1.3'%3E%3Cpath d='M35 22 V3 H16'/%3E%3Cpath d='M31 16 Q31 7 22 7'/%3E%3Ccircle cx='31' cy='7' r='2'/%3E%3C/g%3E%3C/svg%3E") top right / 30px 30px no-repeat; }
/* Space: cyan readout brackets in the corners; Cosmic: a little four-point star glint in two corners. */
[data-era="3"] .v::before { inset: 4px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20'%3E%3Cpath d='M2 12 V2 H12' fill='none' stroke='%2345d0e6' stroke-opacity='.75' stroke-width='1.6'/%3E%3C/svg%3E") top left / 16px 16px no-repeat, url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20'%3E%3Cpath d='M18 8 V18 H8' fill='none' stroke='%2345d0e6' stroke-opacity='.75' stroke-width='1.6'/%3E%3C/svg%3E") bottom right / 16px 16px no-repeat; }
[data-era="4"] .v::before { inset: 6px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16'%3E%3Cpath d='M8 0 L9.2 6.8 L16 8 L9.2 9.2 L8 16 L6.8 9.2 L0 8 L6.8 6.8Z' fill='%23ffd6f4' fill-opacity='.7'/%3E%3C/svg%3E") top right / 12px 12px no-repeat, url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16'%3E%3Cpath d='M8 0 L9.2 6.8 L16 8 L9.2 9.2 L8 16 L6.8 9.2 L0 8 L6.8 6.8Z' fill='%236ff2d6' fill-opacity='.55'/%3E%3C/svg%3E") bottom left / 9px 9px no-repeat; }
.v.empty { opacity: .9; }
/* The Cosmic Era's alignment: the aligned venture glows and says so */
.v.aligned { box-shadow: var(--card-shadow), 0 0 0 2px #ffd6f4, 0 0 26px -2px rgba(255, 150, 240, .75); }
.v-align { display: none; align-items: center; gap: 5px; margin: 0; font-size: 13px; font-weight: 800; color: #ffd6f4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v.aligned .v-align { display: flex; }
.v-align i { width: 16px; height: 16px; flex: none; animation: twinkleS 2.4s ease-in-out infinite; }
.v.aligned .v-icon { box-shadow: 0 0 0 2.5px #e75fc8, 0 0 0 4px #ffd6f4, 0 0 18px rgba(255, 150, 240, .8), 0 4px 10px rgba(0, 0, 0, .28); }
/* The Space Era's launch pad: one card at the top of the era */
.pad {
  position: relative; display: grid; grid-template-columns: 74px 1fr; gap: 8px 12px; padding: 12px; border-radius: 22px; overflow: hidden;
  background: linear-gradient(160deg, rgba(20, 60, 110, .96), rgba(6, 18, 42, .96)); box-shadow: 0 1px 0 rgba(255, 255, 255, .14) inset, 0 0 0 1.5px rgba(125, 240, 255, .55), 0 0 22px -6px rgba(69, 208, 230, .6), 0 10px 22px -8px rgba(0, 0, 0, .7);
  color: #e8f6ff;
}
.pad-art {
  position: relative; width: 74px; height: 92px; grid-row: span 2; border-radius: 18px; overflow: hidden; box-shadow: inset 0 0 0 1.5px rgba(125, 240, 255, .45);
  background: radial-gradient(circle at 78% 18%, #fff6c9 0 4px, rgba(255, 214, 81, .45) 5px, transparent 9px), radial-gradient(1.2px 1.2px at 18% 22%, #dff6ff, transparent), radial-gradient(1px 1px at 40% 12%, #dff6ff, transparent), radial-gradient(1.4px 1.4px at 30% 46%, #dff6ff, transparent), radial-gradient(1px 1px at 70% 40%, #dff6ff, transparent), radial-gradient(1.2px 1.2px at 86% 58%, #dff6ff, transparent), radial-gradient(circle at 50% 20%, #2c5d9a, #0a1d3d 85%);
}
.pad-art .glyph { position: absolute; left: 13px; bottom: 16px; width: 48px; height: 48px; transition: transform .9s cubic-bezier(.5, 0, .9, .4), opacity .9s; }
.pad-art::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: 8px; height: 8px; border-radius: 3px; background: linear-gradient(180deg, #b9c3cd, #66727f); box-shadow: 0 0 0 1.5px #3a2216; }
.pad.flying .pad-art .glyph { transform: translateY(-120px); opacity: 0; }
.pad.flying .pad-art::before { content: ""; position: absolute; left: 50%; top: 10px; bottom: 18px; width: 2px; margin-left: -1px; background: linear-gradient(180deg, transparent, rgba(255, 210, 120, .8)); opacity: .7; }
.pad.landed .pad-art .glyph { animation: bobA 1.4s ease-in-out infinite; }
.pad-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; min-width: 0; }
.pad-head b { font-family: "Orbitron", "Baloo 2", sans-serif; font-weight: 700; font-size: 15px; letter-spacing: .03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pad-head small { flex: none; font-size: 12.5px; font-weight: 800; color: #7df0ff; font-variant-numeric: tabular-nums; }
.pad-line { margin: 0; font-size: 13px; color: #b6d6ec; line-height: 1.25; }
.pad-btns { grid-column: 2; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.pad-btns button, .pad-wide {
  min-height: 48px; border-radius: 13px; padding: 4px 4px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; line-height: 1.05;
  font-weight: 800; font-size: 13px; color: #3d2305; background: var(--gold-grad);
  box-shadow: 0 3px 0 var(--gold-4), 0 6px 12px rgba(0, 0, 0, .25), inset 0 1px 0 rgba(255, 255, 255, .7);
}
.pad-btns button small { font-size: 11px; font-weight: 800; opacity: .8; font-variant-numeric: tabular-nums; }
.pad-btns button:active, .pad-wide:active { transform: translateY(3px) scale(.97); box-shadow: 0 0 0 var(--gold-4), inset 0 1px 0 rgba(255, 255, 255, .6); }
.pad-wide { grid-column: 2; width: 100%; flex-direction: row; gap: 6px; font-size: 15.5px; }
.pad-wide.can::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: radial-gradient(120% 90% at 50% 0%, rgba(255, 255, 255, .55), transparent 70%); opacity: 0; animation: canPulse 2s ease-in-out infinite; pointer-events: none; }
.pad-wide { position: relative; }
.pad-wide.off { color: #93b9d6; background: rgba(0, 0, 0, .35); box-shadow: inset 0 0 0 1.5px rgba(125, 240, 255, .35); }
.pad-bar { grid-column: 2; display: block; height: 8px; border-radius: 4px; background: rgba(0, 0, 0, .4); overflow: hidden; }
.pad-bar b { display: block; height: 100%; width: 100%; transform-origin: 0 50%; transform: scaleX(0); background: linear-gradient(90deg, #2a8fd8, #7df0ff); transition: transform .3s linear; }
/* Catch-up, under the money while a run is still behind the last one */
.ips .catch { margin-left: 4px; padding: 0 8px; border-radius: 99px; font-size: 12px; line-height: 20px; color: #06302a; background: linear-gradient(180deg, #b6ffe8, #4fdcb4); box-shadow: 0 1px 3px rgba(0, 0, 0, .4); }
.v-side { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.v-icon {
  width: 66px; height: 66px; border-radius: 20px; position: relative; display: grid; place-items: center;
  background: radial-gradient(circle at 34% 26%, var(--disk-a), var(--disk-b) 88%);
  box-shadow: 0 0 0 2.5px var(--gold-3), 0 0 0 4px var(--gold-1), inset 0 -4px 8px rgba(0, 0, 0, .18), 0 4px 10px rgba(0, 0, 0, .28);
}
.v-icon .art { width: 92%; height: 92%; display: block; overflow: visible; }
.v.empty .v-icon .art { filter: grayscale(.55) brightness(.92); opacity: .85; }
.v-icon.pay { animation: pay .38s var(--spring); }
@keyframes pay { 35% { transform: scale(1.12) rotate(-3deg); } }
.v-mile { width: 100%; text-align: center; font-size: 11.5px; font-weight: 800; color: var(--soft); line-height: 1; font-variant-numeric: tabular-nums; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.v-mile span { display: inline-flex; align-items: center; gap: 2px; }
.v-mile span i { width: 12px; height: 12px; display: inline-block; }
.v-mile u { display: block; width: 100%; height: 5px; border-radius: 3px; background: var(--bar-bg); overflow: hidden; text-decoration: none; }
.v-mile u b { display: block; height: 100%; width: 100%; transform-origin: 0 50%; transform: scaleX(0); background: var(--gold-grad); transition: transform .3s var(--ease); }
.v-body { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.v-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.v-name { font-family: var(--display); font-weight: var(--display-w); letter-spacing: var(--display-ls); font-size: 18px; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
[data-era="2"] .v-name { font-size: 16px; }
[data-era="3"] .v-name { font-size: 14px; }
[data-era="4"] .v-name { font-size: 16.5px; font-style: italic; }
.v-count {
  margin-left: auto; flex: none; min-width: 34px; text-align: center; font-weight: 800; font-size: 16px; padding: 0 9px; border-radius: 99px; line-height: 24px;
  background: var(--accent); box-shadow: inset 0 0 0 1.5px var(--edge); font-variant-numeric: tabular-nums;
}
.v-count.pop { animation: countPop .35s var(--spring); }
@keyframes countPop { 40% { transform: scale(var(--cp, 1.3)); } }
.bar {
  position: relative; width: 100%; height: 44px; border-radius: 99px; overflow: hidden; display: block;
  background: var(--bar-bg); box-shadow: inset 0 2px 5px rgba(0, 0, 0, .25), 0 0 0 1.5px var(--edge); transition: background .8s;
}
.bar-fill { position: absolute; inset: 0; overflow: hidden; transform: translateX(-100%); background: linear-gradient(90deg, var(--bar-a), var(--bar-b)); will-change: transform; }
.bar-fill::before { content: ""; position: absolute; top: 0; bottom: 0; left: -19.5px; right: 0; background: repeating-linear-gradient(-55deg, rgba(255, 255, 255, .2) 0 8px, transparent 8px 16px); background-size: 19.5px 100%; animation: stripes .7s linear infinite; will-change: transform; }
.bar-fill::after { content: ""; position: absolute; top: 3px; bottom: 3px; right: 0; width: 6px; border-radius: 3px; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55)); }
.bar-gloss { position: absolute; inset: 0 0 52% 0; border-radius: 99px 99px 0 0; background: linear-gradient(180deg, rgba(255, 255, 255, .32), transparent); pointer-events: none; }
@keyframes stripes { to { transform: translateX(19.5px); } }
.bar-text { position: relative; display: flex; justify-content: space-between; align-items: center; height: 100%; padding: 0 14px; font-weight: 800; font-size: 16.5px; color: var(--bar-ink); font-variant-numeric: tabular-nums; }
.bar-text small { font-size: 13.5px; font-weight: 800; opacity: .9; }
[data-era="0"] .bar-text { text-shadow: 0 1px 0 rgba(255, 255, 255, .5); }
body:not([data-era="0"]) .bar-text { text-shadow: 0 1px 3px rgba(0, 0, 0, .85); }
.bar.ready { cursor: pointer; box-shadow: inset 0 2px 4px rgba(0, 0, 0, .22), 0 0 0 1.5px var(--gold-2), 0 0 14px 2px rgba(246, 196, 69, .55); }
.bar.ready .bar-gloss { animation: canPulse 1s ease-in-out infinite; background: linear-gradient(180deg, rgba(255, 255, 255, .7), transparent); }
.bar.ready .bar-text { color: #3a2005; text-shadow: none; }
.bar.ready .bar-fill { background: var(--gold-grad); }
.bar.fast .bar-fill { transform: none; background: linear-gradient(90deg, var(--bar-a), var(--bar-b), var(--bar-a)); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
.bar.fast .bar-fill::after { display: none; }
@keyframes shimmer { to { background-position: -200% 0; } }
.bar.flash::after { content: ""; position: absolute; inset: 0; background: rgba(255, 255, 255, .6); animation: flash .35s ease-out forwards; z-index: 1; border-radius: inherit; }
@keyframes flash { to { opacity: 0; } }
.v-mgr { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 13.5px; font-weight: 700; color: var(--soft); min-width: 0; }
.v-mgr i { width: 18px; height: 18px; flex: none; }
.v-mgr span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v-mgr b { color: var(--ink); font-weight: 800; }
.v-flavor { margin: 0; font-size: 13px; font-style: italic; color: var(--soft); line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.v-buys { display: flex; gap: 8px; }
.buy, .hire {
  position: relative; height: 48px; border-radius: 14px; font-weight: 800; display: flex; align-items: center; gap: 6px; padding: 0 12px; white-space: nowrap; overflow: hidden;
  transition: transform .08s, box-shadow .2s, background .2s, color .2s;
}
.buy { flex: 1.4; min-width: 0; justify-content: space-between; font-size: 15px; }
.buy b { position: relative; font-size: 13.5px; opacity: .85; }
.buy span { position: relative; font-size: 17px; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; }
.buy .near { position: absolute; inset: 0; transform-origin: 0 50%; transform: scaleX(var(--p, 0)); background: linear-gradient(90deg, rgba(246, 196, 69, .1), rgba(246, 196, 69, .32)); transition: transform .25s linear; }
.hire { flex: 1; min-width: 0; font-size: 14.5px; justify-content: center; }
.hire i { width: 20px; height: 20px; flex: none; display: block; }
.buy.can, .hire.can {
  color: #3d2305; background: var(--gold-grad);
  box-shadow: 0 3px 0 var(--gold-4), 0 6px 12px rgba(0, 0, 0, .25), inset 0 1px 0 rgba(255, 255, 255, .7), inset 0 -2px 0 rgba(140, 80, 0, .25);
}
.buy.can::after, .hire.can::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: radial-gradient(120% 90% at 50% 0%, rgba(255, 255, 255, .55), transparent 70%); opacity: 0; animation: canPulse 2.4s ease-in-out infinite; }
.buy.can .near { display: none; }
@keyframes canPulse { 50% { opacity: 1; } }
.buy.can:active, .hire.can:active { transform: translateY(3px) scale(.97); box-shadow: 0 0 0 var(--gold-4), inset 0 1px 0 rgba(255, 255, 255, .6); }
.buy.cant, .hire.cant { color: var(--soft); background: var(--bar-bg); box-shadow: inset 0 0 0 1.5px var(--edge), inset 0 2px 4px rgba(0, 0, 0, .12); }
.hire.hired { background: var(--accent); box-shadow: inset 0 0 0 1.5px var(--gold-3); color: var(--ink); font-size: 13px; padding: 0 9px; justify-content: flex-start; cursor: default; }
.hire.hired span { min-width: 0; overflow: hidden; text-overflow: ellipsis; line-height: 1.05; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.bought { animation: bought .42s var(--spring); }
@keyframes bought { 0% { transform: scale(.94); } 55% { transform: scale(calc(1.04 * var(--bp, 1))); } }
.ring { position: absolute; left: 50%; top: 50%; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%; border: 3px solid #fff3b0; pointer-events: none; animation: ring .5s ease-out forwards; }
@keyframes ring { from { transform: scale(.4); opacity: 1; } to { transform: scale(4); opacity: 0; } }
.shake { animation: shake .28s; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

.teaser {
  margin-top: 2px; padding: 16px; border-radius: 22px; text-align: center; display: grid; justify-items: center; gap: 4px;
  border: 2px dashed var(--gold-3); background: linear-gradient(180deg, var(--card), var(--card-2)); transition: background .8s;
}
.teaser .lock { width: 36px; height: 36px; }
.teaser b { display: block; font-family: var(--display); font-weight: var(--display-w); font-size: 19px; }
.teaser p { margin: 0; font-size: 14px; color: var(--soft); }
.teaser u { display: block; width: 80%; height: 8px; border-radius: 4px; background: var(--bar-bg); overflow: hidden; margin-top: 4px; text-decoration: none; }
.teaser u b { display: block; height: 100%; width: 100%; transform-origin: 0 50%; transform: scaleX(0); background: var(--gold-grad); }

/* ---------- Upgrades ---------- */
.shop-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 2px 4px 0; }
.shop-head h3, .p-head h3 { margin: 0; font-family: var(--display); font-weight: var(--display-w); font-size: 21px; color: var(--ink); text-shadow: 0 1px 0 rgba(255, 255, 255, .2); }
.shop-head small { font-size: 13px; font-weight: 700; color: var(--soft); }
[data-era="0"] .shop-head h3, [data-era="0"] .p-head h3 { color: #4a2a12; }
.up {
  position: relative; display: grid; grid-template-columns: 52px 1fr auto; align-items: center; gap: 10px; padding: 10px 10px 10px 10px; border-radius: 18px;
  background: linear-gradient(180deg, var(--card), var(--card-2)); box-shadow: var(--card-shadow);
}
.up-ic { position: relative; width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: radial-gradient(circle at 34% 26%, var(--disk-a), var(--disk-b) 88%); box-shadow: 0 0 0 2px var(--gold-3), 0 3px 8px rgba(0, 0, 0, .25); }
.up-ic .art { width: 88%; height: 88%; }
.up-ic .glyph { width: 64%; height: 64%; }
.up-ic em { position: absolute; right: -6px; bottom: -6px; min-width: 24px; height: 22px; padding: 0 5px; border-radius: 11px; font-style: normal; font-weight: 800; font-size: 12.5px; line-height: 22px; text-align: center; color: #4a2a08; background: var(--gold-grad); box-shadow: 0 1px 3px rgba(0, 0, 0, .35); }
.up-words { min-width: 0; }
.up-words b { display: block; font-family: var(--display); font-weight: var(--display-w); font-size: 15.5px; line-height: 1.15; }
.up-words small { display: block; margin-top: 1px; font-size: 13px; font-weight: 600; color: var(--soft); line-height: 1.2; }
.up .buy { flex: none; min-width: 96px; height: 46px; justify-content: center; padding: 0 10px; }
.up .buy span { font-size: 15.5px; }
.up.locked { opacity: .62; }
.up.locked .up-ic { filter: grayscale(.8); }
.up.locked .need { font-size: 12.5px; font-weight: 800; color: var(--soft); text-align: right; max-width: 108px; line-height: 1.15; }
.up.gone { animation: gone .4s var(--ease) forwards; }
@keyframes gone { to { transform: scale(.9) translateX(30px); opacity: 0; } }
.owned-row { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px 4px; }
.owned-row i { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: radial-gradient(circle at 34% 26%, var(--disk-a), var(--disk-b)); box-shadow: 0 0 0 1.5px var(--gold-3); }
.owned-row i .art { width: 90%; height: 90%; }
.owned-row i .glyph { width: 70%; height: 70%; }
.empty-note { margin: 6px 4px; padding: 14px; border-radius: 18px; text-align: center; color: var(--soft); font-weight: 700; background: var(--bar-bg); }

/* ---------- Make Partner ---------- */
.p-hero {
  position: relative; overflow: hidden; padding: 18px 16px 16px; border-radius: 24px; text-align: center; color: #fff6dc;
  background: radial-gradient(90% 70% at 50% 0%, rgba(255, 220, 120, .35), transparent 70%), linear-gradient(180deg, #4a2d0c, #1c0f03);
  box-shadow: 0 0 0 2px var(--gold-3), 0 0 0 4px rgba(255, 243, 176, .5), 0 12px 26px -8px rgba(0, 0, 0, .7);
}
.p-hero::before { content: ""; position: absolute; left: 50%; top: 40px; width: 360px; height: 360px; margin-left: -180px; background: repeating-conic-gradient(rgba(255, 224, 130, .16) 0 6deg, transparent 6deg 18deg); -webkit-mask: radial-gradient(circle, #000, transparent 60%); mask: radial-gradient(circle, #000, transparent 60%); animation: spin 60s linear infinite; pointer-events: none; }
.p-hero > * { position: relative; }
.whisker-big { width: 104px; height: 104px; margin: -6px auto 0; }
.whisker-big .art { width: 100%; height: 100%; display: block; overflow: visible; }
.p-count { font-size: 40px; font-weight: 800; line-height: 1; background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 2px 0 rgba(80, 45, 0, .7)); font-variant-numeric: tabular-nums; }
.p-label { margin: 2px 0 0; font-size: 15px; font-weight: 700; color: #ffe9b0; }
.p-sub { margin: 4px 0 0; font-size: 13.5px; font-weight: 600; color: rgba(255, 236, 190, .75); }
.p-title { display: inline-block; margin-top: 8px; padding: 2px 12px; border-radius: 99px; font-size: 12.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #4a2a08; background: var(--gold-grad); }
.p-make { padding: 14px; border-radius: 22px; background: linear-gradient(180deg, var(--card), var(--card-2)); box-shadow: var(--card-shadow); display: grid; gap: 8px; text-align: center; }
.p-make h4 { margin: 0; font-family: var(--display); font-weight: var(--display-w); font-size: 20px; }
.p-make p { margin: 0; font-size: 14.5px; color: var(--soft); font-weight: 600; }
.p-make .gain { font-size: 30px; font-weight: 800; line-height: 1.05; color: var(--ink); font-variant-numeric: tabular-nums; }
.p-make .gain small { font-size: 15px; color: var(--soft); }
.p-make u { display: block; height: 10px; border-radius: 5px; background: var(--bar-bg); overflow: hidden; text-decoration: none; }
.p-make u b { display: block; height: 100%; width: 100%; transform-origin: 0 50%; transform: scaleX(0); background: var(--gold-grad); transition: transform .3s; }
.p-make .gold-btn { margin-top: 2px; }
.p-make .gold-btn[disabled] { filter: grayscale(.8) brightness(.9); opacity: .6; box-shadow: none; }
.p-make .tip { font-size: 13px; font-weight: 700; color: var(--soft); }
.p-make .tip.go { color: var(--ink); }
.p-head { display: flex; align-items: baseline; justify-content: space-between; margin: 6px 4px 0; }
.p-head small { font-size: 13.5px; font-weight: 800; color: var(--soft); display: inline-flex; align-items: center; gap: 4px; }
.p-head small i { width: 18px; height: 18px; display: inline-block; }
.tree { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 92px; gap: 12px 8px; padding: 6px 0 4px; }
.tree svg.links { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.tree svg.links path { fill: none; stroke: var(--edge-2); stroke-width: 3; stroke-linecap: round; opacity: .35; }
.tree svg.links path.on { opacity: 1; stroke: #f6c445; filter: drop-shadow(0 0 3px rgba(246, 196, 69, .8)); }
.perk {
  position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 6px 4px; border-radius: 18px; text-align: center;
  background: linear-gradient(180deg, var(--card), var(--card-2)); box-shadow: var(--card-shadow); min-height: 44px;
}
.perk i { width: 34px; height: 34px; display: block; }
.perk b { font-size: 12.5px; font-weight: 800; line-height: 1.05; }
.perk small { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; font-weight: 800; color: var(--soft); font-variant-numeric: tabular-nums; }
.perk small i { width: 14px; height: 14px; display: inline-block; }
.perk.owned { background: linear-gradient(180deg, #fff3b0, #f6c445 60%, #d9971a); color: #4a2a08; box-shadow: 0 0 0 2px #fff3b0, 0 0 16px rgba(246, 196, 69, .6); }
.perk.owned small { color: #6e4510; }
.perk.ready { box-shadow: var(--card-shadow), 0 0 0 2.5px var(--gold-2), 0 0 18px rgba(246, 196, 69, .7); }
.perk.ready::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: radial-gradient(100% 80% at 50% 0%, rgba(255, 236, 160, .45), transparent 70%); opacity: 0; animation: canPulse 2.4s ease-in-out infinite; }
.perk.locked { opacity: .5; }
.perk.locked i { filter: grayscale(1); }
.perk[aria-pressed="true"] { outline: 3px solid #fff3b0; outline-offset: 2px; }
.perk-info { padding: 14px; border-radius: 20px; background: linear-gradient(180deg, var(--card), var(--card-2)); box-shadow: var(--card-shadow); display: grid; gap: 6px; }
.perk-info h4 { margin: 0; font-family: var(--display); font-weight: var(--display-w); font-size: 18px; }
.perk-info p { margin: 0; font-size: 14.5px; color: var(--soft); font-weight: 600; }
.perk-info .gold-btn { margin-top: 4px; }
/* the Ledger: levelled whisker lines under the tree */
.ledger { padding: 10px; border-radius: 20px; background: linear-gradient(180deg, var(--card), var(--card-2)); box-shadow: var(--card-shadow); display: grid; gap: 8px; }
.lg-sub { margin: 2px 4px 0; font-size: 13.5px; font-weight: 600; color: var(--soft); display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.info-i { position: relative; flex: none; width: 44px; height: 44px; margin: -10px -8px -10px 0; border: 0; background: none; padding: 0; display: grid; place-items: center; font: italic 800 14px/1 Georgia, serif; color: var(--soft); }
.info-i::after { content: ""; position: absolute; width: 22px; height: 22px; border-radius: 50%; box-shadow: 0 0 0 1.5px currentColor; }
.lg-row { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; min-height: 52px; padding: 4px 4px 4px 6px; border-radius: 14px; background: rgba(255, 255, 255, .06); box-shadow: 0 0 0 1px var(--edge); }
.lg-row.locked { opacity: .6; }
.lg-ic { width: 30px; height: 30px; display: block; }
.lg-ic svg { width: 100%; height: 100%; }
.lg-words { min-width: 0; display: grid; gap: 1px; }
.lg-words b { font-size: 15px; font-weight: 800; color: var(--ink); }
.lg-words em { font-style: normal; font-size: 12.5px; font-weight: 800; color: var(--soft); margin-left: 4px; }
.lg-words small { font-size: 12.5px; line-height: 1.25; font-weight: 600; color: var(--soft); }
.lg-buy { min-width: 86px; min-height: 44px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center; gap: 4px; font-size: 14px; }
.lg-buy i { width: 16px; height: 16px; display: inline-block; }
.lg-buy[disabled], .lg-all[disabled] { filter: grayscale(.8) brightness(.9); opacity: .6; box-shadow: none; }
.lg-lock, .lg-max { display: inline-flex; align-items: center; gap: 4px; max-width: 96px; font-size: 12px; font-weight: 800; color: var(--soft); text-align: right; }
.lg-lock svg { width: 14px; height: 14px; flex: none; }
.lg-all { min-height: 44px; }
.lg-info p { margin: 0 0 10px; }
.p-runs { margin: 0 4px; font-size: 13.5px; font-weight: 700; color: var(--soft); text-align: center; }

/* ---------- The golden visitor ---------- */
.gold-layer { position: fixed; left: 0; right: 0; top: 0; bottom: 0; z-index: 50; pointer-events: none; overflow: hidden; }
.golden {
  position: absolute; left: 0; top: 0; width: 108px; height: 82px; pointer-events: auto;
  filter: drop-shadow(0 4px 10px rgba(255, 190, 40, .7)); will-change: transform;
}
.golden .gold-art { width: 100%; height: 100%; display: block; animation: hover 1.1s ease-in-out infinite; }
.golden.flip .gold-art { transform: scaleX(-1); }
.golden.caught { animation: caught .5s var(--ease) forwards; pointer-events: none; }
@keyframes caught { to { opacity: 0; filter: brightness(2) drop-shadow(0 0 30px #ffd84a); } }
@keyframes hover { 50% { translate: 0 -6px; } }

/* ---------- Effects ---------- */
.fx { position: fixed; inset: 0; z-index: 60; pointer-events: none; overflow: hidden; }
.coin {
  position: absolute; left: 0; top: 0; width: 18px; height: 18px; border-radius: 50%; opacity: 0;
  background: radial-gradient(circle at 35% 30%, #fff8c8, #f6c445 55%, #b37608);
  box-shadow: 0 0 0 1.5px #8a5606, 0 0 8px rgba(255, 220, 100, .8); will-change: transform, opacity;
}
.coin::after { content: ""; position: absolute; inset: 4px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px rgba(138, 86, 6, .55); }
.coin.w { width: 14px; height: 4px; border-radius: 2px; background: linear-gradient(90deg, #fff6c8, #f6c445); box-shadow: 0 0 8px rgba(255, 220, 100, .9); }
.coin.w::after { display: none; }
.float {
  position: absolute; left: 0; top: 0; opacity: 0; white-space: nowrap; font-weight: 800; font-size: 20px; color: #fff3b0; font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 0 #7a4a06, 0 0 10px rgba(246, 196, 69, .7), 0 0 2px #7a4a06; will-change: transform, opacity;
}
.float.big { font-size: 26px; }
.toasts { position: fixed; left: 0; right: 0; bottom: calc(env(safe-area-inset-bottom, 0px) + var(--tabs-h) + 14px); z-index: 80; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 7px 18px 7px 8px; border-radius: 99px; max-width: calc(100vw - 28px);
  background: linear-gradient(180deg, #4a2a18, #2a170c); color: #fff3dc; font-weight: 700; font-size: 15px;
  box-shadow: 0 0 0 2px var(--gold-2), 0 8px 22px rgba(0, 0, 0, .45); animation: toast 3.4s var(--ease) forwards;
}
.toast > i { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff8e4, #f5cf8f); box-shadow: 0 0 0 2px var(--gold-3); }
.toast > i .glyph { width: 70%; height: 70%; }
.toast > i .art { width: 92%; height: 92%; }
.toast span { min-width: 0; }
.toast small { display: block; font-weight: 600; opacity: .8; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toast span b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toast.big { font-size: 17px; box-shadow: 0 0 0 2px #fff3b0, 0 0 26px rgba(255, 210, 80, .7); }
@keyframes toast { 0% { transform: translateY(20px) scale(.9); opacity: 0; } 10%, 85% { transform: none; opacity: 1; } 100% { transform: translateY(10px); opacity: 0; } }

/* ---------- Overlays and sheets ---------- */
.overlay { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 20px; background: rgba(12, 6, 22, .62); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; } }
.card { width: min(100%, 360px); max-height: 88dvh; overflow-y: auto; border-radius: 28px; padding: 24px 20px 20px; background: linear-gradient(180deg, #fffaf0, #fbeccd); color: #3f2412; box-shadow: 0 0 0 3px var(--gold-3), 0 0 0 5px var(--gold-1), 0 20px 50px rgba(0, 0, 0, .5); animation: rise .45s var(--ease); text-align: center; position: relative; }
@keyframes rise { from { transform: translateY(24px) scale(.94); opacity: 0; } }
.card h2 { margin: 0; font-size: 28px; font-weight: 800; line-height: 1.05; }
.gold-btn { margin-top: 16px; width: 100%; min-height: 52px; border-radius: 16px; font-weight: 800; font-size: 20px; color: #3d2305; background: var(--gold-grad); box-shadow: 0 4px 0 var(--gold-4), 0 8px 16px rgba(0, 0, 0, .25), inset 0 1px 0 rgba(255, 255, 255, .7); }
.gold-btn:active { transform: translateY(4px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6); }
.away-cats { display: flex; justify-content: center; margin-bottom: 4px; }
.away-cats span { width: 62px; height: 62px; margin: 0 -6px; border-radius: 50%; overflow: hidden; background: #f3c983; box-shadow: 0 0 0 3px var(--gold-3); }
.away-cats svg { width: 104%; height: 104%; margin-top: 3px; }
.away-for { margin: 6px 0 0; color: #8c5e3c; font-weight: 700; }
.away-amount { margin: 6px 0 2px; font-size: 50px; font-weight: 800; line-height: 1.05; background: linear-gradient(180deg, #e8a91a, #a96a08); -webkit-background-clip: text; background-clip: text; color: transparent; font-variant-numeric: tabular-nums; }
.away-note { margin: 0; font-size: 14px; color: #8c5e3c; min-height: 1.2em; }

.era-event { background: radial-gradient(circle at 50% 45%, var(--ev-a, #6b3b1c), var(--ev-b, #1a0c06) 75%); z-index: 100; -webkit-backdrop-filter: none; backdrop-filter: none; overflow: hidden; }
.era-event[data-to="0"] { --ev-a: #7a4a22; --ev-b: #1c0f07; }
.era-event[data-to="1"] { --ev-a: #12654c; --ev-b: #04140f; }
.era-event[data-to="2"] { --ev-a: #6a34c4; --ev-b: #0f0524; }
.era-event[data-to="3"] { --ev-a: #1d64b8; --ev-b: #030a1c; }
.era-event[data-to="4"] { --ev-a: #a42c9a; --ev-b: #0a0216; }
.partner-event { --ev-a: #8a5a10; --ev-b: #1a0c02; }
.era-rays { position: absolute; left: 50%; top: 45%; width: 190vmax; height: 190vmax; margin: -95vmax 0 0 -95vmax; background: repeating-conic-gradient(from 0deg, rgba(255, 224, 130, .22) 0 6deg, transparent 6deg 18deg); -webkit-mask: radial-gradient(circle, #000 0%, transparent 38%); mask: radial-gradient(circle, #000 0%, transparent 38%); animation: spin 50s linear infinite; }
.era-card { position: relative; width: min(100%, 360px); text-align: center; color: #fff3dc; animation: eraIn .9s var(--ease) both; }
@keyframes eraIn { from { transform: scale(.6); opacity: 0; letter-spacing: .3em; } }
.era-kicker { margin: 0; font-weight: 800; letter-spacing: .3em; text-transform: uppercase; font-size: 14px; color: var(--gold-1); opacity: .85; }
.era-kicker.dark { color: #b06d10; letter-spacing: .2em; }
.era-card h2 { margin: 6px 0 8px; font-size: 50px; line-height: 1; font-weight: 800; background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 3px 0 rgba(70, 40, 0, .6)) drop-shadow(0 0 24px rgba(246, 196, 69, .5)); }
.era-event[data-to="1"] .era-card h2 { font-family: "Playfair Display", Georgia, serif; }
.era-event[data-to="2"] .era-card h2 { font-family: "Cinzel", Georgia, serif; font-weight: 700; font-size: 44px; }
.era-event[data-to="3"] .era-card h2 { font-family: "Orbitron", sans-serif; font-weight: 700; font-size: 34px; letter-spacing: .02em; }
.era-event[data-to="4"] .era-card h2 { font-family: "Exo 2", sans-serif; font-style: italic; font-weight: 800; font-size: 44px; }
.era-line { margin: 0; font-size: 19px; font-style: italic; opacity: .92; }
.era-worth { margin: 14px 0 0; font-weight: 800; font-size: 16px; color: var(--gold-1); }
.era-pace { margin: 6px 0 0; font-weight: 700; font-size: 15px; color: #c8ffd8; }
.era-card .gold-btn { margin-top: 26px; }
.partner-card .whisker-big { width: 72px; height: 72px; }
.ask-gain { margin: 6px 0 12px; font-size: 18px; font-weight: 800; color: #9a5e10; }
.ask-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; text-align: left; }
.ask-cols > div { padding: 10px 12px; border-radius: 16px; background: #fff; box-shadow: inset 0 0 0 2px #ebcd90; }
.ask-cols b { display: block; font-size: 14px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: #8c5e3c; margin-bottom: 2px; }
.ask-cols ul { margin: 0; padding: 0 0 0 16px; font-size: 14.5px; font-weight: 600; line-height: 1.45; }
.two-btns { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; align-items: end; }
.two-btns .plain-btn { justify-content: center; min-height: 52px; margin: 0; }
.welcome-sub { margin: 6px 0 10px; color: #8c5e3c; font-weight: 600; }
.welcome-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; text-align: left; }
.welcome-list li { display: grid; grid-template-columns: 40px 1fr; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 14px; background: #fff; box-shadow: inset 0 0 0 2px #ebcd90; font-size: 14.5px; font-weight: 600; line-height: 1.2; }
.welcome-list li i { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: radial-gradient(circle at 35% 30%, #fff8e4, #f5cf8f); box-shadow: 0 0 0 1.5px var(--gold-3); }
.welcome-list li i .glyph { width: 70%; height: 70%; }
.welcome-list b { display: block; font-weight: 800; }
.welcome-note { margin: 10px 0 0; font-size: 14.5px; font-weight: 800; color: #9a5e10; }

/* The finale: a walnut door with a brass nameplate, your cat on the frosted glass */
.finale-event { --ev-a: #8a5a10; --ev-b: #120700; overflow-y: auto; }
.finale-card { padding: 8px 0 12px; }
.finale-card .whisker-big { width: 64px; height: 64px; margin: 0 auto 4px; }
.finale-card h2 { font-size: 40px; font-family: "Playfair Display", Georgia, serif; }
.door { position: relative; width: 168px; height: 236px; margin: 6px auto 14px; border-radius: 12px 12px 4px 4px; background: linear-gradient(180deg, #8a4e22, #5e3112 60%, #4a240b); box-shadow: inset 0 0 0 5px #3a1c08, inset 0 0 0 9px #a8682f, 0 18px 40px rgba(0, 0, 0, .5), 0 0 0 3px #f6c445; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding-top: 18px; gap: 12px; }
.door::after { content: ""; position: absolute; right: 18px; top: 194px; width: 14px; height: 14px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff3b0, #d9971a 60%, #8a5a10); box-shadow: 0 2px 3px rgba(0, 0, 0, .4); }
.door-cat { width: 104px; height: 92px; border-radius: 52px 52px 10px 10px; overflow: hidden; display: grid; place-items: end center; background: radial-gradient(circle at 50% 30%, #fff8e4, #e9cf97); box-shadow: inset 0 0 0 4px #3a1c08, inset 0 0 18px rgba(120, 70, 20, .4); }
.door-cat svg { width: 92px; height: 92px; margin-bottom: -10px; }
.door-plate { max-width: 150px; padding: 6px 10px; border-radius: 6px; background: linear-gradient(180deg, #fff3b0, #f6c445 55%, #c98a16); color: #3d2305; font-family: "Playfair Display", Georgia, serif; font-weight: 800; font-size: 14.5px; line-height: 1.1; box-shadow: 0 2px 0 #8a5a10, inset 0 1px 0 rgba(255, 255, 255, .7); }
@media (prefers-reduced-motion: reduce) { .finale-card { animation: none; } }

/* The crown of the perk tree, and the Founding Partner pill */
.perk.crown:not(.ready):not(.owned) { box-shadow: var(--card-shadow), 0 0 0 2px #f6c445; }
.perk.crown.ready { box-shadow: var(--card-shadow), 0 0 0 3px var(--gold-2), 0 0 26px rgba(246, 196, 69, .9); }
.perk.crown b { font-size: 12px; }
.p-title.founder { margin-left: 6px; background: linear-gradient(180deg, #fff, #e9d7b4); color: #5a3a12; }

.sheet-sub { margin: 2px 0 14px; text-align: center; color: #8c5e3c; font-weight: 600; }
.menu-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 6px; }
.menu-stats div { padding: 8px 10px; border-radius: 14px; background: #fff; box-shadow: inset 0 0 0 2px #ebcd90; }
.menu-stats small { display: block; font-size: 11.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #8c5e3c; }
.menu-stats b { display: block; font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-label { margin: 8px 2px 6px; font-weight: 800; font-size: 14px; letter-spacing: .08em; text-transform: uppercase; color: #8c5e3c; }
.cat-pick { display: flex; gap: 10px; justify-content: center; }
.cat-pick button { width: 76px; padding: 4px 0 6px; border-radius: 18px; background: #fff; box-shadow: inset 0 0 0 2px #ebcd90; font-weight: 800; font-size: 14px; text-align: center; }
.cat-pick button[aria-pressed="true"] { box-shadow: inset 0 0 0 3px var(--gold-3), 0 0 14px rgba(246, 196, 69, .6); background: #fff6d8; }
.cat-pick svg { width: 58px; height: 58px; display: block; margin: 0 auto; }
.plain-btn { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 48px; margin-top: 8px; padding: 0 16px; border-radius: 14px; background: #fff; box-shadow: inset 0 0 0 2px #ebcd90; font-weight: 800; font-size: 17px; color: #3f2412; }
.plain-btn small { font-weight: 700; color: #8c5e3c; font-size: 14px; }
.ach-list { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ach-list li { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 16px; background: #fff; box-shadow: inset 0 0 0 2px #ebcd90; }
.ach-list li > i { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff8e4, #f5cf8f); box-shadow: 0 0 0 2px var(--gold-3); }
.ach-list li > i .glyph { width: 66%; height: 66%; }
.ach-list li b { display: block; font-size: 16px; line-height: 1.1; }
.ach-list li small { color: #8c5e3c; font-weight: 600; font-size: 13px; }
.ach-list li.locked { opacity: .5; }
.ach-list li.locked > i { filter: grayscale(1); }

/* ---------- Idle animations for the pictures (art.js) ---------- */
.art *, .gold-art * { transform-box: view-box; }
.a-hop { animation: hop 2.6s var(--ease) infinite; }
@keyframes hop { 0%, 60%, 100% { transform: none; } 70% { transform: translateY(-7px) rotate(20deg); } 80% { transform: translateY(0); } 86% { transform: translateY(-2px); } }
.a-wobble { animation: wobble 3.2s ease-in-out infinite; }
@keyframes wobble { 50% { transform: rotate(-7deg); } }
.a-wiggle { animation: wiggle 2.2s ease-in-out infinite; transform-origin: 43px 45px; }
@keyframes wiggle { 50% { transform: rotate(6deg); } }
.a-steam path { animation: steam 2.8s ease-in-out infinite; }
.a-steam path + path { animation-delay: -1.4s; }
@keyframes steam { 0% { transform: translateY(6px); opacity: 0; } 30% { opacity: .9; } 100% { transform: translateY(-6px); opacity: 0; } }
.a-sway { animation: sway 3.6s ease-in-out infinite; }
@keyframes sway { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }
.a-twinkle { animation: twinkleS 2.4s ease-in-out infinite; }
.a-late { animation-delay: -1.2s; }
@keyframes twinkleS { 0%, 100% { transform: scale(.5); opacity: .3; } 50% { transform: scale(1.1); opacity: 1; } }
.a-swing { animation: swing 2s ease-in-out infinite; }
.a-breathe { animation: breathe 3.4s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.04, .96); } }
@keyframes swing { 0%, 100% { transform: rotate(16deg); } 50% { transform: rotate(-16deg); } }
.a-write { stroke-dasharray: 18; animation: write 3s ease-in-out infinite; }
@keyframes write { 0%, 15% { stroke-dashoffset: 18; } 45%, 85% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: 0; opacity: 0; } }
.a-bob { animation: bobA 2.4s ease-in-out infinite; }
@keyframes bobA { 50% { transform: translateY(-3px) rotate(-4deg); } }
.a-draw { stroke-dasharray: 60; animation: draw 3.6s ease-in-out infinite; }
@keyframes draw { 0% { stroke-dashoffset: 60; } 60%, 100% { stroke-dashoffset: 0; } }
.a-blink { animation: blinkDot 1s steps(2, jump-none) infinite; }
@keyframes blinkDot { 50% { opacity: .15; } }
.a-sniff { animation: sniff 2.2s ease-in-out infinite; }
@keyframes sniff { 0%, 50%, 100% { transform: none; } 60% { transform: translateX(1.5px) rotate(-3deg); } 70% { transform: none; } 80% { transform: translateX(1.5px) rotate(-3deg); } }
.a-flag { animation: flag 1.4s ease-in-out infinite; }
@keyframes flag { 50% { transform: skewY(-8deg) scaleX(.9); } }
.a-spin-slow { animation: spin 9s linear infinite; }
.a-spin { animation: spin 5s linear infinite; }
.a-glint { animation: glint 3.4s ease-in-out infinite; }
@keyframes glint { 0%, 70% { transform: translateX(0); opacity: 0; } 80% { opacity: 1; } 100% { transform: translateX(20px); opacity: 0; } }
.a-slosh { animation: slosh 2.4s ease-in-out infinite; }
@keyframes slosh { 50% { transform: translateX(-4px) translateY(1px); } }
.a-bubbles circle { animation: bubble 2.2s ease-in infinite; }
.a-bubbles circle:nth-child(2) { animation-delay: -.7s; }
.a-bubbles circle:nth-child(3) { animation-delay: -1.4s; }
@keyframes bubble { 0% { transform: translateY(0); opacity: 0; } 20% { opacity: 1; } 100% { transform: translateY(-16px); opacity: 0; } }
.a-rise circle { animation: rise2 2.6s ease-out infinite; }
.a-rise circle + circle { animation-delay: -1.3s; }
@keyframes rise2 { 0% { transform: translateY(8px); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateY(-10px); opacity: 0; } }
.a-rock { animation: rock 2.8s ease-in-out infinite; }
@keyframes rock { 0%, 100% { transform: rotate(-1.5deg); } 50% { transform: rotate(1.5deg) translateX(1px); } }
.a-flip { animation: flip 4s ease-in-out infinite; }
@keyframes flip { 0%, 55%, 100% { transform: scaleX(1); } 70% { transform: scaleX(.08); } 85% { transform: scaleX(1); } }
.a-orbit { animation: spin 7s linear infinite; }
.a-orbit circle { animation: spin 7s linear infinite reverse; transform-box: fill-box; transform-origin: center; }
.a-tail { animation: tail 2.2s ease-in-out infinite; }
@keyframes tail { 50% { transform: rotate(-8deg); } }
.a-wing { animation: wingF 1.8s ease-in-out infinite; }
@keyframes wingF { 50% { transform: rotate(9deg); } }
.a-blink-eye { animation: blinkEye 4.2s ease-in-out infinite; transform-origin: 32px 16px; }
@keyframes blinkEye { 0%, 92%, 100% { transform: none; } 96% { transform: scaleY(.2); } }
.a-smoke circle { animation: smoke 3s ease-out infinite; }
.a-smoke circle + circle { animation-delay: -.6s; }
@keyframes smoke { 0%, 50% { transform: none; opacity: 0; } 60% { opacity: .8; } 100% { transform: translate(6px, -6px) scale(1.6); opacity: 0; } }
.a-gtail { animation: tail 1s ease-in-out infinite; }
.a-leg-a { animation: legA .5s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 0; }
.a-leg-b { animation: legA .5s ease-in-out infinite reverse; transform-box: fill-box; transform-origin: 50% 0; }
@keyframes legA { 0%, 100% { transform: rotate(18deg); } 50% { transform: rotate(-18deg); } }
.a-wing-l { animation: wingL .35s ease-in-out infinite; }
.a-wing-r { animation: wingR .35s ease-in-out infinite; }
@keyframes wingL { 50% { transform: rotate(18deg); } }
@keyframes wingR { 50% { transform: rotate(-18deg); } }
/* the Space and Cosmic Eras' pictures */
.a-float { animation: floatA 3.4s ease-in-out infinite; }
@keyframes floatA { 50% { transform: translate(2px, -4px) rotate(8deg); } }
.a-signal path { animation: signal 1.8s ease-out infinite; }
.a-signal path + path { animation-delay: .35s; }
@keyframes signal { 0% { opacity: 0; } 30% { opacity: 1; } 100% { opacity: 0; } }
.a-hammer { animation: hammer 1.6s cubic-bezier(.6, 0, .4, 1) infinite; }
@keyframes hammer { 0%, 100% { transform: rotate(-22deg); } 55% { transform: rotate(-22deg); } 70% { transform: rotate(2deg); } 76% { transform: rotate(-3deg); } }
.a-spin-back { animation: spin 6s linear infinite reverse; }
.a-spin-back-slow { animation: spin 24s linear infinite reverse; }
.a-tick-back { animation: spin 4s steps(12) infinite reverse; }
.a-swirl { animation: swirl 2.6s linear infinite; }
@keyframes swirl { to { stroke-dashoffset: -28; } }
.a-spiral { animation: spiral 4.2s ease-in infinite; }
.a-spiral.a-late { animation-delay: -2.1s; }
@keyframes spiral { 0% { transform: rotate(0) scale(1); opacity: 1; } 85% { opacity: 1; } 100% { transform: rotate(300deg) scale(.15); opacity: 0; } }
.a-later { animation-delay: -.8s; }
.a-bob.a-late { animation-delay: -1.2s; }
.a-bob.a-later { animation-delay: -.6s; }
.a-drift { animation: driftA 7s ease-in-out infinite alternate; }
@keyframes driftA { to { transform: translateX(3px) scale(1.03); } }
.a-burst { animation: burst 2.8s ease-in-out infinite; }
@keyframes burst { 0%, 100% { transform: scale(.94) rotate(0); } 50% { transform: scale(1.06) rotate(8deg); } }
.a-flame { animation: flame .18s ease-in-out infinite alternate; }
@keyframes flame { to { transform: scaleX(.78); } }
.a-tailstream { animation: tailStream .9s ease-in-out infinite alternate; }
@keyframes tailStream { to { transform: scaleX(.9) skewY(2deg); } }
/* Cards off screen don't animate */
.v.off .art *, .v.off .bar-fill::before { animation-play-state: paused !important; }

/* ---------- Small phones ---------- */
@media (max-width: 374px) {
  :root { --gutter: 10px; }
  .cash { font-size: 38px; }
  .ips { font-size: 16.5px; }
  .v { grid-template-columns: 58px 1fr; gap: 6px 10px; padding: 10px; }
  .v-icon { width: 58px; height: 58px; border-radius: 18px; }
  .v-name { font-size: 16.5px; }
  [data-era="2"] .v-name { font-size: 15px; }
  [data-era="3"] .v-name { font-size: 13px; }
  [data-era="4"] .v-name { font-size: 15px; }
  .buy, .hire { padding: 0 9px; font-size: 14px; }
  .buy span { font-size: 15.5px; }
  .era-card h2 { font-size: 42px; }
  .seg button { min-width: 44px; padding: 0 5px; font-size: 15px; }
  .up { grid-template-columns: 46px 1fr auto; gap: 8px; }
  .up-ic { width: 46px; height: 46px; }
  .up .buy { min-width: 84px; }
}
@media (max-height: 700px) { .hud { padding-top: calc(var(--sg-corner-top) - 2px); } .cash { font-size: 36px; } .ips { font-size: 16px; } .hud-top, .hud-top .sg-top { height: 48px; min-height: 48px; } .side-btn { width: 48px; height: 48px; } .hud-bar { margin-top: 6px; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .bg { transition: opacity .3s !important; }
  .cat-rays, .bg i, .art *, .gold-art, .gold-art * { animation: none !important; }
}

/* ---------- The places sheet ---------- */
.places .sheet-sub { margin-top: 0; }
.places-era { margin: 16px 0 7px; font: 800 13px/1.1 var(--round); letter-spacing: .08em; text-transform: uppercase; color: #8c5e3c; }
.places-era.dim { color: #c4a57e; }
.places-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.pl { margin: 0; border-radius: 14px; overflow: hidden; background: #fffdf6; box-shadow: 0 0 0 1.5px #efd29a, 0 4px 10px rgba(90, 45, 10, .16); }
.pl.here { box-shadow: 0 0 0 3px var(--gold-2), 0 4px 14px rgba(185, 122, 12, .4); }
.pl-pic { position: relative; display: block; aspect-ratio: 3 / 2; overflow: hidden; background: #2d190e; }
.pl-pic img { position: absolute; left: 0; top: -7.7%; width: 100%; height: auto; display: block; }
.pl.next .pl-pic::after { content: ""; position: absolute; inset: 0; background: rgba(24, 12, 4, .74); }
.pl-lock { position: absolute; left: 50%; top: 50%; z-index: 1; width: 34px; height: 34px; transform: translate(-50%, -50%); }
.pl-tag { position: absolute; left: 8px; top: 8px; padding: 1px 9px; border-radius: 99px; font: 800 11.5px/1.5 var(--round); font-style: normal; color: #4a2a08; background: var(--gold-grad); box-shadow: 0 1px 4px rgba(0, 0, 0, .4); }
.places-later { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.places-grid + .places-later { margin-top: 10px; }
.pl-chip { width: 34px; height: 34px; padding: 7px; border-radius: 10px; background: repeating-linear-gradient(45deg, #efe0c2 0 6px, #e6d3ad 6px 12px); box-shadow: 0 0 0 1.5px #efd29a; opacity: .8; }
.places-later span { margin-left: 4px; font-size: 12.5px; font-weight: 700; color: #a8825a; }
.pl figcaption { display: grid; gap: 2px; padding: 6px 9px 8px; }
.pl figcaption b { font-size: 13.5px; line-height: 1.15; color: #3f2412; }
.pl figcaption small { font-size: 12px; line-height: 1.25; color: #8c5e3c; }
.pl-bar { margin-top: 4px; --pb-fill: linear-gradient(90deg, #f6c445, #d9971a); }
.pl-bar .pb-text { font-size: 11.5px; }

/* ---------- the shared menus (shared/mainmenu.js): colors only, through the --sg-* variables ---------- */
#mm {
  --sg-bg: radial-gradient(120% 90% at 20% 0%, var(--hud-glow), transparent 60%), linear-gradient(180deg, var(--hud-a), var(--hud-b));
  --sg-ink: #fff3dc; --sg-ink-soft: rgba(255, 238, 205, .86); /* light in every era (the eras' --accent is dark from Finance on) */
  --sg-title: var(--gold-1); --sg-title-shadow: 0 3px 0 var(--gold-4), 0 8px 16px rgba(0, 0, 0, .45);
  --sg-accent: var(--gold-2); --sg-accent-ink: #3d2305;
  --sg-card: var(--card); --sg-card-ink: var(--ink); --sg-line: var(--edge);
  --sg-font: var(--round);
}
.sg-sheet { --sg-sheet-bg: #fffaf0; --sg-sheet-ink: #3f2412; --sg-accent: var(--gold-2); --sg-accent-ink: #3d2305; --sg-ink-soft: #8c5e3c; }
.sg-sheet .cat-pick button { color: #3f2412; }
