@import url('https://fonts.cdnfonts.com/css/pokemon-solid');
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;700;800&display=swap');

/* ─── Tokens ─────────────────────────────────────────────────────────────────── */
:root {
    --bg: #f0f4f8;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --border: #e2e8f0;
    --text: #2d3436;
    --text-muted: #64748b;
    --accent: #3b4cca;
    --yellow: #ffcb05;
    --radius: 24px;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
    --shadow-md: 0 8px 24px rgba(0,0,0,0.08);
    --shadow-lg: 0 20px 40px rgba(0,0,0,0.12);

    --fire: #ff7675; --grass: #55efc4; --water: #74b9ff; --electric: #ffe142;
    --poison: #a29bfe; --bug: #fab1a0; --ground: #e17055; --normal: #dfe6e9;
    --fairy: #fd79a8; --fighting: #e17055; --psychic: #eaeda1; --rock: #b2bec3;
    --ghost: #8e9eab; --ice: #81ecec; --dragon: #74b9ff; --dark: #8e9eab;
    --steel: #b2bec3; --flying: #a8edea;
}

[data-theme="dark"] {
    --bg: #0f172a;
    --surface: #1e293b;
    --surface-2: #162032;
    --border: #334155;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
    --shadow-md: 0 8px 24px rgba(0,0,0,0.35);
    --shadow-lg: 0 20px 40px rgba(0,0,0,0.45);
}

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

body {
    background: var(--bg);
    color: var(--text);
    padding: 40px 20px 80px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    transition: background 0.3s ease, color 0.3s ease;
}

/* ─── Splash Screen ──────────────────────────────────────────────────────────── */
#splash {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: #1a1a2e;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

#splash.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.splash-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

/* Pokébola */
.pokeball-wrap {
    position: relative;
    width: 120px;
    height: 120px;
}

.pokeball {
    width: 120px;
    height: 120px;
    animation: pokeSpin 1.2s linear infinite;
    filter: drop-shadow(0 0 20px rgba(231,76,60,0.5));
}

@keyframes pokeSpin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* Pulso no botão central */
.splash-btn-inner {
    animation: btnPulse 1.2s ease-in-out infinite;
}

@keyframes btnPulse {
    0%, 100% { fill: white; }
    50%       { fill: #ffcb05; }
}

/* Título */
.splash-title {
    font-family: 'Pokemon Solid', sans-serif;
    font-size: 3rem;
    letter-spacing: 6px;
    color: #ffcb05;
    text-shadow: 4px 4px 0 #e74c3c;
    -webkit-text-stroke: 1px #e74c3c;
    animation: titlePulse 2s ease-in-out infinite;
}

@keyframes titlePulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.8; }
}

/* Barra de progresso */
.splash-progress-wrap {
    width: 220px;
    height: 6px;
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
    overflow: hidden;
}

.splash-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #e74c3c, #ffcb05);
    border-radius: 3px;
    transition: width 0.4s ease;
}

/* Mensagem */
.splash-msg {
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(255,255,255,0.5);
    letter-spacing: 1px;
    text-transform: uppercase;
    min-height: 20px;
}

/* ─── Header ─────────────────────────────────────────────────────────────────── */
header {
    text-align: center;
    margin-bottom: 40px;
    position: relative;
}

header h1 {
    font-family: 'Pokemon Solid', sans-serif;
    font-size: 3.5rem;
    letter-spacing: 4px;
    color: var(--yellow);
    text-shadow: 4px 4px 0px var(--accent);
    -webkit-text-stroke: 1px var(--accent);
}

.header-sub {
    color: var(--text-muted);
    margin-top: 6px;
    font-size: 0.9rem;
}

