:root {
  --ink: #403847;
  --muted: #766d7b;
  --cream: #fffaf0;
  --paper: #fffdf7;
  --lavender: #e8dff0;
  --lavender-deep: #806b8b;
  --rose: #edb9b6;
  --peach: #f5d7b2;
  --sage: #cad9bd;
  --mint: #d9e8d0;
  --gold: #d19b3e;
  --line: #e4dbd4;
  --shadow: 0 7px 0 rgba(86, 70, 91, 0.08), 0 12px 30px rgba(72, 59, 77, 0.08);
  --radius: 20px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { min-height: 100%; background: #ded5e4; scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 300px;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 10%, rgba(255,255,255,.7) 0 3px, transparent 4px),
    linear-gradient(160deg, #ebe3ee, #d8e4d2);
  font-family: ui-rounded, "Arial Rounded MT Bold", "Trebuchet MS", system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

button, input, select { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible {
  outline: 3px solid #6e5a79;
  outline-offset: 3px;
}

.skip-link { position: fixed; top: -80px; left: 12px; z-index: 100; padding: 10px 14px; border-radius: 10px; background: #fff; color: #222; }
.skip-link:focus { top: 12px; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; clip-path: inset(50%) !important; white-space: nowrap !important; }

.app-shell {
  width: min(100%, 720px);
  min-height: 100vh;
  margin: 0 auto;
  padding-bottom: calc(86px + env(safe-area-inset-bottom));
  background: var(--cream);
  box-shadow: 0 0 60px rgba(70, 55, 75, .18);
}

.topbar { display: flex; align-items: center; justify-content: space-between; padding: 18px 18px 10px; }
.brand-lockup { display: flex; gap: 10px; align-items: center; }
.brand-paw { display: grid; place-items: center; width: 42px; height: 42px; border: 2px solid #66546f; border-radius: 15px; background: var(--rose); font-size: 23px; box-shadow: 3px 3px 0 #66546f; }
.eyebrow { margin: 0 0 3px; color: var(--muted); font-size: .68rem; font-weight: 900; letter-spacing: .13em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin: 0; font-size: clamp(1.12rem, 5vw, 1.45rem); line-height: 1; letter-spacing: -.03em; }
h2 { margin-bottom: 7px; font-size: clamp(1.45rem, 6vw, 2rem); letter-spacing: -.035em; }
h3 { margin: 0; font-size: 1.08rem; }
.icon-button { width: 40px; height: 40px; border: 2px solid var(--line); border-radius: 50%; background: var(--paper); font-weight: 900; cursor: pointer; }

.player-strip { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 9px 10px; margin: 6px 14px 14px; padding: 11px 12px; border: 2px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.78); box-shadow: 0 4px 0 rgba(80,65,85,.05); }
.mini-cat { position: relative; display: grid; place-items: center; width: 45px; height: 45px; border-radius: 14px 14px 17px 17px; background: var(--lavender); font-family: Consolas, monospace; font-weight: 900; white-space: nowrap; }
.mini-cat::before { content: "▲    ▲"; position: absolute; top: -6px; left: 50%; translate: -50%; color: var(--mini-fur, #4b424f); font-size: .68rem; letter-spacing: -.15em; }
.player-identity { min-width: 0; }
.player-identity strong, .player-identity span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-identity span { margin-top: 2px; color: var(--muted); font-size: .72rem; }
.resource-pill { display: inline-flex; align-items: center; gap: 5px; padding: 7px 10px; border-radius: 999px; background: #f5ead0; font-size: .9rem; }
.coin-pill span { color: var(--gold); text-shadow: 1px 1px 0 #7d5b26; }
.energy-summary { grid-column: 2 / -1; }
.energy-label { display: flex; justify-content: space-between; margin-bottom: 4px; color: var(--muted); font-size: .68rem; }
.meter { height: 8px; overflow: hidden; border: 1px solid #dbd1c9; border-radius: 99px; background: #eee7e1; }
.meter span { display: block; height: 100%; width: 50%; border-radius: inherit; background: linear-gradient(90deg, #9fbe8c, #c4d8a8); transition: width .3s ease; }
.action-runner { margin: 0 14px 14px; padding: 11px 12px 10px; border: 2px solid #a991b3; border-radius: 16px; background: linear-gradient(135deg, #eee4f2, #f6e8dc); box-shadow: 0 4px 0 rgba(75,61,79,.08); }
.runner-top { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 9px; }
.runner-cat { display: grid; place-items: center; width: 40px; height: 36px; border-radius: 12px; background: rgba(255,255,255,.58); font: 900 .82rem Consolas, monospace; }
.runner-top strong, .runner-top small { display: block; }
.runner-top strong { font-size: .82rem; }
.runner-top small { margin-top: 2px; color: var(--muted); font-size: .62rem; }
.runner-countdown { color: #6c5875; font-size: .78rem; font-variant-numeric: tabular-nums; }
.runner-meter { height: 10px; margin-top: 8px; overflow: hidden; border: 1px solid #cbbdce; border-radius: 99px; background: rgba(255,255,255,.7); }
.runner-meter span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #9074a0, #d19aa4); transition: width .09s linear; }
.action-runner p { margin: 6px 0 0; color: var(--muted); font-size: .59rem; text-align: center; }

main { padding: 0 14px 26px; }
.page[hidden] { display: none; }
.page { animation: page-in .22s ease both; }
@keyframes page-in { from { opacity: 0; transform: translateY(5px); } }

.hero-card { position: relative; min-height: 188px; overflow: hidden; display: grid; grid-template-columns: minmax(130px, 43%) 1fr; align-items: center; padding: 18px; border: 2px solid #bca9c5; border-radius: 26px; background: linear-gradient(145deg, var(--lavender), #f5e5db); box-shadow: var(--shadow); }
.hero-card::after { content: ""; position: absolute; right: -30px; bottom: -45px; width: 160px; height: 100px; border-radius: 50% 50% 0 0; background: rgba(198,217,185,.6); }
.sky-speckles { position: absolute; inset: 0; opacity: .45; background-image: radial-gradient(#fff 1.5px, transparent 2px); background-size: 27px 27px; }
.cat-stage { position: relative; z-index: 1; display: grid; place-items: center; width: min(100%, 158px); aspect-ratio: 1; border: 3px solid rgba(76,62,80,.6); border-radius: 28px; background: var(--cat-bg, linear-gradient(#dce8d2, #c6d9bd)); box-shadow: inset 0 -14px 0 rgba(77,67,78,.07), 5px 6px 0 rgba(77,67,78,.14); transition: background .2s ease; }
.cat-head { --head-tilt: 0deg; --muzzle-fill: color-mix(in srgb, var(--fur-base, #4b424f) 65%, white); position: absolute; z-index: 1; left: 50%; top: 56%; width: 76%; aspect-ratio: 1 / .88; translate: -50% -50%; rotate: var(--head-tilt); border: 3px solid rgba(62,52,65,.8); border-radius: 43% 43% 48% 48% / 46% 46% 54% 54%; background: var(--fur-fill, #4b424f); box-shadow: inset 0 -10px 0 rgba(30,25,34,.1), 0 5px 0 rgba(63,52,67,.14); transition: width .2s ease, aspect-ratio .2s ease, border-radius .2s ease, rotate .2s ease; }
.cat-head::after { content: ""; position: absolute; z-index: 0; left: 50%; bottom: 16%; width: 46%; height: 27%; translate: -50%; border-radius: 50%; background: var(--muzzle-fill); opacity: .52; transition: width .2s ease, height .2s ease, bottom .2s ease, border-radius .2s ease; }
.cat-head[data-shape="bean"] { --head-tilt: -2deg; width: 73%; aspect-ratio: 1 / .96; border-radius: 52% 39% 47% 52% / 43% 48% 55% 57%; }
.cat-head[data-shape="wedge"] { width: 68%; aspect-ratio: 1 / 1.02; border-radius: 37% 37% 54% 54% / 31% 31% 66% 66%; }
.cat-head[data-shape="broad"] { width: 83%; aspect-ratio: 1 / .76; border-radius: 45% 45% 51% 51% / 43% 43% 58% 58%; }
.cat-head[data-shape="fluffy"] { width: 80%; aspect-ratio: 1 / .86; border-radius: 35% 42% 47% 39% / 40% 37% 59% 55%; box-shadow: inset 0 -10px 0 rgba(30,25,34,.1), 0 5px 0 rgba(63,52,67,.14), -5px 3px 0 color-mix(in srgb, var(--fur-base) 82%, white), 5px 7px 0 color-mix(in srgb, var(--fur-base) 86%, white); }
.cat-ear { position: absolute; z-index: -1; top: -26%; width: 42%; aspect-ratio: 1; clip-path: polygon(50% 0, 100% 100%, 0 100%); background: rgba(62,52,65,.85); transform-origin: 50% 100%; transition: inset .2s ease, width .2s ease, clip-path .2s ease, border-radius .2s ease; }
.cat-ear::after { content: ""; position: absolute; inset: 7px 7px 3px; clip-path: inherit; background: color-mix(in srgb, var(--fur-base, #4b424f) 68%, #f6b9bb); }
.cat-ear-left { left: 3%; rotate: -10deg; }
.cat-ear-right { right: 3%; rotate: 10deg; }
.cat-head[data-ears="perky"] .cat-ear { top: -36%; width: 38%; clip-path: polygon(50% 0, 96% 100%, 4% 100%); }
.cat-head[data-ears="perky"] .cat-ear-left { left: 7%; rotate: -5deg; }
.cat-head[data-ears="perky"] .cat-ear-right { right: 7%; rotate: 5deg; }
.cat-head[data-ears="wide"] .cat-ear { top: -18%; width: 48%; }
.cat-head[data-ears="wide"] .cat-ear-left { left: -9%; rotate: -24deg; }
.cat-head[data-ears="wide"] .cat-ear-right { right: -9%; rotate: 24deg; }
.cat-head[data-ears="folded"] .cat-ear { top: -14%; width: 38%; clip-path: polygon(2% 12%, 100% 48%, 44% 100%); border-radius: 38% 60% 15%; }
.cat-head[data-ears="folded"] .cat-ear-left { left: -3%; rotate: -19deg; }
.cat-head[data-ears="folded"] .cat-ear-right { right: -3%; rotate: 109deg; }
.cat-head[data-ears="tufted"] .cat-ear { top: -31%; width: 40%; clip-path: polygon(50% 0, 58% 15%, 100% 100%, 0 100%, 43% 15%); }
.cat-face { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.cat-brows { position: absolute; z-index: 4; top: 26%; left: 50%; display: flex; justify-content: space-between; width: 61%; translate: -50%; pointer-events: none; }
.cat-brows i { width: 23px; height: 9px; border-top: 3px solid var(--face-ink, #fff7e9); border-radius: 50%; opacity: 0; transition: opacity .15s ease, rotate .15s ease, translate .15s ease; }
.drawn-eyes { position: absolute; z-index: 3; top: 31%; left: 50%; display: flex; justify-content: space-between; width: 60%; translate: -50%; animation: cat-blink 9s linear infinite; transform-origin: center; }
.drawn-eyes i { position: relative; display: block; width: 26px; height: 31px; overflow: hidden; border: 2.5px solid #493e4d; border-top-width: 4px; border-radius: 49% 49% 52% 52% / 43% 43% 57% 57%; background: linear-gradient(180deg, #fffdf6 0 62%, #f8e8df 100%); box-shadow: inset 0 -4px 0 rgba(155,112,137,.13), 0 1px 0 rgba(255,255,255,.35); transition: width .16s ease, height .16s ease, rotate .16s ease, scale .16s ease, border-radius .16s ease; }
.drawn-eyes i:last-child { width: 25px; translate: 0 1px; }
.drawn-eyes i::before { content: ""; position: absolute; left: 50%; top: 54%; width: 14px; height: 20px; translate: -50% -45%; border-radius: 50% 50% 46% 46%; background: linear-gradient(180deg, #403448 0 47%, #765777 70%, #bd8193 100%); box-shadow: inset 0 -3px 0 rgba(255,194,207,.18); }
.drawn-eyes i::after { content: ""; position: absolute; left: 28%; top: 18%; width: 6px; height: 7px; border-radius: 50%; background: #fff; box-shadow: 8px 9px 0 -2px rgba(255,255,255,.9); }
.cat-head[data-eyes="sparkle"] .drawn-eyes i { border-radius: 52% 48% 55% 45% / 44% 45% 55% 56%; background: linear-gradient(180deg, #fffef4, #f8e7f2); }
.cat-head[data-eyes="sparkle"] .drawn-eyes i:last-child { border-radius: 48% 52% 45% 55% / 45% 44% 56% 55%; }
.cat-head[data-eyes="sparkle"] .drawn-eyes i::before { width: 17px; height: 18px; border-radius: 0; background: linear-gradient(145deg, #665087, #d37f9d); clip-path: polygon(50% 0, 62% 35%, 100% 50%, 62% 63%, 50% 100%, 38% 63%, 0 50%, 38% 35%); }
.cat-head[data-eyes="sparkle"] .drawn-eyes i::after { left: 25%; top: 17%; width: 6px; height: 6px; box-shadow: 10px 10px 0 -2px rgba(255,255,255,.92); }
.cat-head[data-eyes="almond"] .drawn-eyes i { width: 29px; height: 20px; border-radius: 64% 36% 58% 42% / 58% 45% 55% 42%; rotate: -4deg; }
.cat-head[data-eyes="almond"] .drawn-eyes i:last-child { width: 29px; border-radius: 36% 64% 42% 58% / 45% 58% 42% 55%; rotate: 4deg; }
.cat-head[data-eyes="almond"] .drawn-eyes i::before { width: 9px; height: 15px; }
.cat-head[data-eyes="almond"] .drawn-eyes i::after { width: 4px; height: 5px; }
.cat-head[data-eyes="sleepy"] .drawn-eyes, .cat-head[data-expression="sleepy"] .drawn-eyes { animation: none; }
.cat-head[data-eyes="sleepy"] .drawn-eyes i, .cat-head[data-expression="sleepy"] .drawn-eyes i { height: 13px; border-width: 0 0 3px; border-radius: 0 0 50% 50%; background: transparent; box-shadow: none; }
.cat-head[data-eyes="sleepy"] .drawn-eyes i::before, .cat-head[data-eyes="sleepy"] .drawn-eyes i::after, .cat-head[data-expression="sleepy"] .drawn-eyes i::before, .cat-head[data-expression="sleepy"] .drawn-eyes i::after { display: none; }
.cat-head[data-eyes="wide"] .drawn-eyes i { width: 29px; height: 34px; }
.cat-head[data-eyes="wide"] .drawn-eyes i::before { width: 16px; height: 22px; }
.cat-head[data-eyes="sideeye"] .drawn-eyes i { width: 29px; height: 20px; border-radius: 53% 47% 45% 55%; }
.cat-head[data-eyes="sideeye"] .drawn-eyes i::before { left: 68%; width: 10px; height: 15px; }
.cat-head[data-eyes="odd"] .drawn-eyes i:first-child { scale: .86; }
.cat-head[data-eyes="odd"] .drawn-eyes i:first-child::before { background: linear-gradient(#36526f, #6c9ec5 65%, #a7d6e2); }
.cat-head[data-eyes="odd"] .drawn-eyes i:last-child::before { background: linear-gradient(#405c3a, #7dab6f 65%, #c1daa5); }
.cat-head[data-eyes="hearts"] .drawn-eyes i::before { width: 20px; height: 19px; background: linear-gradient(145deg, #c95f78, #ef9bad); clip-path: polygon(50% 92%, 7% 49%, 7% 25%, 20% 8%, 39% 8%, 50% 22%, 61% 8%, 80% 8%, 93% 25%, 93% 49%); }
.cat-head[data-eyes="hearts"] .drawn-eyes i::after { left: 29%; top: 20%; width: 5px; height: 6px; box-shadow: none; }
.cat-head[data-eyes="stars"] .drawn-eyes i::before { content: "★"; top: 49%; width: auto; height: auto; background: transparent; color: #d7a743; font-size: 1.25rem; line-height: 1; text-shadow: 0 1px 0 #705a34; }
.cat-head[data-eyes="stars"] .drawn-eyes i::after { left: 24%; top: 18%; width: 5px; height: 5px; box-shadow: none; }
.cat-head[data-muzzle="tiny"]::after { bottom: 19%; width: 33%; height: 20%; }
.cat-head[data-muzzle="split"]::after { bottom: 14%; width: 54%; height: 29%; background: radial-gradient(ellipse at 29% 52%, var(--muzzle-fill) 0 49%, transparent 51%), radial-gradient(ellipse at 71% 52%, var(--muzzle-fill) 0 49%, transparent 51%); opacity: .7; }
.cat-head[data-muzzle="long"]::after { bottom: 9%; width: 40%; height: 39%; border-radius: 46% 46% 42% 42%; }
.cat-head[data-muzzle="flat"]::after { bottom: 19%; width: 57%; height: 20%; border-radius: 44% 44% 54% 54%; opacity: .62; }
.cat-nose { position: absolute; z-index: 4; left: 50%; top: 58%; width: 12px; height: 9px; translate: -50%; clip-path: polygon(0 0,100% 0,50% 100%); background: #e9a5a7; filter: drop-shadow(0 1px 0 rgba(50,40,53,.35)); transition: top .18s ease, scale .18s ease; }
.cat-mouth { position: absolute; z-index: 4; left: 50%; top: 65%; width: 32px; height: 20px; translate: -50%; transition: top .18s ease, rotate .18s ease, scale .18s ease; }
.cat-mouth::before, .cat-mouth::after { content: ""; position: absolute; top: 0; width: 17px; height: 12px; border-bottom: 3px solid var(--face-ink, #fff7e9); }
.cat-mouth::before { right: 50%; border-radius: 0 0 12px 12px; rotate: -6deg; }
.cat-mouth::after { left: 50%; border-radius: 0 0 12px 12px; rotate: 6deg; }
.cat-head[data-muzzle="tiny"] .cat-nose { top: 60%; scale: .78; }
.cat-head[data-muzzle="tiny"] .cat-mouth { top: 66%; scale: .82; }
.cat-head[data-muzzle="long"] .cat-nose { top: 56%; }
.cat-head[data-muzzle="long"] .cat-mouth { top: 68%; }
.cat-head[data-muzzle="flat"] .cat-nose { top: 61%; scale: 1.15 .75; }
.cat-head[data-muzzle="flat"] .cat-mouth { top: 66%; scale: 1.2 .72; }
.cat-head[data-expression="sleepy"] { --head-tilt: 2deg; }
.cat-head[data-expression="sleepy"] .cat-mouth { scale: .85; }
.cat-head[data-expression="wink"] { --head-tilt: -3deg; }
.cat-head[data-expression="wink"] .drawn-eyes i:last-child { height: 11px; margin-top: 9px; border-width: 0 0 3px; border-radius: 0 0 50% 50%; background: transparent; box-shadow: none; rotate: -8deg; }
.cat-head[data-expression="wink"] .drawn-eyes i:last-child::before, .cat-head[data-expression="wink"] .drawn-eyes i:last-child::after { display: none; }
.cat-head[data-expression="wink"] .cat-mouth { left: 52%; rotate: -4deg; scale: 1.08; }
.cat-head[data-expression="wow"] .drawn-eyes i { scale: 1.12; }
.cat-head[data-expression="wow"] .cat-mouth::before { left: 50%; width: 15px; height: 15px; translate: -50%; border: 3px solid var(--face-ink); border-radius: 50%; }
.cat-head[data-expression="wow"] .cat-mouth::after { display: none; }
.cat-head[data-expression="wow"] .emotion-mark::before { content: "✦"; }
.cat-head[data-expression="judge"] { --head-tilt: -2deg; }
.cat-head[data-expression="judge"] .drawn-eyes { top: 37%; }
.cat-head[data-expression="judge"] .drawn-eyes i { scale: 1 .58; }
.cat-head[data-expression="judge"] .drawn-eyes i::before { left: 66%; }
.cat-head[data-expression="judge"] .cat-brows i { opacity: .85; }
.cat-head[data-expression="judge"] .cat-brows i:first-child { rotate: 8deg; }
.cat-head[data-expression="judge"] .cat-brows i:last-child { rotate: -8deg; }
.cat-head[data-expression="judge"] .cat-mouth { rotate: -9deg; }
.cat-head[data-expression="worried"] { --head-tilt: 3deg; }
.cat-head[data-expression="worried"] .cat-brows i { opacity: .9; }
.cat-head[data-expression="worried"] .cat-brows i:first-child { rotate: -17deg; translate: 0 -3px; }
.cat-head[data-expression="worried"] .cat-brows i:last-child { rotate: 17deg; translate: 0 -3px; }
.cat-head[data-expression="worried"] .cat-mouth { top: 70%; rotate: 180deg; scale: .85; }
.cat-head[data-expression="worried"] .emotion-mark::before { content: "◜"; color: #bfe0ea; rotate: -25deg; }
.cat-head[data-expression="derpy"] { --head-tilt: -4deg; }
.cat-head[data-expression="derpy"] .drawn-eyes i:first-child { width: 20px; height: 24px; translate: 1px 6px; }
.cat-head[data-expression="derpy"] .drawn-eyes i:last-child { width: 29px; height: 31px; translate: 0 -2px; }
.cat-head[data-expression="derpy"] .drawn-eyes i:first-child::before { left: 66%; top: 62%; }
.cat-head[data-expression="derpy"] .drawn-eyes i:last-child::before { left: 34%; top: 39%; }
.cat-head[data-expression="derpy"] .cat-mouth { left: 53%; rotate: 7deg; }
.cat-head[data-expression="grumpy"] .cat-brows i { opacity: 1; }
.cat-head[data-expression="grumpy"] .cat-brows i:first-child { rotate: 20deg; translate: 0 5px; }
.cat-head[data-expression="grumpy"] .cat-brows i:last-child { rotate: -20deg; translate: 0 5px; }
.cat-head[data-expression="grumpy"] .drawn-eyes i { scale: 1 .72; }
.cat-head[data-expression="grumpy"] .cat-mouth { top: 70%; rotate: 180deg; scale: .9; }
.cat-head[data-expression="love"] { --head-tilt: 3deg; }
.cat-head[data-expression="love"] .drawn-eyes i::before { width: 20px; height: 18px; background: #df7886; clip-path: polygon(50% 92%, 7% 49%, 7% 25%, 20% 8%, 39% 8%, 50% 22%, 61% 8%, 80% 8%, 93% 25%, 93% 49%); }
.cat-head[data-expression="love"] .drawn-eyes i::after { display: none; }
.cat-head[data-expression="love"] .cat-mouth { scale: 1.2; }
.cat-head[data-expression="love"] .emotion-mark::before { content: "♡"; color: #dd7481; }
.cat-head[data-expression="owo"] .cat-brows i { opacity: .9; }
.cat-head[data-expression="owo"] .cat-brows i:first-child { rotate: -14deg; }
.cat-head[data-expression="owo"] .cat-brows i:last-child { rotate: 14deg; }
.cat-head[data-expression="owo"] .cat-mouth { scale: 1.25; }
.emotion-mark { position: absolute; z-index: 6; top: 13%; right: 4%; pointer-events: none; }
.emotion-mark::before { font-size: 1.2rem; font-weight: 900; text-shadow: 0 1px 0 rgba(67,53,70,.2); }
.face-feature { position: absolute; z-index: 5; inset: 0; pointer-events: none; }
.cat-head[data-feature="rosy"] .face-feature::before, .cat-head[data-feature="rosy"] .face-feature::after { content: ""; position: absolute; top: 61%; width: 16px; height: 8px; border-radius: 50%; background: #e99da4; opacity: .72; }
.cat-head[data-feature="rosy"] .face-feature::before { left: 15%; }
.cat-head[data-feature="rosy"] .face-feature::after { right: 15%; }
.cat-head[data-feature="freckles"] .face-feature { background: radial-gradient(circle at 27% 64%, var(--face-ink) 0 1.5px, transparent 2px), radial-gradient(circle at 32% 68%, var(--face-ink) 0 1.5px, transparent 2px), radial-gradient(circle at 73% 64%, var(--face-ink) 0 1.5px, transparent 2px), radial-gradient(circle at 68% 68%, var(--face-ink) 0 1.5px, transparent 2px); opacity: .6; }
.cat-head[data-feature="fang"] .face-feature::after { content: ""; position: absolute; left: 58%; top: 69%; width: 8px; height: 10px; clip-path: polygon(0 0,100% 0,50% 100%); background: #fff; }
.cat-head[data-feature="tongue"] .face-feature::after { content: ""; position: absolute; left: 50%; top: 73%; width: 13px; height: 10px; translate: -50%; border-radius: 0 0 8px 8px; background: #e99da4; }
@keyframes cat-blink { 0%, 92%, 96%, 100% { scale: 1 1; } 94% { scale: 1 .08; } }
.cat-whiskers { position: absolute; z-index: 2; inset: 0; pointer-events: none; }
.cat-whiskers::before, .cat-whiskers::after { content: ""; position: absolute; top: 61%; width: 27%; height: 2px; border-radius: 3px; background: var(--face-ink, #fff7e9); box-shadow: 0 7px 0 var(--face-ink, #fff7e9); opacity: .82; }
.cat-whiskers::before { left: -10%; rotate: 7deg; }
.cat-whiskers::after { right: -10%; rotate: -7deg; }
.cat-hat { position: absolute; z-index: 4; top: 18%; left: 50%; translate: -50% -50%; font-size: 1.7rem; filter: drop-shadow(2px 2px 0 rgba(70,60,72,.3)); }
.cat-collar { position: absolute; z-index: 3; bottom: -4px; left: 50%; translate: -50%; width: 52%; height: 9px; border: 2px solid rgba(55,46,58,.45); border-radius: 10px; background: var(--collar-color, transparent); box-shadow: 0 2px 0 rgba(60,50,63,.2); }
.cat-collar[data-none="true"] { display: none; }
.hero-copy { position: relative; z-index: 2; }
.hero-copy p { margin: 0; color: #675e6c; font-size: .86rem; line-height: 1.45; }
.title-badge { display: inline-block; margin-bottom: 8px; padding: 5px 8px; border: 1px solid rgba(80,67,85,.25); border-radius: 8px; background: rgba(255,255,255,.58); color: #665670; font-size: .65rem; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; }

.section-heading, .page-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 24px 2px 11px; }
.section-heading.compact { margin-top: 21px; }
.page-heading { margin-top: 7px; }
.page-heading h2 { margin: 0; }
.level-chip { padding: 6px 9px; border-radius: 9px; background: var(--lavender); color: #675770; font-size: .73rem; white-space: nowrap; }
.text-button { border: 0; padding: 5px; background: transparent; color: #735f7d; font-size: .78rem; font-weight: 800; text-decoration: underline; cursor: pointer; }

.action-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.action-card { position: relative; min-height: 134px; overflow: hidden; border: 2px solid var(--line); border-radius: 18px; padding: 13px; background: var(--paper); text-align: left; box-shadow: 0 4px 0 rgba(77,62,80,.07); cursor: pointer; transition: transform .12s, box-shadow .12s; }
.action-card:first-child { background: #f7ebd6; }
.action-card:nth-child(2) { background: #e3eadb; }
.action-card:nth-child(3) { background: #e4e1ed; }
.action-card:nth-child(4) { background: #e5edf0; }
.action-card:nth-child(5) { grid-column: 1 / -1; min-height: 102px; background: #f1e1e4; }
.action-card:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(77,62,80,.08); }
.action-card:disabled { cursor: not-allowed; filter: grayscale(.35); opacity: .58; }
.action-icon { display: inline-grid; place-items: center; width: 38px; height: 38px; margin-bottom: 9px; border: 1px solid rgba(60,50,65,.15); border-radius: 12px; background: rgba(255,255,255,.55); font-size: 1.25rem; }
.action-card strong, .action-card small { display: block; }
.action-card small { margin-top: 5px; color: var(--muted); font-size: .68rem; }
.action-cost { position: absolute; top: 12px; right: 12px; padding: 4px 6px; border-radius: 7px; background: rgba(255,255,255,.7); color: #766777; font-size: .65rem; font-weight: 900; }
.action-card.locked-action { background: #eeeae7; }
.action-card .next-unlock { margin-top: 7px; padding-top: 6px; border-top: 1px dashed rgba(85,70,88,.2); color: #7b6d7f; }

.skills-card { overflow: hidden; border: 2px solid var(--line); border-radius: 18px; background: var(--paper); }
.skill-row { display: grid; grid-template-columns: 31px 1fr auto; align-items: center; gap: 9px; padding: 11px 12px; border-bottom: 1px dashed var(--line); }
.skill-row:last-child { border-bottom: 0; }
.skill-symbol { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 9px; background: var(--lavender); }
.skill-info strong { display: flex; justify-content: space-between; font-size: .82rem; }
.skill-info small { color: var(--muted); font-size: .65rem; }
.skill-info .meter { margin-top: 5px; height: 6px; }
.skill-level { min-width: 31px; text-align: center; font-size: .72rem; font-weight: 900; }

.event-log { list-style: none; margin: 0; padding: 0; border-left: 3px dotted #cdbfd3; }
.event-log li { position: relative; margin: 0 0 8px 13px; padding: 10px 12px; border-radius: 0 12px 12px 12px; background: #f3ede6; font-size: .78rem; line-height: 1.4; }
.event-log li::before { content: ""; position: absolute; left: -20px; top: 12px; width: 9px; height: 9px; border: 2px solid var(--cream); border-radius: 50%; background: #9c849e; }
.event-log time { display: block; margin-top: 3px; color: #918792; font-size: .61rem; }

.rarity-key { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 12px; }
.rarity-key span, .rarity-tag { padding: 4px 7px; border-radius: 7px; font-size: .6rem; font-weight: 900; text-transform: uppercase; }
.common { background: #e6e3df; color: #665f5a; }
.uncommon { background: #dcebd4; color: #4e6b41; }
.rare { background: #dce5f2; color: #46648c; }
.legendary { background: #f4dfb5; color: #805c18; }
.veryRare { background: #eadcf4; color: #70488c; }
.inventory-summary { margin-bottom: 10px; color: var(--muted); font-size: .77rem; }
.item-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.item-card { display: flex; flex-direction: column; min-height: 178px; padding: 13px; border: 2px solid var(--line); border-radius: 17px; background: var(--paper); box-shadow: 0 4px 0 rgba(77,62,80,.06); }
.item-card[data-rarity="uncommon"] { border-color: #bbd2ae; }
.item-card[data-rarity="rare"] { border-color: #aec2dd; }
.item-card[data-rarity="legendary"] { border-color: #dfbe78; background: #fffbeb; }
.item-card[data-rarity="veryRare"] { border-color: #b99ace; background: #fbf6ff; }
.item-top { display: flex; align-items: start; justify-content: space-between; gap: 6px; }
.item-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: #f2ece5; font-size: 1.3rem; }
.item-card h3 { margin-top: 10px; font-size: .88rem; }
.item-card p { flex: 1; margin: 5px 0 10px; color: var(--muted); font-size: .67rem; line-height: 1.4; }
.item-bottom { display: flex; align-items: center; justify-content: space-between; }
.item-count { font-size: .8rem; font-weight: 900; }
.sell-button { border: 1px solid #cdbfc6; border-radius: 8px; padding: 6px 8px; background: #f6eeee; font-size: .65rem; font-weight: 900; cursor: pointer; }
.item-actions { display: flex; align-items: center; gap: 5px; }
.use-button { border: 1px solid #aac49c; border-radius: 8px; padding: 6px 8px; background: #e4f0dc; color: #4e6a45; font-size: .65rem; font-weight: 900; cursor: pointer; }
.collection-heading { margin-top: 28px; }
.collection-log { display: grid; gap: 10px; }
.collection-section { overflow: hidden; border: 2px solid var(--line); border-radius: 16px; background: var(--paper); }
.collection-section header { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; background: #f1e9f1; }
.collection-section header strong { font-size: .78rem; }
.collection-section header span { color: var(--muted); font-size: .65rem; }
.collection-items { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 1px; background: var(--line); }
.collection-entry { min-width: 0; padding: 9px; background: var(--paper); }
.collection-entry strong, .collection-entry small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.collection-entry strong { font-size: .67rem; }
.collection-entry small { margin-top: 3px; color: var(--muted); font-size: .57rem; }
.collection-entry.unknown { color: #9a9297; background: #f2efec; }
.empty-state { padding: 50px 15px; text-align: center; }
.empty-state > span { display: block; margin-bottom: 15px; color: #7d6b84; font: 900 2.2rem Consolas, monospace; }
.empty-state p { color: var(--muted); font-size: .85rem; }

.shopkeeper-card { display: flex; align-items: center; gap: 14px; margin: 12px 0 15px; padding: 14px; border: 2px solid #d7c9b2; border-radius: 18px; background: #f6ead5; }
.shopkeeper { font: 900 1.5rem Consolas, monospace; white-space: nowrap; }
.shopkeeper-card p { margin: 0; color: #6c604f; font-size: .78rem; font-style: italic; }
.shop-list { display: grid; gap: 10px; }
.shop-card { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 11px; padding: 13px; border: 2px solid var(--line); border-radius: 17px; background: var(--paper); box-shadow: 0 3px 0 rgba(77,62,80,.06); }
.shop-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 13px; background: var(--lavender); font-size: 1.35rem; }
.shop-info strong, .shop-info small { display: block; }
.shop-info small { margin-top: 4px; color: var(--muted); font-size: .66rem; line-height: 1.35; }
.buy-button, .primary-button, .secondary-button { border: 2px solid #66536e; border-radius: 11px; background: #826d8b; color: #fff; font-weight: 900; cursor: pointer; box-shadow: 0 3px 0 #514159; }
.buy-button { min-width: 67px; padding: 9px 8px; font-size: .68rem; }
.buy-button:disabled { border-color: #b7adb6; background: #d5ced4; color: #756d75; box-shadow: none; cursor: not-allowed; }
.primary-button { padding: 11px 18px; }
.secondary-button { padding: 9px 12px; background: #eee3ef; color: #55465b; box-shadow: 0 3px 0 #c8bacb; }

.custom-preview { display: flex; flex-direction: column; align-items: center; margin: 10px 0 20px; padding: 20px; border: 2px solid var(--line); border-radius: 24px; background: linear-gradient(145deg, #f0e7f1, #f6e7dc); }
.cat-stage.large { width: 190px; margin: 8px 0 17px; }
.cat-stage.large .drawn-eyes i { width: 28px; height: 32px; }
.field-label { display: block; margin: 0 0 6px 3px; color: var(--muted); font-size: .71rem; font-weight: 900; text-transform: uppercase; }
.name-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
input, select { min-width: 0; border: 2px solid var(--line); border-radius: 11px; background: #fff; color: var(--ink); }
input { width: 100%; padding: 10px 12px; }
.save-tools { margin-top: 16px; padding: 16px; border: 2px solid #d8cbdc; border-radius: 18px; background: linear-gradient(145deg, #f4edf5, #fff8ea); box-shadow: 0 4px 0 rgba(77,62,80,.06); }
.save-tools h3 { margin-bottom: 7px; }
.save-tools > p { margin-bottom: 12px; color: var(--muted); font-size: .76rem; line-height: 1.5; }
.save-tools small { display: block; margin-top: 10px; color: var(--muted); font-size: .66rem; line-height: 1.45; }
.save-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.save-actions .primary-button, .save-actions .secondary-button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; padding: 9px 12px; font-size: .76rem; }
.import-button { user-select: none; cursor: pointer; }
.cosmetic-section { margin-top: 20px; }
.cosmetic-section h3 { margin: 0 0 9px 3px; }
.choice-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.choice-card { position: relative; min-height: 67px; padding: 10px; border: 2px solid var(--line); border-radius: 14px; background: var(--paper); text-align: left; cursor: pointer; }
.choice-card.selected { border-color: #705b79; background: #efe6f1; box-shadow: inset 0 0 0 2px #fff; }
.choice-card.locked { color: #8e868d; background: #f1eeeb; cursor: not-allowed; }
.choice-card strong, .choice-card small { display: block; }
.choice-card strong { font-size: .78rem; }
.choice-card small { margin-top: 4px; color: var(--muted); font-size: .59rem; line-height: 1.3; }
.choice-swatch { display: inline-block; width: 14px; height: 14px; margin-right: 5px; border: 1px solid rgba(50,40,52,.3); border-radius: 50%; vertical-align: -2px; }
.lock-mark { position: absolute; right: 8px; top: 7px; font-size: .7rem; }

.search-box { display: flex; align-items: center; gap: 8px; padding: 0 11px; border: 2px solid var(--line); border-radius: 14px; background: #fff; }
.search-box input { border: 0; padding-left: 0; outline: 0; }
.filter-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 10px; }
.filter-grid label { color: var(--muted); font-size: .63rem; font-weight: 900; text-transform: uppercase; }
.filter-grid select { display: block; width: 100%; margin-top: 4px; padding: 9px 8px; font-size: .72rem; text-transform: none; }
.clear-filters { display: block; margin: 5px 0 5px auto; }
.breed-grid { display: grid; gap: 10px; margin-top: 9px; }
.breed-card { overflow: hidden; border: 2px solid var(--line); border-radius: 18px; background: var(--paper); box-shadow: 0 4px 0 rgba(77,62,80,.06); }
.breed-summary { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 11px; padding: 13px; cursor: pointer; list-style: none; }
.breed-summary::-webkit-details-marker { display: none; }
.breed-face { display: grid; place-items: center; width: 68px; height: 68px; overflow: hidden; border: 1px solid rgba(75,62,79,.12); border-radius: 19px; background: var(--portrait-bg, var(--lavender)); }
.breed-portrait-svg { display: block; width: 64px; height: 64px; overflow: visible; filter: drop-shadow(0 2px 0 rgba(58,47,61,.12)); }
.portrait-outline { stroke: var(--portrait-ink, #554958); stroke-width: 3; stroke-linejoin: round; }
.portrait-detail { fill: none; stroke: var(--portrait-ink, #554958); stroke-width: 2; stroke-linecap: round; }
.breed-title strong, .breed-title small { display: block; }
.breed-title small { margin-top: 4px; color: var(--muted); font-size: .65rem; }
.chevron { color: #7d7081; transition: transform .2s; }
.breed-card[open] .chevron { transform: rotate(180deg); }
.breed-details { padding: 0 14px 15px; border-top: 1px dashed var(--line); }
.breed-details > p { margin: 12px 0; color: #655d68; font-size: .75rem; line-height: 1.55; }
.fact-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; }
.fact { padding: 8px; border-radius: 10px; background: #f3eee8; }
.fact span, .fact strong { display: block; }
.fact span { color: var(--muted); font-size: .56rem; font-weight: 900; text-transform: uppercase; }
.fact strong { margin-top: 3px; font-size: .68rem; }
.bonus { margin-top: 10px; padding: 9px 10px; border-radius: 11px; background: var(--mint); font-size: .68rem; }
.sources { margin: 10px 0 0; font-size: .61rem; }
.sources a { color: #5f5375; }
.sources em { color: #857a87; font-style: normal; }

.bottom-nav { position: fixed; z-index: 20; left: 50%; bottom: 0; translate: -50%; display: grid; grid-template-columns: repeat(5, 1fr); width: min(100%, 720px); padding: 7px 8px calc(7px + env(safe-area-inset-bottom)); border-top: 2px solid var(--line); background: rgba(255,253,247,.95); box-shadow: 0 -8px 25px rgba(72,58,76,.08); backdrop-filter: blur(12px); }
.nav-item { display: flex; flex-direction: column; align-items: center; gap: 3px; border: 0; border-radius: 12px; padding: 7px 2px; background: transparent; color: #827785; font-size: .61rem; font-weight: 900; cursor: pointer; }
.nav-item span { font-size: 1.12rem; }
.nav-item.active { background: var(--lavender); color: #594960; }

dialog { width: min(calc(100% - 30px), 400px); border: 2px solid #6e5a76; border-radius: 22px; padding: 22px; background: var(--paper); color: var(--ink); box-shadow: 0 15px 0 rgba(63,48,66,.14); text-align: center; }
dialog::backdrop { background: rgba(62,51,65,.48); backdrop-filter: blur(3px); }
.dialog-art { display: grid; place-items: center; width: 58px; height: 58px; margin: 0 auto 13px; border-radius: 18px; background: var(--lavender); font-size: 1.8rem; }
dialog h2 { margin-bottom: 9px; }
dialog p, dialog li { color: var(--muted); font-size: .78rem; line-height: 1.5; }
dialog ul { padding-left: 18px; text-align: left; }
dialog .primary-button { margin-top: 10px; }
.loot-list { display: grid; gap: 6px; margin: 12px 0; text-align: left; }
.loot-row { display: flex; justify-content: space-between; padding: 8px 10px; border-radius: 9px; background: #f3eee8; font-size: .72rem; }
.toast-region { position: fixed; z-index: 50; left: 50%; bottom: calc(78px + env(safe-area-inset-bottom)); translate: -50%; width: min(calc(100% - 24px), 450px); pointer-events: none; }
.toast { margin-top: 7px; padding: 10px 13px; border: 2px solid #62516a; border-radius: 12px; background: #77627f; color: #fff; box-shadow: 0 5px 0 rgba(62,48,66,.2); font-size: .75rem; font-weight: 800; animation: toast-in .2s ease both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

@media (min-width: 560px) {
  .topbar { padding-left: 24px; padding-right: 24px; }
  .player-strip { margin-left: 22px; margin-right: 22px; }
  main { padding-left: 22px; padding-right: 22px; }
  .action-grid { grid-template-columns: repeat(3, 1fr); }
  .action-card:nth-child(5) { grid-column: auto; min-height: 134px; }
  .item-grid { grid-template-columns: repeat(3, 1fr); }
  .choice-grid { grid-template-columns: repeat(3, 1fr); }
  .breed-grid { grid-template-columns: repeat(2, 1fr); align-items: start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
