:root {
    --bg:        #0d0d12;
    --surface:   #16161f;
    --surface-2: #1e1e2a;
    --border:    #2a2a38;
    --border-2:  #363648;
    --text:      #e8e8f0;
    --muted:     #6b6b80;
    --blue:      #60a5fa;
    --blue-hover:#93c5fd;
    --green:     #4ade80;
    --green-bg:  #0d1f14;
    --green-bdr: #166534;
    --red:       #e3350d;
    --radius:    12px;
    --sx: 0;
    --sy: 0;
    --ex: 0;
    --ey: 0;
}

#NavigationBar {
    display: flex;
    align-items: center;
    width: 100vw;
    height: 4rem;
    background-color: #000000;
    color: #f0f8ff;
    flex-shrink: 0;
}

.navigationItem {
    display: inline-block;
    padding-left: 1rem;
    text-decoration: none;
    font-family: 'Nunito', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
}

.otherLink:link,
.otherLink:hover,
.otherLink:active { color: #59a0bd; }
.otherLink:visited { color: #7759bd; }

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Nunito', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    scrollbar-gutter: stable;
}

header {
    background: #0a0a0f;
    border-bottom: 1px solid var(--border);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 200;
    box-shadow: 0 3px 20px rgba(0,0,0,.5);
}

.header-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    height: 56px;
    width: 100%;
}

/* Hide mobile nav on desktop */
#mobile-nav { display: none; }

header h1 {
    font-size: 1.25rem;
    font-weight: 900;
    letter-spacing: -0.5px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}

header h1 img {
    height: 36px;
    width: 36px;
    object-fit: cover;
    border-radius: 8px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-divider {
    width: 1px;
    height: 20px;
    background: var(--border-2);
}

#progress {
    font-size: 0.82rem;
    font-weight: 800;
    background: var(--surface-2);
    color: var(--muted);
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid var(--border);
}

.filter-btns { display: flex; gap: 4px; }

.filter-btn {
    padding: 4px 10px;
    border: 1.5px solid var(--border-2);
    border-radius: 20px;
    background: transparent;
    color: var(--muted);
    font-family: 'Nunito', sans-serif;
    font-size: 0.75rem;
    font-weight: 800;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
}

.filter-btn:hover {
    background: var(--surface-2);
    color: var(--text);
}

.filter-btn.active {
    background: var(--red);
    color: #fff;
    border-color: var(--red);
}

.header-btn {
    padding: 4px 10px;
    border: 1.5px solid var(--border-2);
    border-radius: 20px;
    background: transparent;
    color: var(--muted);
    font-family: 'Nunito', sans-serif;
    font-size: 0.75rem;
    font-weight: 800;
    cursor: pointer;
    transition: all .15s;
}

.header-btn:hover {
    background: var(--surface-2);
    color: var(--text);
}

.header-btn-accent {
    color: #f59e0b;
    border-color: #78350f;
}

.header-btn-accent:hover {
    background: #1c1408;
    color: #fbbf24;
}

.header-btn-dev {
    color: #f59e0b;
    border-color: #78350f;
}

.header-btn-dev:hover {
    background: #1c1408;
    color: #fbbf24;
}

#pokemon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
    gap: 10px;
    padding: 14px;
    max-width: 1700px;
    margin: 0 auto;
}

.poke-card {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    transition: transform .15s, box-shadow .15s, border-color .15s;
}

.poke-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0,0,0,.4);
    border-color: var(--border-2);
}

.poke-card.collected {
    background: var(--green-bg);
    border-color: var(--green-bdr);
}

.card-sprite {
    background: transparent;
    display: flex;
    justify-content: center;
    padding: 14px 8px 6px;
    border-radius: var(--radius) var(--radius) 0 0;
}

.card-sprite picture,
.card-sprite img {
    background: transparent;
    display: block;
    mix-blend-mode: screen;
}

.card-sprite img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    image-rendering: pixelated;
}

.card-name {
    text-align: center;
    padding: 5px 8px 7px;
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--blue);
    text-decoration: underline;
    cursor: pointer;
    line-height: 1.25;
    transition: color .1s;
}

.card-name:hover { color: var(--blue-hover); }

.shiny-badge {
    display: inline-block;
    margin-left: 4px;
    color: #ef4444;
    font-size: 0.7rem;
    vertical-align: middle;
    line-height: 1;
    animation: shinyPulse 2s ease-in-out infinite;
    cursor: default;
}

@keyframes shinyPulse {
    0%, 100% { opacity: 1;   transform: scale(1);    }
    50%       { opacity: 0.6; transform: scale(1.35); }
}

.card-div { background: var(--border); height: 1px; }

.card-check {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 10px;
}

.card-check input[type=checkbox] {
    width: 30px;
    height: 30px;
    cursor: pointer;
    accent-color: var(--green);
}

.card-links {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 8px 8px 12px;
    overflow: visible;
    position: relative;
    z-index: 10;
}

.site-link {
    position: relative;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .12s;
    text-decoration: none;
    background: var(--surface-2);
}

.site-link img {
    width: 18px;
    height: 18px;
    border-radius: 3px;
}

.site-link:hover { transform: scale(1.2); }