/* Dark toggle: canto superior direito do header */
.dark-toggle {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: 50px;
    padding: 8px 14px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.dark-toggle:hover {
    transform: scale(1.1) rotate(15deg);
    box-shadow: var(--shadow-md);
}

/* ─── Filter Bar (Premium Redesign) ─────────────────────────────────────────── */
.filter-bar {
    max-width: 900px;
    margin: 0 auto 36px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Busca principal */
.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 18px;
    font-size: 1rem;
    pointer-events: none;
    opacity: 0.5;
}

.search-input {
    width: 100%;
    padding: 16px 48px;
    border-radius: 16px;
    border: 2px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-size: 1rem;
    font-family: inherit;
    font-weight: 500;
    outline: none;
    box-shadow: var(--shadow-sm);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-input::placeholder { color: var(--text-muted); }

.search-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(59,76,202,0.1);
}

.search-clear {
    position: absolute;
    right: 14px;
    background: var(--surface-2);
    border: none;
    border-radius: 50%;
    width: 26px;
    height: 26px;
    font-size: 1rem;
    cursor: pointer;
    color: var(--text-muted);
    display: none;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
    line-height: 1;
}

.search-clear.visible { display: flex; }
.search-clear:hover { background: var(--border); color: var(--text); }

/* Linha de controles secundários */
.filter-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* Nova estrutura: regiões scrolláveis + sort fixo */
.filter-controls-row {
    display: flex;
    align-items: center;
    gap: 12px;
    overflow: hidden;
}

/* Region chips - scrollável horizontalmente */
.filter-chip-group {
    display: flex;
    gap: 8px;
    flex: 1;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
}

.filter-chip-group::-webkit-scrollbar { display: none; }

.region-chip {
    padding: 8px 16px;
    border-radius: 50px;
    border: 2px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    flex-shrink: 0;
    white-space: nowrap;
    transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.region-chip:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(59,76,202,0.15);
}

.region-chip.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
    box-shadow: 0 4px 12px rgba(59,76,202,0.3);
}

