/* PokéNova menu: moonlit night. Dark navy surfaces, silver frames, saturated colour only for actions, rarity and types. */
:root {
  --n0: #03050f; --n1: #080d24; --n2: #0f1736; --n3: #17214a; --n4: #223066; --n5: #33458a;
  --moon: #eef3ff; --silver: #c5d2f0; --dim: #a9b7d8; --faint: #8e9dc6;
  --frame: #41548f; --frame-hi: #7c92d0; --frame-lo: #050919;
  --gold: #ffd23f; --gold-hi: #ffe680; --gold-lo: #c47a0c; --red: #ff5a6e; --cyan: #5fd0ff; --green: #6cf29a; --violet: #c7a4ff; --pink: #ff6fb1;
  /* One dial for the whole UI: menus and run screens are zoomed by this. Whole-device-pixel sprite scaling accounts for it. */
  --ui-scale: 1.2;
  /* Type system: tune every font and size here. Pixel font for display sizes only; everything else is Nunito 700+. */
  --font-display: 'Jersey 15', 'Trebuchet MS', sans-serif;
  --font-body: 'Nunito', 'Trebuchet MS', sans-serif;
  --pixel: var(--font-display); --sans: var(--font-body);
  --fs-badge: 11px; --fs-small: 13px; --fs-body: 14px; --fs-label: 16px; --fs-lead: 18px;
  --fs-d20: 20px; --fs-d24: 24px; --fs-d28: 28px; --fs-d32: 32px; --fs-d38: 38px; --fs-d44: 44px; --fs-d52: 52px; --fs-d64: 64px;
  --gap: 14px; --bar-h: 64px;
  --safe-l: max(16px, env(safe-area-inset-left)); --safe-r: max(16px, env(safe-area-inset-right));
  --safe-t: max(10px, env(safe-area-inset-top)); --safe-b: max(10px, env(safe-area-inset-bottom));
  --ease: cubic-bezier(.2, .9, .25, 1.15);
}
@media (max-height: 520px) { :root { --fs-small: 12px; --fs-body: 13px; --fs-label: 14px; --fs-lead: 16px; --gap: 8px; --bar-h: 44px; --safe-l: max(8px, env(safe-area-inset-left)); --safe-r: max(8px, env(safe-area-inset-right)); --safe-t: max(5px, env(safe-area-inset-top)); --safe-b: max(5px, env(safe-area-inset-bottom)); } }

.game-shell { min-height: 0; height: 100dvh; }
.game-shell:has(.welcome-layer:not([hidden])) > .topbar { display: none; }
.game-shell:has(.page:not([hidden])) .home { visibility: hidden; }

/* Jersey 15 runs small, so menu text is normalised by x-height. Bold is never faked on it. */




/* Rotate prompt */
.rotate-hint { position: fixed; z-index: 40; inset: 0; display: none; place-content: center; justify-items: center; gap: 14px; padding: 24px; background: var(--n1); color: var(--moon); text-align: center; }
.rotate-hint i { width: 52px; height: 88px; border: 5px solid var(--moon); border-radius: 11px; animation: rotate-phone 2.2s ease-in-out infinite; }
.rotate-hint b { font: 400 var(--fs-d28)/1.15 var(--font-display); }
@keyframes rotate-phone { 0%, 25% { transform: rotate(0); } 60%, 100% { transform: rotate(-90deg); } }
@media (orientation: portrait) and (pointer: coarse) and (max-width: 700px) { .rotate-hint { display: grid; } }

/* Pixel frame: four offset shadows leave the corners notched. */
.px, .deck-card, .strip-btn, .info-card, .box-card, .banner-card, .stage, .gacha-side, .pc-roster, .pokemon-detail, .dex-list, .dex-detail, .mission, .badge-card, .growth-row, .boost-card, .hero-note, .partner-side, .mega-hero, .settings-nav, .settings-body, .record-hero, .rank-row, .link-row, .mini-card, .roster-row {
  --edge: var(--frame);
  box-shadow: 0 -3px 0 var(--edge), 0 3px 0 var(--edge), -3px 0 0 var(--edge), 3px 0 0 var(--edge), inset 0 2px 0 rgba(200, 220, 255, .1), inset 0 -2px 0 rgba(0, 0, 0, .35), 0 8px 0 rgba(2, 4, 14, .5);
  background: linear-gradient(180deg, rgba(23, 33, 74, .96), rgba(10, 15, 40, .97));
  color: var(--moon);
}

.ic { display: inline-flex; flex: none; align-items: center; justify-content: center; font-style: normal; line-height: 0; }
.ic svg, .ic-tone svg { display: block; width: var(--ic, 24px); height: var(--ic, 24px); fill: currentColor; }
.ic-tone { display: inline-flex; }
.muted { color: var(--dim); }
.chips { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 5px; }