.card-edit-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 26px;
    height: 26px;
    border: none;
    background: var(--surface-2);
    border-radius: 6px;
    font-size: 0.75rem;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background .1s;
    padding: 0;
}

.card-edit-btn:hover { background: var(--border-2); }

body.dev-mode .card-edit-btn { display: flex; }

@media (max-width: 600px) {
    #pokemon-grid {
        display: flex;
        flex-direction: column;
        gap: 7px;
        padding: 8px;
    }

    .poke-card {
        display: grid;
        grid-template-columns: 68px 1fr auto;
        grid-template-rows: auto auto;
        border-radius: 10px;
    }

    .card-sprite {
        grid-column: 1;
        grid-row: 1 / 3;
        background: none;
        padding: 8px;
        align-items: center;
        border-radius: 10px 0 0 10px;
    }

    .card-sprite img { width: 52px; height: 52px; }

    .card-name {
        grid-column: 2;
        grid-row: 1;
        text-align: left;
        padding: 10px 8px 3px;
        font-size: 0.82rem;
        align-self: end;
    }

    .card-links {
        grid-column: 2;
        grid-row: 2;
        justify-content: flex-start;
        padding: 3px 8px 10px;
        gap: 6px;
        align-self: start;
    }

    .card-check {
        grid-column: 3;
        grid-row: 1 / 3;
        padding: 12px;
        align-self: center;
    }

    .card-div { display: none; }
}

@media (max-width: 380px) {
    .filter-btns { display: none; }
}

#tooltip-global {
    position: fixed;
    background: #e8e8f0;
    color: #0d0d12;
    font-family: 'Nunito', sans-serif;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 4px 9px;
    border-radius: 5px;
    pointer-events: none;
    white-space: nowrap;
    z-index: 9999;
    opacity: 0;
    transition: opacity .12s;
    transform: translateX(-50%);
}

#tooltip-global.visible { opacity: 1; }

.poke-bubble {
    position: fixed;
    pointer-events: none;
    z-index: 500;
    image-rendering: pixelated;
    width: 48px;
    height: 48px;
    animation: bubbleFloat linear forwards;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,.6));
}

@keyframes bubbleFloat {
    0%   { transform: translateX(0)      translateY(0px)   rotate(0deg);   opacity: 0; }
    6%   { opacity: 1; }
    15%  { transform: translateX(15vw)   translateY(-45px) rotate(-12deg); }
    30%  { transform: translateX(30vw)   translateY(40px)  rotate(10deg);  }
    45%  { transform: translateX(45vw)   translateY(-55px) rotate(-14deg); }
    60%  { transform: translateX(60vw)   translateY(48px)  rotate(11deg);  }
    75%  { transform: translateX(75vw)   translateY(-42px) rotate(-10deg); }
    90%  { transform: translateX(90vw)   translateY(35px)  rotate(8deg);   opacity: 1; }
    100% { transform: translateX(108vw)  translateY(-20px) rotate(0deg);   opacity: 0; }
}

.poke-bubble.shiny {
    filter: drop-shadow(0 0 6px gold) drop-shadow(0 2px 8px rgba(0,0,0,.6));
}

.sparkle {
    position: fixed;
    pointer-events: none;
    z-index: 501;
    width: 0;
    height: 0;
    animation: sparklePop ease-out forwards;
}

.sparkle::before,
.sparkle::after {
    content: '✦';
    position: absolute;
    font-size: 1rem;
    animation: sparkleFly linear forwards;
}

.sparkle::before { color: #fde68a; }
.sparkle::after  { color: #f9a8d4; animation-delay: 0.08s; }

@keyframes sparklePop {
    0%   { opacity: 1; }
    100% { opacity: 0; }
}

@keyframes sparkleFly {
    0%   { transform: translate(0, 0)                  scale(0);   opacity: 1; }
    40%  { transform: translate(var(--sx), var(--sy))  scale(1.3); opacity: 1; }
    100% { transform: translate(var(--ex), var(--ey))  scale(0.2); opacity: 0; }
}

@keyframes popIn {
    from { transform: scale(.94); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}

#popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 16px;
    backdrop-filter: blur(3px);
}

#popup-overlay.hidden { display: none; }

#popup {
    background: var(--surface);
    border: 1px solid var(--border-2);
    border-radius: 16px;
    width: 100%;
    max-width: 580px;
    max-height: 82vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 32px 80px rgba(0,0,0,.7);
    animation: popIn .18s ease-out;
}

#popup-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
    flex-shrink: 0;
}

#popup-close {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    border: none;
    background: var(--border-2);
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 900;
    cursor: pointer;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .1s;
    line-height: 1;
}

#popup-close:hover { background: #444460; }

#popup-pokemon-name {
    font-size: 1rem;
    font-weight: 900;
    flex: 1;
    color: var(--text);
}

#popup-tabs {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.gen-tab {
    padding: 4px 8px;
    border: 1.5px solid var(--border-2);
    border-radius: 6px;
    background: transparent;
    font-family: 'Nunito', sans-serif;
    font-size: 0.7rem;
    font-weight: 800;
    cursor: pointer;
    color: var(--muted);
    transition: all .1s;
}

.gen-tab:hover { border-color: var(--red); color: var(--red); }