/* Cores por região quando ativa */
.region-chip.kanto.active  { background: #e74c3c; border-color: #e74c3c; box-shadow: 0 4px 12px rgba(231,76,60,0.35); }
.region-chip.johto.active  { background: #8e44ad; border-color: #8e44ad; box-shadow: 0 4px 12px rgba(142,68,173,0.35); }
.region-chip.hoenn.active  { background: #2980b9; border-color: #2980b9; box-shadow: 0 4px 12px rgba(41,128,185,0.35); }
.region-chip.sinnoh.active { background: #d35400; border-color: #d35400; box-shadow: 0 4px 12px rgba(211,84,0,0.35); }
.region-chip.unova.active  { background: #1a1a2e; border-color: #1a1a2e; box-shadow: 0 4px 12px rgba(26,26,46,0.45); }
.region-chip.kalos.active  { background: #1abc9c; border-color: #1abc9c; box-shadow: 0 4px 12px rgba(26,188,156,0.35); }

/* Sort select discreto */
.sort-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 8px 14px;
    transition: border-color 0.2s ease;
}

.sort-wrapper:focus-within { border-color: var(--accent); }

/* Nova versão para estar ao lado das regiões */
.sort-wrapper-mobile {
    display: none;
    align-items: center;
    gap: 8px;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 8px 12px;
    flex-shrink: 0;
    transition: border-color 0.2s ease;
}

.sort-icon {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 800;
}

.sort-select {
    border: none;
    background: transparent;
    color: var(--text);
    font-size: 0.8rem;
    font-weight: 700;
    font-family: inherit;
    outline: none;
    cursor: pointer;
}

/* Footer do filtro */
.filter-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 4px;
}

.results-count {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
}

.clear-filters {
    background: none;
    border: 1.5px solid var(--border);
    border-radius: 50px;
    padding: 5px 14px;
    font-size: 0.75rem;
    font-weight: 700;
    font-family: inherit;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.clear-filters:hover {
    border-color: #e74c3c;
    color: #e74c3c;
}


/* ─── Grid ───────────────────────────────────────────────────────────────────── */
.pokeContainer {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

/* ─── Card ───────────────────────────────────────────────────────────────────── */
.pokemon {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 18px;
    text-align: center;
    cursor: pointer;
    border: 2px solid transparent;
    position: relative;
    box-shadow: var(--shadow-sm);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.35s ease,
                border-color 0.25s ease;
}

/* tipos no card — suporte a múltiplos */
.card-types {
    display: flex;
    gap: 6px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 6px 0 0;
}

.pokemon:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: var(--shadow-lg);
}

/* Micro-interaction: entrada em cascata */
@keyframes cardEnter {
    from { opacity: 0; transform: translateY(28px) scale(0.92); }
    to   { opacity: 1; transform: translateY(0)    scale(1); }
}

.pokemon.entering {
    animation: cardEnter 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.number { font-size: 0.85rem; color: var(--text-muted); font-weight: 700; }

.actions { display: flex; gap: 8px; }

.shiny-toggle, .compare-btn {
    background: var(--surface-2);
    border: none;
    padding: 9px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: transform 0.2s ease, background 0.2s ease;
}

.shiny-toggle:hover, .compare-btn:hover {
    transform: scale(1.2);
    background: var(--border);
}

/* Bob animation na imagem do card */
@keyframes bob {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-5px); }
}

.imgContainer {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    margin: 0 auto 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: bob 3s ease-in-out infinite;
}

.imgContainer img {
    width: 90px;
    height: 90px;
    transition: transform 0.3s ease;
}

/* Gen 1-5: pixel art animado */
.pixel-sprite {
    image-rendering: pixelated;
    transform: scale(1.6);
}

.pokemon:hover .pixel-sprite { transform: scale(1.9); }

/* Gen 6+: official artwork HD */
.hd-sprite {
    image-rendering: auto;
    transform: scale(1);
    object-fit: contain;
}

.pokemon:hover .hd-sprite { transform: scale(1.12); }

.name {
    font-family: 'Pokemon Solid', sans-serif;
    letter-spacing: 2px;
    color: var(--text);
    text-transform: capitalize;
    margin: 10px 0;
    font-size: 1.1rem;
}

.type {
    display: inline-block;
    padding: 5px 14px;
    border-radius: 12px;
    color: white;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.is-shiny {
    border-color: gold !important;
    box-shadow: 0 0 20px rgba(255,215,0,0.35) !important;
}

/* ─── Abilities no Card ──────────────────────────────────────────────────────── */
.abilities-section {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    justify-content: center;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

.ability-tag {
    font-size: 0.6rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 20px;
    background: var(--surface-2);
    color: var(--text-muted);
    text-transform: capitalize;
    letter-spacing: 0.2px;
    white-space: nowrap;
    border: 1px solid var(--border);
    transition: transform 0.15s ease;
}

.ability-tag:hover { transform: scale(1.06); }

/* Hidden ability: destaque sutil */
.ability-hidden {
    background: #fff8e6;
    color: #92400e;
    border-color: #fbbf24;
}

[data-theme="dark"] .ability-hidden {
    background: #2d2010;
    color: #fbbf24;
    border-color: #92400e;
}

/* ─── Skeleton ───────────────────────────────────────────────────────────────── */
.skeleton {
    background: var(--surface);
    height: 340px;
    border-radius: var(--radius);
    overflow: hidden;
    pointer-events: none;
    position: relative;
}

.skeleton::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.07), transparent);
    animation: wave 1.6s infinite;
}

@keyframes wave {
    from { transform: translateX(-100%); }
    to   { transform: translateX(100%); }
}

/* ─── Results Text ───────────────────────────────────────────────────────────── */
.resultsText {
    text-align: center;
    margin-bottom: 25px;
    font-weight: 700;
    color: var(--accent);
}

/* ─── Modal ──────────────────────────────────────────────────────────────────── */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(10, 20, 40, 0.75);
    backdrop-filter: blur(8px);
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal.open {
    display: flex;
    animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.modal-content {
    background: var(--surface);
    width: 100%;
    max-width: 540px;
    max-height: 88vh;
    overflow-y: auto;
    padding: 36px;
    border-radius: 28px;
    position: relative;
    text-align: center;
    animation: slideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.close {
    position: absolute;
    right: 20px;
    top: 16px;
    background: var(--surface-2);
    border: none;
    border-radius: 50%;
    width: 34px;
    height: 34px;
    font-size: 18px;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, color 0.2s ease;
}

.close:hover { transform: rotate(90deg); color: var(--text); }

/* ─── Modal Header ───────────────────────────────────────────────────────────── */
.modal-header { margin-bottom: 20px; }

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-8px); }
}

.modal-header img {
    width: 150px;
    height: 150px;
    object-fit: contain;
    animation: float 4s ease-in-out infinite;
    filter: drop-shadow(0 8px 16px rgba(0,0,0,0.12));
}

.modal-header h2 {
    font-family: 'Pokemon Solid', sans-serif;
    font-size: 1.7rem;
    letter-spacing: 3px;
    color: var(--text);
    text-transform: capitalize;
    margin: 8px 0 6px;
}

.modal-header .modal-id {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 700;
    display: block;
    margin-bottom: 8px;
}

.modal-types {
    display: flex;
    gap: 6px;
    justify-content: center;
}

/* ─── Modal Tabs ─────────────────────────────────────────────────────────────── */
.modal-tabs {
    display: flex;
    border-bottom: 2px solid var(--border);
    margin-bottom: 24px;
}

.modal-tab-btn {
    flex: 1;
    background: none;
    border: none;
    padding: 12px 8px;
    cursor: pointer;
    font-weight: 700;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.85rem;
    position: relative;
    transition: color 0.2s ease;
}

.modal-tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0; right: 0;
    height: 2px;
    background: var(--accent);
    transform: scaleX(0);
    transition: transform 0.25s ease;
}

.modal-tab-btn:hover  { color: var(--accent); }
.modal-tab-btn.active { color: var(--accent); }
.modal-tab-btn.active::after { transform: scaleX(1); }

.modal-tab-pane { display: none; }

.modal-tab-pane.active {
    display: block;
    animation: tabIn 0.25s ease;
}

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

/* ─── Stats ──────────────────────────────────────────────────────────────────── */
.stats-section {
    text-align: left;
    max-width: 380px;
    margin: 0 auto 20px;
}

.stats-section h4 {
    color: var(--text-muted);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 14px;
    font-weight: 800;
}

.stat-row { margin-bottom: 10px; }

.stat-label-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.72rem;
    font-weight: 800;
    margin-bottom: 4px;
    color: var(--text);
}