/* Type badges from pokemon-icons.css */
.game-shell .pokemon-type-badge { border-width: 2px; border-radius: 0; padding: 2px 7px; background: color-mix(in srgb, var(--pokemon-icon-color) 26%, #0a0f28); text-transform: capitalize; }
.game-shell .pokemon-type-badge.compact { padding: 1px 5px; font-size: var(--fs-badge); }

/* Buttons */
.btn { --b: var(--n4); --b-hi: var(--n5); --b-lo: #0a1130; --t: var(--moon); display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 7px 16px; margin: 3px; border: 0; background: var(--b); color: var(--t); font: 800 var(--fs-body)/1.1 var(--font-body); cursor: pointer; box-shadow: 0 -3px 0 var(--b-hi), 0 3px 0 var(--b-lo), -3px 0 0 var(--b-hi), 3px 0 0 var(--b-hi), 0 6px 0 var(--b-lo); transition: transform .08s, filter .15s, box-shadow .08s; }
.btn:hover:not(:disabled) { filter: brightness(1.15); transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 -3px 0 var(--b-hi), 0 3px 0 var(--b-lo), -3px 0 0 var(--b-hi), 3px 0 0 var(--b-hi); }
.btn:disabled { --b: #171f42; --b-hi: #27305a; --b-lo: #0a0f28; --t: #7886ac; cursor: not-allowed; }
.btn:disabled .ic-tone { filter: grayscale(1) opacity(.6); }
.btn-gold { --b: var(--gold); --b-hi: var(--gold-hi); --b-lo: var(--gold-lo); --t: #2a1a02; }
.btn-gold .ic-tone { color: #5a3600 !important; }
.btn-cool { --b: #1f7fc4; --b-hi: var(--cyan); --b-lo: #0c3f6c; --t: #fff; }
.btn-cool .ic-tone { color: #fff !important; }
.btn-red { --b: #c92a44; --b-hi: var(--red); --b-lo: #6a1024; --t: #fff; }
.btn-ghost { --b: #141c40; --b-hi: var(--frame); --b-lo: #2c3a70; }
.btn-mini { min-height: 28px; padding: 3px 9px; margin: 3px; font-size: var(--fs-small); --ic: 12px; flex: none; white-space: nowrap; }
.round-btn { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; background: var(--n3); color: var(--moon); cursor: pointer; box-shadow: 0 -2px 0 var(--frame), 0 2px 0 var(--frame), -2px 0 0 var(--frame), 2px 0 0 var(--frame); transition: transform .08s, background .15s; flex: none; }
.round-btn:hover { background: var(--n5); }
.round-btn:active { transform: translateY(2px); }
.icon-btn { display: grid; place-items: center; width: 42px; height: 42px; border: 0; background: var(--n2); cursor: pointer; box-shadow: 0 -3px 0 var(--frame), 0 3px 0 var(--frame), -3px 0 0 var(--frame), 3px 0 0 var(--frame); margin: 3px; transition: transform .1s, filter .15s; }
.icon-btn:hover { filter: brightness(1.3); transform: rotate(12deg); }
button:focus-visible, .chip:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; }

/* Resources */
.res-bar { display: flex; align-items: center; gap: 8px; margin-left: auto; flex: none; }
.res { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px 0 8px; margin: 3px; background: #070c22; color: var(--moon); box-shadow: 0 -2px 0 var(--frame), 0 2px 0 var(--frame), -2px 0 0 var(--frame), 2px 0 0 var(--frame); font: 400 var(--fs-d20)/1 var(--font-display); }
.res-small { height: 24px; padding: 0 7px 0 4px; font-size: var(--fs-badge); --ic: 12px; }

/* Main menu */
.welcome-layer { position: absolute; inset: 0; z-index: 3; display: block; padding: 0; overflow: hidden; background: var(--n0); color: var(--moon); font-family: var(--sans); }
#home-scene { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; pointer-events: none; image-rendering: pixelated; }
.home { position: relative; z-index: 1; display: flex; flex-direction: column; width: 100%; height: 100%; padding: var(--safe-t) var(--safe-r) var(--safe-b) var(--safe-l); gap: var(--gap); }
.home-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex: none; }
.home-brand { display: flex; align-items: baseline; gap: 2px; color: var(--moon); font: 700 44px/1 var(--pixel); text-shadow: 0 3px 0 #1d2b63, 0 0 22px rgba(160, 190, 255, .45); }
.home-brand em { display: inline-block; font-style: normal; color: var(--gold); text-shadow: 0 3px 0 var(--gold-lo), 0 0 18px rgba(255, 210, 63, .45); transform: rotate(-4deg); transform-origin: 50% 90%; animation: bonk 3.8s var(--ease) infinite; }
.home-brand small { margin-left: 12px; color: var(--silver); font: 600 15px/1 var(--pixel); letter-spacing: 1px; text-shadow: none; }
@keyframes bonk { 0%, 86%, 100% { transform: rotate(-4deg); } 90% { transform: rotate(6deg) translateY(-3px); } 94% { transform: rotate(-7deg); } }
.home-top-right { display: flex; align-items: center; gap: 10px; }
.home-main { flex: 1; min-height: 0; }
.home-foot { flex: none; color: #7686ad; font: 700 var(--fs-small)/1.2 var(--font-body); text-align: center; }
.home-foot a { color: #a9b9dc; }

.hero { position: absolute; z-index: 2; left: 33%; right: 33%; top: 0; bottom: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; min-height: 0; gap: 6px; }
.hero-stand-btn { flex: 1; min-height: 0; width: 100%; display: flex; align-items: flex-end; justify-content: center; padding: 0; border: 0; background: none; cursor: pointer; }
.hero-stand { position: relative; display: block; width: min(100%, 420px); height: min(100%, 300px); }
.hero-art { position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: center; }
.hero-glow { position: absolute; left: 50%; bottom: -6px; width: 170px; height: 22px; transform: translateX(-50%); background: radial-gradient(closest-side, rgba(170, 200, 255, .55), rgba(170, 200, 255, 0)); }
.sprite-canvas { display: block; flex: none; image-rendering: pixelated; }
.hero-capsule { display: block; width: 96px; height: 96px; background: linear-gradient(180deg, var(--red) 0 46%, #0a0f2c 46% 54%, var(--moon) 54%); box-shadow: 0 -4px 0 #0a0f2c, 0 4px 0 #0a0f2c, -4px 0 0 #0a0f2c, 4px 0 0 #0a0f2c, 0 0 40px rgba(255, 210, 63, .5); animation: hero-bob 1.8s ease-in-out infinite; clip-path: polygon(24% 0, 76% 0, 76% 8%, 92% 8%, 92% 24%, 100% 24%, 100% 76%, 92% 76%, 92% 92%, 76% 92%, 76% 100%, 24% 100%, 24% 92%, 8% 92%, 8% 76%, 0 76%, 0 24%, 8% 24%, 8% 8%, 24% 8%); }
@keyframes hero-bob { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-8px) rotate(3deg); } }
.hero-card { width: min(100%, 420px); padding: 6px 12px; background: rgba(5, 9, 28, .72); box-shadow: 0 -2px 0 rgba(124, 146, 208, .45), 0 2px 0 rgba(124, 146, 208, .45), -2px 0 0 rgba(124, 146, 208, .45), 2px 0 0 rgba(124, 146, 208, .45); }
.hero-name { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 10px; }
.hero-name strong { font: 400 var(--fs-d28)/1.1 var(--font-display); color: var(--moon); }
.hero-level { display: flex; align-items: center; gap: 7px; margin-top: 3px; font: 800 var(--fs-small)/1 var(--font-body); color: var(--silver); --ic: 12px; }
.hero-level:empty { display: none; }
.hero-level .meter { flex: 1; }
.hero-move { margin: 3px 0 0; color: var(--silver); font: 700 var(--fs-small)/1.25 var(--font-body); }
.hero-actions { display: flex; align-items: stretch; gap: 10px; width: min(100%, 420px); margin-top: 6px; }
.btn-play { --ic: 36px; position: relative; flex: 1; display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 74px; padding: 6px 18px; margin: 3px; overflow: hidden; border: 0; background: linear-gradient(180deg, var(--gold-hi), var(--gold) 45%, #ffae22); color: #2a1a02; cursor: pointer; box-shadow: 0 -4px 0 #fff2b0, 0 4px 0 var(--gold-lo), -4px 0 0 #ffe680, 4px 0 0 #ffe680, 0 8px 0 #6e4304, 0 0 34px rgba(255, 210, 63, .45); transition: transform .08s, box-shadow .08s, filter .15s; }
.btn-play::after { content: ''; position: absolute; top: 0; bottom: 0; left: -40%; width: 26%; background: rgba(255, 255, 255, .45); transform: skewX(-20deg); animation: play-sheen 3.4s ease-in-out infinite; }
@keyframes play-sheen { 0%, 62% { left: -40%; } 100% { left: 130%; } }
.btn-play:hover { filter: brightness(1.07); transform: translateY(-2px); }
.btn-play:active { transform: translateY(5px); box-shadow: 0 -4px 0 #fff2b0, 0 4px 0 var(--gold-lo), -4px 0 0 #ffe680, 4px 0 0 #ffe680, 0 0 24px rgba(255, 210, 63, .4); }
.btn-play > span { display: flex; flex-direction: column; align-items: flex-start; }
.btn-play b { font: 400 var(--fs-d44)/1 var(--font-display); }
.btn-play small { font: 800 var(--fs-small)/1.2 var(--font-body); }
.btn-play.is-compact { min-height: 62px; width: calc(100% - 8px); flex: none; }
.btn-duo { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; width: 72px; margin: 3px; border: 0; background: var(--n3); color: var(--moon); cursor: pointer; font: 800 var(--fs-body)/1 var(--font-body); box-shadow: 0 -4px 0 var(--cyan), 0 4px 0 #0c3f6c, -4px 0 0 var(--cyan), 4px 0 0 var(--cyan), 0 8px 0 #06223c; transition: transform .08s, filter .15s; }
.btn-duo:hover { filter: brightness(1.25); transform: translateY(-2px); }
.btn-duo:active { transform: translateY(4px); }
.hub-record { display: flex; gap: 6px; align-items: center; justify-content: center; margin: 8px 0 0; color: var(--silver); font: 700 var(--fs-small)/1 var(--font-body); }
.hub-record span { width: 4px; height: 4px; margin: 0 4px; background: var(--faint); }
.hub-record b { color: var(--moon); font: 800 var(--fs-body)/1 var(--font-body); }

/* Constellation menu */
.home-main { position: relative; display: block; }
.home-account { display: inline-flex; align-items: center; gap: 5px; color: var(--silver); font: 800 var(--fs-body)/1 var(--font-body); --ic: 24px; }
.sky-lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.sky-lines line { stroke: rgba(170, 195, 255, .24); stroke-width: 2; stroke-dasharray: 2 5; transition: stroke .18s; }
.sky-lines rect { fill: rgba(205, 222, 255, .5); transition: fill .18s; }
.sky-lines line.lit { stroke: var(--moon); stroke-dasharray: none; filter: drop-shadow(0 0 4px #b9d0ff); }
.sky-lines rect.lit { fill: #fff; }
.sky { position: absolute; inset: 0; }
.sky-group { position: absolute; top: 0; margin: 0; color: var(--dim); font: 800 var(--fs-badge)/1 var(--font-body); text-transform: uppercase; }
.sky-group.is-left { left: 2%; }
.sky-group.is-right { right: 2%; }
.star { --disc: 76px; position: absolute; left: calc(var(--x) * 1%); top: calc(var(--y) * 1%); width: 150px; height: calc(var(--disc) + 42px); margin: calc((var(--disc) + 42px) / -2) 0 0 -75px; padding: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; border: 0; background: none; color: var(--moon); cursor: pointer; font-family: var(--sans); }
.star.is-major { --disc: 96px; }
.star-disc { position: relative; display: grid; place-items: center; width: var(--disc); height: var(--disc); flex: none; --ic: 36px; border-radius: 50%; background: radial-gradient(circle at 40% 32%, #2b3c80, #0c1438 72%); box-shadow: 0 0 0 3px #7c92d0, 0 0 0 7px rgba(10, 16, 44, .9), 0 0 0 9px rgba(124, 146, 208, .5), 0 0 22px rgba(150, 180, 255, .4); animation: star-in .42s var(--ease) both; animation-delay: calc(var(--i) * 36ms); transition: transform .14s var(--ease), box-shadow .14s; }
.star.is-major .star-disc { --ic: 48px; box-shadow: 0 0 0 3px var(--gold), 0 0 0 7px rgba(10, 16, 44, .9), 0 0 0 9px rgba(255, 210, 63, .55), 0 0 30px rgba(255, 210, 63, .38); }
.star-disc::before { content: ''; position: absolute; inset: -16px; z-index: -1; background: linear-gradient(135deg, rgba(200, 220, 255, .55), rgba(120, 150, 240, .08)); clip-path: polygon(50% 0, 56% 40%, 100% 50%, 56% 60%, 50% 100%, 44% 60%, 0 50%, 44% 40%); opacity: .55; animation: star-shimmer 4.6s ease-in-out infinite; animation-delay: calc(var(--i) * -470ms); }
.star.is-major .star-disc::before { background: linear-gradient(135deg, rgba(255, 230, 150, .8), rgba(255, 200, 80, .1)); }
@keyframes star-shimmer { 0%, 100% { opacity: .22; transform: scale(.92) rotate(0); } 50% { opacity: .8; transform: scale(1.08) rotate(45deg); } }
@keyframes star-in { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: none; } }
.star:hover .star-disc, .star:focus-visible .star-disc { transform: scale(1.1); box-shadow: 0 0 0 3px #fff, 0 0 0 7px rgba(10, 16, 44, .9), 0 0 0 9px rgba(255, 255, 255, .7), 0 0 34px rgba(210, 228, 255, .85); }
.star:active .star-disc { transform: scale(.94); }
.star.is-angelic .star-disc { background: radial-gradient(circle at 40% 32%, #3a3f78, #141a44 72%); box-shadow: 0 0 0 3px #f2dc96, 0 0 0 7px rgba(10, 16, 44, .9), 0 0 0 9px rgba(242, 220, 150, .45), 0 0 26px rgba(255, 236, 170, .4); }
.star-badge { position: absolute; right: -8px; top: -5px; min-width: 24px; padding: 2px 5px; background: var(--moon); color: #0a0f28; font: 800 var(--fs-body)/1.1 var(--font-body); text-align: center; box-shadow: 0 0 0 2px #0a0f28; }
.star-badge:empty { display: none; }
.star-badge.is-alert { background: var(--gold); animation: alert-pulse 1.4s ease-in-out infinite; }
.star-label { display: grid; justify-items: center; gap: 1px; margin-top: 6px; padding: 2px 8px; max-width: 100%; background: rgba(3, 6, 20, .72); text-align: center; white-space: nowrap; }
.star-label b { color: var(--moon); font: 400 var(--fs-d20)/1.1 var(--font-display); }
.star-label small { color: var(--silver); font: 700 var(--fs-small)/1.1 var(--font-body); }
.star:focus-visible { outline: 0; }

/* Login gate */
.page.auth-page { z-index: 12; flex-direction: row; align-items: center; justify-content: center; gap: 56px; background: linear-gradient(90deg, rgba(3, 5, 15, 0) 30%, rgba(3, 5, 15, .55)); padding-left: max(32px, env(safe-area-inset-left)); padding-right: max(32px, env(safe-area-inset-right)); }
.auth-brand { flex: 0 1 46%; max-width: 620px; display: grid; gap: 10px; text-align: center; justify-items: center; }
.auth-logo { font: 700 104px/1 var(--pixel); color: var(--moon); text-shadow: 0 5px 0 #1d2b63, 0 0 28px #070c26, 0 0 8px #070c26; }
.auth-logo em { display: inline-block; font-style: normal; color: var(--gold); text-shadow: 0 5px 0 var(--gold-lo), 0 0 26px rgba(255, 210, 63, .55); transform: rotate(-4deg); }
.auth-tag { margin: 0; padding: 3px 12px; background: rgba(3, 6, 20, .85); color: var(--moon); font: 400 var(--fs-d20)/1.2 var(--font-display); box-shadow: 0 0 0 2px #34447c; }
.auth-device { display: flex; gap: 9px; margin: 6px 0 0; padding: 9px 12px; background: rgba(3, 6, 20, .82); color: var(--silver); font: 700 var(--fs-small)/1.4 var(--font-body); text-align: left; box-shadow: 0 0 0 2px #34447c; }
.auth-card { --edge: var(--frame-hi); flex: 0 0 430px; display: grid; gap: 9px; min-width: 0; padding: 16px 18px; color: var(--moon); background: linear-gradient(180deg, rgba(23, 33, 74, .97), rgba(10, 15, 40, .98)); box-shadow: 0 -3px 0 var(--edge), 0 3px 0 var(--edge), -3px 0 0 var(--edge), 3px 0 0 var(--edge), 0 10px 0 rgba(2, 4, 14, .5), 0 0 40px rgba(140, 170, 255, .2); animation: mini-pop .28s var(--ease) both; }
#auth-form { display: grid; gap: 6px; }
.auth-field { display: grid; gap: 3px; color: var(--silver); font: 800 var(--fs-small)/1.2 var(--font-body); }
.auth-field[hidden] { display: none; }
.auth-password { position: relative; display: block; }
.auth-password input { padding-right: 42px; }
.auth-eye { position: absolute; right: 2px; top: 50%; display: grid; place-items: center; width: 34px; height: 30px; margin-top: -15px; padding: 0; border: 0; background: none; color: var(--silver); cursor: pointer; }
.auth-eye:hover { color: #fff; }
.auth-error { min-height: 15px; color: #ff9aa8; font: 700 var(--fs-small)/1.25 var(--font-body); }
.auth-error.is-form { margin: 0; padding: 5px 8px; background: rgba(120, 20, 40, .5); box-shadow: 0 0 0 2px var(--red); }
.field-input[aria-invalid='true'] { box-shadow: inset 0 0 0 2px var(--red); }
.auth-submit { width: calc(100% - 6px); min-height: 46px; font-size: var(--fs-lead); }
.auth-or { display: flex; align-items: center; gap: 9px; color: var(--dim); font: 800 var(--fs-small)/1 var(--font-body); }
.auth-or::before, .auth-or::after { content: ''; flex: 1; height: 2px; background: #27325e; }
.auth-guest { width: calc(100% - 6px); }
.auth-guest span { display: grid; justify-items: start; gap: 1px; }
.auth-guest small { color: var(--silver); font: 700 var(--fs-small)/1 var(--font-body); }
.auth-legacy { margin: 0; color: var(--gold-hi); font: 700 var(--fs-small)/1.35 var(--font-body); }
#gacha-layer.is-forced [data-close-hub], #gacha-layer.is-forced #gacha-to-select { display: none; }

/* Meters, tags, chips */
.meter { display: block; height: 8px; background: #050919; box-shadow: 0 0 0 2px #2b3866; }
.meter i { display: block; height: 100%; min-width: 0; background: var(--cyan); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .35); transition: width .4s ease; }
.meter-gold i { background: var(--gold); }
.meter-xp i { background: #66b3ff; }
.meter-red i { background: #ff7a6b; }
.meter-green i { background: var(--green); }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; background: #1c2752; color: var(--silver); font: 800 var(--fs-badge)/1.25 var(--font-body); white-space: nowrap; --ic: 12px; box-shadow: 0 0 0 2px #34447c; }
.tag-new { background: #0f4a33; color: #b6ffd2; box-shadow: 0 0 0 2px #2fa76e; }
.tag-gold { background: #4a3408; color: var(--gold-hi); box-shadow: 0 0 0 2px var(--gold-lo); }
.tag-cool { background: #0e3a5c; color: #bfe9ff; box-shadow: 0 0 0 2px #2b86c0; }
.tag-off { background: #1a1f3c; color: #a7b2d0; box-shadow: 0 0 0 2px #39426c; }
.tag-form { background: #33205c; color: #e0ceff; box-shadow: 0 0 0 2px #6d4fc0; }
.rarity-tag { display: inline-flex; padding: 2px 8px; margin: 0; background: color-mix(in srgb, var(--rarity, var(--r, #6fc3ff)) 24%, #0a0f28); color: var(--rarity, var(--r, #6fc3ff)); box-shadow: 0 0 0 2px var(--rarity, var(--r, #6fc3ff)); font: 800 var(--fs-badge)/1.25 var(--font-body); white-space: nowrap; }
.chip-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chip { min-height: 28px; padding: 3px 10px; margin: 2px; border: 0; background: var(--n2); color: var(--silver); cursor: pointer; font: 800 var(--fs-small)/1.1 var(--font-body); box-shadow: 0 0 0 2px #34447c; transition: background .12s, transform .08s; }
.chip:hover { background: var(--n4); color: #fff; }
.chip:active { transform: translateY(1px); }
.chip.active { background: var(--moon); color: #0a0f28; box-shadow: 0 0 0 2px #fff, 0 0 14px rgba(220, 232, 255, .5); }
.chip-stack { display: flex; flex-direction: column; align-items: center; gap: 1px; flex: none; }
.chip-stack small { font: 700 var(--fs-small)/1 var(--font-body); opacity: .85; }
.seg-tabs { display: flex; gap: 6px; flex: none; }
.seg-tab { flex: 1; min-height: 36px; padding: 4px 6px; margin: 2px; border: 0; background: #0a1030; color: var(--silver); cursor: pointer; font: 800 var(--fs-body)/1 var(--font-body); box-shadow: 0 0 0 2px #34447c; transition: background .12s, color .12s, transform .08s; white-space: nowrap; }
.seg-tab small { color: inherit; opacity: .75; font: 700 var(--fs-small)/1 var(--font-body); }
.seg-tab:hover { background: var(--n3); color: #fff; }
.seg-tab.active { background: var(--moon); color: #0a0f28; box-shadow: 0 0 0 2px #fff, 0 0 16px rgba(220, 232, 255, .45); }
.field-input, .field-select { width: 100%; min-height: 36px; padding: 5px 10px; border: 0; background: #060a20; color: var(--moon); font: 700 var(--fs-small)/1.2 var(--font-body); box-shadow: inset 0 0 0 2px #34447c; }
.field-input::placeholder { color: #8493b9; }
.field-select { width: auto; flex: none; }
.field-row { display: flex; gap: 8px; align-items: center; }
.search-box { display: flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 8px; background: #060a20; box-shadow: inset 0 0 0 2px #34447c; flex: 1; min-width: 120px; --ic: 12px; }
.search-box input { flex: 1; min-width: 0; height: 32px; border: 0; background: none; color: var(--moon); font: 700 var(--fs-small)/1.2 var(--font-body); outline: 0; }
.search-box input::placeholder { color: #8493b9; }
.search-box:focus-within { box-shadow: inset 0 0 0 2px var(--cyan); }
.view-note { margin: 0 0 8px; color: var(--silver); font: 700 var(--fs-small)/1.4 var(--font-body); }
.empty-note { padding: 14px; color: var(--silver); font: 700 var(--fs-small)/1.35 var(--font-body); text-align: center; background: rgba(5, 9, 28, .55); box-shadow: inset 0 0 0 2px #27325e; }
.sub-head { margin: 12px 0 8px; color: var(--moon); font: 400 var(--fs-d20)/1.1 var(--font-display); }
.sub-head:first-child { margin-top: 2px; }
.plain-list { margin: 8px 0 0; padding: 0; list-style: none; color: var(--silver); font: 700 var(--fs-small)/1.35 var(--font-body); }
.plain-list li { position: relative; padding-left: 12px; margin-bottom: 3px; }
.plain-list li::before { content: ''; position: absolute; left: 0; top: 6px; width: 5px; height: 5px; background: var(--cyan); }
.plain-list a { color: var(--cyan); }
.view-in { animation: view-in .22s ease-out both; }
@keyframes view-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Pages */
.page { position: absolute; z-index: 8; inset: 0; display: flex; flex-direction: column; gap: var(--gap); padding: var(--safe-t) var(--safe-r) var(--safe-b) var(--safe-l); color: var(--moon); font-family: var(--sans); background: linear-gradient(180deg, rgba(3, 5, 15, .78), rgba(5, 9, 28, .88)); animation: page-in .2s ease-out both; }
@keyframes page-in { from { opacity: 0; } to { opacity: 1; } }
.page-bar { display: flex; align-items: center; gap: 10px; flex: none; min-height: var(--bar-h); }
.btn-back { --ic: 24px; display: inline-flex; align-items: center; gap: 7px; height: 44px; padding: 0 14px 0 9px; margin: 3px; border: 0; background: var(--n3); color: var(--moon); cursor: pointer; font: 400 var(--fs-d20)/1 var(--font-display); box-shadow: 0 -3px 0 var(--frame-hi), 0 3px 0 #0a1130, -3px 0 0 var(--frame-hi), 3px 0 0 var(--frame-hi), 0 6px 0 #0a1130; transition: transform .08s, filter .15s; flex: none; }
.btn-back:hover { filter: brightness(1.25); transform: translateX(-2px); }
.btn-back:active { transform: translateY(3px); }
.btn-back.is-soft { background: var(--n2); box-shadow: 0 -3px 0 var(--frame), 0 3px 0 #0a1130, -3px 0 0 var(--frame), 3px 0 0 var(--frame); }
.page-icon { display: inline-flex; --ic: 36px; flex: none; }
.page-icon:empty { display: none; }
.page-title { min-width: 0; flex: 0 1 auto; }
.page-title h2 { margin: 0; color: var(--moon); font: 400 var(--fs-d38)/1.05 var(--font-display); white-space: nowrap; text-shadow: 0 3px 0 #1d2b63; overflow: hidden; text-overflow: ellipsis; }
.page-title small { display: block; color: var(--silver); font: 700 var(--fs-small)/1.2 var(--font-body); }
.page-title small:empty { display: none; }
.page-body { flex: 1; min-height: 0; }
.page-scroll { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 4px 6px 10px 4px; scrollbar-width: thin; scrollbar-color: var(--frame) transparent; }
#hub-menu-dialog .page-body { display: flex; min-width: 0; }
#hub-menu-dialog .page-body > [data-hub-panel] { flex: 1; min-width: 0; min-height: 0; }
.info-page { display: flex; flex-direction: column; gap: var(--gap); min-height: 0; }
.info-page > .page-scroll { flex: 1; }
.split-page { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 30%); gap: calc(var(--gap) + 6px); padding: 4px; }
.split-page > aside:first-child { order: 0; }
.info-upgrades .split-page, .info-leaderboard .split-page { grid-template-columns: minmax(250px, 30%) minmax(0, 1fr); }
.info-friends .split-page { grid-template-columns: minmax(0, 1fr); max-width: 900px; margin: 0 auto; width: 100%; }
.partner-side { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px; min-height: 0; overflow-y: auto; }
.iv-stats { width: 100%; }
.settings-body { align-self: start; }
.coop-main { align-self: start; }
.partner-side h3 { margin: 0; font: 400 var(--fs-d32)/1.1 var(--font-display); text-align: center; }
.partner-side .view-note { text-align: center; }
.panel-sprite { position: relative; display: flex; align-items: flex-end; justify-content: center; width: 100%; height: 160px; flex: none; }
.hero-note { display: flex; align-items: center; gap: 16px; padding: 16px; margin-bottom: 10px; }
.hero-note h3 { margin: 0 0 6px; font: 400 var(--fs-d28)/1.1 var(--font-display); }
.hero-note p { margin: 0 0 8px; color: var(--silver); font: 700 var(--fs-small)/1.4 var(--font-body); }
.gem-big { --ic: 72px; display: inline-flex; flex: none; filter: drop-shadow(0 0 16px rgba(199, 164, 255, .6)); }
.info-card { padding: 11px 13px; margin: 3px 3px 12px; }
.info-card header { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; --ic: 24px; }
.info-card header b { font: 400 var(--fs-d20)/1.1 var(--font-display); }
.info-card header > span:last-child { margin-left: auto; }
.info-card p { margin: 6px 0 0; color: var(--silver); font: 700 var(--fs-small)/1.35 var(--font-body); }
.value-gold { color: var(--gold); font: 800 var(--fs-body)/1 var(--font-body); }
.mini-stat { display: grid; justify-items: center; align-content: center; gap: 1px; padding: 5px 10px; background: #070c22; box-shadow: 0 0 0 2px #34447c; }
.mini-stat b { font: 400 var(--fs-d24)/1 var(--font-display); color: var(--moon); }
.mini-stat small { color: var(--silver); font: 700 var(--fs-small)/1.1 var(--font-body); white-space: nowrap; }
.mini-stat.with-icon { grid-template-columns: auto auto; justify-content: start; column-gap: 8px; }
.mini-stat.with-icon .ic { grid-row: span 2; }
.mini-stat.with-icon b, .mini-stat.with-icon small { justify-self: start; }
.mini-stat.is-hot { box-shadow: 0 0 0 2px #ff9a4d, 0 0 14px rgba(255, 154, 77, .4); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 10px; width: 100%; }
.stat-grid.is-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* Missions and friends */
.mission-list, .growth-list { display: grid; gap: 12px; padding: 3px; }
.mission { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 10px 13px; animation: view-in .22s ease-out both; }
.mission.is-ready { --edge: var(--gold); box-shadow: 0 -3px 0 var(--edge), 0 3px 0 var(--edge), -3px 0 0 var(--edge), 3px 0 0 var(--edge), 0 0 18px rgba(255, 210, 63, .35); }
.mission.is-claimed { opacity: .72; }
.mission-text { display: grid; gap: 3px; min-width: 0; }
.mission-text b { font: 400 var(--fs-d20)/1.1 var(--font-display); }
.mission-text small { color: var(--silver); font: 700 var(--fs-small)/1.2 var(--font-body); }
.mission-text .mission-count, .badge-card .mission-count { color: var(--dim); font: 700 var(--fs-small)/1 var(--font-body); }
.mission-reward { display: flex; gap: 4px; }
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; padding: 3px; }
.badge-card { display: grid; gap: 4px; padding: 11px 13px; }
.badge-card b { font: 800 var(--fs-label)/1.1 var(--font-body); }
.badge-card small { color: var(--silver); font: 700 var(--fs-small)/1.2 var(--font-body); }
.badge-card.is-done { --edge: var(--gold); }
.badge-card:not(.is-done) { opacity: .85; }
.growth-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 9px 13px; }
.icon-well { display: grid; place-items: center; width: 42px; height: 42px; background: #070c22; box-shadow: 0 0 0 2px #34447c; }
.growth-text { display: grid; gap: 3px; min-width: 0; }
.growth-text b { font: 800 var(--fs-label)/1.1 var(--font-body); }
.growth-text small { color: var(--silver); font: 700 var(--fs-small)/1.25 var(--font-body); }
.growth-value { font: 400 var(--fs-d20)/1 var(--font-display); color: var(--moon); }
.boost-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; padding: 3px; }
.boost-card { display: grid; gap: 3px; padding: 9px 12px; }
.boost-card b { font: 800 var(--fs-body)/1.1 var(--font-body); }
.boost-card small { color: var(--silver); font: 700 var(--fs-small)/1.25 var(--font-body); }
.step-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0 0 14px; padding: 0; list-style: none; counter-reset: step; }
.step-list li { position: relative; padding: 12px 12px 12px 46px; background: rgba(10, 15, 40, .9); box-shadow: 0 0 0 2px #34447c; counter-increment: step; }
.step-list li::before { content: counter(step); position: absolute; left: 10px; top: 12px; display: grid; place-items: center; width: 26px; height: 26px; background: var(--gold); color: #2a1a02; font: 400 var(--fs-d20)/1 var(--font-display); }
.step-list b { display: block; font: 800 var(--fs-label)/1.1 var(--font-body); }
.step-list small { color: var(--silver); font: 700 var(--fs-small)/1.25 var(--font-body); }
.roster-rows { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; padding: 3px; }
.roster-row { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border: 0; cursor: pointer; text-align: left; font-family: var(--sans); transition: filter .15s, transform .1s; }
.roster-row:hover { filter: brightness(1.2); transform: translateY(-1px); }
.roster-row > span { flex: 1; min-width: 0; }
.roster-row b { display: block; font: 800 var(--fs-body)/1.1 var(--font-body); }
.roster-row small { color: var(--silver); font: 700 var(--fs-small)/1.2 var(--font-body); }

/* Records */
.record-hero { display: grid; justify-items: center; gap: 2px; width: 100%; padding: 12px; --ic: 36px; --edge: var(--gold); }
.record-hero small { color: var(--silver); font: 700 var(--fs-small)/1 var(--font-body); }
.record-hero b { color: var(--gold); font: 400 var(--fs-d52)/1 var(--font-display); text-shadow: 0 3px 0 var(--gold-lo); }
.rank-list { display: grid; gap: 10px; padding: 3px; }
.rank-row { display: grid; grid-template-columns: 34px 40px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 5px 13px; }
.rank-pos { font: 400 var(--fs-d28)/1 var(--font-display); color: var(--dim); text-align: center; }
.rank-1 { --edge: var(--gold); } .rank-1 .rank-pos { color: var(--gold); }
.rank-2 { --edge: var(--silver); } .rank-2 .rank-pos { color: var(--silver); }
.rank-3 { --edge: #d98d5e; } .rank-3 .rank-pos { color: #ffb68a; }
.rank-name b { display: block; font: 800 var(--fs-label)/1.1 var(--font-body); }
.rank-name small { color: var(--silver); font: 700 var(--fs-small)/1.2 var(--font-body); }
.rank-value { font: 400 var(--fs-d24)/1 var(--font-display); }

/* Mega and Angelic */
.mega-page { flex: 1; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); gap: calc(var(--gap) + 6px); padding: 4px; }
.mega-hero { display: flex; align-items: center; gap: 22px; padding: 12px 20px; background: linear-gradient(90deg, color-mix(in srgb, var(--type) 26%, #0a0f28), rgba(10, 15, 40, .97) 60%); }
.mega-hero .panel-sprite { width: 170px; height: 140px; flex: none; }
.mega-copy h3 { margin: 0 0 6px; font: 400 var(--fs-d32)/1.1 var(--font-display); }
.mega-copy .view-note { margin: 7px 0; max-width: 640px; }
.mega-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 8px; }
.mega-cell { display: grid; justify-items: center; gap: 2px; padding: 8px 5px; border: 0; background: #0a1030; color: var(--moon); cursor: pointer; box-shadow: 0 0 0 2px #27325e; font-family: var(--sans); transition: transform .1s, background .12s; }
.mega-cell:hover { background: var(--n3); transform: translateY(-2px); }
.mega-cell.selected { box-shadow: 0 0 0 3px var(--violet), 0 0 16px rgba(199, 164, 255, .5); }
.mega-cell .portrait { filter: brightness(.45) saturate(.5); }
.mega-cell.is-owned .portrait { filter: none; }
.mega-cell.is-owned { background: #151c46; }
.mega-cell b { font: 800 var(--fs-small)/1.1 var(--font-body); text-align: center; }
.mega-cell small { color: var(--dim); font: 700 var(--fs-small)/1.1 var(--font-body); }
.mega-cell.is-done small { color: var(--green); }
.angelic-page { flex: 1; display: flex; align-items: center; justify-content: center; gap: 48px; padding: 14px; background: radial-gradient(ellipse at 30% 50%, rgba(255, 228, 150, .16), transparent 60%); }
.halo-mark { position: relative; display: grid; place-items: center; width: 280px; height: 280px; flex: none; --ic: 96px; }
.halo-mark .ic-tone { filter: drop-shadow(0 0 18px rgba(255, 232, 160, .85)); }
.halo-ring { position: absolute; inset: 0; border: 4px solid rgba(242, 220, 150, .75); border-radius: 50%; box-shadow: 0 0 22px rgba(255, 232, 160, .4), inset 0 0 22px rgba(255, 232, 160, .25); }
.halo-ring.is-two { inset: 34px; border: 3px dotted rgba(205, 220, 255, .75); box-shadow: none; animation: halo-turn 24s linear infinite; }
@keyframes halo-turn { to { transform: rotate(360deg); } }
.angelic-copy { max-width: 520px; }
.angelic-copy h3 { margin: 0 0 10px; color: #ffe9a8; font: 400 var(--fs-d44)/1.05 var(--font-display); text-shadow: 0 3px 0 #6a5420; }
.angelic-copy p { margin: 0 0 12px; color: var(--silver); font: 700 var(--fs-body)/1.45 var(--font-body); }
.angelic-copy .chips { margin-bottom: 14px; }

/* Settings */
.settings-page { flex: 1; min-height: 0; display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: calc(var(--gap) + 6px); padding: 4px; max-width: 1100px; width: 100%; margin: 0 auto; }
.settings-nav { display: flex; flex-direction: column; gap: 6px; padding: 10px; align-self: start; }
.settings-tab { display: flex; align-items: center; gap: 9px; min-height: 44px; padding: 5px 10px; border: 0; background: transparent; color: var(--silver); cursor: pointer; font: 800 var(--fs-label)/1 var(--font-body); text-align: left; transition: background .12s; }
.settings-tab:hover { background: var(--n3); color: #fff; }
.settings-tab.active { background: var(--n4); color: #fff; box-shadow: 0 0 0 2px var(--frame-hi); }
.settings-body { padding: 14px 18px; }
.settings-body h3 { margin: 0 0 10px; font: 400 var(--fs-d32)/1.1 var(--font-display); }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 11px 0; border-bottom: 2px solid #27325e; }
.setting-text { min-width: 0; }
.setting-text b { display: block; font: 400 var(--fs-d20)/1.15 var(--font-display); }
.setting-text small { color: var(--silver); font: 700 var(--fs-small)/1.3 var(--font-body); }
.setting-row.is-danger b { color: #ff8f9d; }
.switch { position: relative; flex: none; width: 58px; height: 30px; padding: 0; border: 0; background: #1a2148; cursor: pointer; box-shadow: 0 0 0 3px var(--frame); transition: background .15s; }
.switch i { position: absolute; top: 4px; left: 4px; width: 22px; height: 22px; background: var(--silver); transition: transform .15s var(--ease); }
.switch.is-on { background: var(--gold-lo); box-shadow: 0 0 0 3px var(--gold); }
.switch.is-on i { transform: translateX(28px); background: #fff; }
.keys { display: flex; gap: 4px; flex: none; }
.keys kbd { min-width: 28px; padding: 4px 7px; background: var(--n3); color: var(--moon); font: 800 var(--fs-body)/1.1 var(--font-body); text-align: center; box-shadow: 0 0 0 2px var(--frame), 0 3px 0 2px #0a1130; }

/* Region select */
.dex-no { margin: 0; color: var(--cyan); font: 800 var(--fs-small)/1.1 var(--font-body); }
.input-hint { margin: 0; color: var(--silver); font: 700 var(--fs-small)/1.2 var(--font-body); }

/* Co-op */
.coop-page { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 34%); gap: calc(var(--gap) + 8px); padding: 4px; align-content: start; max-width: 1180px; margin: 0 auto; width: 100%; }
.coop-main p { font-size: var(--fs-small); }
.coop-actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 12px 0 4px; }
.join-panel, .room-panel { display: grid; gap: 8px; margin-top: 12px; color: var(--silver); font: 700 var(--fs-small)/1.2 var(--font-body); }
.coop-side { display: grid; gap: 12px; align-content: start; padding: 3px; }
.link-row { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 6px 12px; border: 0; text-align: left; cursor: pointer; font-family: var(--sans); transition: filter .15s; }
.link-row:hover { filter: brightness(1.2); }
.link-row > span { flex: 1; min-width: 0; }
.link-row b { display: block; font: 800 var(--fs-label)/1.1 var(--font-body); }
.link-row small { color: var(--silver); font: 700 var(--fs-small)/1.2 var(--font-body); }
.link-row.is-off { opacity: .68; cursor: default; }
.link-row.is-off:hover { filter: none; }

/* Portraits */
.portrait.portrait-fallback { width: 120px; height: 120px; background: transparent; }
.pc-sprite .portrait.portrait-fallback, .dex-sprite .portrait.portrait-fallback, .panel-sprite .portrait.portrait-fallback, .stage-sprite .portrait.portrait-fallback { width: 80px; height: 80px; }
.portrait { display: block; width: 40px; height: 40px; flex: none; image-rendering: pixelated; object-fit: contain; background: #0a1030; }
.portrait-unknown { display: grid; place-items: center; width: 40px; height: 40px; flex: none; background: #060a20; box-shadow: inset 0 0 0 2px #1e2850; color: #3d4c80; font: 400 var(--fs-d32)/1 var(--font-display); }
.portrait-unknown::before { content: '?'; }
.dex-cell .portrait-unknown { width: 80px; height: 80px; font-size: var(--fs-lead); background: transparent; }
.dex-sprite.is-unknown canvas { filter: brightness(0) drop-shadow(0 0 2px rgba(180, 205, 255, .8)); }
.dex-sprite.is-unknown .portrait { filter: brightness(0); }
.portrait.sprite-missing { visibility: hidden; }
.portrait-big { width: 80px; height: 80px; }

/* Gacha: banner select */
.gacha-select { min-height: 0; overflow-y: auto; padding: 4px; }
.banner-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr); height: 100%; min-height: 330px; gap: calc(var(--gap) + 7px); }
.banner-card { --edge: color-mix(in srgb, var(--tint) 62%, #223066); position: relative; display: flex; flex-direction: column; justify-content: flex-end; min-height: 0; padding: 0; overflow: hidden; border: 0; cursor: pointer; text-align: left; animation: rise .3s var(--ease) both; transition: transform .12s var(--ease), filter .15s; }
.banner-card:hover { --edge: var(--tint); transform: translateY(-3px) scale(1.01); filter: brightness(1.12); }
.banner-card:active { transform: translateY(2px); }
.banner-card:nth-child(2) { animation-delay: 30ms; } .banner-card:nth-child(3) { animation-delay: 60ms; } .banner-card:nth-child(4) { animation-delay: 90ms; } .banner-card:nth-child(5) { animation-delay: 120ms; } .banner-card:nth-child(6) { animation-delay: 150ms; } .banner-card:nth-child(7) { animation-delay: 180ms; } .banner-card:nth-child(8) { animation-delay: 210ms; } .banner-card:nth-child(9) { animation-delay: 240ms; } .banner-card:nth-child(10) { animation-delay: 270ms; } .banner-card:nth-child(11) { animation-delay: 300ms; } .banner-card:nth-child(12) { animation-delay: 330ms; }
.banner-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }
.banner-card.is-special .banner-art { filter: hue-rotate(0deg) saturate(1.2); }
.banner-card::after { content: ''; position: absolute; inset: 40% 0 0; background: linear-gradient(180deg, transparent, rgba(3, 5, 15, .94) 60%); }
.banner-card-chip { position: absolute; z-index: 1; top: 7px; left: 7px; padding: 2px 7px; background: rgba(3, 5, 15, .85); color: var(--tint); font: 800 var(--fs-badge)/1.2 var(--font-body); box-shadow: 0 0 0 2px color-mix(in srgb, var(--tint) 60%, #0a0f28); }
.banner-card-cost { position: absolute; z-index: 1; top: 7px; right: 7px; display: inline-flex; align-items: center; gap: 3px; padding: 1px 6px 1px 3px; background: rgba(3, 5, 15, .85); color: var(--moon); font: 800 var(--fs-small)/1 var(--font-body); --ic: 12px; box-shadow: 0 0 0 2px #34447c; }
.banner-card-sprites { position: relative; z-index: 1; display: flex; justify-content: center; gap: 4px; margin-bottom: auto; padding-top: 34px; }
.banner-card-sprites img { box-shadow: 0 0 0 2px color-mix(in srgb, var(--tint) 70%, #0a0f28); }
.banner-card-text { position: relative; z-index: 2; display: grid; gap: 3px; padding: 5px 11px 9px; }
.banner-card-text b { font: 400 var(--fs-d24)/1.05 var(--font-display); color: var(--moon); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.banner-card-text small { color: var(--silver); font: 700 var(--fs-small)/1.15 var(--font-body); }
.banner-card-text .meter { height: 5px; }
.banner-card-text .meter i { background: var(--tint); }

/* Gacha: banner page */
.gacha-banner { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: calc(var(--gap) + 8px); padding: 4px; }
.stage { --edge: color-mix(in srgb, var(--tint) 70%, #223066); position: relative; display: flex; flex-direction: column; min-height: 0; overflow: hidden; background: #050919; }
.stage-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; opacity: .95; }
.stage::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(3, 5, 15, .15) 30%, rgba(3, 5, 15, .9) 86%), radial-gradient(ellipse at 50% 55%, color-mix(in srgb, var(--tint) 24%, transparent), transparent 62%); pointer-events: none; }
.stage > * { position: relative; z-index: 1; }
.stage > .stage-art { position: absolute; z-index: 0; }
.stage-top { display: flex; justify-content: space-between; gap: 8px; padding: 9px 10px 0; }
.chip-plain { padding: 3px 8px; background: rgba(3, 5, 15, .85); color: var(--moon); font: 800 var(--fs-badge)/1.2 var(--font-body); box-shadow: 0 0 0 2px color-mix(in srgb, var(--tint) 55%, #0a0f28); white-space: nowrap; }
.stage-arrows { position: absolute; left: 10px; right: 10px; top: 40%; display: flex; justify-content: space-between; pointer-events: none; }
.stage-arrows button { pointer-events: auto; }
.stage-arrows[hidden] { display: none; }
.stage-floor { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; justify-items: center; gap: 6px; padding: 8px 54px 0; }
.stage-sprite { width: 100%; height: 66%; display: flex; align-items: flex-end; justify-content: center; }
.stage-machine { height: 100%; max-height: 300px; aspect-ratio: 64 / 88; image-rendering: pixelated; filter: drop-shadow(0 0 22px color-mix(in srgb, var(--tint) 45%, transparent)); }
.stage-caption { z-index: 2; display: grid; justify-items: center; gap: 3px; padding: 5px 16px; text-align: center; }
.stage-caption h3 { margin: 0; color: var(--tint); font: 400 var(--fs-d38)/1.05 var(--font-display); text-shadow: 0 3px 0 #03050f; }
.stage-caption p { margin: 0; color: var(--moon); font: 700 var(--fs-small)/1.25 var(--font-body); }
.stage-owned { display: flex; align-items: center; gap: 8px; color: var(--silver); font: 700 var(--fs-small)/1 var(--font-body); width: min(320px, 90%); justify-content: center; }
.stage-owned .meter { flex: 1; }
.stage-owned .meter i { background: var(--tint); }
.pull-row { display: flex; gap: 12px; padding: 7px 14px 14px; z-index: 2; }
.btn-pull { flex: 1; display: grid; justify-items: center; gap: 2px; min-height: 58px; padding: 5px; margin: 3px; border: 0; background: linear-gradient(180deg, var(--gold-hi), var(--gold)); color: #2a1a02; cursor: pointer; box-shadow: 0 -3px 0 #fff2b0, 0 3px 0 var(--gold-lo), -3px 0 0 #ffe680, 3px 0 0 #ffe680, 0 7px 0 #6e4304; transition: transform .08s, filter .15s; }
.btn-pull.is-ten { background: linear-gradient(180deg, #ff9ac6, var(--pink)); color: #3d0824; box-shadow: 0 -3px 0 #ffc6de, 0 3px 0 #a12a69, -3px 0 0 #ffb0d2, 3px 0 0 #ffb0d2, 0 7px 0 #5c123a; }
.btn-pull:hover:not(:disabled) { transform: translateY(-2px); filter: brightness(1.08); }
.btn-pull:active:not(:disabled) { transform: translateY(4px); }
.btn-pull:disabled { background: #171f42; color: #8c9ac0; box-shadow: 0 -3px 0 #2d3862, 0 3px 0 #0a0f28, -3px 0 0 #2d3862, 3px 0 0 #2d3862; cursor: not-allowed; }
.btn-pull b { font: 400 var(--fs-d28)/1 var(--font-display); }
.btn-pull small { font: 800 var(--fs-small)/1.1 var(--font-body); }
.gacha-side { display: flex; flex-direction: column; min-height: 0; padding: 10px 11px; gap: 7px; }
.gacha-result { margin: 0; color: var(--gold-hi); font: 700 var(--fs-small)/1.25 var(--font-body); }
.gacha-result:empty { display: none; }
.gacha-results { display: flex; gap: 6px; overflow-x: auto; flex: none; padding: 2px; }
.gacha-results:empty { display: none; }
.pull-result { display: grid; justify-items: center; flex: none; width: 66px; padding: 3px; background: #070c22; box-shadow: 0 0 0 2px var(--rarity); font-family: var(--sans); }
.pull-result b { max-width: 100%; overflow: hidden; color: var(--moon); font: 800 var(--fs-small)/1.1 var(--font-body); text-overflow: ellipsis; white-space: nowrap; }
.pull-result small { color: var(--rarity); font: 700 var(--fs-small)/1.1 var(--font-body); }
.gacha-view { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 3px 4px 8px; scrollbar-width: thin; scrollbar-color: var(--frame) transparent; }
.starter-pool { display: grid; gap: 7px; }
.starter-pool > b { color: var(--gold-hi); font: 800 var(--fs-body)/1.15 var(--font-body); }
.pool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 6px; padding: 2px; }
.pool-cell { display: grid; justify-items: center; gap: 1px; padding: 4px 2px; background: #0a1030; box-shadow: 0 0 0 2px #27325e; }
.pool-cell .portrait { filter: brightness(.55) saturate(.7); }
#starter-pool-list .pool-cell .portrait { filter: none; }
.pool-cell.is-owned { box-shadow: 0 0 0 2px var(--rarity, #6cf29a); background: #151c46; }
.pool-cell.is-owned .portrait { filter: none; }
.pool-cell b { max-width: 100%; overflow: hidden; color: var(--moon); font: 800 var(--fs-badge)/1.15 var(--font-body); text-overflow: ellipsis; white-space: nowrap; }
.pool-cell small { color: var(--gold-hi); font: 700 var(--fs-badge)/1 var(--font-body); }
.pool-group { margin-top: 9px; content-visibility: auto; contain-intrinsic-size: auto 300px; }
.pool-group h4 { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 0 0 5px; color: var(--rarity); font: 800 var(--fs-label)/1.1 var(--font-body); }
.pool-group h4 small { color: var(--silver); font: 700 var(--fs-small)/1 var(--font-body); }
.odds-rows { display: grid; gap: 10px; }
.odds-row { display: grid; grid-template-columns: 1fr auto; gap: 3px 10px; padding: 8px 10px; background: #0a1030; box-shadow: 0 0 0 2px #27325e; }
.odds-row b { color: var(--rarity); font: 400 var(--fs-d20)/1 var(--font-display); }
.odds-rate { color: var(--moon); font: 400 var(--fs-d24)/1 var(--font-display); }
.odds-row small { grid-column: 1 / -1; color: var(--silver); font: 700 var(--fs-small)/1.1 var(--font-body); }
.odds-row .meter { grid-column: 1 / -1; height: 6px; }
.odds-row .meter i { background: var(--rarity); }
.history-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 8px; padding: 2px; }
.history-stats .mini-stat { padding: 4px 2px; }
.history-list { display: grid; gap: 5px; margin-top: 8px; }
.history-row { display: flex; align-items: center; gap: 8px; padding: 3px 8px 3px 3px; background: #0a1030; box-shadow: 0 0 0 2px #27325e; }
.history-name { flex: 1; min-width: 0; }
.history-name b { display: block; font: 800 var(--fs-body)/1.1 var(--font-body); color: var(--moon); }
.history-name small { color: var(--dim); font: 700 var(--fs-small)/1.1 var(--font-body); }
.milestones { display: flex; gap: 8px; }
.milestone { position: relative; flex: 1; display: grid; justify-items: center; gap: 1px; padding: 6px 3px; background: #070c22; box-shadow: 0 0 0 2px #27325e; }
.milestone b { font: 400 var(--fs-d20)/1 var(--font-display); color: var(--silver); }
.milestone small { color: var(--dim); font: 700 var(--fs-small)/1.1 var(--font-body); text-align: center; }
.milestone.is-done { box-shadow: 0 0 0 2px var(--green); }
.milestone.is-done b { color: var(--green); }
.milestone-tick { position: absolute; top: 2px; right: 2px; --ic: 12px; }

/* Reveal */
.reveal { position: absolute; z-index: 9; left: 0; right: 0; bottom: 0; top: calc(var(--bar-h) + var(--safe-t) + 2px); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 8px var(--safe-r) var(--safe-b) var(--safe-l); overflow: hidden; background: radial-gradient(ellipse at 50% 42%, color-mix(in srgb, var(--r) 30%, #050919), #03050f 72%); animation: page-in .18s ease-out both; }
.reveal.rank-3 { background: radial-gradient(ellipse at 50% 42%, color-mix(in srgb, var(--r) 48%, #050919), #03050f 75%); }
.capsule-stage { display: grid; place-items: center; width: 100%; flex: none; }
.reveal .capsule-ball { position: relative; display: block; width: 128px; height: 128px; margin: 0; padding: 0; border: 0; border-radius: 0; background: linear-gradient(180deg, var(--red) 0 46%, #0a0f2c 46% 54%, var(--moon) 54%); box-shadow: none; clip-path: polygon(24% 0, 76% 0, 76% 8%, 92% 8%, 92% 24%, 100% 24%, 100% 76%, 92% 76%, 92% 92%, 76% 92%, 76% 100%, 24% 100%, 24% 92%, 8% 92%, 8% 76%, 0 76%, 0 24%, 8% 24%, 8% 8%, 24% 8%); filter: drop-shadow(0 0 28px var(--r)); }
.reveal .capsule-ball span { position: absolute; top: 40%; left: 40%; display: block; width: 20%; height: 20%; background: var(--r); box-shadow: 0 0 0 5px #0a0f2c; }
.reveal-content { position: relative; display: flex; flex-direction: column; align-items: center; width: 100%; flex: 0 1 auto; min-height: 0; }
.reveal-content:empty { display: none; }
.reveal-single { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; animation: view-in .28s var(--ease) both; }
.reveal-rays { position: absolute; left: 50%; top: 42%; width: 900px; height: 900px; margin: -450px 0 0 -450px; background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--r) 40%, transparent) 0 11deg, transparent 11deg 28deg); mask-image: radial-gradient(closest-side, #000 18%, transparent 75%); animation: rays 14s linear infinite; pointer-events: none; }
@keyframes rays { to { transform: rotate(360deg); } }
.reveal-stand { position: relative; display: flex; justify-content: center; align-items: flex-end; width: 100%; height: min(38vh, 320px); }
.reveal-sprite { position: relative; z-index: 1; width: min(100%, 420px); height: 100%; display: flex; align-items: flex-end; justify-content: center; animation: sprite-pop .42s var(--ease) both; }
@keyframes sprite-pop { from { opacity: 0; transform: scale(.4) translateY(20px); } to { opacity: 1; transform: none; } }
.reveal-pad { position: absolute; left: 50%; bottom: -8px; width: 220px; height: 24px; transform: translateX(-50%); background: radial-gradient(closest-side, var(--r), transparent); }
.reveal-copy { position: relative; z-index: 1; display: grid; justify-items: center; gap: 6px; margin-top: 4px; }
.reveal-copy h3 { margin: 0; color: var(--moon); font: 400 var(--fs-d44)/1.05 var(--font-display); text-shadow: 0 3px 0 #1d2b63; }
.reveal-grid { perspective: 700px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 9px; width: min(100%, 860px); }
.reveal-card { position: relative; display: grid; justify-items: center; gap: 2px; min-width: 0; padding: 7px 4px 8px; background: #0a1030; box-shadow: 0 0 0 3px var(--r); transform: rotateY(90deg); transition: transform .24s var(--ease); }
.reveal-card.is-open { transform: none; }
.reveal-card.rank-3, .reveal-card.rank-2 { box-shadow: 0 0 0 3px var(--r), 0 0 22px var(--r); }
.reveal-card-back { display: none; }
.reveal-card b { max-width: 100%; overflow: hidden; color: var(--moon); font: 800 var(--fs-body)/1.1 var(--font-body); text-overflow: ellipsis; white-space: nowrap; }
.reveal-card small { color: var(--r); font: 800 var(--fs-small)/1 var(--font-body); }
.reveal-card em { color: var(--silver); font: 700 var(--fs-small)/1 var(--font-body); font-style: normal; }
.reveal-card em.is-new { color: var(--green); }
.reveal-actions { position: relative; z-index: 2; display: flex; gap: 14px; flex: none; }
.reveal-skip { position: absolute; right: var(--safe-r); bottom: var(--safe-b); z-index: 2; }
.spark { position: absolute; left: 50%; top: 42%; width: 7px; height: 7px; background: var(--c); animation: spark .95s ease-out both; pointer-events: none; }
@keyframes spark { from { opacity: 1; transform: translate(0, 0) scale(1); } to { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(.3); } }

/* PC Box */
.pc-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: calc(var(--gap) + 8px); padding: 4px; }
.pc-roster { display: flex; flex-direction: column; gap: 9px; min-height: 0; padding: 11px; }
.pc-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; padding: 2px; flex: none; }
.pc-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 7px 10px; flex: none; }
.pc-tools > .chip-row { gap: 6px; }
.chip-row.is-sort { margin-left: auto; }
.chip-row.is-sort small { color: var(--silver); font: 700 var(--fs-small)/1 var(--font-body); margin-right: 4px; }
.box-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(102px, 1fr)); grid-auto-rows: 118px; align-content: start; gap: 7px; padding: 8px; overflow-y: auto; overscroll-behavior: contain; background: repeating-linear-gradient(0deg, rgba(95, 208, 255, .05) 0 2px, transparent 2px 10px), repeating-linear-gradient(90deg, rgba(95, 208, 255, .05) 0 2px, transparent 2px 10px), #071032; box-shadow: inset 0 0 0 2px #2b3866; scrollbar-width: thin; scrollbar-color: var(--frame) transparent; }
.box-grid .box-card { --edge: #2f3f75; position: relative; display: grid; justify-items: center; align-content: end; gap: 2px; width: auto; height: auto; min-height: 0; margin: 3px; padding: 3px 3px 5px; overflow: hidden; border: 0; border-radius: 0; background: linear-gradient(180deg, #1b2857, #0c1336); color: var(--moon); text-align: center; cursor: pointer; box-shadow: 0 0 0 2px #34447c; transition: transform .1s var(--ease), box-shadow .12s, filter .12s; }
.box-grid .box-card:hover { transform: translateY(-2px); filter: brightness(1.2); box-shadow: 0 0 0 2px var(--frame-hi); }
.box-grid .box-card.selected { box-shadow: 0 0 0 3px var(--gold), 0 0 16px rgba(255, 210, 63, .5); background: linear-gradient(180deg, #2f3d78, #141c4a); }
.box-grid .box-card .portrait { width: 80px; height: 80px; background: transparent; }
.box-name { max-width: 100%; overflow: hidden; font: 800 var(--fs-badge)/1.1 var(--font-body); text-overflow: ellipsis; white-space: nowrap; }
.box-level { position: absolute; top: 2px; left: 2px; padding: 1px 4px; background: rgba(3, 5, 15, .85); color: var(--moon); font: 800 var(--fs-badge)/1.2 var(--font-body); }
.box-rank { position: absolute; top: 2px; right: 2px; display: inline-flex; align-items: center; gap: 1px; padding: 1px 3px; background: rgba(3, 5, 15, .85); color: var(--gold); font: 800 var(--fs-badge)/1.2 var(--font-body); --ic: 12px; }
.box-partner { position: absolute; left: 3px; bottom: 16px; --ic: 12px; }
.box-ready { position: absolute; right: 3px; bottom: 16px; --ic: 12px; animation: alert-pulse 1.2s ease-in-out infinite; }
.box-slot { display: block; background: rgba(8, 14, 44, .7); box-shadow: inset 0 0 0 2px rgba(60, 78, 130, .35); margin: 3px; }
.box-none { grid-column: 1 / -1; }
#pokemon-detail.pokemon-detail { width: auto; max-width: none; position: static; display: flex; flex-direction: column; align-items: stretch; text-align: left; gap: 7px; min-height: 0; padding: 11px; overflow: hidden; --edge: color-mix(in srgb, var(--type, #41548f) 60%, #41548f); }
.pc-head { display: grid; grid-template-columns: 150px minmax(0, 1fr) minmax(190px, 1fr); gap: 12px; align-items: stretch; flex: none; }
.pc-stand { position: relative; display: flex; align-items: flex-end; justify-content: center; min-height: 140px; background: radial-gradient(ellipse at 50% 80%, color-mix(in srgb, var(--type, #5fd0ff) 45%, transparent), transparent 70%), #071032; box-shadow: inset 0 0 0 2px #2b3866; overflow: hidden; }
.pc-stand .hero-glow { width: 110px; bottom: 2px; }
.pc-sprite { position: relative; z-index: 1; width: 100%; height: 100%; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 6px; }
.pc-title { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pc-title h3 { margin: 0; font: 400 var(--fs-d32)/1.05 var(--font-display); color: var(--moon); }
.pc-rank { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pc-stars { display: inline-flex; align-items: center; gap: 4px; --ic: 12px; }
.pc-stars small { color: var(--silver); font: 700 var(--fs-small)/1 var(--font-body); }
.stars { display: inline-flex; gap: 1px; }
.pc-training { display: grid; gap: 3px; }
.level-line { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.level-line b { font: 800 var(--fs-body)/1 var(--font-body); }
.level-line small { color: var(--silver); font: 700 var(--fs-small)/1 var(--font-body); }
.wallet-line { display: flex; flex-wrap: wrap; gap: 3px 12px; --ic: 12px; }
.wallet-line span { display: inline-flex; align-items: center; gap: 4px; }
.wallet-line b { font: 800 var(--fs-small)/1 var(--font-body); }
.wallet-line small { color: var(--silver); font: 700 var(--fs-small)/1 var(--font-body); }
.stat-bars { display: grid; gap: 3px; }
.stat-row { display: grid; grid-template-columns: 50px 26px minmax(0, 1fr); align-items: center; gap: 5px; }
.stat-row > span:first-child { color: var(--silver); font: 700 var(--fs-small)/1.1 var(--font-body); white-space: nowrap; }
.stat-row b { color: var(--moon); font: 800 var(--fs-small)/1 var(--font-body); text-align: right; }
.stat-track { display: block; height: 7px; background: #050919; box-shadow: 0 0 0 1px #2b3866; }
.stat-track i { display: block; height: 100%; background: var(--stat); }
.stat-total { display: flex; justify-content: space-between; color: var(--silver); font: 700 var(--fs-small)/1 var(--font-body); margin-top: 2px; }
.stat-total b { color: var(--gold); font: 800 var(--fs-body)/1 var(--font-body); }
.pc-choose { flex: none; --ic: 24px; align-self: stretch; }
.pc-action-status { margin: 0; flex: none; color: var(--green); font: 700 var(--fs-small)/1.25 var(--font-body); }
.pc-action-status:empty { display: none; }
.pc-action-status.is-bad { color: #ff9aa8; }
.pc-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 3px 6px 8px 3px; scrollbar-width: thin; scrollbar-color: var(--frame) transparent; }
.pc-section[hidden] { display: none; }
.pc-section > .field-input { margin-bottom: 7px; }
.move-group { margin-bottom: 11px; }
.move-group h4 { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 0 0 5px; font: 800 var(--fs-body)/1.1 var(--font-body); color: var(--moon); }
.move-group h4 small { color: var(--silver); font: 700 var(--fs-small)/1 var(--font-body); }
.move-row { display: flex; align-items: center; gap: 8px; min-height: 40px; margin-bottom: 5px; padding: 3px 5px; background: #0a1030; box-shadow: inset 3px 0 0 var(--type), 0 0 0 2px #27325e; }
.move-row.is-equipped { background: #2a2408; box-shadow: inset 3px 0 0 var(--gold), 0 0 0 2px var(--gold-lo); }
.move-type { flex: none; width: 58px; color: var(--type); font: 800 var(--fs-badge)/1 var(--font-body); text-align: center; text-transform: capitalize; }
.move-text { flex: 1; min-width: 0; }
.move-text b { display: block; font: 800 var(--fs-body)/1.1 var(--font-body); color: var(--moon); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.move-text small { color: var(--silver); font: 700 var(--fs-small)/1.1 var(--font-body); text-transform: none; }
.move-level { flex: none; color: var(--cyan); font: 800 var(--fs-small)/1 var(--font-body); }
.evo-card { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 11px; margin-bottom: 9px; padding: 8px 10px; background: #0a1030; box-shadow: 0 0 0 2px #27325e; }
.evo-card.is-ready { box-shadow: 0 0 0 2px var(--gold), 0 0 14px rgba(255, 210, 63, .28); }
.evo-preview { display: flex; align-items: center; gap: 3px; --ic: 24px; align-self: start; }
.evo-preview.is-big { justify-content: center; margin-bottom: 8px; }
.evo-preview.is-big .portrait { width: 80px; height: 80px; }
.evo-info { display: grid; gap: 5px; min-width: 0; }
.evo-info header { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 7px; }
.evo-info header b { font: 400 var(--fs-d20)/1.05 var(--font-display); }
.check-list { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; --ic: 12px; }
.check-list li { display: flex; align-items: center; gap: 5px; font: 700 var(--fs-small)/1.2 var(--font-body); }
.check-list li.is-met { color: #b6ffd2; }
.check-list li.is-unmet { color: #ffb3bd; }
.check-list li.is-unmet .ic { color: #ff7a8f; }
.evo-note { margin: 0; color: var(--dim); font: 700 var(--fs-small)/1.3 var(--font-body); }
.evo-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.evo-actions .btn { min-height: 32px; padding: 4px 10px; font-size: var(--fs-body); --ic: 12px; }
.evo-confirm .chips { display: flex; justify-content: center; --ic: 12px; }
.rank-card { grid-template-columns: auto minmax(0, 1fr); }
.rank-big { display: grid; justify-items: center; align-content: center; min-width: 76px; padding: 6px; background: #070c22; box-shadow: 0 0 0 2px var(--gold-lo); }
.rank-big b { color: var(--gold); font: 400 var(--fs-d52)/1 var(--font-display); }
.rank-big small { color: var(--silver); font: 700 var(--fs-small)/1 var(--font-body); }
.rank-bonuses { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 2px; }
.rank-bonuses .mini-stat { grid-template-columns: auto 1fr auto 1fr; justify-items: start; align-items: center; column-gap: 5px; }
.rank-card > .view-note { grid-column: 1 / -1; margin: 0; }
.form-row { display: flex; align-items: center; justify-content: space-between; gap: 9px; margin-bottom: 5px; padding: 5px 7px; background: #0a1030; box-shadow: 0 0 0 2px #27325e; }
.form-row.is-active { box-shadow: 0 0 0 2px var(--gold); }
.form-row.is-locked { opacity: .9; }
.form-text { display: grid; gap: 3px; min-width: 0; }
.form-text b { font: 800 var(--fs-body)/1.1 var(--font-body); }
.form-text small { font: 700 var(--fs-small)/1 var(--font-body); }

/* Pokédex */
.dex-page .page-bar { flex-wrap: nowrap; }
.dex-progress { display: flex; gap: 9px; margin-left: auto; flex: none; padding: 2px; }
.dex-regions { flex: none; flex-wrap: nowrap; overflow-x: auto; padding: 3px; gap: 7px; scrollbar-width: none; }
.dex-regions .chip { flex: 1 0 auto; }
.dex-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: calc(var(--gap) + 8px); padding: 4px; }
.dex-list { display: flex; flex-direction: column; gap: 8px; min-height: 0; padding: 10px; }
.pc-tools.is-dex { flex-wrap: nowrap; }
.dex-grid { position: relative; flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--frame) transparent; }
.dex-grid-inner { position: relative; width: 100%; }
.dex-cell { position: absolute; display: block; padding: 3px; border: 0; background: none; cursor: pointer; color: var(--moon); }
.dex-cell-inner { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: end; width: 100%; height: 100%; padding: 2px 2px 5px; background: linear-gradient(180deg, #151e48, #0a1030); box-shadow: inset 0 0 0 2px #27325e; transition: filter .12s, box-shadow .12s; }
.dex-cell:hover .dex-cell-inner { filter: brightness(1.25); }
.dex-cell.selected .dex-cell-inner { box-shadow: inset 0 0 0 3px var(--gold), 0 0 12px rgba(255, 210, 63, .4); }
.dex-cell.is-owned .dex-cell-inner { background: linear-gradient(180deg, #24346f, #111a48); box-shadow: inset 0 0 0 2px var(--cyan); }
.dex-cell.is-owned.selected .dex-cell-inner { box-shadow: inset 0 0 0 3px var(--gold); }
.dex-cell .portrait { width: 80px; height: 80px; background: transparent; }
.dex-num { position: absolute; top: 3px; left: 5px; color: var(--dim); font: 800 var(--fs-badge)/1 var(--font-body); }
.dex-cell b { max-width: 100%; overflow: hidden; font: 800 var(--fs-badge)/1.1 var(--font-body); text-overflow: ellipsis; white-space: nowrap; }
.dex-cell.is-unseen b { color: var(--faint); }
.dex-pip { position: absolute; top: 4px; right: 4px; width: 7px; height: 7px; background: var(--cyan); }
.dex-detail { display: flex; flex-direction: column; gap: 8px; min-height: 0; padding: 11px; }
.dex-head { display: flex; align-items: center; gap: 8px; flex: none; }
.dex-sprite { position: relative; display: flex; align-items: flex-end; justify-content: center; width: 170px; height: 150px; flex: none; background: radial-gradient(ellipse at 50% 85%, color-mix(in srgb, var(--type) 45%, transparent), transparent 70%), #071032; box-shadow: inset 0 0 0 2px #2b3866; overflow: hidden; padding-bottom: 6px; }
.dex-sprite > .portrait { background: transparent; margin-bottom: 20px; }
.dex-title { min-width: 0; margin-left: 8px; display: grid; gap: 5px; }
.dex-title h3 { margin: 0; font: 400 var(--fs-d32)/1.05 var(--font-display); }
.dex-tab-body { flex: 1; min-height: 0; overflow-y: auto; padding: 3px 5px 6px 3px; scrollbar-width: thin; scrollbar-color: var(--frame) transparent; }
.matchups { display: grid; gap: 6px; margin-top: 10px; }
.match-row { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 7px; align-items: start; }
.match-label { font: 800 var(--fs-badge)/1.3 var(--font-body); }
.is-weak .match-label { color: #ff9aa8; }
.is-res .match-label { color: #9ef5bd; }
.route-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.route-list li { display: flex; align-items: center; gap: 9px; padding: 9px; background: #0a1030; box-shadow: 0 0 0 2px #27325e; color: var(--silver); font: 700 var(--fs-small)/1.35 var(--font-body); }

/* Small confirmations */
.mini-dialog { position: absolute; z-index: 30; inset: 0; display: grid; place-items: center; padding: 12px; background: rgba(2, 4, 14, .72); animation: page-in .14s ease-out both; }
.mini-card { width: min(440px, 100%); max-height: 100%; overflow-y: auto; padding: 14px 16px; --edge: var(--frame-hi); animation: mini-pop .18s var(--ease) both; }
@keyframes mini-pop { from { transform: scale(.9); opacity: 0; } to { transform: none; opacity: 1; } }
.mini-card header { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; }
.mini-card h3 { margin: 0; font: 400 var(--fs-d28)/1.1 var(--font-display); color: var(--moon); }
.mini-card p { margin: 0 0 10px; color: var(--silver); font: 700 var(--fs-small)/1.4 var(--font-body); }
.mini-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 10px; }

.empty-state { flex: 1; display: grid; place-content: center; justify-items: center; gap: 8px; text-align: center; --ic: 48px; }
.empty-state h3 { margin: 0; font: 400 var(--fs-d32)/1.1 var(--font-display); }
.empty-state p { margin: 0; color: var(--silver); font: 700 var(--fs-body)/1.4 var(--font-body); }

/* Phone landscape: every screen is designed for 844x390 and 667x375. */
@media (max-height: 520px) {
  .home-brand { font-size: 28px; }
  .home-brand small { display: none; }
  .res { height: 26px; font-family: var(--font-body); font-weight: 800; font-size: var(--fs-body); padding: 0 8px 0 4px; --ic: 12px; margin: 2px; }
  .icon-btn { width: 30px; height: 30px; --ic: 12px; }
  .home-foot { display: none; }
  .hero { gap: 2px; }
  .hero-card { padding: 2px 7px; }
  .hero-name strong { font-family: var(--font-body); font-weight: 800; font-size: var(--fs-label); }
  .hero-move { font-size: var(--fs-small); margin-top: 1px; }
  .hero-level { font-size: var(--fs-small); margin-top: 1px; }
  .hero-actions { margin-top: 3px; gap: 7px; }
  .btn-play { min-height: 46px; --ic: 24px; gap: 7px; }
  .btn-play b { font-size: var(--fs-d28); }
  .btn-play small { font-size: var(--fs-small); }
  .btn-duo { width: 44px; }
  .hub-record { margin-top: 6px; font-size: var(--fs-small); }
  .hub-record b { font-size: var(--fs-small); }
  .hero-capsule { width: 64px; height: 64px; }
  .home-account { font-size: var(--fs-small); --ic: 12px; }
  .sky-group { font-size: var(--fs-badge); }
  .star { --disc: 44px; width: 96px; height: 76px; margin: -38px 0 0 -48px; gap: 0; }
  .star.is-major { --disc: 50px; height: 80px; margin-top: -40px; }
  .star .star-disc, .star.is-major .star-disc { --ic: 24px; }
  .star-disc { box-shadow: 0 0 0 2px #7c92d0, 0 0 0 4px rgba(10, 16, 44, .9), 0 0 0 5px rgba(124, 146, 208, .5), 0 0 12px rgba(150, 180, 255, .4); }
  .star.is-major .star-disc { box-shadow: 0 0 0 2px var(--gold), 0 0 0 4px rgba(10, 16, 44, .9), 0 0 0 5px rgba(255, 210, 63, .55), 0 0 16px rgba(255, 210, 63, .35); }
  .star-disc::before { inset: -9px; }
  .star-badge { min-width: 17px; padding: 0 3px; right: -7px; top: -4px; font-size: var(--fs-badge); }
  .star-label { margin-top: 4px; padding: 0 4px; }
  .star-label b { font-family: var(--font-body); font-weight: 800; font-size: var(--fs-small); }
  .star-label small { font-size: var(--fs-small); }
  .page.auth-page { gap: 18px; padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); }
  .auth-brand { gap: 4px; flex-basis: 42%; }
  .auth-logo { font-size: 58px; }
  .auth-tag { font-family: var(--font-body); font-weight: 800; font-size: var(--fs-small); }
  .auth-device { font-size: var(--fs-small); padding: 4px 7px; margin-top: 2px; line-height: 1.3; --ic: 12px; gap: 5px; }
  .auth-card { flex: 0 0 55%; padding: 6px 10px 7px; gap: 3px; }
  #auth-form { gap: 1px; }
  .auth-field { font-size: var(--fs-small); gap: 1px; grid-template-columns: 96px minmax(0, 1fr); align-items: center; column-gap: 6px; }
  .auth-error { min-height: 0; font-size: var(--fs-small); grid-column: 2; }
  .auth-submit { min-height: 30px; font-size: var(--fs-body); }
  .auth-or { font-size: var(--fs-small); }
  .auth-guest b { font-size: var(--fs-small); }
  .auth-guest small { font-size: var(--fs-small); }
  .auth-legacy { font-size: var(--fs-small); }
  .auth-eye { height: 24px; margin-top: -12px; --ic: 12px; }

  .btn { min-height: 30px; padding: 3px 10px; font-size: var(--fs-small); }
  .btn-mini { min-height: 24px; padding: 2px 7px; font-size: var(--fs-small); }
  .round-btn { width: 28px; height: 28px; --ic: 12px; }
  .btn-back { height: 32px; font-family: var(--font-body); font-weight: 800; font-size: var(--fs-body); padding: 0 9px 0 5px; --ic: 12px; gap: 4px; }
  .page-icon { --ic: 24px; }
  .page-title h2 { font-size: var(--fs-d24); }
  .page-title small { font-size: var(--fs-small); }
  .page-bar { gap: 7px; }
  .seg-tab { min-height: 26px; font-size: var(--fs-small); }
  .chip { min-height: 22px; padding: 1px 7px; font-size: var(--fs-small); }
  .chip-stack small { font-size: var(--fs-small); }
  .field-input, .field-select, .search-box { min-height: 26px; font-size: var(--fs-small); }
  .search-box input { height: 24px; font-size: var(--fs-small); }
  .view-note, .plain-list { font-size: var(--fs-small); margin-bottom: 4px; }
  .plain-list { margin-top: 5px; }
  .sub-head { margin: 7px 0 5px; font-family: var(--font-body); font-weight: 800; font-size: var(--fs-body); }
  .mini-stat { padding: 2px 5px; }
  .mini-stat b { font-family: var(--font-body); font-weight: 800; font-size: var(--fs-body); }
  .mini-stat small { font-size: var(--fs-small); }
  .mini-stat.with-icon { column-gap: 4px; --ic: 12px; }
  .info-card { padding: 6px 8px; margin-bottom: 9px; }
  .info-card header { margin-bottom: 4px; --ic: 12px; }
  .info-card header b { font-family: var(--font-body); font-weight: 800; font-size: var(--fs-body); }
  .info-card p { font-size: var(--fs-small); }

  .split-page { grid-template-columns: minmax(0, 1fr) minmax(190px, 28%); gap: 10px; }
  .info-upgrades .split-page, .info-leaderboard .split-page { grid-template-columns: minmax(190px, 28%) minmax(0, 1fr); }
  .partner-side { padding: 7px; gap: 4px; }
  .partner-side h3 { font-size: var(--fs-d20); }
  .panel-sprite { height: 70px; }
  .hero-note { padding: 8px; gap: 9px; margin-bottom: 6px; }
  .hero-note h3 { font-size: var(--fs-d20); margin-bottom: 3px; }
  .hero-note p { font-size: var(--fs-small); margin-bottom: 4px; }
  .gem-big { --ic: 48px; }
  .stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-bottom: 6px; }
  .mission-list, .growth-list { gap: 9px; }
  .mission { padding: 4px 8px; gap: 8px; }
  .mission-text { gap: 1px; }
  .mission-text b { font-family: var(--font-body); font-weight: 800; font-size: var(--fs-body); }
  .mission-text small { font-size: var(--fs-small); }
  .res-small { height: 20px; }
  .badge-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
  .badge-card { padding: 5px 7px; --ic: 12px; gap: 1px; }
  .badge-card b { font-size: var(--fs-small); }
  .badge-card small { font-size: var(--fs-small); }
  .growth-row { padding: 3px 8px; gap: 8px; }
  .icon-well { width: 28px; height: 28px; --ic: 12px; }
  .growth-text { gap: 1px; }
  .growth-text b { font-size: var(--fs-small); }
  .growth-text small { font-size: var(--fs-small); }
  .growth-value { font-family: var(--font-body); font-weight: 800; font-size: var(--fs-small); }
  .boost-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .boost-card { padding: 4px 7px; }
  .boost-card b { font-size: var(--fs-small); }
  .boost-card small { font-size: var(--fs-small); }
  .step-list { gap: 8px; margin-bottom: 8px; }
  .step-list li { padding: 6px 6px 6px 32px; }
  .step-list li::before { width: 20px; height: 20px; font-family: var(--font-body); font-weight: 800; font-size: var(--fs-small); left: 6px; top: 7px; }
  .step-list b { font-size: var(--fs-small); }
  .step-list small { font-size: var(--fs-small); }
  .roster-rows { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .roster-row { padding: 2px 6px; }
  .roster-row b { font-size: var(--fs-small); }
  .roster-row small { font-size: var(--fs-small); }
  .record-hero { padding: 4px; --ic: 24px; }
  .record-hero b { font-size: var(--fs-d32); }
  .record-hero small { font-size: var(--fs-small); }
  .rank-list { gap: 7px; }
  .rank-row { padding: 1px 8px; gap: 8px; grid-template-columns: 22px 40px minmax(0, 1fr) auto; }
  .rank-pos { font-family: var(--font-body); font-weight: 800; font-size: var(--fs-label); }
  .rank-name b { font-size: var(--fs-small); }
  .rank-name small { font-size: var(--fs-small); }
  .rank-value { font-family: var(--font-body); font-weight: 800; font-size: var(--fs-body); }
  .mega-page { gap: 8px; }
  .mega-hero { padding: 3px 10px; gap: 10px; }
  .mega-hero .panel-sprite { width: 90px; height: 76px; }
  .mega-copy h3 { font-size: var(--fs-d20); margin-bottom: 2px; }
  .mega-copy .view-note { font-size: var(--fs-small); margin: 3px 0; }
  .mega-grid { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; }
  .mega-cell { padding: 2px; }
  .mega-cell b { font-size: var(--fs-small); }
  .angelic-page { gap: 22px; padding: 4px; }
  .halo-mark { width: 170px; height: 170px; --ic: 48px; }
  .halo-ring.is-two { inset: 22px; }
  .angelic-copy h3 { font-size: var(--fs-d32); margin-bottom: 5px; }
  .angelic-copy p { font-size: var(--fs-small); margin-bottom: 7px; }
  .angelic-copy .chips { margin-bottom: 7px; }
  .settings-page { grid-template-columns: 130px minmax(0, 1fr); gap: 10px; }
  .settings-nav { padding: 4px; gap: 2px; }
  .settings-tab { min-height: 30px; font-size: var(--fs-small); --ic: 12px; padding: 2px 5px; gap: 5px; }
  .settings-body { padding: 6px 10px; }
  .settings-body h3 { font-size: var(--fs-d20); margin-bottom: 3px; }
  .setting-row { padding: 5px 0; gap: 10px; }
  .setting-text b { font-family: var(--font-body); font-weight: 800; font-size: var(--fs-body); }
  .setting-text small { font-size: var(--fs-small); }
  .switch { width: 46px; height: 24px; }
  .switch i { width: 16px; height: 16px; }
  .switch.is-on i { transform: translateX(22px); }
  .keys kbd { font-size: var(--fs-badge); min-width: 22px; padding: 2px 5px; }

  .dex-no { font-size: var(--fs-small); }
  .btn-play.is-compact { min-height: 38px; }
  .input-hint { font-size: var(--fs-small); }
  .coop-page { gap: 11px; grid-template-columns: minmax(0, 1fr) minmax(220px, 34%); }
  .coop-main p { font-size: var(--fs-small); }
  .coop-actions { margin: 6px 0 2px; gap: 8px; }
  .join-panel, .room-panel { margin-top: 5px; gap: 3px; font-size: var(--fs-small); }
  .coop-side { gap: 8px; }
  .link-row { min-height: 34px; padding: 1px 8px; gap: 6px; --ic: 12px; }
  .link-row b { font-size: var(--fs-small); }
  .link-row small { font-size: var(--fs-small); }

  .banner-grid { min-height: 0; gap: 10px; }
  .banner-card-chip { top: 4px; left: 4px; font-size: var(--fs-badge); padding: 1px 4px; }
  .banner-card-cost { top: 4px; right: 4px; font-size: var(--fs-small); }
  .banner-card-sprites { padding-top: 18px; gap: 2px; }
  .banner-card-sprites img { width: 30px; height: 30px; }
  .banner-card-text { padding: 1px 6px 4px; gap: 1px; }
  .banner-card-text b { font-family: var(--font-body); font-weight: 800; font-size: var(--fs-small); }
  .banner-card-text small { font-size: var(--fs-small); }
  .banner-card-text .meter { height: 4px; }
  .gacha-banner { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 11px; }
  .stage-top { padding: 3px 4px 0; }
  .chip-plain { font-size: var(--fs-badge); padding: 1px 3px; }
  .stage-floor { padding: 2px 32px 0; }
  .stage-arrows { left: 3px; right: 3px; top: 34%; }
  .stage-caption { padding: 1px 6px; gap: 1px; }
  .stage-caption h3 { font-family: var(--font-body); font-weight: 800; font-size: var(--fs-label); }
  .stage-caption p { font-size: var(--fs-small); line-height: 1.15; }
  .stage-owned { font-size: var(--fs-small); }
  .pull-row { gap: 9px; padding: 2px 6px 7px; }
  .btn-pull { min-height: 36px; padding: 1px; }
  .btn-pull b { font-family: var(--font-body); font-weight: 800; font-size: var(--fs-body); }
  .btn-pull small { font-size: var(--fs-small); }
  .gacha-side { padding: 5px 7px; gap: 4px; }
  .gacha-result { font-size: var(--fs-small); max-height: 26px; overflow: hidden; }
  .pull-result { width: 56px; }
  .pull-result .portrait { width: 30px; height: 30px; }
  .pool-grid { grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 5px; }
  .pool-group { margin-top: 5px; }
  .pool-group h4 { font-size: var(--fs-small); margin-bottom: 3px; }
  .odds-rows { gap: 7px; }
  .odds-row { padding: 3px 7px; gap: 1px 7px; }
  .odds-row b, .odds-rate { font-size: var(--fs-small); }
  .odds-row small { font-size: var(--fs-small); }
  .milestones { gap: 6px; }
  .milestone { padding: 2px; }
  .milestone b { font-family: var(--font-body); font-weight: 800; font-size: var(--fs-small); }
  .milestone small { font-size: var(--fs-small); }
  .history-row { gap: 5px; padding: 1px 5px 1px 1px; }
  .history-row .portrait { width: 30px; height: 30px; }
  .history-name b { font-size: var(--fs-small); }
  .history-name small { font-size: var(--fs-small); }
  .history-stats { gap: 6px; }

  .reveal { gap: 3px; padding-top: 2px; }
  .reveal .capsule-ball { width: 96px; height: 96px; }
  .reveal-stand { height: 130px; }
  .reveal-copy { gap: 3px; margin-top: 1px; }
  .reveal-copy h3 { font-size: var(--fs-d28); }
  .reveal-single { gap: 2px; }
  .reveal-grid { gap: 7px; width: min(100%, 640px); }
  .reveal-card { padding: 1px 3px 3px; gap: 0; }
  .reveal-card .portrait { width: 40px; height: 40px; }
  .reveal-card b { font-size: var(--fs-small); }
  .reveal-card small { font-size: var(--fs-small); }
  .reveal-card em { font-size: var(--fs-small); }
  .reveal-actions { gap: 9px; }

  .pc-layout { grid-template-columns: minmax(0, .72fr) minmax(0, 1fr); gap: 11px; }
  .pc-roster { padding: 5px; gap: 4px; }
  .pc-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
  .pc-stats .mini-stat { grid-template-columns: 1fr; justify-items: center; padding: 1px; }
  .pc-stats .mini-stat .ic { display: none; }
  .pc-tools { gap: 3px 5px; }
  .pc-tools .chip-row { gap: 3px; }
  .chip-row.is-sort small { display: none; }
  .chip-row.is-sort { margin-left: 0; }
  .box-grid { grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); grid-auto-rows: 62px; padding: 3px; gap: 4px; }
  .box-grid .box-card { margin: 2px; padding: 1px; }
  .box-grid .box-card .portrait { width: 40px; height: 40px; }
  .halo-wing { --ic: 24px; }
  /* Phone Pokédex: the grid fills the page, a tap opens the detail full-screen. */
  .dex-page { --dex-bar: 0; }
  .dex-layout { grid-template-columns: minmax(0, 1fr); padding: 0; }
  .dex-regions .chip { flex: 0 0 auto; }
  .dex-ring { width: 40px; height: 40px; }
  .dex-ring b { width: 30px; height: 30px; font-size: var(--fs-badge); }
  .dex-progress .mini-stat .ic { display: none; }
  .dex-progress .mini-stat.with-icon { grid-template-columns: 1fr; }
  .pc-tools.is-dex { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .pc-tools.is-dex .search-box { flex: 1 0 150px; }
  .dex-filter-toggle { display: inline-block; flex: none; }
  .dex-filters { display: none; }
  .dex-list.filters-open .pc-tools.is-dex { flex-wrap: wrap; }
  .dex-list.filters-open .dex-filters { display: flex; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .dex-filters .field-select { flex: none; }
  .dex-detail { display: none; }
  .dex-detail.is-open { position: absolute; z-index: 5; inset: 0; display: grid; grid-template-columns: minmax(170px, 34%) minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); padding: 6px 8px; background: linear-gradient(180deg, #111a48, #070c22); }
  .dex-close { display: inline-flex; grid-column: 1; justify-self: start; }
  .dex-id { grid-row: 2; grid-column: 1; }
  .dex-panel { grid-row: 1 / span 2; grid-column: 2; }
  .dex-stage .dex-sprite { height: 110px; }
  .dex-name h3 { font-family: var(--font-display); font-weight: 400; font-size: var(--fs-d24); }
  .dex-actions .btn { min-height: 34px; }
  .match-row { grid-template-columns: 92px minmax(0, 1fr); }
  /* Phone PC: stats give way to the roster, filters and sorts share one scrolling row, the detail scrolls as a whole. */
  .pc-roster .pc-stats { display: none; }
  .pc-tools { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .pc-tools .chip-row { flex: none; flex-wrap: nowrap; }
  .pc-tools .search-box { flex: 0 0 150px; min-width: 150px; }
  #pokemon-detail.pokemon-detail { overflow-y: auto; }
  #pokemon-detail .pc-scroll { flex: none; overflow: visible; }
  /* Home: the moon gets the height; Play keeps a single line. */
  .btn-play small { display: none; }
  .btn-play { min-height: 40px; }
  .partner-glyph .model-canvas { bottom: 12px !important; }
  .claim-bar { min-height: 38px; gap: 8px; }
  .claim-all { min-height: 34px; padding: 3px 12px; --ic: 12px; }
  .box-name { font-size: var(--fs-badge); }
  .box-level { font-size: var(--fs-badge); padding: 0 2px; }
  .box-rank { font-size: var(--fs-badge); padding: 0 1px; }
  .box-partner, .box-ready { bottom: 12px; }
  .box-slot { margin: 2px; }
  #pokemon-detail.pokemon-detail { padding: 5px 6px; gap: 3px; }
  .pc-head { grid-template-columns: 74px minmax(0, 1fr) minmax(130px, .9fr); gap: 6px; }
  .pc-stand { min-height: 84px; }
  .pc-stand .hero-glow { width: 60px; }
  .pc-title { gap: 1px; }
  .pc-title h3 { font-family: var(--font-body); font-weight: 800; font-size: var(--fs-label); }
  .pc-rank { gap: 3px; }
  .pc-rank .rarity-tag { font-size: var(--fs-badge); padding: 0 4px; }
  .pc-stars small { display: none; }
  .level-line b { font-size: var(--fs-small); }
  .level-line small, .wallet-line small { font-size: var(--fs-small); }
  .wallet-line b { font-size: var(--fs-small); }
  .wallet-line { gap: 1px 7px; }
  .pc-training { gap: 1px; }
  .stat-row { grid-template-columns: 38px 20px minmax(0, 1fr); gap: 3px; }
  .stat-row > span:first-child { font-size: var(--fs-small); }
  .stat-row b { font-size: var(--fs-small); }
  .stat-track { height: 5px; }
  .stat-bars { gap: 1px; }
  .stat-total { font-size: var(--fs-small); margin-top: 0; }
  .stat-total b { font-size: var(--fs-small); }
  .pc-choose { min-height: 24px; font-size: var(--fs-small); --ic: 12px; padding: 1px; }
  .pc-action-status { font-size: var(--fs-small); }
  .move-row { min-height: 28px; margin-bottom: 3px; padding: 1px 3px; gap: 5px; }
  .move-type { width: 44px; font-size: var(--fs-badge); }
  .move-text b { font-size: var(--fs-small); }
  .move-text small { font-size: var(--fs-small); }
  .move-group h4 { font-size: var(--fs-small); margin-bottom: 3px; }
  .move-group h4 small { font-size: var(--fs-small); }
  .move-group { margin-bottom: 6px; }
  .evo-card { padding: 3px 6px; gap: 6px; margin-bottom: 6px; }
  .evo-preview .portrait { width: 40px; height: 40px; }
  .evo-preview { --ic: 12px; }
  .evo-info { gap: 2px; }
  .evo-info header b { font-family: var(--font-body); font-weight: 800; font-size: var(--fs-body); }
  .check-list li { font-size: var(--fs-small); }
  .evo-note { font-size: var(--fs-small); }
  .evo-actions .btn { min-height: 24px; font-size: var(--fs-small); padding: 1px 7px; }
  .rank-big { min-width: 48px; padding: 3px; }
  .rank-big b { font-size: var(--fs-d32); }
  .rank-big small { font-size: var(--fs-small); }
  .form-row { padding: 2px 5px; margin-bottom: 3px; }
  .form-text b { font-size: var(--fs-small); }
  .mini-card { padding: 7px 10px; }
  .mini-card h3 { font-family: var(--font-body); font-weight: 800; font-size: var(--fs-label); }
  .mini-card header { margin-bottom: 3px; }
  .mini-card p { font-size: var(--fs-small); margin-bottom: 5px; }
  .mini-actions { margin-top: 5px; }
  .evo-preview.is-big { margin-bottom: 3px; }
  .evo-preview.is-big .portrait { width: 40px; height: 40px; }

  .portrait.portrait-fallback { width: 80px; height: 80px; }
  .pc-sprite .portrait.portrait-fallback, .dex-sprite .portrait.portrait-fallback, .panel-sprite .portrait.portrait-fallback, .stage-sprite .portrait.portrait-fallback { width: 60px; height: 60px; }
  .dex-regions { gap: 5px; padding: 2px; }
  .dex-progress { gap: 5px; }
  .dex-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 11px; }
  .dex-list { padding: 4px; gap: 3px; }
  .dex-cell { padding: 2px; }
  .dex-cell .portrait, .dex-cell .portrait-unknown { width: 40px; height: 40px; font-size: var(--fs-lead); }
  .dex-cell b { font-size: var(--fs-badge); }
  .dex-num { font-size: var(--fs-badge); top: 2px; left: 3px; }
  .dex-detail { padding: 5px 6px; gap: 3px; }
  .dex-head { gap: 3px; }
  .dex-sprite { width: 76px; height: 66px; padding-bottom: 2px; }
  .dex-sprite > .portrait { width: 40px; height: 40px; margin-bottom: 8px; }
  .dex-title { margin-left: 3px; gap: 1px; }
  .dex-title h3 { font-family: var(--font-body); font-weight: 800; font-size: var(--fs-label); }
  .match-row { grid-template-columns: 62px minmax(0, 1fr); gap: 4px; }
  .match-label { font-size: var(--fs-badge); }
  .matchups { gap: 3px; margin-top: 5px; }
  .route-list li { padding: 4px; font-size: var(--fs-small); --ic: 12px; }
  .game-shell .pokemon-type-badge { padding: 0 3px; font-size: var(--fs-badge); border-width: 1px; gap: 2px; }
  .game-shell .pokemon-type-badge.compact { padding: 0 3px; font-size: var(--fs-badge); }
  .chips { gap: 2px; }
  .tag { font-size: var(--fs-badge); padding: 0 4px; }
}
@media (max-height: 380px), (max-width: 700px) and (max-height: 520px) {
  .star-label small { display: none; }
  .hero-move { display: none; }
  .hero { left: 33%; right: 33%; }
  .star { width: 84px; }
  .pc-head { grid-template-columns: 60px minmax(0, 1fr) minmax(110px, .8fr); }
  .stage-caption p { display: none; }
}

/* Follows the in-game Motion setting, not the OS. */
html.motion-reduced .game-shell *, html.motion-reduced .game-shell *::before, html.motion-reduced .game-shell *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; animation-delay: 0ms !important; transition-duration: .001ms !important; }

/* Polish pass. Appended last so it overrides the rules above without touching them. */
.game-shell { font-synthesis: none; font-variant-numeric: tabular-nums; }
.game-shell .pokemon-type-badge { font: 800 var(--fs-badge)/1.2 var(--font-body); }
.btn:disabled { --t: #a7b4d4; }
.btn-play::after { background: rgba(255, 255, 255, .22); }
.btn-pull:not(:disabled)::after { background: rgba(255, 255, 255, .22); }
/* The font shorthand resets font-size-adjust, so the menu normalising above reached almost nothing: Jersey sat tiny while plain text came out oversized. */


.auth-logo em { text-shadow: 0 5px 0 var(--gold-lo), 0 0 3px #070c26, 0 0 18px rgba(7, 12, 38, .85); }
#auth-form { gap: 10px; }
.auth-field { gap: 5px; }
.auth-error:empty { min-height: 0; }
header > .muted { font: 800 var(--fs-body)/1 var(--font-body); }
.field-select { font: 800 var(--fs-body)/1.2 var(--font-body); }
.move-text small, .roster-row small, .link-row small { display: block; margin-top: 2px; }
.boost-card { align-content: start; }
.mission { grid-template-columns: minmax(0, 1fr) minmax(96px, auto) 96px; }
.mission > :nth-child(2), .mission > :nth-child(3) { justify-self: end; }
.growth-row { grid-template-columns: auto minmax(0, 1fr) 92px 74px; }
.growth-value { justify-self: end; }
.growth-row > :nth-child(4) { justify-self: end; }
.rank-bonuses { margin-bottom: 8px; }
.join-panel, .room-panel { padding: 10px 12px; background: #070c22; border: 0; box-shadow: 0 0 0 2px #27325e; }
.join-panel label, .room-panel label { color: var(--silver); font: 800 var(--fs-body)/1.2 var(--font-body); }
.join-panel input, .room-panel input { padding: 5px 10px; border: 0; background: #060a20; color: var(--moon); font: 700 var(--fs-small)/1.2 var(--font-body); box-shadow: inset 0 0 0 2px #34447c; }
.join-panel > div .btn, .room-panel > div .btn { padding: 7px 16px; background: var(--b); color: var(--t); font: 800 var(--fs-body)/1.1 var(--font-body); }
.box-name { font-size: var(--fs-badge); }

/* Animated idle models. A model fills its cell; the canvas sits on the cell's floor at a whole device-pixel scale. */
.model.portrait { position: relative; display: block; width: 56px; height: 56px; background: none; flex: none; }
.model-canvas { position: absolute; bottom: 0; z-index: 1; image-rendering: pixelated; }
.model.has-shadow::after { content: ''; position: absolute; left: 50%; bottom: -2px; width: var(--model-w, 60%); height: 7px; transform: translateX(-50%); background: radial-gradient(closest-side, rgba(2, 4, 15, .62), transparent); pointer-events: none; }
.model.is-loading::before { content: ''; position: absolute; left: 50%; bottom: 8%; width: 34%; height: 34%; transform: translateX(-50%); background: radial-gradient(circle, rgba(165, 190, 255, .35) 34%, transparent 36%); animation: model-load 1s ease-in-out infinite; }
@keyframes model-load { 50% { opacity: .35; } }
.model.is-portrait img { position: absolute; left: 50%; bottom: 0; width: 100%; height: 100%; transform: translateX(-50%); }
.box-grid .box-card .model.portrait { width: 100%; height: auto; flex: 1; min-height: 0; }
.dex-cell-inner .model.portrait { width: 100%; height: auto; flex: 1; min-height: 0; }
.pool-cell .model.portrait { width: 100%; height: 60px; filter: none; }
.pool-cell:not(.is-owned) .model-canvas { opacity: .62; }
.history-row .model.portrait, .roster-row .model.portrait, .rank-row .model.portrait { width: 52px; height: 52px; }
.rank-row { grid-template-columns: 34px 56px minmax(0, 1fr) auto; }
.mega-cell .model.portrait { width: 100%; height: 72px; }
.evo-preview .model.portrait { width: 72px; height: 72px; }
.evo-preview.is-big .model.portrait { width: 110px; height: 110px; }
.pull-result .model.portrait { width: 56px; height: 56px; }
.reveal-card .model.portrait { width: 100%; height: 96px; }
.reveal-sprite .reveal-model.portrait { width: 100%; height: 100%; }
.reveal-sprite { filter: drop-shadow(0 0 18px color-mix(in srgb, var(--r) 60%, transparent)); }
.reveal-scene { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; image-rendering: pixelated; opacity: .75; }
.badge-model.portrait { width: 100%; height: 100%; }
.partner-glyph, .pause-portrait { position: relative; }

/* Banner cards: the Pokémon stand in the scene. */
.banner-card-sprites { position: absolute; left: 6px; right: 6px; top: 26px; bottom: 34%; z-index: 1; display: flex; justify-content: center; align-items: flex-end; gap: 0; margin: 0; padding: 0; }
.banner-card-model { flex: 1 1 0; min-width: 0; height: 100%; display: flex; align-items: flex-end; }
.banner-card-model:nth-child(2) { flex-grow: 1.15; z-index: 1; }
.banner-card-sprites .model.portrait { width: 100%; height: 100%; }
.banner-card-sprites img { box-shadow: none; }
.banner-card::after { inset: 62% 0 0; background: linear-gradient(180deg, transparent, rgba(3, 5, 15, .92) 55%); }

/* Banner page */
.gacha-banner { grid-template-columns: minmax(0, 1.4fr) minmax(320px, 1fr); }
.stage::after { background: radial-gradient(ellipse 46% 40% at 50% 46%, color-mix(in srgb, var(--tint) 20%, transparent), transparent 70%); }
.stage-floor { position: relative; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); padding: 0 10px; gap: 0; align-items: end; justify-items: stretch; }
.stage-machine { height: auto; max-height: none; aspect-ratio: auto; filter: drop-shadow(0 0 26px color-mix(in srgb, var(--tint) 55%, transparent)) drop-shadow(0 10px 6px rgba(2, 4, 15, .55)); z-index: 1; }
.stage-sprite { position: relative; width: 100%; height: 58%; display: flex; align-items: flex-end; justify-content: center; gap: 0; z-index: 2; }
.stage-model { flex: 1 1 0; min-width: 0; height: 100%; display: flex; align-items: flex-end; }
.stage-model.is-back { height: 78%; margin-bottom: 26px; z-index: -1; }
.stage-model .model.portrait { width: 100%; height: 100%; }
.stage-caption { z-index: 2; margin: 0 14px; padding: 10px 16px 11px; gap: 5px; background: rgba(3, 6, 20, .78); box-shadow: 0 -2px 0 color-mix(in srgb, var(--tint) 55%, #223066), 0 2px 0 #050919, -2px 0 0 color-mix(in srgb, var(--tint) 35%, #223066), 2px 0 0 color-mix(in srgb, var(--tint) 35%, #223066); }
.stage-owned { width: min(420px, 100%); }
.pull-row { gap: 14px; padding: 12px 18px 20px; }
.btn-pull { position: relative; overflow: hidden; grid-template-columns: auto auto; grid-template-rows: auto auto; justify-content: center; align-content: center; column-gap: 12px; min-height: 66px; padding: 8px 14px; background: linear-gradient(180deg, #ffe680, var(--gold) 55%, #ffb62e); box-shadow: 0 -4px 0 #fff2b0, 0 4px 0 var(--gold-lo), -4px 0 0 #ffe680, 4px 0 0 #ffe680, 0 9px 0 #7a4b08, 0 0 24px rgba(255, 210, 63, .32); transition: transform .08s, filter .15s; }
.btn-pull.is-ten { background: linear-gradient(180deg, #ffb6d8, var(--pink) 55%, #ee4d9b); box-shadow: 0 -4px 0 #ffd6e8, 0 4px 0 #a12a69, -4px 0 0 #ffb6d8, 4px 0 0 #ffb6d8, 0 9px 0 #5c123a, 0 0 24px rgba(255, 111, 177, .32); }
.btn-pull .pull-icon { grid-row: 1 / span 2; align-self: center; --ic: 24px; display: inline-flex; }
.btn-pull b { font: 400 var(--fs-d38)/1 var(--font-display); justify-self: start; }
.btn-pull small { justify-self: start; }
.btn-pull:not(:disabled)::after { content: ''; position: absolute; top: 0; bottom: 0; left: -40%; width: 26%; background: rgba(255, 255, 255, .4); transform: skewX(-20deg); animation: play-sheen 3.4s ease-in-out infinite; }
.btn-pull:disabled { background: repeating-linear-gradient(135deg, #131a3c 0 8px, #101633 8px 16px); color: #c5d2f0; box-shadow: 0 -3px 0 #3a4778, 0 3px 0 #1a2350, -3px 0 0 #3a4778, 3px 0 0 #3a4778, 0 7px 0 #0a0f28; }
.btn-pull:disabled .pull-icon { opacity: .55; }
.btn-pull[hidden] { display: none; }
.btn-pull .ic-tone { color: #5a3600 !important; }
.btn-pull.is-ten .ic-tone { color: #5c123a !important; }
.btn-pull:disabled .ic-tone { color: #c5d2f0 !important; }
.model.is-portrait img { max-width: 72px; max-height: 72px; }

.model-note { position: absolute; inset: auto 0 30%; color: #c5d2f0; font: 800 var(--fs-small)/1.1 var(--font-body); text-align: center; }
.model.is-missing, .model.is-retry { box-shadow: inset 0 0 0 1px #34447c; }
.model.is-retry .model-note { color: var(--gold-hi); }
.stage-model-fill.model.portrait { width: 100%; height: 100%; }
.box-grid .box-card .model.portrait { flex: none; height: 80px; }
.box-shiny, .tag-shiny { color: #2a1a02; background: linear-gradient(180deg, #fff4c2, var(--gold)); }
.box-shiny { position: absolute; z-index: 2; right: 3px; top: 22px; padding: 0 3px; font: 800 var(--fs-small)/1.3 var(--font-body); }
.tag-shiny { box-shadow: 0 0 0 2px #fff4c2, 0 0 12px rgba(255, 230, 128, .7); }
.form-row.has-model { grid-template-columns: 56px minmax(0, 1fr) auto; }
.shiny-row .form-text small { display: block; color: var(--silver); font: 700 var(--fs-small)/1.25 var(--font-body); }
.reveal-copy h3.is-shiny { color: var(--gold-hi); text-shadow: 0 3px 0 var(--gold-lo), 0 0 22px rgba(255, 230, 128, .8); }
.reveal-card.is-shiny { box-shadow: 0 0 0 3px #fff4c2, 0 0 26px rgba(255, 230, 128, .85); }
.shiny-flare { position: absolute; left: 50%; top: 30%; z-index: 2; pointer-events: none; }
.shiny-flare i { position: absolute; width: 6px; height: 6px; background: #fff4c2; box-shadow: 0 0 10px #ffe680; transform: rotate(var(--a)) translateY(-120px); animation: shiny-twinkle 1.1s var(--d) ease-in-out infinite; }
@keyframes shiny-twinkle { 0%, 100% { opacity: .2; } 50% { opacity: 1; } }

/* Partner on the moon. A hard dark outline keeps pale models readable against the bright disc. */
.hero-art .sprite-canvas, .hero-art .model-canvas { filter: drop-shadow(2px 0 0 #0a1030) drop-shadow(-2px 0 0 #0a1030) drop-shadow(0 2px 0 #0a1030) drop-shadow(0 -2px 0 #0a1030); }
.hero-glow { display: none; }
.hero-stand-btn { padding-bottom: 10px; }
/* Nova logo: upright, so the letters stay crisp, with one star twinkling off the last letter. */
.home-brand em, .auth-logo em { position: relative; transform: none; animation: none; }
.home-brand em::after, .auth-logo em::after { content: ''; position: absolute; right: -.22em; top: .02em; width: .26em; height: .26em; background: var(--gold-hi); clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%); animation: nova-twinkle 2.8s ease-in-out infinite; }
@keyframes nova-twinkle { 0%, 100% { opacity: .55; transform: scale(.7); } 50% { opacity: 1; transform: scale(1.15); } }

.claim-bar { display: flex; align-items: center; gap: 14px; flex: none; min-height: 48px; flex-wrap: wrap; }
.claim-all { min-height: 44px; padding: 7px 20px; font: 800 var(--fs-label)/1.1 var(--font-body); --ic: 24px; }
.claim-all.is-empty:disabled { background: repeating-linear-gradient(135deg, #131a3c 0 8px, #101633 8px 16px); color: #c5d2f0; }
.claim-summary { display: flex; align-items: center; gap: 8px; margin: 0; padding: 5px 12px; background: rgba(3, 6, 20, .85); color: var(--gold-hi); font: 800 var(--fs-body)/1.2 var(--font-body); box-shadow: 0 0 0 2px var(--gold), 0 0 16px rgba(255, 210, 63, .4); }
.info-missions .page-scroll { flex: 1; }

/* Partner stands inside the moon: the page positions .hero-art over the disc. */
.hero-stand { width: 100%; height: 100%; }
.hero-art { inset: auto; align-items: center; }
.hero-stand-btn { padding-bottom: 0; }
.hero-art canvas { animation: hero-hover 3.4s steps(1) infinite; }
@keyframes hero-hover { 0%, 100% { transform: translateY(0); } 25%, 75% { transform: translateY(-1px); } 50% { transform: translateY(-2px); } }
.halo-wing { position: absolute; top: 50%; --ic: 48px; opacity: .8; }
.halo-wing.is-left { left: 14%; transform: translateY(-50%) scaleX(-1); }
.halo-wing.is-right { right: 14%; transform: translateY(-50%); }
.partner-glyph .model-canvas, .pause-portrait .model-canvas { bottom: 4px; }

/* The size dial. The night-sky canvas, the field and the joystick stay out of it. */
.home, .page, .mini-dialog, .top-actions { zoom: var(--ui-scale); }
@media (max-height: 700px) and (min-height: 521px) { :root { --ui-scale: 1.05; } }
@media (max-height: 520px) { :root { --ui-scale: 1.18; } }
@media (max-height: 380px), (max-width: 700px) and (max-height: 520px) { :root { --ui-scale: 1.1; } }

/* Model cards: PC, Pokédex and pool share one look. */
.model.has-shadow::after { bottom: calc(var(--model-foot, 4px) - 4px); height: 10px; background: radial-gradient(closest-side, color-mix(in srgb, var(--type, #7c92d0) 70%, #fff 10%), transparent); opacity: .75; }
.model-canvas { bottom: var(--model-foot, 4px); }
.box-grid { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); grid-auto-rows: 146px; }
.box-grid .box-card, .dex-cell-inner, .pool-cell { background: radial-gradient(ellipse 70% 46% at 50% 62%, color-mix(in srgb, var(--type, #33458a) 34%, transparent), transparent), linear-gradient(180deg, #1a2452, #0c1236); }
.box-grid .box-card { display: flex; flex-direction: column; align-items: stretch; gap: 0; padding: 4px 4px 5px; overflow: hidden; }
.box-grid .box-card .model.portrait { flex: 1; height: auto; min-height: 0; width: 100%; }
.box-top { position: relative; z-index: 2; display: flex; align-items: center; gap: 2px; flex: none; min-height: 20px; }
.box-gap { flex: 1; }
.box-top .box-level, .box-top .box-rank, .box-top .box-flag { position: static; }
.box-top .box-flag { display: inline-flex; bottom: auto; right: auto; left: auto; top: auto; --ic: 12px; }
.box-top .box-shiny { padding: 0 3px; font: 800 var(--fs-badge)/1.3 var(--font-body); }
.box-grid .box-card .box-name { flex: none; text-align: center; font: 800 var(--fs-small)/1.15 var(--font-body); }
.mon-types { display: flex; justify-content: center; gap: 3px; flex: none; height: 6px; margin-top: 2px; }
.mon-type { width: 22px; height: 5px; background: var(--t); box-shadow: 0 0 0 1px #050919; }
.box-grid .box-card.selected { background: radial-gradient(ellipse 70% 46% at 50% 62%, color-mix(in srgb, var(--type, #33458a) 48%, transparent), transparent), linear-gradient(180deg, #33427f, #151d4c); }

/* Pokédex */
.dex-ring { display: grid; place-items: center; width: 52px; height: 52px; flex: none; border-radius: 50%; background: conic-gradient(var(--gold) calc(var(--p) * 1%), #1c2650 0); box-shadow: inset 0 0 0 2px #050919; }
.dex-ring b { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: #0a1030; color: var(--moon); font: 800 var(--fs-small)/1 var(--font-body); }
.pc-tools.is-dex { flex-wrap: wrap; gap: 6px 8px; align-items: center; }
.pc-tools.is-dex .search-box { flex: 1 1 200px; }
.mode-toggle { display: flex; gap: 3px; }
.dex-filter-toggle { display: none; }
.dex-filters { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; width: 100%; }
.dex-shown { margin-left: auto; color: var(--silver); font: 700 var(--fs-small)/1 var(--font-body); }
.field-select { font: 800 var(--fs-small)/1.2 var(--font-body); }
.dex-cell-inner { align-items: stretch; justify-content: flex-start; padding: 4px 4px 5px; }
.dex-cell .dex-num { position: static; }
.dex-cell .model.portrait, .dex-cell-inner .model.portrait { width: 100%; height: auto; flex: 1; min-height: 0; }
.dex-cell b { flex: none; align-self: center; font: 800 var(--fs-small)/1.15 var(--font-body); }
.dex-rarity { flex: none; align-self: center; width: 22px; height: 4px; margin-top: 3px; background: var(--r); box-shadow: 0 0 0 1px #050919; }
.dex-cell.is-unseen .dex-cell-inner { background: linear-gradient(180deg, #111838, #090e28); }
.model.is-silhouette.has-shadow::after { background: radial-gradient(closest-side, rgba(90, 110, 170, .4), transparent); }
.model.is-silhouette.is-portrait img { filter: brightness(0); }
.dex-detail { display: grid; grid-template-columns: minmax(200px, 38%) minmax(0, 1fr); gap: 12px; }
.dex-close { display: none; }
.dex-id { display: flex; flex-direction: column; align-items: center; gap: 5px; min-height: 0; overflow-y: auto; text-align: center; scrollbar-width: thin; }
.dex-stage { display: flex; align-items: center; justify-content: center; gap: 5px; width: 100%; flex: none; }
.dex-stage .dex-sprite { flex: 1; min-width: 0; height: 190px; width: auto; background: radial-gradient(ellipse 70% 40% at 50% 74%, color-mix(in srgb, var(--type) 45%, transparent), transparent), linear-gradient(180deg, #0a1030, #141d4c); box-shadow: 0 0 0 2px color-mix(in srgb, var(--type) 60%, #223066); }
.dex-big.model.portrait { width: 100%; height: 100%; }
.dex-name { display: flex; align-items: center; justify-content: center; gap: 6px; }
.dex-name h3 { margin: 0; font: 400 var(--fs-d28)/1.05 var(--font-display); }
.dex-heart { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; background: none; cursor: pointer; opacity: .45; --ic: 24px; }
.dex-heart.is-on { opacity: 1; filter: drop-shadow(0 0 6px #ff7a8f); }
.dex-id .chips { justify-content: center; }
.dex-when { margin: 0; color: var(--silver); font: 700 var(--fs-small)/1.2 var(--font-body); }
.dex-actions { display: grid; gap: 7px; width: 100%; }
.dex-actions .btn { width: calc(100% - 6px); }
.dex-panel { display: flex; flex-direction: column; gap: 7px; min-width: 0; min-height: 0; }
.dex-better { margin: 8px 0 0; padding: 6px 9px; background: #070c22; box-shadow: 0 0 0 2px #27325e; color: var(--silver); font: 700 var(--fs-small)/1.3 var(--font-body); }
.dex-better b { color: var(--gold-hi); font: 400 var(--fs-d20)/1 var(--font-display); }
.match-row { grid-template-columns: 112px minmax(0, 1fr); }
.match-label { font: 800 var(--fs-small)/1.3 var(--font-body); }
.is-hard .match-label { color: var(--gold-hi); }
.match-chip { display: inline-flex; align-items: center; gap: 3px; }
.match-chip small { color: var(--silver); font: 800 var(--fs-badge)/1 var(--font-body); }

.box-model-slot { display: flex; flex: 1; min-height: 0; width: 100%; }
.box-model-slot .model.portrait { width: 100%; height: 100%; }
.dex-sprite .sprite-canvas { position: relative; }
/* Phones: visible controls grow where there is room, and an invisible hit area carries them to about 40px. */
@media (max-height: 520px) {
  button:focus-visible, .chip:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline-width: 2px; outline-offset: 1px; }
  :where(.btn, .chip, .seg-tab, .btn-back, .round-btn, .icon-btn, .settings-tab) { position: relative; }
  .btn::after, .chip::after, .seg-tab::after, .btn-back::after, .round-btn::after, .icon-btn::after, .settings-tab::after, .switch::after, .pc-choose::after { content: ''; position: absolute; inset: -4px 0; }
  .btn { min-height: 34px; }
  .btn-mini { min-height: 30px; }
  .btn-mini::after { inset: -5px 0; }
  .chip { min-height: 28px; }
  .chip::after { inset: -6px 0; }
  .chip-stack { min-height: 30px; }
  .chip-stack::after { inset: -4px 0; }
  .seg-tab { min-height: 34px; }
  .btn-back { height: 36px; }
  .round-btn { width: 36px; height: 36px; }
  .round-btn::after { inset: -2px; }
  .icon-btn { width: 36px; height: 36px; }
  .icon-btn::after { inset: -2px; }
  .field-input, .field-select, .search-box { min-height: 34px; }
  .field-select { font-size: var(--fs-small); }
  .search-box input { height: 32px; }
  .settings-tab { min-height: 38px; }
  .settings-tab::after { inset: -1px 0; }
  .switch { width: 58px; height: 30px; }
  .switch i { top: 4px; left: 4px; width: 22px; height: 22px; }
  .switch.is-on i { transform: translateX(28px); }
  .switch::after { inset: -5px -3px; }
  .settings-body a, .page-scroll a { display: inline-block; padding: 12px 4px; margin: -12px -4px; }
  .pc-choose { min-height: 34px; }
  .pc-tools { gap: 6px 5px; }
  .pc-tools .chip-row { gap: 4px; }
  .auth-card { padding: 9px 12px 11px; gap: 6px; }
  #auth-form { gap: 5px; }
  .auth-field { font-size: var(--fs-small); gap: 1px; }
  .auth-eye { width: 40px; height: 34px; margin-top: -17px; }
  .auth-submit { min-height: 38px; font-size: var(--fs-label); }
  .auth-guest { min-height: 38px; }
  .auth-or { font-size: var(--fs-small); }
  .auth-guest b { font-size: var(--fs-body); }
  .auth-guest small { font-size: var(--fs-small); }
  .model.portrait { width: 40px; height: 40px; }
  .pool-cell .model.portrait { height: 44px; }
  .history-row .model.portrait, .roster-row .model.portrait, .rank-row .model.portrait { width: 36px; height: 36px; }
  .rank-row { grid-template-columns: 22px 40px minmax(0, 1fr) auto; }
  .mega-cell .model.portrait { height: 44px; }
  .reveal-card .model.portrait { height: 48px; }
  .evo-preview .model.portrait { width: 44px; height: 44px; }
  .pull-result .model.portrait { width: 40px; height: 40px; }
  .banner-card-sprites { top: 14px; bottom: 30%; }
  .gacha-banner { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
  .stage-sprite { height: 72%; }
  .stage-model.is-back { margin-bottom: 10px; }
  .stage-caption { margin: 0 7px; padding: 3px 8px 4px; gap: 2px; }
  .pull-row { gap: 9px; padding: 8px 10px 11px; }
  .btn-pull { min-height: 38px; padding: 2px 8px; column-gap: 7px; box-shadow: 0 -2px 0 #fff2b0, 0 2px 0 var(--gold-lo), -2px 0 0 #ffe680, 2px 0 0 #ffe680, 0 5px 0 #7a4b08; }
  .btn-pull.is-ten { box-shadow: 0 -2px 0 #ffd6e8, 0 2px 0 #a12a69, -2px 0 0 #ffb6d8, 2px 0 0 #ffb6d8, 0 5px 0 #5c123a; }
  .btn-pull:disabled { box-shadow: 0 -2px 0 #3a4778, 0 2px 0 #1a2350, -2px 0 0 #3a4778, 2px 0 0 #3a4778, 0 5px 0 #0a0f28; }
  .btn-pull .pull-icon { --ic: 12px; }
  .btn-pull b { font-size: var(--fs-d24); }
  .box-grid { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); grid-auto-rows: 92px; }
  .box-top { min-height: 15px; }
  .mon-types { height: 4px; margin-top: 1px; }
  .mon-type { width: 16px; height: 3px; }
  .box-shiny { top: 16px; }
  .form-row.has-model { grid-template-columns: 40px minmax(0, 1fr) auto; }
  .banner-card-sprites { bottom: 40%; }
  .banner-card::after { inset: 52% 0 0; }
  .shiny-flare i { transform: rotate(var(--a)) translateY(-64px); }
  .box-name { font-size: var(--fs-badge); }
  .gacha-result { max-height: none; overflow: visible; }
  .stage-caption p, .stage-owned, .btn-pull small, .mini-stat small, .input-hint, .odds-row small, .milestone small, .history-name small, .reveal-card small, .reveal-card em, .banner-card-text small, .move-text small, .level-line small, .wallet-line small, .stat-row > span:first-child, .stat-total, .btn-play small, .auth-device { font-size: var(--fs-small); }
}