.gen-tab.active {
    background: var(--red);
    border-color: var(--red);
    color: white;
}

#popup-body {
    overflow-y: auto;
    padding: 14px;
    flex: 1;
    background: var(--bg);
}

#popup-body::-webkit-scrollbar { width: 6px; }
#popup-body::-webkit-scrollbar-track { background: transparent; }
#popup-body::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 3px; }

.gen-empty {
    height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 700;
    font-style: italic;
}

.unavail-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 9px 13px;
    margin-bottom: 10px;
}

.unavail-names {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--muted);
}

.unavail-badge {
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--muted);
    background: var(--surface-2);
    border: 1px solid var(--border);
    padding: 2px 8px;
    border-radius: 4px;
    white-space: nowrap;
    flex-shrink: 0;
}

.game-row {
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 8px;
}

.game-row-title {
    padding: 6px 11px;
    font-size: 0.78rem;
    font-weight: 800;
    background: var(--surface);
    border-left: 4px solid #444;
    color: var(--text);
}

.game-row-locs {
    padding: 7px 11px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    background: var(--surface-2);
}

.loc-tag {
    background: #1a2540;
    color: var(--blue);
    font-size: 0.74rem;
    font-weight: 700;
    padding: 2px 9px;
    border-radius: 5px;
}

#loading-msg {
    padding: 60px 20px;
    text-align: center;
    color: var(--muted);
    font-weight: 700;
    font-size: 1rem;
    grid-column: 1 / -1;
}

.game-row-add {
    display: flex;
    gap: 6px;
    padding: 6px 11px 10px;
    background: var(--surface-2);
    border-top: 1px solid var(--border);
}

.loc-add-input {
    flex: 1;
    background: var(--bg);
    border: 1px solid var(--border-2);
    border-radius: 6px;
    color: var(--text);
    font-family: 'Nunito', sans-serif;
    font-size: 0.76rem;
    font-weight: 700;
    padding: 4px 8px;
    outline: none;
    transition: border-color .15s;
}

.loc-add-input:focus { border-color: #f59e0b; }

.loc-add-btn {
    padding: 4px 12px;
    background: #f59e0b;
    color: #0a0a0f;
    border: none;
    border-radius: 6px;
    font-family: 'Nunito', sans-serif;
    font-size: 0.76rem;
    font-weight: 800;
    cursor: pointer;
    transition: background .1s;
}

.loc-add-btn:hover { background: #fbbf24; }

.loc-delete {
    margin-left: 5px;
    background: none;
    border: none;
    color: #ef4444;
    font-size: 0.75rem;
    font-weight: 900;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
    vertical-align: middle;
    transition: color .1s;
}

.loc-delete:hover { color: #fca5a5; }

.loc-empty {
    font-size: 0.74rem;
    color: var(--muted);
    font-style: italic;
}

.dev-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 16px;
    backdrop-filter: blur(3px);
}

.dev-popup {
    background: var(--surface);
    border: 1px solid #78350f;
    border-radius: 14px;
    width: 100%;
    max-width: 560px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 24px 70px rgba(0,0,0,.7);
    animation: popIn .16s ease-out;
}

.dev-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #1c1408;
    border-bottom: 1px solid #78350f;
    font-size: 0.88rem;
    font-weight: 900;
    color: #fbbf24;
    flex-shrink: 0;
}

.dev-popup-close {
    width: 28px;
    height: 28px;
    border: none;
    background: #2c1f08;
    border-radius: 7px;
    font-size: 1rem;
    font-weight: 900;
    cursor: pointer;
    color: #fbbf24;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .1s;
}

.dev-popup-close:hover { background: #3d2a0a; }

.dev-popup-body {
    padding: 14px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dev-hint {
    font-size: 0.78rem;
    color: var(--muted);
    font-weight: 700;
}

.dev-hint code {
    background: var(--surface-2);
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 0.75rem;
    color: #f59e0b;
}

.dev-json-area {
    width: 100%;
    min-height: 260px;
    background: #0a0a0f;
    border: 1px solid var(--border-2);
    border-radius: 8px;
    color: #86efac;
    font-family: 'Courier New', monospace;
    font-size: 0.78rem;
    padding: 10px;
    resize: vertical;
    outline: none;
    transition: border-color .15s;
}

.dev-json-area:focus { border-color: #f59e0b; }

.dev-error {
    font-size: 0.78rem;
    font-weight: 700;
    color: #ef4444;
    min-height: 18px;
}

.dev-popup-footer {
    padding: 10px 14px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    background: var(--surface-2);
    flex-shrink: 0;
}

.dev-save-btn, .dev-cancel-btn, .dev-copy-btn {
    padding: 6px 16px;
    border-radius: 8px;
    border: none;
    font-family: 'Nunito', sans-serif;
    font-size: 0.8rem;
    font-weight: 800;
    cursor: pointer;
    transition: background .1s;
}

.dev-save-btn, .dev-copy-btn { background: #f59e0b; color: #0a0a0f; }
.dev-save-btn:hover, .dev-copy-btn:hover { background: #fbbf24; }
.dev-cancel-btn { background: var(--border-2); color: var(--text); }
.dev-cancel-btn:hover { background: #444460; }

#achievements-overlay,
#settings-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1100;
    padding: 16px;
    backdrop-filter: blur(3px);
}

#achievements-overlay.hidden,
#settings-overlay.hidden { display: none; }

#achievements-popup {
    background: var(--surface);
    border: 1px solid var(--border-2);
    border-radius: 16px;
    width: 100%;
    max-width: 740px;
    max-height: 86vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 32px 80px rgba(0,0,0,.7);
    animation: popIn .18s ease-out;
}

#achievements-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 16px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    font-size: 1rem;
    font-weight: 900;
    color: var(--text);
}

#achievements-close {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    border: none;
    background: var(--border-2);
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 900;
    cursor: pointer;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .1s;
    line-height: 1;
}

#achievements-close:hover { background: #444460; }

#achievements-body {
    overflow-y: auto;
    padding: 14px;
    flex: 1;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#achievements-body::-webkit-scrollbar { width: 6px; }
#achievements-body::-webkit-scrollbar-track { background: transparent; }
#achievements-body::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 3px; }

.ach-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px;
}

.ach-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.ach-section-name {
    font-size: 0.85rem;
    font-weight: 900;
    color: var(--text);
}

.ach-section-count {
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--muted);
}

.ach-progress-bar {
    height: 4px;
    background: var(--border-2);
    border-radius: 2px;
    margin-bottom: 12px;
    overflow: hidden;
}

.ach-progress-fill {
    height: 100%;
    background: var(--green);
    border-radius: 2px;
    transition: width .4s ease;
}

.ach-badge-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.ach-badge-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    cursor: default;
    border-radius: 8px;
    transition: background .1s;
}