.stat-bar-bg {
    background: var(--border);
    height: 6px;
    border-radius: 3px;
    overflow: hidden;
}

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

.stat-bar-fill {
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--accent), #7c86e0);
    transform-origin: left;
    animation: barGrow 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.type-matchup-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    text-align: left;
    margin-top: 16px;
}

.matchup-section h4 {
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    font-weight: 800;
}

.matchup-section.strong h4 { color: #059669; }
.matchup-section.weak   h4 { color: #dc2626; }

.type-chips { display: flex; flex-wrap: wrap; gap: 4px; }

/* ─── Evolution Chain ────────────────────────────────────────────────────────── */
.evolution-chain {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    padding: 12px 0;
}

.evo-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 12px;
    border-radius: 16px;
    border: 2px solid transparent;
    transition: background 0.2s ease,
                transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
                border-color 0.2s ease;
}

.evo-step:hover {
    background: var(--surface-2);
    transform: translateY(-4px) scale(1.05);
}

.evo-step.current-pokemon {
    background: var(--surface-2);
    border-color: var(--accent);
}

.evo-step img {
    width: 76px;
    height: 76px;
    object-fit: contain;
    image-rendering: pixelated;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.12));
}

.evo-name {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: capitalize;
    color: var(--text);
}

.evo-id { font-size: 0.6rem; color: var(--text-muted); }

