/* ==========================================================================
   ポケモン図鑑 — styles
   Tokens → base → layout → components. Day / night themes via [data-theme].
   ========================================================================== */

:root {
    --cream: #f4efdf;
    --paper: #fbf8ec;
    --ink: #242424;
    --brand: #b62930;          /* constant red used for fills */
    --red: var(--brand);       /* accent used for text on the page background */
    --red-bright: color-mix(in srgb, var(--brand) 80%, #ff4000);
    --blue: #3b9bf0;
    --yellow: #ffdb63;
    --nav: #1d2030;
    --on-brand: #f4efdf;
    --font-body: "DotGothic16", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    --font-pixel: "Press Start 2P", "DotGothic16", ui-monospace, monospace;
    color-scheme: light;
}

[data-theme="night"] {
    --cream: #12141d;
    --paper: #1b1f2d;
    --ink: #f1ead4;
    --red: color-mix(in srgb, var(--brand) 50%, #fff);
    --nav: #0a0c12;
    color-scheme: dark;
}

* { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--nav-h, 64px) + var(--sub-h, 0px) + 12px);
}

body {
    margin: 0;
    background-color: var(--cream);
    background-image: radial-gradient(color-mix(in srgb, var(--ink) 9%, transparent) 1px, transparent 1px);
    background-size: 18px 18px;
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.45;
    transition: background-color .3s, color .3s;
}

h1, h2, h3, p { margin: 0; }
h2 { color: var(--red); }

small {
    display: block;
    letter-spacing: 2px;
    margin-top: 5px;
}

img { max-width: 100%; }

.skip {
    position: absolute; left: 8px; top: -60px; z-index: 200;
    background: var(--yellow); color: #242424; padding: 10px 14px; text-decoration: none;
}
.skip:focus { top: 8px; }

/* ---------- buttons ---------- */
.button, button {
    background: var(--brand);
    color: #fff;
    border: 0;
    padding: 13px 18px;
    font: inherit;
    cursor: pointer;
    text-decoration: none;
}

.button {
    display: inline-block;
    margin-top: 24px;
    font-family: var(--font-pixel);
    font-size: 12px;
    border: 3px solid var(--ink);
    box-shadow: 4px 4px 0 var(--ink);
    transition: transform .12s, box-shadow .12s;
}
.button:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
.button:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
    outline: 3px solid #e0a800;
    outline-offset: 3px;
}