.ach-badge-cell:hover { background: var(--surface-2); }

.ach-badge-img {
    width: 70%;
    max-width: 72px;
    height: auto;
    display: block;
    transition: filter .2s;
}

.ach-badge-img.earned {
    filter: drop-shadow(0 0 6px rgba(251,191,36,0.35));
}

.ach-badge-img.locked {
    filter: brightness(0) saturate(0) opacity(0.2);
}


#ach-tooltip {
    position: fixed;
    background: #e8e8f0;
    color: #0d0d12;
    font-family: 'Nunito', sans-serif;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 5px 10px;
    border-radius: 5px;
    pointer-events: none;
    z-index: 9999;
    opacity: 0;
    transition: opacity .12s;
    transform: translateX(-50%) translateY(-100%);
    max-width: 220px;
    white-space: normal;
    text-align: center;
    line-height: 1.4;
}

#ach-tooltip.visible { opacity: 1; }

#settings-popup {
    background: var(--surface);
    border: 1px solid var(--border-2);
    border-radius: 16px;
    width: 100%;
    max-width: 440px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 32px 80px rgba(0,0,0,.7);
    animation: popIn .18s ease-out;
}

#settings-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 16px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    font-size: 1rem;
    font-weight: 900;
    color: var(--text);
}

#settings-close {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    border: none;
    background: var(--border-2);
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 900;
    cursor: pointer;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .1s;
    line-height: 1;
}

#settings-close:hover { background: #444460; }

#settings-body {
    padding: 16px;
    background: var(--bg);
}

.settings-section {
    display: flex;
    flex-direction: column;
}



.settings-row:last-child { border-bottom: none; }

.settings-row-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.settings-label {
    font-size: 0.88rem;
    font-weight: 800;
    color: var(--text);
}

.settings-desc {
    font-size: 0.74rem;
    color: var(--muted);
    font-weight: 600;
}

.settings-toggle {
    padding: 5px 16px;
    border-radius: 20px;
    border: 1.5px solid var(--border-2);
    background: transparent;
    color: var(--muted);
    font-family: 'Nunito', sans-serif;
    font-size: 0.78rem;
    font-weight: 800;
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 58px;
    text-align: center;
}

.settings-toggle.active {
    background: var(--green-bg);
    border-color: var(--green);
    color: var(--green);
}

.settings-btn {
    padding: 5px 16px;
    border-radius: 8px;
    border: 1.5px solid var(--border-2);
    background: transparent;
    color: var(--text);
    font-family: 'Nunito', sans-serif;
    font-size: 0.78rem;
    font-weight: 800;
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
    flex-shrink: 0;
}

.settings-btn:hover { background: var(--surface-2); }