.evo-arrow {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    color: var(--text-muted);
    font-size: 1.2rem;
}

.evo-trigger {
    font-size: 0.55rem;
    color: var(--text-muted);
    text-align: center;
    max-width: 64px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.evo-loading {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.evo-loading::after {
    content: '';
    display: block;
    width: 28px;
    height: 28px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    margin: 10px auto 0;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.evo-empty, .no-data-message {
    text-align: center;
    color: var(--text-muted);
    padding: 28px;
    font-size: 0.85rem;
    font-style: italic;
}

/* ─── Moves Table ────────────────────────────────────────────────────────────── */
#movesContainer {
    max-height: 360px;
    overflow-y: auto;
    border-radius: 10px;
}

.moves-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.moves-table thead {
    position: sticky;
    top: 0;
    background: var(--surface);
    z-index: 1;
}

.moves-table th {
    padding: 10px 8px;
    border-bottom: 2px solid var(--border);
    font-weight: 800;
    color: var(--text-muted);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: left;
}

.moves-table td {
    padding: 9px 8px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}

.moves-table tbody tr { transition: background 0.15s ease; }
.moves-table tbody tr:hover { background: var(--surface-2); }

.move-level {
    background: linear-gradient(135deg, var(--accent), #5b6ee0);
    color: white;
    padding: 4px 9px;
    border-radius: 8px;
    font-weight: 800;
    font-size: 0.7rem;
    display: inline-block;
    min-width: 34px;
    text-align: center;
}

.move-name {
    text-transform: capitalize;
    font-weight: 600;
    padding-left: 8px;
}

/* ─── Music Player Premium ───────────────────────────────────────────────────── */
.music-player {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 500;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.2),
        inset 0 1px 1px rgba(255, 255, 255, 0.1);
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    min-width: 300px;
    max-width: 400px;
    backdrop-filter: blur(16px) saturate(180%);
}

/* Hover: mais opaco e elevado */
.music-player:hover {
    background: rgba(15, 23, 42, 0.85);
    border-color: rgba(59, 76, 202, 0.3);
    box-shadow: 
        0 12px 48px rgba(0, 0, 0, 0.3),
        0 0 32px rgba(59, 76, 202, 0.15),
        inset 0 1px 1px rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

/* Dark mode: ajusta a cor de fundo */
[data-theme="dark"] .music-player {
    background: rgba(15, 23, 42, 0.8);
}

[data-theme="dark"] .music-player:hover {
    background: rgba(15, 23, 42, 0.9);
}

/* Light mode: versão clara */
[data-theme="light"] .music-player {
    background: rgba(255, 255, 255, 0.7);
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.08),
        inset 0 1px 1px rgba(255, 255, 255, 0.5);
}

[data-theme="light"] .music-player:hover {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(59, 76, 202, 0.2);
    box-shadow: 
        0 12px 48px rgba(0, 0, 0, 0.12),
        0 0 32px rgba(59, 76, 202, 0.1),
        inset 0 1px 1px rgba(255, 255, 255, 0.6);
}

.music-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    overflow: hidden;
    min-width: 0;
}

.music-note {
    font-size: 1.2rem;
    color: var(--accent);
    animation: notePulse 2s ease-in-out infinite;
    flex-shrink: 0;
    filter: drop-shadow(0 0 4px rgba(59, 76, 202, 0.3));
}

@keyframes notePulse {
    0%, 100% { opacity: 1; transform: scale(1) rotate(0deg); }
    50%       { opacity: 0.7; transform: scale(1.1) rotate(8deg); }
}

.music-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
    letter-spacing: 0.3px;
}