/* ---------- header: the Pokédex lens ---------- */
.top {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 18px 5%;
    background: linear-gradient(180deg, color-mix(in srgb, var(--brand) 82%, #fff), var(--brand) 55%, color-mix(in srgb, var(--brand) 72%, #000));
    color: var(--on-brand);
    border-bottom: 4px solid #1a1a1a;
}

.lens { display: flex; align-items: flex-start; gap: 12px; flex: none; }

.lens-big {
    width: 68px; height: 68px; border-radius: 50%;
    border: 4px solid #f4efdf;
    background: radial-gradient(circle at 30% 28%, #e8f8ff 0 7%, #5fc0ff 17%, #1769c4 60%, #0a3470);
    box-shadow: 0 0 0 4px #1a1a1a, 0 0 22px 2px #4aa8ff, inset -6px -8px 14px #0a2a5a;
    animation: lens 3.2s ease-in-out infinite;
}

.leds { display: flex; gap: 8px; margin-top: 2px; }
.led {
    width: 14px; height: 14px; border-radius: 50%; border: 2px solid #1a1a1a;
    animation: blink 2.4s steps(1) infinite;
}
.led.r { background: #ff5b5b; }
.led.y { background: #ffd43b; animation-delay: .8s; }
.led.g { background: #55dd8d; animation-delay: 1.6s; }

.brand { flex: 1; min-width: 0; }
.brand h1 { color: #fff; font-size: clamp(24px, 4vw, 38px); text-shadow: 3px 3px 0 #0005; }
.brand small { opacity: .9; font-size: 12px; }

.top-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.vol { font-family: var(--font-pixel); font-size: 10px; }

.ghost {
    background: #0003;
    border: 2px solid var(--on-brand);
    color: var(--on-brand);
    padding: 9px 12px;
    font-family: var(--font-pixel);
    font-size: 10px;
}
.ghost:hover { background: #0006; }

/* ---------- nav ---------- */
nav {
    position: sticky; top: 0; z-index: 50;
    display: flex; align-items: center; justify-content: space-around; gap: 16px;
    background: var(--nav);
    color: var(--on-brand);
    padding: 12px 5%;
    border-bottom: 3px solid var(--brand);
}
nav a {
    color: inherit; text-decoration: none; text-align: center; font-weight: bold;
    padding: 6px 12px; border: 2px solid transparent; transition: .15s;
}
nav a small { font-size: 10px; margin-top: 2px; opacity: .8; }
nav a:hover { color: var(--yellow); }
nav a.active { background: var(--brand); border-color: var(--yellow); box-shadow: 3px 3px 0 #000; }

/* ---------- layout ---------- */
main { margin: 40px auto; width: 90%; max-width: 1500px; }
section { margin-bottom: 70px; }

.heading {
    display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
    border-bottom: 4px double var(--ink);
    padding-bottom: 14px; margin-bottom: 22px;
}
.heading h2 { font-size: clamp(20px, 2.6vw, 30px); }
.heading b { font-family: var(--font-pixel); font-size: 11px; }

/* ---------- hero ---------- */
.hero {
    position: relative; overflow: hidden;
    display: flex; align-items: center; justify-content: space-between; gap: 20px;
    border: 3px solid var(--ink);
    box-shadow: 8px 8px 0 var(--ink);
    background: linear-gradient(135deg, var(--paper), color-mix(in srgb, var(--yellow) 22%, var(--paper)));
    padding: clamp(20px, 4vw, 60px);
}
.hero-copy { position: relative; z-index: 2; }
.hero h2 { color: var(--ink); font-size: clamp(22px, 3vw, 40px); margin-top: 20px; }
.hero h3 {
    font-family: var(--font-pixel);
    font-size: clamp(22px, 3.8vw, 52px);
    line-height: 1.25; margin: 22px 0 18px;
    color: var(--red); text-shadow: 3px 3px 0 color-mix(in srgb, var(--ink) 25%, transparent);
}
.hero-stats { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; margin: 26px 0 0; padding: 0; }
.hero-stats li { border: 2px solid var(--ink); background: var(--paper); padding: 6px 10px; font-size: 13px; letter-spacing: 1px; }
.hero-stats b { font-family: var(--font-pixel); color: var(--red); margin-right: 4px; }

.hero-art { position: relative; width: min(42%, 460px); flex: none; z-index: 1; }
.hero-art img { position: relative; width: 100%; height: auto; filter: drop-shadow(0 14px 10px #0004); animation: float 4s ease-in-out infinite; }
.halo {
    position: absolute; inset: 4%; border-radius: 50%;
    background:
        repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--yellow) 55%, transparent) 0 8deg, transparent 8deg 20deg);
    -webkit-mask: radial-gradient(circle, #000 35%, transparent 70%);
    mask: radial-gradient(circle, #000 35%, transparent 70%);
    animation: spin 30s linear infinite;
}

/* ---------- filters ---------- */
.filters { display: flex; align-items: center; gap: 12px; margin-bottom: 15px; flex-wrap: wrap; }
input, select {
    background: var(--paper);
    border: 3px solid var(--ink);
    padding: 12px;
    font: inherit;
    color: inherit;
}
input { flex: 1; min-width: 200px; }
#status { font-family: var(--font-pixel); font-size: 10px; letter-spacing: 1px; margin: 14px 0 6px; }

/* ---------- grid & cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 20px; margin-top: 20px; }

.card {
    --lift: 0px;
    position: relative;
    background: var(--paper);
    border: 3px solid var(--ink);
    padding: 12px;
    transform: perspective(800px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(var(--lift));
    transition: transform .15s ease-out, box-shadow .15s;
    content-visibility: auto;
    contain-intrinsic-size: 330px;
}
.card:hover { --lift: -4px; box-shadow: 6px 6px 0 var(--ink); }

.no { font-family: var(--font-pixel); font-size: 10px; margin-bottom: 10px; opacity: .85; }

.open {
    display: block; width: 100%; padding: 0;
    background: none; color: inherit; text-align: left;
}

.art-wrap {
    position: relative; display: block; aspect-ratio: 1;
    border: 2px solid var(--ink);
    background: radial-gradient(circle at 50% 38%, color-mix(in srgb, var(--tc) 40%, var(--paper)), color-mix(in srgb, var(--tc) 14%, var(--paper)) 78%);
    overflow: hidden;
}
.art {
    display: block; width: 100%; height: 100%; object-fit: contain; padding: 10px;
    filter: drop-shadow(0 6px 5px #0003);
    transition: transform .3s;
}
.card:hover .art { transform: scale(1.09) translateY(-3px); }

.jp { display: block; font-size: 22px; font-weight: bold; margin: 12px 0 4px; }
.en { display: block; font-family: var(--font-pixel); font-size: 10px; letter-spacing: .5px; }
.tags { display: block; margin-top: 10px; }

.tag {
    display: inline-block;
    background: var(--c, #888); color: #fff;
    border: 2px solid var(--ink);
    padding: 5px 6px; margin: 0 4px 4px 0;
    font-family: var(--font-pixel); font-size: 8px;
    text-shadow: 1px 1px 0 #0006;
}
.t-normal { --c: #a8a77a; } .t-fire { --c: #ee8130; } .t-water { --c: #6390f0; } .t-electric { --c: #f7d02c; }
.t-grass { --c: #7ac74c; } .t-ice { --c: #96d9d6; } .t-fighting { --c: #c22e28; } .t-poison { --c: #a33ea1; }
.t-ground { --c: #e2bf65; } .t-flying { --c: #a98ff3; } .t-psychic { --c: #f95587; } .t-bug { --c: #a6b91a; }
.t-rock { --c: #b6a136; } .t-ghost { --c: #735797; } .t-dragon { --c: #6f35fc; } .t-steel { --c: #b7b7ce; }
.t-fairy { --c: #d685ad; }
.t-electric, .t-ice, .t-ground, .t-steel, .t-bug, .t-fairy { color: #1a1a1a; text-shadow: none; }

/* favourite button drawn as a tiny Poké Ball */
.ball {
    position: absolute; right: 12px; top: 8px; z-index: 2;
    width: 32px; height: 32px; padding: 0; border-radius: 50%;
    border: 2px solid var(--ink);
    background: linear-gradient(to bottom, #bdbdbd 0 45%, var(--ink) 45% 55%, #fff 55%);
    font-size: 0;
    transition: transform .2s;
}
.ball::after {
    content: ''; position: absolute; left: 50%; top: 50%;
    width: 11px; height: 11px; border-radius: 50%;
    background: #fff; border: 2px solid var(--ink);
    transform: translate(-50%, -50%);
}
.ball:hover { transform: rotate(25deg) scale(1.12); }
.ball.active { background: linear-gradient(to bottom, var(--red-bright) 0 45%, var(--ink) 45% 55%, #fff 55%); }
.ball.active::after { background: var(--yellow); box-shadow: 0 0 8px var(--yellow); }

.empty { grid-column: 1 / -1; padding: 30px 0; opacity: .75; }

/* ---------- footer ---------- */
footer {
    background: var(--brand); color: var(--on-brand);
    padding: 24px 5%; text-align: center;
    border-top: 4px solid #1a1a1a;
}
.developer-credit { margin-top: 14px; font-size: 12px; letter-spacing: 2px; }
.developer-credit a { color: var(--on-brand); text-decoration: none; font-weight: bold; }
.developer-credit a:hover { color: #ffd85c; }

/* ---------- toast ---------- */
#toast {
    position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px);
    background: var(--ink); color: var(--cream);
    padding: 12px 18px; z-index: 300;
    font-family: var(--font-pixel); font-size: 10px; line-height: 1.6;
    border: 3px solid var(--yellow);
    opacity: 0; pointer-events: none; transition: .25s;
    max-width: 90vw; text-align: center;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- keyframes ---------- */
@keyframes float { 50% { transform: translateY(-14px) rotate(1.5deg); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes lens { 50% { box-shadow: 0 0 0 4px #1a1a1a, 0 0 34px 6px #6cc0ff, inset -6px -8px 14px #0a2a5a; } }
@keyframes blink { 0%, 55% { opacity: 1; } 56%, 100% { opacity: .35; } }

/* ---------- responsive ---------- */
@media (max-width: 650px) {
    .top { flex-wrap: wrap; gap: 14px; }
    .top-actions { width: 100%; justify-content: space-between; }
    nav { flex-wrap: wrap; gap: 6px; padding: 8px 3%; }
    nav a { padding: 4px 8px; }
    .hero { flex-direction: column; align-items: flex-start; }
    .hero-art { width: 80%; align-self: center; }
    .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .card { padding: 8px; }
    .jp { font-size: 16px; }
    .heading h2 { font-size: 18px; }
    .stat { grid-template-columns: 90px 1fr 35px; }
}

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

/* ---------- boot splash ---------- */
.no-boot #boot { display: none; }
#boot { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; overflow: hidden; cursor: pointer; }
.boot-half { position: absolute; left: 0; right: 0; height: 50%; transition: transform .85s cubic-bezier(.75, 0, .2, 1); }
.boot-half.top { top: 0; background: linear-gradient(#d2323a, #a8232a); border-bottom: 10px solid #1a1a1a; }
.boot-half.bottom { bottom: 0; background: #f4f4f4; border-top: 10px solid #1a1a1a; }
#boot.open .top { transform: translateY(-101%); }
#boot.open .bottom { transform: translateY(101%); }
.boot-ball {
    position: relative; z-index: 2; width: 120px; height: 120px; border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #fff, #e8e8e8);
    border: 10px solid #1a1a1a;
    box-shadow: 0 0 0 6px #f4f4f4, 0 0 40px 6px #fff8;
    animation: wobble 1s ease-in-out infinite;
    transition: transform .6s, opacity .6s;
}
.boot-ball::after {
    content: ''; position: absolute; left: 50%; top: 50%; width: 34px; height: 34px;
    border-radius: 50%; background: #fff; border: 8px solid #1a1a1a;
    transform: translate(-50%, -50%); animation: pulse 1s steps(2) infinite;
}
#boot.open .boot-ball { transform: scale(7); opacity: 0; animation: none; }
.boot-text {
    position: absolute; bottom: 12%; z-index: 2; text-align: center;
    font-family: var(--font-pixel); font-size: 14px; color: #242424; line-height: 1.8;
}
.boot-text small { font-size: 9px; animation: blink 1s steps(1) infinite; }
#boot.open .boot-text { opacity: 0; transition: opacity .2s; }
@keyframes wobble {
    0%, 100% { transform: rotate(0); }
    20% { transform: rotate(-22deg) translateX(-6px); }
    40% { transform: rotate(18deg) translateX(6px); }
    60% { transform: rotate(-12deg); }
    80% { transform: rotate(8deg); }
}
@keyframes pulse { 50% { background: #ff6b6b; } }

/* ---------- sort, random & type chips ---------- */
.btn-sm {
    font-family: var(--font-pixel); font-size: 10px;
    border: 3px solid var(--ink); box-shadow: 3px 3px 0 var(--ink);
    transition: transform .12s, box-shadow .12s;
}
.btn-sm:hover { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--ink); }
.btn-sm:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 4px; }
.chip {
    background: var(--c, var(--paper)); color: #fff; text-shadow: 1px 1px 0 #0006;
    border: 2px solid var(--ink); padding: 8px 9px;
    font-family: var(--font-pixel); font-size: 9px;
    opacity: .72; box-shadow: 2px 2px 0 var(--ink);
    transition: opacity .12s, transform .12s, box-shadow .12s;
}
.chip[data-type=""] { --c: var(--paper); color: var(--ink); text-shadow: none; }
.chip.t-electric, .chip.t-ice, .chip.t-ground, .chip.t-steel, .chip.t-bug, .chip.t-fairy { color: #1a1a1a; text-shadow: none; }
.chip:hover { opacity: 1; transform: translateY(-2px); }
.chip.on { opacity: 1; transform: translate(2px, 2px); box-shadow: none; outline: 3px solid var(--yellow); outline-offset: 1px; }

/* ---------- holographic cards ---------- */
.card::before {
    content: ''; position: absolute; inset: -3px; z-index: 3; pointer-events: none;
    opacity: 0; transition: opacity .25s; mix-blend-mode: color-dodge;
    background:
        radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, .6), transparent 42%),
        conic-gradient(from var(--ang, 0deg) at var(--mx, 50%) var(--my, 50%), #ff7ad9, #7ad7ff, #7affb1, #fff27a, #ff7ad9);
    background-blend-mode: soft-light;
}
.card.tilting { transition: transform .06s linear, box-shadow .15s; --lift: -4px; box-shadow: 6px 6px 0 var(--ink), 0 0 26px color-mix(in srgb, var(--tc) 60%, transparent); }
.card.tilting::before { opacity: .32; }

.card[data-rarity="legendary"] { border-color: #c9a227; animation: glint 2.8s ease-in-out infinite; }
.card[data-rarity="legendary"] .no::after { content: " ✦ LEGENDARY"; color: #c9a227; }
@keyframes glint { 50% { box-shadow: 0 0 0 2px #ffe27a, 0 0 20px 2px #ffd34e; } }

/* ---------- profile dialog ---------- */
html { scrollbar-gutter: stable; }
html.locked { overflow: hidden; }

dialog {
    background: var(--cream); color: var(--ink);
    border: 4px solid var(--ink);
    width: min(640px, 94vw); max-height: 92vh;
    padding: 0; overflow-y: auto;
    box-shadow: 10px 10px 0 var(--ink);
}
dialog[open] { animation: pop .28s cubic-bezier(.2, 1.4, .4, 1); }
dialog::backdrop { background: #000a; backdrop-filter: blur(3px); }
@keyframes pop { from { transform: scale(.88); opacity: 0; } }

#close, #compare-close {
    position: sticky; top: 10px; display: block; margin: 10px 10px -48px auto; z-index: 5;
    width: 38px; height: 38px; padding: 0; font-size: 24px; line-height: 1;
    background: var(--paper); color: var(--ink); border: 3px solid var(--ink);
}
#close:hover, #compare-close:hover { background: var(--yellow); color: #242424; }

.pf { position: relative; padding: 0 clamp(16px, 4vw, 28px) 28px; }
.pf::before {
    content: ''; position: absolute; left: 0; right: 0; top: -0px; height: 190px; z-index: 0;
    background:
        repeating-linear-gradient(135deg, #fff2 0 12px, transparent 12px 24px),
        linear-gradient(120deg, var(--tc), var(--tc2));
    border-bottom: 4px solid var(--ink);
}
.pf > * { position: relative; z-index: 1; }

.pf-top { display: flex; align-items: center; gap: 12px; padding-top: 14px; }
.pf-no { font-family: var(--font-pixel); font-size: 11px; color: #fff; text-shadow: 2px 2px 0 #0007; }
.pf-nav { width: 38px; height: 38px; padding: 0; background: var(--paper); color: var(--ink); border: 3px solid var(--ink); box-shadow: 2px 2px 0 var(--ink); }
.pf-nav:hover { background: var(--yellow); color: #242424; }

.pf-stage {
    width: min(260px, 70%); aspect-ratio: 1; margin: 6px auto 0; border-radius: 50%;
    background: radial-gradient(circle at 50% 40%, #fff, color-mix(in srgb, var(--tc) 45%, var(--paper)) 70%);
    border: 4px solid var(--ink); box-shadow: 0 0 0 6px var(--paper), 0 0 30px color-mix(in srgb, var(--tc) 70%, transparent);
    display: grid; place-items: center; position: relative; overflow: hidden;
}
.pf-stage img { width: 88%; height: 88%; object-fit: contain; filter: drop-shadow(0 8px 6px #0004); animation: float 4s ease-in-out infinite; }
.pf-stage.shiny::after {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(115deg, transparent 35%, #fff9 50%, transparent 65%);
    background-size: 250% 100%; animation: shine 2.2s linear infinite;
}
@keyframes shine { from { background-position: 150% 0; } to { background-position: -50% 0; } }

.pf-name { font-size: clamp(20px, 4vw, 28px); margin: 22px 0 4px; text-align: center; color: var(--ink); }
.pf-name span { color: var(--red); }
.pf-genus { text-align: center; opacity: .8; letter-spacing: 1px; min-height: 1.4em; }
.pf .tags { text-align: center; margin-top: 8px; }

.pf-actions { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; margin: 14px 0 6px; }
.pf-actions button:not(.ball) { font-family: var(--font-pixel); font-size: 10px; border: 3px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); }
.pf-actions button.on { background: var(--yellow); color: #242424; }
.pf-actions .ball { position: relative; right: auto; top: auto; width: 40px; height: 40px; }
.pf-actions .ball::after { width: 14px; height: 14px; }

.pf-flavor {
    margin: 14px 0; padding: 14px 16px; line-height: 1.6;
    background: var(--paper); border: 3px solid var(--ink); border-left: 10px solid var(--tc);
}
.pf-facts { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 6px; }
.pf-facts b { display: inline-block; min-width: 100px; font-family: var(--font-pixel); font-size: 9px; }
.ability { text-transform: capitalize; }
.pf-h { font-family: var(--font-pixel); font-size: 11px; color: var(--red); margin: 22px 0 10px; padding-bottom: 8px; border-bottom: 2px dashed var(--ink); }
.pf-wait { opacity: .7; }

.stat { display: grid; grid-template-columns: 70px 1fr 40px; gap: 10px; align-items: center; margin: 8px 0; }
.stat > span:first-child { font-family: var(--font-pixel); font-size: 9px; }
.stat > span:last-child { text-align: right; font-weight: bold; }
.bar { height: 14px; background: color-mix(in srgb, var(--ink) 12%, transparent); border: 2px solid var(--ink); overflow: hidden; }
.bar i { display: block; height: 100%; width: var(--w); background: hsl(var(--h) 72% 46%); animation: grow .8s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes grow { from { width: 0; } }
.stat.total { grid-template-columns: 70px 1fr; padding-top: 8px; border-top: 2px dashed var(--ink); }
.stat.total b { text-align: right; font-family: var(--font-pixel); font-size: 13px; color: var(--red); }

.evo, .evo-kids { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.evo-node { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.evo-kids { flex-direction: column; align-items: flex-start; }
.evo-arrow { font-family: var(--font-pixel); font-size: 18px; color: var(--red); }
.evo-btn {
    display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 8px;
    background: var(--paper); color: var(--ink); border: 2px solid var(--ink); font-size: 12px;
    transition: transform .12s;
}
.evo-btn:hover { transform: translateY(-3px); background: var(--yellow); color: #242424; }
.evo-btn.here { border-color: var(--red); box-shadow: 0 0 0 3px var(--yellow); }
.evo-btn img { width: 64px; height: 64px; object-fit: contain; }

@media (max-width: 650px) {
    .stat { grid-template-columns: 60px 1fr 36px; }
    .pf-facts b { min-width: 86px; }
}

/* ---------- Who's that Pokémon? ---------- */
.quiz { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.quiz-screen {
    position: relative; aspect-ratio: 1; max-width: 520px; width: 100%; margin: 0 auto;
    border: 4px solid var(--ink); box-shadow: 8px 8px 0 var(--ink); overflow: hidden;
    background: repeating-conic-gradient(from 0deg at 50% 52%, #2a6fd8 0 9deg, #3b88f0 9deg 18deg);
    display: grid; place-items: center;
}
.quiz-screen img {
    width: 78%; height: 78%; object-fit: contain; margin-top: -6%;
    filter: brightness(0); transition: filter .7s;
    animation: float 4s ease-in-out infinite;
}
.quiz-screen img.revealed { filter: none; }
.quiz-screen p {
    position: absolute; left: 0; right: 0; bottom: 0; padding: 12px 10px; text-align: center;
    font-family: var(--font-pixel); font-size: clamp(9px, 1.6vw, 12px); line-height: 1.6;
    background: #1a1a1a; color: #ffdb63; border-top: 4px solid #ffdb63;
}
.quiz-screen p.good { color: #7dff9a; border-color: #7dff9a; }
.quiz-screen p.bad { color: #ff8a8a; border-color: #ff8a8a; }

.quiz-options { display: grid; gap: 12px; }
.quiz-opt {
    display: flex; align-items: center; gap: 12px; text-align: left; width: 100%;
    background: var(--paper); color: var(--ink);
    border: 3px solid var(--ink); box-shadow: 4px 4px 0 var(--ink);
    font-family: var(--font-pixel); font-size: 11px; padding: 16px 14px;
    transition: transform .12s, box-shadow .12s, background .12s;
}
.quiz-opt:not(:disabled):hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); background: var(--yellow); color: #242424; }
.quiz-opt kbd { font-family: var(--font-pixel); background: var(--ink); color: var(--cream); padding: 4px 6px; font-size: 9px; }
.quiz-opt:disabled { cursor: default; }
.quiz-opt.right { background: #3fb95f; color: #fff; }
.quiz-opt.wrong { background: #e5484d; color: #fff; animation: shake .4s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.quiz-actions { display: flex; gap: 12px; margin-top: 18px; flex-wrap: wrap; }
.quiz-actions button { font-family: var(--font-pixel); font-size: 10px; border: 3px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); }
.quiz-actions button:disabled { opacity: .45; cursor: not-allowed; }
.quiz-actions #quiz-next { background: var(--blue); }
.quiz-keys { margin-top: 16px; font-size: 13px; opacity: .75; }
@media (max-width: 800px) { .quiz { grid-template-columns: 1fr; } }

/* ---------- delight layer ---------- */
.pika-btn {
    display: block; width: 100%; padding: 0; background: none; border: 0; cursor: pointer;
    transform: translate(var(--px, 0), var(--py, 0)); transition: transform .25s ease-out;
    -webkit-tap-highlight-color: transparent;
}
.pika-btn:active img { animation: none; transform: scale(.94); }
.halo { translate: calc(var(--px, 0px) * -.6) calc(var(--py, 0px) * -.6); transition: translate .25s ease-out; }
.hero-tip { display: block; text-align: center; margin-top: 8px; font-family: var(--font-pixel); font-size: 9px; letter-spacing: 1px; opacity: .7; animation: blink 1.6s steps(1) infinite; }

.hero.zap { animation: zapShake .45s linear; }
@keyframes zapShake { 20% { transform: translate(-5px, 2px); } 40% { transform: translate(5px, -3px); } 60% { transform: translate(-3px, 3px); } 80% { transform: translate(3px, -2px); } }
.flash { position: fixed; inset: 0; z-index: 400; background: #fff9c4; pointer-events: none; animation: flash .5s ease-out forwards; mix-blend-mode: screen; }
@keyframes flash { 0% { opacity: .95; } 100% { opacity: 0; } }
.bolt {
    position: absolute; left: 50%; top: 45%; width: 34px; height: 80px; z-index: 3; pointer-events: none;
    background: #ffe033; filter: drop-shadow(0 0 6px #fff);
    clip-path: polygon(60% 0, 15% 55%, 45% 55%, 30% 100%, 90% 38%, 55% 38%);
    animation: bolt .65s ease-out forwards;
}
@keyframes bolt {
    0% { opacity: 1; transform: translate(-50%, -50%) scale(.4) rotate(var(--r)); }
    100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1.5) rotate(var(--r)); }
}

#progress {
    position: fixed; top: 0; left: 0; width: 100%; height: 5px; z-index: 150; pointer-events: none;
    transform-origin: 0 50%; transform: scaleX(var(--p, 0));
    background: linear-gradient(90deg, var(--yellow), var(--red-bright));
}

.to-top {
    position: fixed; right: 18px; bottom: 18px; z-index: 90;
    width: 54px; height: 54px; padding: 0; border-radius: 50%;
    border: 3px solid #1a1a1a; box-shadow: 3px 3px 0 #1a1a1a;
    background: linear-gradient(to bottom, var(--red-bright) 0 44%, #1a1a1a 44% 56%, #fff 56%);
    transition: transform .2s;
}
.to-top[hidden] { display: none; }
.to-top::after {
    content: '▲'; position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; border-radius: 50%;
    transform: translate(-50%, -50%); background: #fff; border: 3px solid #1a1a1a; color: #1a1a1a;
    font-size: 9px; line-height: 16px; text-align: center;
}
.to-top:hover { transform: rotate(-20deg) scale(1.1); }

.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s, transform .7s; }
.js .reveal.in { opacity: 1; transform: none; }

.rain {
    position: fixed; top: -140px; z-index: 350; pointer-events: none;
    animation: rain linear forwards; filter: drop-shadow(0 6px 4px #0004);
}
@keyframes rain { to { transform: translateY(calc(100vh + 200px)) rotate(var(--r)); } }

/* ---------- type chart ---------- */
.t-dark { --c: #705746; }
.seg { display: flex; }
.seg button {
    font-family: var(--font-pixel); font-size: 9px; background: var(--paper); color: var(--ink);
    border: 3px solid var(--ink); padding: 10px 12px; margin-left: -3px;
}
.seg button[aria-pressed="true"] { background: var(--brand); color: #fff; }
.tc-result { margin-top: 18px; display: grid; gap: 14px; }
.tc-title { font-size: 18px; }
.tc-group { border: 3px solid var(--ink); background: var(--paper); padding: 12px 14px; border-left-width: 12px; }
.tc-group h4 { margin: 0 0 8px; font-family: var(--font-pixel); font-size: 10px; }
.tc-group.sup { border-left-color: #3fb95f; }
.tc-group.half { border-left-color: #e5a100; }
.tc-group.none { border-left-color: #e5484d; }
.tc-group em { opacity: .6; }
.tc-count { opacity: .85; }
.tc-count .btn-sm { margin-left: 8px; }
.tc-matrix { margin-top: 20px; border: 3px solid var(--ink); background: var(--paper); }
.tc-matrix summary { cursor: pointer; padding: 12px 14px; font-family: var(--font-pixel); font-size: 10px; }
#tc-matrix { overflow-x: auto; padding: 0 10px 14px; }
#tc-matrix table { border-collapse: collapse; margin: 0 auto; }
#tc-matrix th, #tc-matrix td { border: 1px solid color-mix(in srgb, var(--ink) 25%, transparent); padding: 3px; text-align: center; min-width: 34px; font-size: 13px; }
#tc-matrix .tag { margin: 0; font-size: 7px; padding: 4px 3px; }
.m2 { background: #3fb95f; color: #fff; font-weight: bold; }
.mh { background: #f0b429; color: #242424; }
.m0 { background: #e5484d; color: #fff; }

/* ---------- party builder ---------- */
.sub { font-family: var(--font-pixel); font-size: 11px; color: var(--red); margin: 26px 0 12px; }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.slot { position: relative; border: 3px solid var(--ink); background: var(--paper); min-height: 190px; padding: 8px; text-align: center; }
.slot:not(.empty) { background: radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--tc) 40%, var(--paper)), var(--paper) 75%); }
.slot.empty { display: grid; place-items: center; border-style: dashed; opacity: .55; font-family: var(--font-pixel); font-size: 28px; }
.slot .open { text-align: center; }
.slot img { width: 100%; max-width: 120px; height: auto; aspect-ratio: 1; object-fit: contain; filter: drop-shadow(0 5px 4px #0003); }
.slot .tags { margin-top: 6px; }
.slot-x { position: absolute; right: 6px; top: 6px; z-index: 2; width: 28px; height: 28px; padding: 0; background: var(--paper); color: var(--ink); border: 2px solid var(--ink); line-height: 1; }
.slot-x:hover { background: #e5484d; color: #fff; }
.team-actions { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.pick { display: flex; flex-wrap: wrap; gap: 8px; }
.pick-btn { display: flex; align-items: center; gap: 6px; background: var(--paper); color: var(--ink); border: 2px solid var(--ink); padding: 4px 10px 4px 4px; font-size: 13px; }
.pick-btn:hover { background: var(--yellow); color: #242424; }
.cov-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.cov { border: 2px solid var(--ink); background: var(--paper); padding: 6px; display: grid; gap: 4px; justify-items: center; font-size: 13px; }
.cov b { font-weight: normal; }
.cov.bad { background: color-mix(in srgb, #e5484d 40%, var(--paper)); }
.cov.warn { background: color-mix(in srgb, #f0b429 38%, var(--paper)); }
.cov.good { background: color-mix(in srgb, #3fb95f 36%, var(--paper)); }
.cov-key { margin-top: 8px; font-size: 12px; opacity: .7; }
.cov-note { margin-top: 10px; }
.cov-note.bad { color: var(--red); }
.pf-actions .pf-party.on { background: #3fb95f; }

/* ---------- Pokémon of the day ---------- */
.potd {
    display: flex; align-items: center; gap: clamp(16px, 4vw, 40px); flex-wrap: wrap;
    border: 3px solid var(--ink); box-shadow: 8px 8px 0 var(--ink); padding: clamp(16px, 3vw, 32px);
    background: linear-gradient(120deg, color-mix(in srgb, var(--tc, #888) 35%, var(--paper)), var(--paper) 65%);
    margin-bottom: 70px;
}
.potd-art { width: clamp(150px, 22vw, 240px); aspect-ratio: 1; flex: none; border-radius: 50%; border: 4px solid var(--ink); background: radial-gradient(circle, #fff, color-mix(in srgb, var(--tc, #888) 40%, var(--paper)) 75%); display: grid; place-items: center; }
.potd-art img { width: 88%; height: 88%; object-fit: contain; animation: float 4s ease-in-out infinite; filter: drop-shadow(0 6px 5px #0004); }
.potd-info { display: grid; gap: 10px; justify-items: start; }
.potd-info h2 { font-size: clamp(28px, 5vw, 48px); }
.potd-en { font-family: var(--font-pixel); font-size: 12px; }
.potd-timer { font-size: 13px; opacity: .85; }
.potd-timer b { font-family: var(--font-pixel); font-size: 12px; color: var(--red); }

/* ---------- profile: language toggle & moves ---------- */
.pf-lang { text-align: right; margin: -6px 0 6px; }
.pf-lang button { font-family: var(--font-pixel); font-size: 9px; padding: 8px 10px; background: var(--paper); color: var(--ink); border: 2px solid var(--ink); }
.pf-lang button[aria-pressed="true"] { background: var(--yellow); color: #242424; }
.pf-moves { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.pf-moves li { border: 2px solid var(--ink); background: var(--paper); padding: 4px 8px; font-size: 13px; text-transform: capitalize; }
.pf-moves b { font-family: var(--font-pixel); font-size: 8px; color: var(--red); margin-right: 4px; }
.pf-stage img.pixel { image-rendering: pixelated; width: 70%; height: 70%; animation: none; }

/* ---------- compare ---------- */
#compare { width: min(780px, 95vw); }
#compare-body { padding: 0 clamp(14px, 3vw, 28px) 26px; position: relative; }
.cmp-head { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; padding-top: 18px; }
.cmp-vs { font-family: var(--font-pixel); font-size: 16px; color: var(--red); }
.cmp-side { text-align: center; display: grid; gap: 8px; justify-items: center; }
.cmp-side select { width: 100%; max-width: 230px; padding: 8px; font-size: 13px; }
.cmp-art { width: min(190px, 100%); aspect-ratio: 1; border-radius: 50%; border: 4px solid var(--ink); background: radial-gradient(circle, #fff, color-mix(in srgb, var(--tc) 45%, var(--paper)) 75%); display: grid; place-items: center; }
.cmp-art img { width: 86%; height: 86%; object-fit: contain; }
.cmp-side h3 { font-size: 20px; }
#cmp-stats { margin-top: 22px; }
.cmp-row { display: grid; grid-template-columns: 38px 1fr 62px 1fr 38px; gap: 8px; align-items: center; margin: 9px 0; }
.cmp-row .lbl { font-family: var(--font-pixel); font-size: 8px; text-align: center; }
.cmp-row .va { text-align: right; } .cmp-row .vb { text-align: left; }
.cmp-row .win { color: var(--red); font-weight: bold; }
.cb { height: 14px; border: 2px solid var(--ink); background: color-mix(in srgb, var(--ink) 10%, transparent); display: flex; }
.cb.a { justify-content: flex-end; }
.cb i { display: block; height: 100%; width: var(--w); animation: grow .8s cubic-bezier(.2, .8, .2, 1) both; }
.cb.a i { background: #3b9bf0; } .cb.b i { background: #e3350d; }
.cmp-row.total { border-top: 2px dashed var(--ink); padding-top: 8px; font-family: var(--font-pixel); font-size: 12px; }
.cmp-verdict { margin-top: 14px; text-align: center; font-size: 14px; }
@media (max-width: 650px) { .cmp-head { grid-template-columns: 1fr 1fr; } .cmp-vs { display: none; } }

/* ---------- gym badges ---------- */
.badges { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; }
.badge { border: 3px solid var(--ink); background: var(--paper); padding: 16px 10px; text-align: center; display: grid; gap: 6px; justify-items: center; filter: grayscale(1); opacity: .7; }
.badge.earned { filter: none; opacity: 1; box-shadow: 5px 5px 0 var(--ink); }
.badge-medal {
    width: 64px; height: 64px; display: grid; place-items: center; font-size: 28px; color: #fff;
    background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--b) 40%, #fff), var(--b) 70%);
    border: 4px solid var(--ink); clip-path: polygon(50% 0, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%);
    text-shadow: 1px 1px 0 #0006;
}
.badge.earned .badge-medal { animation: float 4s ease-in-out infinite; }
.badge b { font-family: var(--font-pixel); font-size: 10px; }
.badge-jp { font-size: 12px; opacity: .8; }
.badge small { margin: 0; letter-spacing: 0; font-size: 12px; opacity: .75; }
.champ { margin-top: 22px; text-align: center; padding: 16px; border: 3px solid #c9a227; background: color-mix(in srgb, #ffd34e 30%, var(--paper)); font-family: var(--font-pixel); font-size: 12px; animation: glint 2.8s ease-in-out infinite; }
.champ[hidden] { display: none; }

/* many nav links: scroll sideways instead of cramming */
nav { overflow-x: auto; justify-content: safe center; scrollbar-width: thin; }
nav a { flex: none; font-size: 14px; padding: 6px 10px; }
@media (min-width: 1100px) { nav { justify-content: space-around; } }
@media (max-width: 650px) { nav { flex-wrap: nowrap; justify-content: flex-start; } }

/* ---------- battle ---------- */
.b-setup { display: flex; flex-wrap: wrap; gap: 14px; align-items: end; }
.b-setup label { display: grid; gap: 6px; font-family: var(--font-pixel); font-size: 9px; }
.b-setup select { min-width: 220px; font-size: 14px; }
.arena {
    border: 4px solid var(--ink); box-shadow: 8px 8px 0 var(--ink); padding: clamp(10px, 2vw, 22px);
    background:
        linear-gradient(to bottom, #8fd0ff 0 46%, #7cc26a 46% 100%);
    display: grid; gap: 10px;
}
[data-theme="night"] .arena { background: linear-gradient(to bottom, #1b2a55 0 46%, #285a3a 46% 100%); }
.arena[hidden] { display: none; }
.b-mon { display: flex; align-items: center; gap: 14px; }
.b-mon.foe { justify-content: space-between; }
.b-mon.me { justify-content: space-between; }
.b-mon img { width: clamp(110px, 22vw, 200px); height: auto; aspect-ratio: 1; object-fit: contain; filter: drop-shadow(0 8px 5px #0005); }
.b-mon.me img { transform: scaleX(-1); }
.b-mon.foe img { width: clamp(90px, 18vw, 160px); }
.b-info { background: var(--paper); color: var(--ink); border: 3px solid var(--ink); padding: 10px 12px; min-width: min(250px, 55%); display: grid; gap: 4px; box-shadow: 3px 3px 0 var(--ink); }
.b-info b { font-family: var(--font-pixel); font-size: 10px; }
.b-info span { font-size: 12px; }
.b-info small { margin: 0; letter-spacing: 0; font-size: 12px; }
.b-info .tags { margin: 0; }
.hp { height: 12px; border: 2px solid var(--ink); background: #0002; }
.hp i { display: block; height: 100%; width: 100%; background: #3fb95f; transition: width .6s ease-out, background .3s; }
.hp i.mid { background: #f0b429; } .hp i.low { background: #e5484d; }
.b-log { background: #101522; color: #fff; border: 3px solid var(--ink); padding: 10px 14px; min-height: 120px; font-size: 14px; }
.b-log p { margin: 2px 0; } .b-log p:last-child { color: #ffdb63; }
.b-moves { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.b-move { text-align: left; background: var(--c, var(--paper)); color: #fff; border: 3px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); display: grid; gap: 4px; padding: 10px 12px; text-shadow: 1px 1px 0 #0006; transition: transform .1s; }
.b-move b { font-family: var(--font-pixel); font-size: 9px; }
.b-move small { margin: 0; letter-spacing: 0; font-size: 11px; opacity: .95; }
.b-move.t-electric, .b-move.t-ice, .b-move.t-ground, .b-move.t-steel, .b-move.t-bug, .b-move.t-fairy { color: #1a1a1a; text-shadow: none; }
.b-move.heal, .b-move[data-act] { background: var(--paper); color: var(--ink); text-shadow: none; }
.b-move:not(:disabled):hover { transform: translate(-2px, -2px); }
.b-move:disabled { opacity: .5; cursor: not-allowed; }
.lunge img { animation: lunge .35s ease-out; }
.hit img { animation: hit .45s; }
.faint img { animation: faint .9s forwards; }
@keyframes lunge { 40% { transform: translate(40px, -24px) scaleX(var(--fx, 1)); } }
.me.lunge img { animation: lungeMe .35s ease-out; }
@keyframes lungeMe { 40% { transform: translate(40px, -24px) scaleX(-1); } }
.foe.lunge img { animation: lungeFoe .35s ease-out; }
@keyframes lungeFoe { 40% { transform: translate(-40px, 24px); } }
@keyframes hit { 0%, 100% { filter: drop-shadow(0 8px 5px #0005); } 20%, 60% { filter: brightness(3) drop-shadow(0 0 8px #fff); opacity: .5; } 40%, 80% { opacity: 1; } }
@keyframes faint { to { transform: translateY(60px) scaleX(var(--fx, 1)); opacity: 0; } }
.me.faint img { animation: faintMe .9s forwards; }
@keyframes faintMe { to { transform: translateY(60px) scaleX(-1); opacity: 0; } }

/* ---------- catch game ---------- */
.catch { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 24px; align-items: center; }
.c-stage {
    position: relative; height: 400px; border: 4px solid var(--ink); box-shadow: 8px 8px 0 var(--ink); overflow: hidden;
    background: linear-gradient(to bottom, #4aa8f0 0%, #9bd6ff 45%, #d9f1ff 62%);
    display: grid; place-items: center; isolation: isolate;
}
[data-theme="night"] .c-stage { background: linear-gradient(to bottom, #0b1233 0%, #1b2a55 55%, #34437a 62%); }
.c-stage img { width: 52%; max-height: 66%; object-fit: contain; margin-top: -20px; animation: float 3s ease-in-out infinite; filter: drop-shadow(0 8px 5px #0005); transition: transform .4s, opacity .4s; }
.c-stage.sucked img { transform: scale(.05); opacity: 0; animation: none; }
.c-stage p { position: absolute; left: 0; right: 0; bottom: 0; background: #101522; color: #ffdb63; border-top: 4px solid #ffdb63; padding: 10px; text-align: center; font-family: var(--font-pixel); font-size: 10px; line-height: 1.7; }
.c-ball {
    position: absolute; left: calc(50% - 24px); bottom: 70px; width: 48px; height: 48px; border-radius: 50%; z-index: 3;
    border: 4px solid #1a1a1a; background: linear-gradient(to bottom, #e3350d 0 44%, #1a1a1a 44% 56%, #fff 56%);
}
.c-ball::after { content: ''; position: absolute; left: 50%; top: 50%; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3px solid #1a1a1a; transform: translate(-50%, -50%); }
.c-ball[hidden] { display: none; }
.c-ball.throw { animation: throwBall .75s ease-out forwards; }
.c-ball.shake { transform: translateY(-170px) scale(.8); animation: catchShake .6s ease-in-out 3; }
.c-ball.done { transform: translateY(-170px) scale(.8); box-shadow: 0 0 0 6px #ffdb6988, 0 0 30px #ffdb69; }
@keyframes throwBall { 0% { transform: translate(-150px, 20px) rotate(0) scale(1.1); } 55% { transform: translate(-30px, -250px) rotate(540deg) scale(.9); } 100% { transform: translate(0, -170px) rotate(720deg) scale(.8); } }
@keyframes catchShake { 0%, 100% { transform: translateY(-170px) scale(.8) rotate(0); } 25% { transform: translateY(-170px) scale(.8) rotate(-28deg); } 75% { transform: translateY(-170px) scale(.8) rotate(28deg); } }
.c-side { display: grid; gap: 18px; }
.c-balls { font-family: var(--font-pixel); font-size: 12px; color: var(--red); letter-spacing: 2px; }
.meter { position: relative; height: 36px; border: 4px solid var(--ink); background: repeating-linear-gradient(90deg, #e5484d 0 12px, #d93a3f 12px 24px); }
.zone { position: absolute; top: 0; bottom: 0; background: repeating-linear-gradient(90deg, #3fb95f 0 8px, #5ad67d 8px 16px); border-inline: 3px solid var(--ink); }
.needle { position: absolute; top: -8px; bottom: -8px; width: 8px; margin-left: -4px; background: #fff; border: 2px solid var(--ink); box-shadow: 0 0 8px #fff; }
.c-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.c-actions .button { margin: 0; }
.box { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; }
.box-btn { background: var(--paper); color: var(--ink); border: 2px solid var(--ink); padding: 4px; display: grid; justify-items: center; font-family: var(--font-pixel); font-size: 8px; }
.box-btn:hover { background: var(--yellow); color: #242424; }
.box-btn img { width: 64px; height: 64px; object-fit: contain; }
@media (max-width: 800px) { .catch { grid-template-columns: 1fr; } .c-stage { height: 340px; } }

/* ---------- quiz modes ---------- */
.quiz-modes { display: flex; flex-wrap: wrap; margin-bottom: 20px; }
.quiz-modes button { font-family: var(--font-pixel); font-size: 9px; background: var(--paper); color: var(--ink); border: 3px solid var(--ink); padding: 12px 14px; margin-right: -3px; }
.quiz-modes button[aria-pressed="true"] { background: var(--brand); color: #fff; }
.quiz-screen img { transition: filter .7s, opacity .4s; }
.quiz-screen.cry img:not(.revealed) { opacity: 0; }
.quiz-screen.cry::before { content: '♪'; position: absolute; top: 18%; left: 0; right: 0; text-align: center; font-size: clamp(80px, 16vw, 150px); color: #fff; text-shadow: 6px 6px 0 #0a3a86; animation: float 2s ease-in-out infinite; }
.quiz-screen.cry:has(img.revealed)::before { display: none; }
.quiz-actions #quiz-cry, .quiz-actions #quiz-share { background: var(--yellow); color: #242424; }
.quiz-done { text-align: center; font-family: var(--font-pixel); font-size: 12px; line-height: 2.2; padding: 24px 10px; border: 3px solid var(--ink); background: var(--paper); }
.quiz-done span { font-size: 18px; letter-spacing: 3px; }
.quiz-done small { font-family: var(--font-body); letter-spacing: 0; font-size: 13px; opacity: .8; }

/* ---------- regions: each generation re-colours the Pokédex ---------- */
[data-gen="2"] { --brand: #9a6b00; }
[data-gen="3"] { --brand: #1f8a5b; }
[data-gen="4"] { --brand: #3b5bb5; }
[data-gen="5"] { --brand: #4a4a58; }
[data-gen="6"] { --brand: #3a78c9; }
[data-gen="7"] { --brand: #cf6a14; }
[data-gen="8"] { --brand: #b0338a; }
[data-gen="9"] { --brand: #7a3fc0; }
.gens { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 18px; }
.gen { display: grid; gap: 2px; justify-items: center; background: var(--paper); color: var(--ink); border: 3px solid var(--ink); padding: 8px 10px; box-shadow: 3px 3px 0 var(--ink); font-size: 11px; transition: transform .12s, box-shadow .12s; }
.gen b { font-family: var(--font-pixel); font-size: 11px; color: var(--red); }
.gen span { font-family: var(--font-pixel); font-size: 7px; }
.gen:hover { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--ink); }
.gen[aria-pressed="true"] { background: var(--brand); color: #fff; transform: translate(2px, 2px); box-shadow: none; }
.gen[aria-pressed="true"] b { color: #fff; }
.gen-note { min-height: 1.4em; font-size: 13px; opacity: .8; }

/* ---------- sub-navigation ---------- */
.subnav { position: sticky; top: var(--nav-h, 64px); z-index: 49; display: flex; gap: 6px; overflow-x: auto; padding: 8px 5%; background: color-mix(in srgb, var(--nav) 88%, var(--brand)); border-bottom: 2px solid var(--ink); scrollbar-width: none; }
.subnav[hidden] { display: none; }
.subnav a { flex: none; color: var(--on-brand); text-decoration: none; font-family: var(--font-pixel); font-size: 9px; padding: 8px 10px; border: 2px solid transparent; opacity: .8; }
.subnav a:hover { opacity: 1; color: var(--yellow); }
.subnav a.active { opacity: 1; border-color: var(--yellow); background: #0004; }

/* ---------- items & berries ---------- */
.it-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.it-btn { display: grid; justify-items: center; gap: 4px; background: var(--paper); color: var(--ink); border: 2px solid var(--ink); padding: 8px 6px; font-size: 12px; text-align: center; transition: transform .1s; }
.it-btn:hover { transform: translateY(-2px); background: var(--yellow); color: #242424; }
.it-btn img { width: 48px; height: 48px; object-fit: contain; image-rendering: pixelated; }
.it-btn img.missing, .it-detail img.missing { visibility: hidden; }
.it-more { margin-top: 14px; text-align: center; }
.it-detail { display: flex; gap: 18px; align-items: flex-start; border: 3px solid var(--ink); background: var(--paper); box-shadow: 5px 5px 0 var(--ink); padding: 16px 18px; margin-bottom: 16px; scroll-margin-top: 140px; }
.it-detail[hidden] { display: none; }
.it-detail img { image-rendering: pixelated; width: 96px; height: 96px; flex: none; }
.it-detail h3 { font-size: 20px; margin-bottom: 6px; color: var(--red); }
.it-detail p { line-height: 1.5; margin-bottom: 8px; }

/* ---------- moves ---------- */
.mv-list { display: flex; flex-wrap: wrap; gap: 6px; }
.mv-btn { background: var(--paper); color: var(--ink); border: 2px solid var(--ink); padding: 6px 10px; font-size: 13px; }
.mv-btn:hover { background: var(--yellow); color: #242424; }
.mv-detail { border: 3px solid var(--ink); background: var(--paper); box-shadow: 5px 5px 0 var(--ink); padding: 16px 18px; margin: 16px 0; scroll-margin-top: 140px; }
.mv-detail[hidden] { display: none; }
.mv-detail h3 { font-size: 22px; color: var(--red); margin-bottom: 8px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.mv-class { --c: #777; }
.mv-stats { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 0; padding: 0; }
.mv-stats li { border: 2px solid var(--ink); padding: 6px 10px; font-size: 13px; }
.mv-stats b { font-family: var(--font-pixel); font-size: 8px; margin-right: 6px; color: var(--red); }
.mv-learners { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }

/* ---------- stat calculator ---------- */
.calc-top { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 14px; }
.calc-top label { display: grid; gap: 6px; font-family: var(--font-pixel); font-size: 9px; }
.calc-top select { min-width: 220px; font-size: 14px; }
.calc-top input { width: 100px; min-width: 0; flex: none; }
.calc-presets { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
#calc-ev.over { color: #e5484d; }
.calc-table { border: 3px solid var(--ink); background: var(--paper); padding: 10px; max-width: 760px; }
.calc-row { display: grid; grid-template-columns: 90px 54px 76px 86px 1fr; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px dashed color-mix(in srgb, var(--ink) 30%, transparent); }
.calc-row:last-child { border-bottom: 0; }
.calc-row.head { font-family: var(--font-pixel); font-size: 8px; opacity: .8; }
.calc-row input { min-width: 0; padding: 6px; border-width: 2px; width: 100%; }
.calc-name { font-family: var(--font-pixel); font-size: 9px; }
.calc-name.up { color: #3fb95f; } .calc-name.down { color: #e5484d; }
.calc-final { position: relative; display: block; height: 28px; background: color-mix(in srgb, var(--ink) 10%, transparent); border: 2px solid var(--ink); }
.calc-final i { position: absolute; left: 0; top: 0; bottom: 0; background: color-mix(in srgb, var(--brand) 55%, transparent); transition: width .3s; }
.calc-final b { position: relative; z-index: 1; display: block; line-height: 24px; padding-left: 8px; font-family: var(--font-pixel); font-size: 11px; }
.calc-note { margin-top: 12px; font-size: 12px; opacity: .75; max-width: 760px; }
@media (max-width: 650px) { .calc-row { grid-template-columns: 62px 40px 58px 66px 1fr; gap: 6px; } }

/* ---------- cry soundboard ---------- */
.cry-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-bottom: 16px; }
.cry-controls label { display: flex; align-items: center; gap: 8px; font-family: var(--font-pixel); font-size: 9px; }
.cry-controls input[type="range"] { min-width: 140px; flex: none; padding: 0; border: 0; background: none; accent-color: var(--brand); }
.cry-now { font-family: var(--font-pixel); font-size: 11px; color: var(--red); }
.cry-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; }
.cry-btn { display: grid; justify-items: center; background: var(--paper); color: var(--ink); border: 2px solid var(--ink); padding: 4px; font-family: var(--font-pixel); font-size: 7px; transition: transform .1s; }
.cry-btn img { width: 56px; height: 56px; image-rendering: pixelated; }
.cry-btn:hover { background: var(--yellow); color: #242424; transform: translateY(-2px); }
.cry-btn.playing { background: var(--brand); color: #fff; animation: pulseBtn .5s ease-out; }
@keyframes pulseBtn { 50% { transform: scale(1.12); } }
.eq { display: inline-flex; gap: 3px; align-items: flex-end; height: 22px; }
.eq i { width: 5px; height: 4px; background: var(--red); }
.eq.on i { animation: eq .6s ease-in-out infinite alternate; }
.eq.on i:nth-child(2) { animation-delay: .15s; } .eq.on i:nth-child(3) { animation-delay: .3s; } .eq.on i:nth-child(4) { animation-delay: .45s; }
@keyframes eq { to { height: 22px; } }

/* ---------- shiny hunt ---------- */
.hunt-new { display: flex; flex-wrap: wrap; gap: 14px; align-items: end; }
.hunt-new label { display: grid; gap: 6px; font-family: var(--font-pixel); font-size: 9px; }
.hunt-new select { min-width: 220px; font-size: 14px; }
.hunt-keys { margin: 12px 0 18px; font-size: 13px; opacity: .8; }
kbd { font-family: var(--font-pixel); font-size: 9px; background: var(--ink); color: var(--cream); padding: 3px 6px; }
.hunt-list { display: grid; gap: 14px; }
.hunt { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; border: 3px solid var(--ink); background: var(--paper); padding: 14px 18px; box-shadow: 5px 5px 0 var(--ink); }
.hunt.found { border-color: #c9a227; background: color-mix(in srgb, #ffd34e 22%, var(--paper)); animation: glint 2.8s ease-in-out infinite; }
.hunt img { width: 120px; height: 120px; object-fit: contain; flex: none; filter: drop-shadow(0 5px 4px #0003); }
.hunt-main { flex: 1; min-width: 240px; }
.hunt h3 { font-family: var(--font-pixel); font-size: 12px; }
.hunt-count { font-family: var(--font-pixel); font-size: clamp(30px, 6vw, 54px); color: var(--red); margin: 6px 0; line-height: 1.1; }
.hunt-odds { font-size: 13px; opacity: .85; margin-bottom: 6px; }
.hunt-btns { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.hunt-plus { font-family: var(--font-pixel); font-size: 12px; padding: 16px 22px; border: 3px solid var(--ink); box-shadow: 4px 4px 0 var(--ink); }
.hunt-plus:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.found-btn { background: #c9a227; color: #242424; }
.hunt-del { margin-top: 8px; background: none; color: var(--ink); opacity: .6; padding: 4px 0; font-size: 12px; text-decoration: underline; }
.hunt-del.armed { color: #e5484d; opacity: 1; }
.sparkle { position: fixed; z-index: 350; color: #ffd34e; pointer-events: none; text-shadow: 0 0 10px #fff; animation: sparkle 1.6s ease-out forwards; }
@keyframes sparkle { 0% { opacity: 0; transform: scale(.2) rotate(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(-80px) scale(1.4) rotate(180deg); } }

/* ---------- trainer card ---------- */
.trainer { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.tr-card { border: 4px solid var(--ink); box-shadow: 8px 8px 0 var(--ink); background: linear-gradient(135deg, var(--paper), color-mix(in srgb, var(--brand) 14%, var(--paper))); padding: 20px; display: grid; gap: 16px; }
.tr-top { display: flex; gap: 18px; align-items: center; }
.tr-avatar { width: 110px; aspect-ratio: 1; flex: none; border-radius: 50%; border: 4px solid var(--ink); background: radial-gradient(circle, #fff, color-mix(in srgb, var(--brand) 25%, var(--paper)) 75%); display: grid; place-items: center; }
.tr-avatar img { width: 88%; height: 88%; object-fit: contain; }
.tr-top h3 { font-size: 26px; color: var(--red); word-break: break-all; }
.tr-top p { font-family: var(--font-pixel); font-size: 9px; margin-top: 6px; opacity: .8; }
.tr-badges { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.tr-badges li { aspect-ratio: 1; display: grid; place-items: center; background: #cfcabb; color: #8a8576; font-size: 18px; clip-path: polygon(50% 0, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%); }
.tr-badges li.on { background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--b) 40%, #fff), var(--b) 70%); color: #fff; }
.tr-stats { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.tr-stats li { border: 2px solid var(--ink); padding: 8px 10px; display: flex; justify-content: space-between; gap: 8px; background: var(--paper); }
.tr-stats b { font-family: var(--font-pixel); font-size: 8px; align-self: center; }
.tr-stats span { font-family: var(--font-pixel); font-size: 12px; color: var(--red); }
.tr-party { display: flex; flex-wrap: wrap; gap: 6px; min-height: 64px; align-items: center; }
.tr-party button { background: var(--paper); border: 2px solid var(--ink); padding: 2px; }
.tr-party img { width: 64px; height: 64px; object-fit: contain; display: block; }
.tr-edit { display: grid; gap: 14px; }
.tr-edit label { display: grid; gap: 6px; font-family: var(--font-pixel); font-size: 9px; }
.tr-edit input[type="text"], .tr-edit select { width: 100%; font-size: 15px; }
.tr-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.tr-hint { font-size: 13px; opacity: .75; }
@media (max-width: 800px) { .trainer { grid-template-columns: 1fr; } }

/* ---------- region map ---------- */
.map-pick { display: flex; align-items: center; gap: 8px; font-family: var(--font-pixel); font-size: 9px; }
.map-pick select { max-width: 220px; font-size: 13px; padding: 8px; }
.map-wrap { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.map-svg { border: 4px solid var(--ink); box-shadow: 8px 8px 0 var(--ink); background: #7cc3f2; line-height: 0; }
.map-svg svg { width: 100%; height: auto; display: block; }
.sea { fill: #6fb7ea; } [data-theme="night"] .sea { fill: #17325c; }
.land { fill: #9fd37a; stroke: #3d7a2c; stroke-width: 6; stroke-linejoin: round; } [data-theme="night"] .land { fill: #2d6b46; stroke: #1c4a2f; }
.map-link { stroke: #fff9; stroke-width: 4; stroke-dasharray: 2 9; stroke-linecap: round; }
.mk { cursor: pointer; outline: none; }
.mk rect, .mk path, .mk circle { fill: #f4efdf; stroke: #242424; stroke-width: 3; opacity: .85; transition: transform .15s; }
.mk.town rect { fill: #ffdb63; } .mk.dungeon path { fill: #c9b79c; }
.mk text { font-family: var(--font-pixel); text-anchor: middle; pointer-events: none; }
.mk .num { font-size: 10px; fill: #242424; } .mk .lbl { font-size: 11px; fill: #1d2a14; paint-order: stroke; stroke: #fff8; stroke-width: 3px; }
[data-theme="night"] .mk .lbl { fill: #fff; stroke: #0008; }
.mk:hover rect, .mk:hover path, .mk:hover circle, .mk:focus-visible rect, .mk:focus-visible path, .mk:focus-visible circle { opacity: 1; stroke: var(--brand); stroke-width: 5; }
.mk.hit rect, .mk.hit path, .mk.hit circle { fill: #ff4d4d; opacity: 1; animation: ping 1.4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.mk.hit .num { fill: #fff; }
@keyframes ping { 50% { transform: scale(1.35); } }
.map-info { border: 3px solid var(--ink); background: var(--paper); padding: 16px 18px; min-height: 160px; line-height: 1.5; }
.map-info h3 { color: var(--red); margin-bottom: 6px; font-size: 20px; }
.map-list { font-size: 13px; opacity: .85; margin-top: 8px; }
.map-rows { margin: 8px 0 12px; padding-left: 18px; font-size: 14px; text-transform: capitalize; }
.map-note { margin-top: 10px; font-size: 12px; opacity: .7; }
@media (max-width: 800px) { .map-wrap { grid-template-columns: 1fr; } }

/* ---------- leaderboard ---------- */
.quiz-board { margin-top: 14px; border: 3px solid var(--ink); background: var(--paper); padding: 12px 16px; }
.quiz-board h4 { font-family: var(--font-pixel); font-size: 10px; margin-bottom: 8px; color: var(--red); }
.quiz-board ol { margin: 0; padding-left: 22px; } .quiz-board li { display: flex; gap: 10px; align-items: baseline; padding: 2px 0; }
.quiz-board li span { flex: 1; } .quiz-board small { font-size: 10px; letter-spacing: 1px; }
.lb-form { display: flex; gap: 8px; flex-wrap: wrap; } .lb-form input { flex: 1; min-width: 140px; padding: 8px; font: inherit; border: 3px solid var(--ink); background: #fff; color: #242424; }
#lb-msg { margin-top: 6px; font-size: 13px; }

/* ---------- touch & small-screen polish ---------- */
.map-pick { flex-wrap: wrap; max-width: 100%; } .map-pick select { max-width: 100%; min-width: 0; }
@media (pointer: coarse), (max-width: 700px) {
    .ball { width: 40px; height: 40px; right: 8px; top: 6px; }
    .chip, .mv-btn, #sound, #theme, .btn-sm { min-height: 40px; }
    #sound, #theme { min-width: 40px; }
    .chip { padding-inline: 12px; display: inline-flex; align-items: center; }
    .calc-row input, .calc-top input, .map-pick select { min-height: 40px; font-size: 16px; }
    .mk { stroke-linecap: round; }
}
@media (max-width: 700px) { .map-pick { width: 100%; } .map-pick select { flex: 1; } }
@media (max-width: 700px) {
    .map-svg { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .map-svg svg { min-width: 700px; }
    .map-hint-m { display: block; }
}
.map-hint-m { display: none; margin: 6px 0 0; font-size: 12px; opacity: .7; }

/* ---------- contrast: dark text on light type colours, white only on dark ones ---------- */
.tag, .chip[class*="t-"] { color: #14141c; text-shadow: none; }
.tag.t-fighting, .tag.t-poison, .tag.t-ghost, .tag.t-dragon, .tag.t-dark,
.chip.t-fighting, .chip.t-poison, .chip.t-ghost, .chip.t-dragon, .chip.t-dark { color: #fff; text-shadow: 1px 1px 0 #0006; }
.m2 { color: #0d2a15; } .m0 { background: #c62c31; }
.calc-name.up { color: #1b7a37; } .calc-name.down { color: #b3242a; }
[data-theme="night"] .calc-name.up { color: #5fd486; } [data-theme="night"] .calc-name.down { color: #ff7a7f; }
.tr-badges li:not(.on) { color: #4f4a3e; }

/* ---------- catch stage scenery & effects ---------- */
.c-sky, .c-hills, .c-ground, .c-fx { position: absolute; inset: 0; pointer-events: none; }
.c-sky { z-index: 0; overflow: hidden; }
.c-sun { position: absolute; right: 12%; top: 9%; width: 62px; height: 62px; border-radius: 50%; background: radial-gradient(circle, #fff7c2 30%, #ffd84a 70%); box-shadow: 0 0 0 10px #ffe78a55, 0 0 50px 18px #fff2a8aa; animation: sunPulse 5s ease-in-out infinite; }
[data-theme="night"] .c-sun { background: radial-gradient(circle at 35% 35%, #fff 20%, #dfe6ff 60%, #b7c3f0); box-shadow: 0 0 40px 10px #b7c3f055; animation: none; }
.c-cloud { position: absolute; height: 22px; border-radius: 22px; background: #fffffff0; box-shadow: 26px -12px 0 -2px #fffffff0, 52px 0 0 0 #fffffff0; opacity: .95; animation: cloudDrift linear infinite; }
.c-cloud.c1 { width: 70px; top: 16%; left: -20%; animation-duration: 46s; }
.c-cloud.c2 { width: 54px; top: 30%; left: -35%; animation-duration: 64s; animation-delay: -20s; transform: scale(.8); }
.c-cloud.c3 { width: 80px; top: 8%; left: -10%; animation-duration: 80s; animation-delay: -45s; transform: scale(.7); }
[data-theme="night"] .c-cloud { background: #8c9bd488; box-shadow: 26px -12px 0 -2px #8c9bd488, 52px 0 0 0 #8c9bd488; }
.c-stars { position: absolute; inset: 0; opacity: 0; background:
    radial-gradient(1.5px 1.5px at 12% 18%, #fff 50%, transparent 51%), radial-gradient(1.5px 1.5px at 28% 8%, #fff 50%, transparent 51%), radial-gradient(2px 2px at 44% 22%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 61% 11%, #fff 50%, transparent 51%), radial-gradient(1.5px 1.5px at 74% 27%, #fff 50%, transparent 51%), radial-gradient(2px 2px at 88% 14%, #fff 50%, transparent 51%), radial-gradient(1.5px 1.5px at 6% 34%, #fff 50%, transparent 51%); }
[data-theme="night"] .c-stars { opacity: 1; animation: twinkle 3s ease-in-out infinite; }
.c-hills { z-index: 1; }
.c-hills i { position: absolute; bottom: 33%; border-radius: 50% 50% 0 0; }
.c-hills .h1 { left: -12%; width: 70%; height: 24%; background: #86c96b; }
.c-hills .h2 { right: -18%; width: 80%; height: 30%; background: #6fb857; }
[data-theme="night"] .c-hills .h1 { background: #2e6a4a; } [data-theme="night"] .c-hills .h2 { background: #245a3d; }
.c-ground { z-index: 1; top: auto; height: 36%; background:
    radial-gradient(circle at 8% 22%, #ffffff55 0 2px, transparent 3px), radial-gradient(circle at 33% 44%, #ffee7a88 0 2px, transparent 3px), radial-gradient(circle at 71% 30%, #ffffff55 0 2px, transparent 3px), radial-gradient(circle at 90% 55%, #ffee7a88 0 2px, transparent 3px),
    repeating-linear-gradient(100deg, transparent 0 14px, #ffffff14 14px 16px),
    linear-gradient(to bottom, #78c95f, #4f9f43); border-top: 3px solid #3d7f33; }
[data-theme="night"] .c-ground { background: repeating-linear-gradient(100deg, transparent 0 14px, #ffffff0c 14px 16px), linear-gradient(to bottom, #2f6e48, #1d4a31); border-top-color: #163a26; }
.c-platform { position: absolute; left: 50%; top: 4%; width: 56%; height: 44px; transform: translateX(-50%); border-radius: 50%; background: radial-gradient(ellipse at 50% 40%, #a8e07f 0 55%, #5da74a 56% 100%); box-shadow: 0 6px 0 #3d7f33, 0 14px 18px #0003; }
[data-theme="night"] .c-platform { background: radial-gradient(ellipse at 50% 40%, #4a8f62 0 55%, #2a6144 56% 100%); box-shadow: 0 6px 0 #163a26, 0 14px 18px #0006; }
.c-stage img { position: relative; z-index: 2; margin-top: -36px; }
.c-stage p { z-index: 5; }
.c-ball { z-index: 4; box-shadow: 0 5px 8px #0004; }
.c-stage img.enter { animation: wildIn .6s cubic-bezier(.2, 1.4, .4, 1) both, float 3s ease-in-out .6s infinite; }
.c-stage.sucked img.enter { animation: none; }
.c-stage::before, .c-stage::after { content: ''; position: absolute; inset: 0; z-index: 3; pointer-events: none; opacity: 0; }
.c-stage::before { background: radial-gradient(circle at 50% 38%, #fff 0, #ffffffcc 30%, transparent 70%); }
.c-stage::after { background: radial-gradient(circle at 50% 42%, #ff3b3b99 0, #ff3b3b44 35%, transparent 70%); }
.c-stage.c-win::before { animation: whiteFlash .7s ease-out; }
.c-stage.c-beam::after { animation: redBeam .8s ease-out; }
.c-stage.c-appear::before { animation: whiteFlash .5s ease-out; }
.c-fx b { position: absolute; left: 50%; top: 38%; color: #ffe46b; font-size: calc(18px * var(--s, 1)); text-shadow: 0 0 8px #fff, 0 0 14px #ffb800; animation: starOut 1.1s ease-out forwards; }
.c-ball.done { animation: doneBounce .6s ease-out; }
.c-stage:has(.c-ball.done) p { animation: msgPop .5s ease-out; }
@keyframes cloudDrift { to { left: 130%; } }
@keyframes sunPulse { 50% { transform: scale(1.06); box-shadow: 0 0 0 14px #ffe78a44, 0 0 60px 22px #fff2a8aa; } }
@keyframes twinkle { 50% { opacity: .55; } }
@keyframes wildIn { from { transform: translateX(-60%) scale(.4); opacity: 0; filter: brightness(4) drop-shadow(0 8px 5px #0005); } to { transform: none; opacity: 1; filter: drop-shadow(0 8px 5px #0005); } }
@keyframes whiteFlash { 0% { opacity: .55; } 100% { opacity: 0; } }
@keyframes redBeam { 0% { opacity: .7; } 100% { opacity: 0; } }
@keyframes starOut { 0% { transform: translate(-50%, -50%) scale(.2) rotate(0); opacity: 1; } 100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1) rotate(var(--r)); opacity: 0; } }
@keyframes doneBounce { 0% { transform: translateY(-170px) scale(.8); } 40% { transform: translateY(-200px) scale(.95); } 100% { transform: translateY(-170px) scale(.8); } }
@keyframes msgPop { 0% { transform: scale(1.12); } 100% { transform: none; } }
@media (prefers-reduced-motion: reduce) { .c-cloud, .c-sun, .c-stars, .c-fx b, .c-stage img.enter { animation: none !important; } .c-stage::before, .c-stage::after { display: none; } }