.settings-btn-danger { color: #ef4444; border-color: #7f1d1d; }
.settings-btn-danger:hover { background: #1c0a0a; color: #fca5a5; }

.settings-hr {
    height: 1px;
    background: var(--border);
    margin: 6px 0;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 16px;
    backdrop-filter: blur(3px);
}

.modal-popup {
    background: var(--surface);
    border: 1px solid var(--border-2);
    border-radius: 14px;
    width: 100%;
    max-width: 520px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 24px 70px rgba(0,0,0,.7);
    animation: popIn .16s ease-out;
}

.modal-popup-danger {
    border-color: #7f1d1d;
    max-width: 400px;
}

.modal-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
    font-weight: 900;
    color: var(--text);
    flex-shrink: 0;
}

.modal-header-danger {
    background: #1c0a0a;
    border-color: #7f1d1d;
    color: #fca5a5;
}

.modal-close {
    width: 28px;
    height: 28px;
    border: none;
    background: var(--border-2);
    border-radius: 7px;
    font-size: 1rem;
    font-weight: 900;
    cursor: pointer;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .1s;
    flex-shrink: 0;
}

.modal-close:hover { background: #444460; }

.modal-close-danger {
    background: #2c1010;
    color: #fca5a5;
}

.modal-close-danger:hover { background: #3d1515; }

.modal-body {
    padding: 14px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.modal-hint {
    font-size: 0.8rem;
    color: var(--muted);
    font-weight: 700;
    line-height: 1.4;
}

.modal-textarea {
    width: 100%;
    min-height: 180px;
    background: #0a0a0f;
    border: 1px solid var(--border-2);
    border-radius: 8px;
    color: #86efac;
    font-family: 'Courier New', monospace;
    font-size: 0.78rem;
    padding: 10px;
    resize: vertical;
    outline: none;
    transition: border-color .15s;
}

.modal-textarea:focus { border-color: var(--blue); }

.modal-error {
    font-size: 0.78rem;
    font-weight: 700;
    color: #ef4444;
    min-height: 18px;
}

.modal-footer {
    padding: 10px 14px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    background: var(--surface-2);
    flex-shrink: 0;
}

.modal-btn {
    padding: 6px 16px;
    border-radius: 8px;
    border: none;
    background: var(--blue);
    color: #0a0a0f;
    font-family: 'Nunito', sans-serif;
    font-size: 0.8rem;
    font-weight: 800;
    cursor: pointer;
    transition: background .1s;
}

.modal-btn:hover { background: var(--blue-hover); }

.modal-btn-red { background: #ef4444; color: #fff; }
.modal-btn-red:hover { background: #f87171; }

.modal-btn-secondary {
    padding: 6px 16px;
    border-radius: 8px;
    border: none;
    background: var(--border-2);
    color: var(--text);
    font-family: 'Nunito', sans-serif;
    font-size: 0.8rem;
    font-weight: 800;
    cursor: pointer;
    transition: background .1s;
}

.modal-btn-secondary:hover { background: #444460; }

.ach-shiny-badge {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--surface-2);
    border: 2px solid var(--border-2);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    transition: all .2s;
}

.ach-shiny-badge.earned {
    background: #130f04;
    border-color: #f59e0b;
    box-shadow: 0 0 14px rgba(245,158,11,.3);
}

.shiny-gem-svg {
    width: 44px;
    height: 44px;
}

.ach-shiny-num {
    font-size: 0.6rem;
    font-weight: 900;
    color: #6b6b80;
    font-family: 'Nunito', sans-serif;
}

.ach-shiny-badge.earned .ach-shiny-num {
    color: #f59e0b;
}

.achievement-toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(90px);
    background: linear-gradient(135deg, #1a1208 0%, #0f0f18 60%);
    border: 1px solid #78350f;
    border-radius: 14px;
    padding: 0;
    display: flex;
    align-items: stretch;
    gap: 0;
    box-shadow: 0 0 0 1px rgba(245,158,11,.15), 0 16px 48px rgba(0,0,0,.7), 0 0 32px rgba(245,158,11,.08);
    z-index: 9000;
    opacity: 0;
    transition: transform .35s cubic-bezier(.175,.885,.32,1.275), opacity .25s ease;
    pointer-events: all;
    min-width: 300px;
    max-width: 420px;
    overflow: hidden;
}

.achievement-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.achievement-toast.hiding {
    animation: toastSlideOut .3s ease-in forwards;
}

@keyframes toastSlideOut {
    to { opacity: 0; transform: translateX(-50%) translateY(90px); }
}

.toast-shimmer {
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, transparent 40%, rgba(245,158,11,.06) 50%, transparent 60%);
    animation: toastShimmer 2.5s ease-in-out infinite;
    pointer-events: none;
}

@keyframes toastShimmer {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(200%); }
}

.toast-icon {
    width: 56px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: linear-gradient(160deg, #1c1408, #0f0a02);
    border-right: 1px solid rgba(245,158,11,.2);
}

.toast-content {
    flex: 1;
    padding: 12px 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.toast-label {
    font-family: 'Nunito', sans-serif;
    font-size: 0.64rem;
    font-weight: 900;
    color: #f59e0b;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.toast-msg {
    font-family: 'Nunito', sans-serif;
    font-size: 0.86rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1.3;
}

.toast-close {
    background: none;
    border: none;
    color: rgba(245,158,11,.4);
    font-size: 1.1rem;
    font-weight: 900;
    cursor: pointer;
    padding: 8px 12px 8px 4px;
    line-height: 1;
    flex-shrink: 0;
    align-self: flex-start;
    transition: color .1s;
}

.toast-close:hover { color: #f59e0b; }

.toast-timer {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
    border-radius: 0 0 0 14px;
    animation: toastDrain 4.5s linear forwards;
    width: 100%;
    transform-origin: left;
}

@keyframes toastDrain {
    from { transform: scaleX(1); }
    to   { transform: scaleX(0); }
}

.event-only {
    flex-direction: column;
    gap: 10px;
}

.event-only-icon {
    font-size: 2rem;
}

#header-gen-tabs {
    display: flex;
    gap: 4px;
    flex-wrap: nowrap;
    align-items: center;
    width: 100%;
    justify-content: center;
    padding: 6px 20px;
    overflow-x: auto;
    scrollbar-width: none;
    border-top: 1px solid var(--border);
    background: #0a0a0f;
}

#header-gen-tabs:empty { display: none; }

.header-gen-tab {
    padding: 4px 10px;
    border: 1.5px solid var(--border-2);
    border-radius: 20px;
    background: transparent;
    color: var(--muted);
    font-family: 'Nunito', sans-serif;
    font-size: 0.75rem;
    font-weight: 800;
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
    flex-shrink: 0;
}

.header-gen-tab:hover {
    background: var(--surface-2);
    color: var(--text);
    border-color: var(--border-2);
}

.gen-divider {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 2px 4px;
    scroll-margin-top: 72px;
}

.gen-divider::before,
.gen-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-2));
}

.gen-divider::before {
    background: linear-gradient(90deg, transparent, var(--border-2));
}

.gen-divider::after {
    background: linear-gradient(90deg, var(--border-2), transparent);
}

.gen-divider-label {
    font-size: 0.7rem;
    font-weight: 900;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    white-space: nowrap;
    flex-shrink: 0;
}

.card-meta {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 3px 6px 2px;
}

.card-dex, .card-box {
    font-size: 0.7rem;
    font-weight: 800;
    font-family: 'Courier New', monospace;
    color: #9ca3b0;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1px 5px;
    letter-spacing: 0.3px;
}

.card-div-0 { grid-row: unset; background: var(--border); height: 1px; }

.card-div-meta  { background: var(--border); }
.card-div-marks { background: var(--border); }

.card-marks-bar {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 7px 8px;
}

.mark-icon {
    font-size: 0.9rem;
    line-height: 1;
    transition: color .15s, transform .15s;
    cursor: default;
}

.mark-icon.on  { color: #ffffff; }
.mark-icon.off { color: transparent; }

.poke-card.shiny-collected {
    background: #181208;
    border-color: #92630a;
}

.card-check {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 10px;
}

.shiny-cb {
    width: 24px;
    height: 24px;
    cursor: pointer;
    accent-color: #f59e0b;
}

.shiny-cb:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.ctx-menu {
    position: fixed;
    z-index: 5000;
    background: var(--surface);
    border: 1px solid var(--border-2);
    border-radius: 10px;
    padding: 4px;
    box-shadow: 0 8px 32px rgba(0,0,0,.6);
    min-width: 160px;
    animation: popIn .12s ease-out;
}

.ctx-menu.hidden { display: none; }

.ctx-item {
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    color: var(--text);
    font-family: 'Nunito', sans-serif;
    font-size: 0.84rem;
    font-weight: 700;
    padding: 8px 12px;
    border-radius: 7px;
    cursor: pointer;
    transition: background .1s;
}

.ctx-item:hover { background: var(--surface-2); }

.marks-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.marks-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 12px 8px;
    background: var(--surface-2);
    border: 1.5px solid var(--border-2);
    border-radius: 10px;
    cursor: pointer;
    transition: all .15s;
}

.marks-btn:hover { border-color: var(--border-2); background: var(--surface); }

.marks-btn.active {
    border-color: #f59e0b;
    background: #130f04;
}

.marks-btn-icon {
    font-size: 1.4rem;
    color: var(--muted);
    transition: color .15s;
}

.marks-btn.active .marks-btn-icon { color: #ffffff; }

.marks-btn-label {
    font-family: 'Nunito', sans-serif;
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--muted);
    transition: color .15s;
}

.marks-btn.active .marks-btn-label { color: #f59e0b; }

#shiny-filter-row {
    gap: 4px;
    align-items: center;
}

.sprite-compare-body {
    display: flex;
    align-items: stretch;
    background: #1a1a28;
    border-radius: 0 0 14px 14px;
    overflow: hidden;
    min-height: 260px;
}

.sprite-compare-pane {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 24px 16px;
    background: #12121e;
}

.sprite-compare-pane.sprite-compare-locked {
    opacity: 0.5;
}

.sprite-compare-divider {
    width: 1px;
    background: var(--border-2);
    flex-shrink: 0;
}

.sprite-compare-label {
    font-family: 'Nunito', sans-serif;
    font-size: 0.78rem;
    font-weight: 900;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.locked-badge {
    background: #7f1d1d;
    color: #fca5a5;
    font-size: 0.62rem;
    padding: 1px 6px;
    border-radius: 4px;
    letter-spacing: 0;
    text-transform: none;
}

.sprite-compare-img-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 180px;
    height: 180px;
    border-radius: 12px;
    background: #0d0d16;
    border: 1px solid var(--border);
}

.sprite-compare-img-wrap img {
    max-width: 160px;
    max-height: 160px;
    object-fit: contain;
    image-rendering: pixelated;
}

.sprite-locked-icon {
    font-size: 2.5rem;
    opacity: 0.4;
}

.filter-select {
    padding: 4px 10px;
    border: 1.5px solid var(--border-2);
    border-radius: 20px;
    background: var(--surface);
    color: var(--text);
    font-family: 'Nunito', sans-serif;
    font-size: 0.78rem;
    font-weight: 800;
    cursor: pointer;
    outline: none;
    transition: border-color .15s;
    appearance: none;
    -webkit-appearance: none;
    padding-right: 28px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%236b6b80'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.filter-select:focus { border-color: var(--red); }

.filter-select option {
    background: var(--surface);
    color: var(--text);
}

#settings-body {
    padding: 0 0 16px;
    background: var(--bg);
    overflow-y: auto;
    max-height: calc(86vh - 56px);
}

#settings-body::-webkit-scrollbar { width: 6px; }
#settings-body::-webkit-scrollbar-track { background: transparent; }
#settings-body::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 3px; }

.settings-group-title {
    padding: 14px 16px 6px;
    font-size: 0.65rem;
    font-weight: 900;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    background: var(--bg);
}

.settings-section {
    background: var(--surface);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin-bottom: 8px;
    display: flex;
    flex-direction: column;
}

.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 13px 16px;
    border-bottom: 1px solid var(--border);
}

.sprite-unavail {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 100%;
    width: 100%;
}

.sprite-unavail-icon {
    font-size: 2rem;
    color: var(--border-2);
    line-height: 1;
}

.sprite-unavail-text {
    font-family: 'Nunito', sans-serif;
    font-size: 0.82rem;
    font-weight: 900;
    color: var(--muted);
}

.sprite-unavail-sub {
    font-family: 'Nunito', sans-serif;
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--border-2);
}

/* ═══════════════════════════════════════════════════════════════════
   MOBILE LAYOUT  ≤ 768px
   Desktop (> 768px) is completely untouched.
   ═══════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {

    /* ── NAVIGATION BAR ── */
    #NavigationBar {
        height: 2.6rem;
        overflow-x: auto;
        overflow-y: hidden;
        flex-wrap: nowrap;
        scrollbar-width: none;
    }
    #NavigationBar::-webkit-scrollbar { display: none; }
    .navigationItem { padding-left: 0.75rem; font-size: 0.82rem; white-space: nowrap; }

    /* ── HEADER: two-row stacked layout ── */
    header {
        height: auto;
        flex-direction: column;
        align-items: stretch;
        padding: 0;
        gap: 0;
        position: sticky;
        top: 0;
        z-index: 200;
    }

    /* Row 1: logo + progress + filter */
    .header-top-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 12px;
        height: 48px;
        gap: 8px;
        border-bottom: 1px solid var(--border);
    }

    header h1 {
        font-size: 1rem;
        gap: 6px;
    }

    header h1 img {
        width: 28px;
        height: 28px;
    }

    .header-right {
        flex: 1;
        justify-content: flex-end;
        gap: 6px;
    }

    /* Hide desktop-only header items on mobile */
    #btn-achievements,
    #btn-settings,
    #btn-download-json,
    .header-divider {
        display: none;
    }

    #progress {
        font-size: 0.75rem;
        padding: 3px 10px;
    }

    .filter-select {
        font-size: 0.72rem;
        padding: 4px 24px 4px 8px;
        background-position: right 6px center;
    }

    /* Row 2: gen tabs strip */
    #header-gen-tabs {
        display: flex;
        gap: 6px;
        padding: 6px 12px;
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: none;
        border-bottom: 1px solid var(--border);
        background: #0a0a0f;
        justify-content: flex-start;
        flex: unset;
    }

    #header-gen-tabs::-webkit-scrollbar { display: none; }

    .header-gen-tab {
        flex-shrink: 0;
        padding: 5px 12px;
        font-size: 0.72rem;
        min-height: 32px;
    }

    /* ── BOTTOM NAV BAR ── */
    #mobile-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 56px;
        background: #0a0a0f;
        border-top: 1px solid var(--border);
        display: flex;
        align-items: center;
        justify-content: space-around;
        z-index: 300;
        padding-bottom: env(safe-area-inset-bottom);
    }

    .mobile-nav-btn {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 3px;
        background: none;
        border: none;
        color: var(--muted);
        font-family: 'Nunito', sans-serif;
        font-size: 0.58rem;
        font-weight: 800;
        cursor: pointer;
        padding: 6px 20px;
        transition: color .15s;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .mobile-nav-btn:hover,
    .mobile-nav-btn.active { color: var(--text); }

    .mobile-nav-icon {
        font-size: 1.2rem;
        line-height: 1;
    }

    /* ── GRID: add bottom padding for nav bar ── */
    #pokemon-grid {
        padding-bottom: 72px;
    }

    /* ── CARDS: 5-tile flex row ── */
    .poke-card {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-evenly;
        border-radius: 10px;
        padding: 10px 8px;
        gap: 0;
    }

    /* Tile 1: image */
    .card-sprite {
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        padding: 0;
        border-radius: 0;
    }

    .card-sprite img,
    .card-sprite picture img {
        width: 52px;
        height: 52px;
    }

    /* Tile 2: dex + box stacked */
    .card-meta {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        padding: 0;
        flex-shrink: 0;
    }

    .card-dex, .card-box {
        font-size: 0.6rem;
        padding: 1px 4px;
        text-align: center;
    }

    .card-div-meta { display: none; }

    /* Tile 3: name + checkboxes stacked */
    .card-name {
        display: block;
        text-align: center;
        padding: 0 0 4px 0;
        font-size: 0.78rem;
        flex-shrink: 0;
        max-width: 90px;
        line-height: 1.2;
    }

    .card-div-1 { display: none; }

    .card-check {
        display: flex;
        justify-content: center;
        padding: 0;
        gap: 10px;
        flex-shrink: 0;
    }

    .card-check input[type=checkbox] {
        width: 24px;
        height: 24px;
    }

    .shiny-cb {
        width: 20px;
        height: 20px;
    }

    .card-div-2 { display: none; }

    /* Tile 3 wrapper — name and checkbox need to be a column together */
    .card-name,
    .card-check {
        /* handled via order in the flex row — they sit adjacent naturally */
    }

    /* Tile 4: marks 2x3 grid */
    .card-marks-bar {
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: repeat(3, auto);
        gap: 3px 6px;
        padding: 0;
        flex-shrink: 0;
        align-items: center;
        justify-items: center;
    }

    .mark-icon { font-size: 0.85rem; }

    .card-div-marks { display: none; }

    /* Tile 5: site links 2x2 grid */
    .card-links {
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: 1fr 1fr;
        gap: 4px;
        padding: 0;
        flex-shrink: 0;
    }

    .site-link {
        width: 26px;
        height: 26px;
    }

    .card-edit-btn {
        position: absolute;
        top: 4px;
        right: 4px;
        width: 22px;
        height: 22px;
        font-size: 0.65rem;
    }

    .card-dex, .card-box {
        font-size: 0.62rem;
        padding: 1px 4px;
    }

    /* ── POPUPS: full screen on mobile ── */
    #popup-overlay,
    #achievements-overlay,
    #settings-overlay {
        padding: 0;
        align-items: flex-end;
    }

    #popup,
    #achievements-popup,
    #settings-popup {
        max-width: 100%;
        max-height: 92vh;
        border-radius: 18px 18px 0 0;
        animation: slideUp .22s ease-out;
    }

    @keyframes slideUp {
        from { transform: translateY(30px); opacity: 0; }
        to   { transform: translateY(0);    opacity: 1; }
    }

    #popup-tabs {
        gap: 3px;
    }

    .gen-tab {
        padding: 3px 6px;
        font-size: 0.65rem;
    }

    /* ── SETTINGS: full width ── */
    #settings-body {
        max-height: 80vh;
    }

    /* ── ACHIEVEMENTS: full width ── */
    #achievements-body {
        max-height: 80vh;
    }

    .ach-badge-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 6px;
    }

    /* ── GEN DIVIDER ── */
    .gen-divider {
        scroll-margin-top: 112px;
    }

    /* ── CONTEXT MENU: larger touch targets ── */
    .ctx-item {
        padding: 12px 16px;
        font-size: 0.9rem;
    }

    /* ── TOAST: full width ── */
    .achievement-toast {
        bottom: 68px;
        min-width: calc(100vw - 32px);
        max-width: calc(100vw - 32px);
    }
}