.music-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.music-btn {
    background: rgba(59, 76, 202, 0.1);
    border: 1px solid rgba(59, 76, 202, 0.2);
    cursor: pointer;
    font-size: 0.95rem;
    padding: 6px 8px;
    border-radius: 10px;
    color: var(--text);
    transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.music-btn:hover {
    background: rgba(59, 76, 202, 0.2);
    border-color: rgba(59, 76, 202, 0.4);
    transform: scale(1.12);
    box-shadow: 0 4px 12px rgba(59, 76, 202, 0.2);
}

.music-btn:active {
    transform: scale(0.96);
}

.music-play {
    font-size: 1.1rem;
    background: rgba(59, 76, 202, 0.2);
}

.music-play:hover {
    background: linear-gradient(135deg, rgba(59, 76, 202, 0.3), rgba(59, 76, 202, 0.15));
}

.music-volume {
    -webkit-appearance: none;
    appearance: none;
    width: 70px;
    height: 5px;
    border-radius: 3px;
    background: linear-gradient(90deg, rgba(59, 76, 202, 0.2), rgba(59, 76, 202, 0.1));
    outline: none;
    cursor: pointer;
    transition: background 0.25s ease;
}

.music-volume:hover {
    background: linear-gradient(90deg, rgba(59, 76, 202, 0.3), rgba(59, 76, 202, 0.15));
}

.music-volume::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #5b6ee0);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(59, 76, 202, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.music-volume::-webkit-slider-thumb:hover {
    transform: scale(1.3);
    box-shadow: 0 4px 16px rgba(59, 76, 202, 0.5);
}

.music-volume::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #5b6ee0);
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.5);
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(59, 76, 202, 0.4);
}

/* Mudo: estilo dessaturado */
.music-player.muted .music-note {
    animation: none;
    opacity: 0.4;
    filter: grayscale(100%);
}

.music-player.muted .music-btn {
    opacity: 0.6;
}

/* ─── Mobile: Music Player compacto ──────────────────────────────────────────── */
@media (max-width: 768px) {
    .music-player {
        bottom: 12px;
        right: 12px;
        left: 12px;
        min-width: unset;
        padding: 12px 14px;
        border-radius: 16px;
    }

    .music-title { max-width: 80px; font-size: 0.75rem; }

    .music-volume { width: 60px; }

    .music-btn { font-size: 0.9rem; padding: 5px 7px; }
}

/* ═══════════════════════════════════════════════════════════════════════════════
   MOBILE RESPONSIVO + ACESSIBILIDADE + TRANSIÇÕES
   ═══════════════════════════════════════════════════════════════════════════════ */

/* ─── Focus Styles (Acessibilidade global) ───────────────────────────────────── */
:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 3px;
    border-radius: 6px;
}

/* Remove outline padrão feio só quando não é teclado */
:focus:not(:focus-visible) { outline: none; }

/* ─── Reduced Motion (respeita preferência do SO) ───────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ─── Transições de Página Suaves ────────────────────────────────────────────── */