/* ── Very small screens ── */
@media (max-width: 380px) {
    header h1 span { display: none; }
    .header-gen-tab { padding: 5px 9px; }
}

/* Desktop: tile wrapper is transparent */
.card-name-check-tile {
    display: contents;
}

/* Mobile: tile wrapper becomes a flex column */
@media (max-width: 768px) {
    .card-name-check-tile {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        flex-shrink: 0;
        max-width: 90px;
    }

    .card-name-check-tile .card-div-1 { display: none; }
}

@media (max-width: 768px) {
    /* Stack sprite compare vertically */
    .sprite-compare-body {
        flex-direction: column;
    }

    .sprite-compare-divider {
        width: 100%;
        height: 1px;
    }

    .sprite-compare-pane {
        padding: 16px;
    }

    /* No wobble on mobile bubbles */
    .poke-bubble {
        animation: bubbleFloatMobile linear forwards;
    }

    @keyframes bubbleFloatMobile {
        0%   { transform: translateX(0)     translateY(0px);  opacity: 0; }
        6%   { opacity: 1; }
        90%  { opacity: 1; }
        100% { transform: translateX(108vw) translateY(0px);  opacity: 0; }
    }
}

.loc-tap-tip {
    position: fixed;
    background: #e8e8f0;
    color: #0d0d12;
    font-family: 'Nunito', sans-serif;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 5px 10px;
    border-radius: 6px;
    pointer-events: none;
    z-index: 9999;
    transform: translateX(-50%) translateY(-100%);
    white-space: normal;
    max-width: 220px;
    text-align: center;
    line-height: 1.4;
    animation: tipFade 2.5s ease forwards;
}

@keyframes tipFade {
    0%   { opacity: 0; transform: translateX(-50%) translateY(-110%); }
    15%  { opacity: 1; transform: translateX(-50%) translateY(-100%); }
    75%  { opacity: 1; }
    100% { opacity: 0; }
}

@media (max-width: 768px) {
    .poke-card {
        transform: none !important;
        transition: none !important;
    }

    .poke-card:hover {
        transform: none !important;
        box-shadow: none !important;
    }
}