/* Cards entram com efeito mais suave e consistente */
@keyframes cardEnter {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.pokemon.entering {
    animation: cardEnter 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Modal com transição mais polida */
@keyframes modalEnter {
    from {
        opacity: 0;
        transform: translateY(32px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-content {
    animation: modalEnter 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Aba troca com slide suave */
@keyframes tabSlide {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.modal-tab-pane.active {
    animation: tabSlide 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Região chips: transição ao ativar */
.region-chip {
    transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Dark mode: transição suave em todos os elementos */
*, *::before, *::after {
    transition-property: background-color, border-color, color, box-shadow;
    transition-duration: 0.25s;
    transition-timing-function: ease;
}

/* Exceção: não aplicar transition global em transforms (afeta animações) */
.pokemon, .shiny-toggle, .compare-btn, .modal-tab-btn,
.region-chip, .music-btn, .close, .dark-toggle {
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
                background-color 0.25s ease,
                border-color 0.25s ease,
                box-shadow 0.25s ease,
                color 0.25s ease;
}

/* ─── MOBILE: < 768px ────────────────────────────────────────────────────────── */
@media (max-width: 768px) {

    body { padding: 20px 12px 100px; }

    /* Header */
    header { margin-bottom: 24px; }

    header h1 { font-size: 2.4rem; }

    .header-sub { font-size: 0.8rem; }

    .dark-toggle {
        position: absolute;
        top: 4px;
        right: 0;
        padding: 6px 10px;
        font-size: 1rem;
    }

    /* Filter bar */
    .filter-bar { gap: 10px; }

    .search-input {
        font-size: 0.95rem;
        padding: 14px 44px;
    }

    .filter-controls {
        display: none;
    }

    /* Nova estrutura mobile: regiões + sort em uma linha */
    .filter-controls-row {
        display: flex;
        align-items: center;
        gap: 10px;
        overflow: hidden;
    }

    .filter-chip-group {
        gap: 6px;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 4px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .filter-chip-group::-webkit-scrollbar { display: none; }

    .region-chip {
        flex-shrink: 0;
        padding: 7px 14px;
        font-size: 0.75rem;
    }

    .sort-wrapper-mobile {
        display: flex;
    }

    .sort-wrapper-mobile:focus-within { border-color: var(--accent); }

    /* Grid de cards: 2 colunas em mobile */
    .pokeContainer {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    /* Cards menores em mobile */
    .pokemon { padding: 12px; }

    .imgContainer {
        width: 90px;
        height: 90px;
    }

    .imgContainer img { width: 68px; height: 68px; }

    .pixel-sprite { transform: scale(1.3); }
    .pokemon:hover .pixel-sprite { transform: scale(1.5); }

    .name { font-size: 0.85rem; }

    .ability-tag { font-size: 0.55rem; padding: 2px 6px; }

    /* Modal fullscreen em mobile */
    .modal { padding: 0; align-items: flex-end; }

    .modal-content {
        max-width: 100%;
        max-height: 92vh;
        border-radius: 24px 24px 0 0;
        padding: 24px 20px;
    }

    /* Abas do modal: fonte menor */
    .modal-tab-btn { font-size: 0.78rem; padding: 10px 4px; }

    /* Stats menores */
    .stats-section { max-width: 100%; }

    /* Player de música: menor e embaixo */
    .music-player {
        bottom: 12px;
        right: 12px;
        left: 12px;
        min-width: unset;
        padding: 10px 14px;
        border-radius: 16px;
    }

    .music-title { max-width: 90px; }

    .music-volume { width: 50px; }
}

/* ─── MOBILE: < 480px (smartphones pequenos) ─────────────────────────────────── */
@media (max-width: 480px) {

    header h1 { font-size: 2rem; }

    .pokeContainer { gap: 10px; }

    .pokemon { padding: 10px; border-radius: 18px; }

    .imgContainer { width: 80px; height: 80px; }

    .name { font-size: 0.8rem; }

    .type { font-size: 0.62rem; padding: 4px 10px; }

    .modal-content { padding: 20px 16px; }

    .modal-header img, .modal-pokemon-img { width: 120px; height: 120px; }

    .modal-header h2 { font-size: 1.4rem; }
}

/* ─── TABLET: 768px - 1024px ─────────────────────────────────────────────────── */
@media (min-width: 769px) and (max-width: 1024px) {

    .pokeContainer {
        grid-template-columns: repeat(3, 1fr);
        gap: 18px;
    }

    .modal-content { max-width: 480px; }
}

/* ─── Skip Link (Acessibilidade) ─────────────────────────────────────────────── */
.skip-link {
    position: absolute;
    top: -100px;
    left: 16px;
    background: var(--accent);
    color: white;
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.85rem;
    z-index: 9999;
    transition: top 0.2s ease;
    text-decoration: none;
}

.skip-link:focus { top: 16px; }
