/* ==================== CSS Variables ==================== */
:root {
    /* Primary Colors */
    --primary-red: #E3350D;
    --primary-yellow: #FFCB05;
    --primary-blue: #3B5CA8;
    --primary-light: #7AB8F5;
    
    /* Dark Theme */
    --bg-primary: #0B0D17;
    --bg-secondary: #111827;
    --bg-card: #1A1D2E;
    --bg-card-hover: #222639;
    --bg-input: #151827;
    --bg-border: #2A2E3F;
    --bg-overlay: #0D0F1A;
    
    /* Text */
    --text-primary: #F0F0F5;
    --text-secondary: #9CA3AF;
    --text-muted: #6B7280;
    
    /* Accent */
    --accent-red: #EF4444;
    --accent-green: #10B981;
    --accent-blue: #3B82F6;
    --accent-purple: #8B5CF6;
    
    /* Type Colors */
    --type-normal: #A8A878;
    --type-fire: #F08030;
    --type-water: #6890F0;
    --type-electric: #F8D030;
    --type-grass: #78C850;
    --type-ice: #98D8D8;
    --type-fighting: #C03028;
    --type-poison: #A040A0;
    --type-ground: #E0C068;
    --type-flying: #A890F0;
    --type-psychic: #F85888;
    --type-bug: #A8B820;
    --type-rock: #B8A038;
    --type-ghost: #705898;
    --type-dragon: #7038F8;
    --type-dark: #705848;
    --type-steel: #B8B8D0;
    --type-fairy: #EE99AC;
    
    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    --space-3xl: 64px;
    
    /* Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;
    
    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.5);
    --shadow-glow: 0 0 20px rgba(227,53,13,0.2);
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    
    /* Nav Height */
    --nav-height: 64px;
}

/* ==================== Reset ==================== */
*,*::before,*::after { box-sizing:border-box; margin:0; padding:0; }
html { scroll-behavior:smooth; -webkit-font-smoothing:antialiased; }
body {
    font-family: 'Noto Sans SC', 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}
a { text-decoration:none; color:inherit; }
ul { list-style:none; }
img { max-width:100%; height:auto; }
button { cursor:pointer; border:none; background:none; font-family:inherit; transition:all var(--transition-fast); }
button:active { transform:scale(0.97); }

/* ==================== Container ==================== */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

/* ==================== Navigation ==================== */
.navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    height: var(--nav-height);
    background: rgba(11,13,23,0.98);
    border-bottom: 1px solid var(--bg-border);
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}
.nav-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
    display: flex;
    align-items: center;
    height: 100%;
    gap: var(--space-xl);
}
.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    letter-spacing: -0.3px;
}
.nav-logo-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}
.nav-logo-text { font-weight: 700; }
.nav-logo-text .accent { color: var(--primary-red); }

.nav-menu {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    flex: 1;
    justify-content: center;
}
.nav-menu > li { position: relative; }
.nav-menu > li > a,
.nav-menu > li > button {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 14px;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
    transition: all var(--transition-fast);
    background: none;
    border: none;
    cursor: pointer;
}
.nav-menu > li > a:hover,
.nav-menu > li > button:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.05);
}
.nav-menu > li > a.active {
    color: var(--primary-red);
    background: rgba(227,53,13,0.1);
}
.nav-menu .dropdown-arrow {
    width: 16px;
    height: 16px;
    transition: transform var(--transition-fast);
}
.nav-menu > li:hover .dropdown-arrow,
.nav-menu > li.expanded .dropdown-arrow {
    transform: rotate(180deg);
}

/* Desktop hover transform (not mobile — touch :hover sticky causes translateX off-screen) */
@media (min-width: 769px) {
    .nav-menu > li:hover .nav-dropdown {
        opacity: 1;
        visibility: visible;
        transform: translateX(-50%) translateY(0);
    }
    .hero-content { padding-left: 140px; }
}

/* Dropdown Menu */
.nav-dropdown {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    min-width: 180px;
    background: var(--bg-card);
    border: 1px solid var(--bg-border);
    border-radius: var(--radius-md);
    padding: var(--space-sm);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-fast);
    z-index: 1001;
}
.nav-menu > li.expanded .nav-dropdown {
    opacity: 1;
    visibility: visible;
}
.nav-dropdown a {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    white-space: nowrap;
}
.nav-dropdown a:hover {
    background: rgba(255,255,255,0.06);
    color: var(--text-primary);
}
.nav-dropdown a.active {
    color: var(--primary-red);
    background: rgba(227,53,13,0.08);
}
.nav-dropdown .dd-icon {
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}

/* Nav Right Section */
.nav-right {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}
.nav-right .nav-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}
.nav-right .nav-btn:hover { color: var(--text-primary); background: rgba(255,255,255,0.05); }
.nav-right .nav-btn svg { width: 18px; height: 18px; }

/* Language Selector */
.lang-selector { position: relative; }
.lang-current {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    color: var(--text-secondary);
    border: 1px solid var(--bg-border);
    transition: all var(--transition-fast);
    min-width: 50px;
    justify-content: center;
}
.lang-current:hover { border-color: var(--text-muted); color: var(--text-primary); }
.lang-arrow { width: 14px; height: 14px; transition: transform var(--transition-fast); }
.lang-selector.open .lang-arrow { transform: rotate(180deg); }
.lang-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 130px;
    background: var(--bg-card);
    border: 1px solid var(--bg-border);
    border-radius: var(--radius-md);
    padding: var(--space-xs);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: all var(--transition-fast);
    z-index: 1001;
}
.lang-selector.open .lang-dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.lang-option {
    display: block;
    width: 100%;
    padding: 8px 12px;
    text-align: left;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}
.lang-option:hover { background: rgba(255,255,255,0.06); color: var(--text-primary); }
.lang-option.active { background: rgba(227,53,13,0.1); color: var(--primary-red); }

/* Mobile Menu */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 8px;
    z-index: 1001;
}
.mobile-menu-btn span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 1px;
    transition: all var(--transition-fast);
}
.mobile-menu-btn.active span:nth-child(1) { transform: rotate(45deg) translate(5px,5px); }
.mobile-menu-btn.active span:nth-child(2) { opacity: 0; }
.mobile-menu-btn.active span:nth-child(3) { transform: rotate(-45deg) translate(5px,-5px); }

/* Mobile Menu Overlay */
.nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-fast);
    pointer-events: none;
}

/* Mobile Menu Active State */
.nav-menu.active {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}
.nav-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* ==================== Page Header ==================== */
.page-header {
    padding: calc(var(--nav-height) + var(--space-xl)) 0 var(--space-xl);
    text-align: center;
    border-bottom: 1px solid var(--bg-border);
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
}
.page-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: var(--space-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
}
.page-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* ==================== Search & Filters ==================== */
.filters-bar {
    display: flex;
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
    flex-wrap: wrap;
    align-items: center;
}
.search-box, .filter-group { padding-bottom: 10px; }
.search-box {
    flex: 1;
    min-width: 220px;
    position: relative;
}
.search-box svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    pointer-events: none;
}
.search-box input {
    width: 100%;
    height: 40px;
    padding: 0 14px 0 42px;
    background: var(--bg-input);
    border: 1px solid var(--bg-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
    transition: all var(--transition-fast);
}
.search-box input::placeholder { color: var(--text-muted); }
.search-box input:focus {
    outline: none;
    border-color: var(--primary-red);
    box-shadow: 0 0 0 3px rgba(227,53,13,0.15);
}
.search-box input:hover { border-color: var(--text-muted); }

.filter-group {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}
.filter-group label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    white-space: nowrap;
}
.filter-group select {
    height: 40px;
    padding: 0 36px 0 14px;
    background: var(--bg-input);
    border: 1px solid var(--bg-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-fast);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    min-width: 130px;
}
.filter-group select:hover { border-color: var(--text-muted); }
.filter-group select:focus {
    outline: none;
    border-color: var(--primary-red);
    box-shadow: 0 0 0 3px rgba(227,53,13,0.15);
}

.filter-btn {
    height: 40px;
    padding: 0 16px;
    background: var(--bg-input);
    border: 1px solid var(--bg-border);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-family: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all var(--transition-fast);
    white-space: nowrap;
}
.filter-btn:hover { border-color: var(--text-muted); color: var(--text-primary); }
.filter-btn.active {
    background: rgba(227,53,13,0.12);
    border-color: var(--primary-red);
    color: var(--primary-red);
}

.result-count {
    font-size: 0.85rem;
    color: var(--text-muted);
    white-space: nowrap;
    margin-left: auto;
}

/* ==================== Pokemon Grid ==================== */
.pokemon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 12px;
}
.pokemon-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    text-align: center;
    border: 1px solid transparent;
    transition: all var(--transition-normal);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}
.pokemon-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary-red);
    box-shadow: 0 8px 24px rgba(227,53,13,0.15);
}
.pokemon-card img {
    width: 80px;
    height: 80px;
    margin-bottom: var(--space-sm);
    transition: transform var(--transition-normal), opacity 0.25s ease;
    image-rendering: pixelated;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Ccircle cx='24' cy='24' r='22' fill='none' stroke='%234B5563' stroke-width='1.5'/%3E%3Cline x1='2' y1='24' x2='46' y2='24' stroke='%234B5563' stroke-width='1.5'/%3E%3Ccircle cx='24' cy='24' r='5' fill='none' stroke='%234B5563' stroke-width='1.5'/%3E%3Ccircle cx='24' cy='24' r='2.5' fill='%234B5563'/%3E%3C/svg%3E");
    background-size: 56%;
    background-position: center;
    background-repeat: no-repeat;
}
.pokemon-card img.loaded { background-image: none; }
.pokemon-card:hover img { transform: scale(1.1); filter: drop-shadow(0 0 12px rgba(227,53,13,0.6)); }
.pokemon-card .dex-number {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: monospace;
    margin-bottom: 2px;
}
.pokemon-card .name {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 6px;
    color: var(--text-primary);
}
.pokemon-card .eng-name {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.pokemon-card .types {
    display: flex;
    justify-content: center;
    gap: 4px;
}
.pokemon-card .mega-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 0.65rem;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, #FFD700, #FF8C00);
    color: #000;
    font-weight: 700;
    letter-spacing: 0.5px;
}
.pokemon-card .evo-only-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 0.6rem;
    padding: 1px 6px;
    border-radius: var(--radius-full);
    background: rgba(255,255,255,0.1);
    color: var(--text-muted);
    border: 1px solid rgba(255,255,255,0.15);
}

/* ==================== Type Badge ==================== */
.type-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 600;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    position: relative;
    overflow: hidden;
    background-image: linear-gradient(90deg, rgba(255,255,255,0.2) 0%, transparent 50%);
    background-size: 200% 100%;
    background-position: 0% 0%;
    animation: type-shimmer 3s infinite;
}

@keyframes type-shimmer {
    0% { background-position: -100% 0%; }
    100% { background-position: 100% 0%; }
}

/* ==================== Modal (通用弹窗) ==================== */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.8);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    padding: var(--space-lg);
}
.modal.active { display: flex; }

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    max-width: 720px;
    width: 100%;
    max-height: calc(100vh - var(--space-lg) * 2);
    border: 1px solid var(--bg-border);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.modal-header {
    padding: var(--space-md) var(--space-xl);
    border-bottom: 1px solid var(--bg-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}
.modal-header h2 { font-size: 1.1rem; }
.modal-close {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    color: var(--text-secondary);
    flex-shrink: 0;
}
.modal-close:hover { background: rgba(255,255,255,0.08); color: var(--primary-red); }
.modal-body {
    padding: var(--space-lg) var(--space-xl);
    overflow-y: auto;
    flex: 1;
}

.pokemon-detail-top {
    display: flex;
    gap: var(--space-xl);
    margin-bottom: var(--space-xl);
    align-items: center;
}
.pokemon-detail-top img {
    width: 140px;
    height: 140px;
    image-rendering: pixelated;
    flex-shrink: 0;
}
.pokemon-detail-info { flex: 1; }
.pokemon-detail-info .dex-num {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-family: monospace;
}
.pokemon-detail-info h2 {
    font-size: 1.5rem;
    margin: 4px 0;
}
.pokemon-detail-info .eng-name {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: var(--space-sm);
}
.pokemon-detail-info .pokemon-types {
    display: flex;
    gap: 6px;
    margin-bottom: var(--space-sm);
}
.pokemon-detail-info .abilities {
    margin-top: var(--space-sm);
}
.pokemon-detail-info .ability-tag {
    display: inline-block;
    padding: 2px 10px;
    background: rgba(255,255,255,0.06);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-right: 6px;
    margin-bottom: 4px;
}
.evo-chain { border-top: 1px solid var(--bg-border); padding-top: 8px; margin-top: 8px; }
.evo-chain-item { text-align: center; }
.evo-chain-item.current { border: 1px solid var(--primary-red); border-radius: 6px; padding: 2px 4px; }
.evo-chain-arrow { color: var(--text-muted); font-size: 0.8rem; }

.pokemon-detail-info .ability-tag.hidden {
    background: rgba(139,92,246,0.1);
    color: var(--accent-purple);
}

/* Detail Tabs */
.detail-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--bg-border);
    margin-bottom: var(--space-lg);
}
.detail-tab {
    padding: 10px 18px;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
    border-bottom: 2px solid transparent;
}
.detail-tab:hover { color: var(--text-primary); }
.detail-tab.active {
    color: var(--primary-red);
    border-bottom-color: var(--primary-red);
}

/* Stats EV */
.stat-ev-row {
    display: grid;
    grid-template-columns: 60px 1fr 50px auto;
    align-items: center;
    gap: var(--space-sm);
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}
.stat-ev-row .stat-name { font-size: 0.85rem; color: var(--text-secondary); }
.nature-mod {
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: 4px;
    padding: 0 4px;
    border-radius: 3px;
}
.nature-mod.up   { color: var(--primary-red); background: rgba(227,53,13,0.15); }
.nature-mod.down { color: #6890F0; background: rgba(104,144,240,0.15); }
.stat-ev-row .stat-bar-wrap {
    height: 8px;
    background: var(--bg-secondary);
    border-radius: var(--radius-full);
    overflow: hidden;
}
.stat-ev-row .stat-bar {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width 0.3s;
    background: var(--primary-red);
}
.stat-ev-row .stat-bar.hp { background: #10B981; }
.stat-ev-row .stat-bar.atk { background: #F08030; }
.stat-ev-row .stat-bar.def { background: #F8D030; }
.stat-ev-row .stat-bar.spa { background: #6890F0; }
.stat-ev-row .stat-bar.spd { background: #78C850; }
.stat-ev-row .stat-bar.spe { background: #F85888; }
.stat-ev-row .stat-val { font-size: 0.85rem; text-align: right; font-weight: 600; }
.stat-ev-row .ev-ctrl {
    display: flex;
    align-items: center;
    gap: 4px;
}
.stat-ev-row .ev-btn {
    width: 24px;
    height: 24px;
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.06);
    color: var(--text-secondary);
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}
.stat-ev-row .ev-btn:hover { background: rgba(255,255,255,0.12); color: var(--text-primary); }
.stat-ev-row .ev-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.stat-ev-row .ev-val {
    font-size: 0.8rem;
    width: 28px;
    text-align: center;
    color: var(--text-muted);
}

.ev-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md);
    background: rgba(255,255,255,0.03);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-md);
}
.ev-remaining { font-weight: 700; }
.ev-remaining.warning { color: var(--primary-yellow); }
.nature-select {
    height: 40px;
    padding: 0 14px;
    background: var(--bg-input);
    border: 1px solid var(--bg-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-family: inherit;
    cursor: pointer;
}
.nature-select:focus { outline: none; border-color: var(--primary-red); }

/* Moves Table in Detail */
.moves-list {
    font-size: 0.85rem;
}
.move-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}
.move-item .move-type-badge {
    min-width: 56px;
    text-align: center;
    flex-shrink: 0;
}
.move-item .move-info {
    flex: 1;
    min-width: 0;
}
.move-item .move-name {
    font-size: 0.85rem;
    line-height: 1.3;
}
.move-item .move-details {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
    display: flex;
    gap: 12px;
}
.move-item .move-detail-item {
    display: flex;
    align-items: center;
    gap: 3px;
}

/* ==================== Moves List (New Layout) ==================== */
.moves-list-new {
    font-size: 0.85rem;
}
.move-row:first-child .move-row-sep {
    opacity: 0.6;
}
.move-row-sep {
    height: 1px;
    background: linear-gradient(to right, transparent, var(--border-color), transparent);
    margin: 0;
    opacity: 0.5;
}
.move-row-inner {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    padding: 8px var(--space-sm);
    transition: background 0.15s;
}
.move-row-inner:hover {
    background: rgba(255,255,255,0.03);
}
.move-row-type {
    min-width: 52px;
    text-align: center;
    flex-shrink: 0;
    font-size: 0.75rem;
    padding: 3px 8px;
    border-radius: 4px;
    color: #fff;
    font-weight: 500;
}
.move-row-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.move-row-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.move-row-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.move-row-stat {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
}
.move-row-desc {
    font-size: 0.7rem;
    color: var(--text-muted);
    opacity: 0.65;
    line-height: 1.3;
}

/* ==================== Type Chart Page ==================== */
.type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: var(--space-sm);
    margin-bottom: var(--space-xl);
}
.type-card {
    padding: var(--space-md);
    border-radius: var(--radius-md);
    text-align: center;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition-normal);
    border: 2px solid transparent;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
.type-card:hover { transform: scale(1.05); filter: brightness(1.1); }
.type-card.selected { border-color: var(--primary-yellow); transform: scale(1.05); }
.type-card.selected-def { border-color: #10B981; }

.type-effectiveness-panel {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    border: 1px solid var(--bg-border);
}
.effectiveness-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.effectiveness-table th,
.effectiveness-table td {
    padding: 10px 8px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.effectiveness-table th {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.75rem;
}
.effectiveness-table .mul { font-weight: 600; }
.effectiveness-table .mul-4x { color: #EF4444; font-weight: 700; }
.effectiveness-table .mul-2x { color: #F87171; }
.effectiveness-table .mul-1x { color: var(--text-secondary); }
.effectiveness-table .mul-0_5x { color: #34D399; }
.effectiveness-table .mul-0_25x { color: #6EE7B7; font-weight: 700; }
.effectiveness-table .mul-0x { color: var(--text-muted); text-decoration: line-through; }

/* ==================== Speed Line Page ==================== */
.speed-table-wrap {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--bg-border);
    overflow: hidden;
}
.speed-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.speed-table th,
.speed-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.speed-table th {
    background: rgba(255,255,255,0.02);
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.8rem;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}
.speed-table th:hover { color: var(--text-primary); }
.speed-table th .sort-icon { margin-left: 4px; font-size: 0.7rem; }
.speed-table tr:hover { background: rgba(255,255,255,0.02); }
.speed-table .speed-poke {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    min-width: 160px;
}
.speed-table .speed-poke img {
    width: 32px;
    height: 32px;
    image-rendering: pixelated;
}
.speed-table .speed-poke .speed-name { font-weight: 500; }
.speed-table .speed-poke .speed-types { display: flex; gap: 3px; margin-left: auto; }
.speed-table .speed-val { font-weight: 600; font-variant-numeric: tabular-nums; }
.speed-table .weather-badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    background: rgba(104,144,240,0.2);
    color: #6890F0;
}

.speed-guide {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    border: 1px solid var(--bg-border);
    margin-top: var(--space-xl);
}
.speed-guide h3 {
    font-size: 1.1rem;
    color: var(--primary-yellow);
    margin-bottom: var(--space-md);
}
.speed-guide p { color: var(--text-secondary); font-size: 0.9rem; line-height: 1.8; }
.speed-guide code {
    background: rgba(255,255,255,0.06);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: var(--primary-red);
}

/* ==================== Speed Compare ==================== */
.compare-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
    margin-bottom: var(--space-xl);
}
.compare-side {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--bg-border);
    padding: var(--space-lg);
}
.compare-side h3 {
    font-size: 1rem;
    margin-bottom: var(--space-md);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}
.compare-side .side-label {
    font-size: 0.8rem;
    padding: 2px 10px;
    border-radius: var(--radius-full);
    font-weight: 600;
}
.side-label.my { background: rgba(59,130,246,0.2); color: var(--accent-blue); }
.side-label.op { background: rgba(239,68,68,0.2); color: var(--accent-red); }

.compare-slots {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}
.compare-slot {
    background: rgba(255,255,255,0.03);
    border: 2px dashed var(--bg-border);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    text-align: center;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}
.compare-slot:hover { border-color: var(--text-muted); background: rgba(255,255,255,0.05); }
.compare-slot.filled { border-style: solid; border-color: var(--bg-border); }
.compare-slot img { width: 48px; height: 48px; }
.compare-slot .slot-name { font-size: 0.8rem; margin-top: 4px; }
.compare-slot .slot-speed { font-size: 0.75rem; color: var(--text-muted); }

.compare-result {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--bg-border);
    overflow: hidden;
}
.compare-result table { width: 100%; border-collapse: collapse; }
.compare-result th,
.compare-result td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.compare-result th { background: rgba(255,255,255,0.02); color: var(--text-muted); font-weight: 500; font-size: 0.8rem; }
.compare-result .highlight { color: var(--primary-yellow); font-weight: 600; }

/* ==================== Damage Calculator V2 ==================== */
.calc-main {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 12px;
    align-items: start;
}
.calc-panel {
    background: var(--bg-card);
    border: 1px solid var(--bg-border);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
}
.calc-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding-top: 60px;
    min-width: 200px;
}
.calc-swap-btn {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--bg-border);
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex; align-items: center; justify-content: center;
}
.calc-swap-btn:hover { border-color: var(--primary-red); color: var(--primary-red); }
.calc-move-select { width: 100%; position: relative; }
.calc-move-select input {
    width: 100%; height: 36px;
    background: var(--bg-input); border: 1px solid var(--bg-border);
    border-radius: 6px; color: var(--text-primary); font-size: 0.85rem;
    padding: 0 10px;
}
.calc-move-dropdown {
    position: absolute; top: 100%; left: 0; right: 0; z-index: 100;
    max-height: 200px; overflow-y: auto;
    background: var(--bg-card); border: 1px solid var(--bg-border);
    border-radius: 0 0 6px 6px; display: none;
}
.calc-move-dropdown.show { display: block; }
.calc-move-item {
    padding: 6px 10px; cursor: pointer; font-size: 0.8rem;
    display: flex; justify-content: space-between;
}
.calc-move-item:hover { background: rgba(227,53,13,0.1); }
.calc-move-item .m-type { font-size: 0.65rem; color: var(--text-muted); }
.calc-stat-stage {
    display: flex; align-items: center; gap: 4px; margin-bottom: 3px;
}
.calc-stat-stage label { font-size: 0.7rem; color: var(--text-muted); width: 42px; }
.calc-stat-stage button {
    width: 22px; height: 22px; border-radius: 4px; font-size: 0.7rem;
    background: rgba(255,255,255,0.04); color: var(--text-secondary);
    border: 1px solid var(--bg-border); cursor: pointer;
}
.calc-stat-stage button:hover { border-color: var(--primary-red); }
.calc-stat-stage .stage-val { font-size: 0.8rem; font-weight: 600; width: 24px; text-align: center; }
.calc-poke-header {
    display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
}
.calc-poke-header img { width: 40px; height: 40px; image-rendering: pixelated; }
.calc-poke-name { font-weight: 700; font-size: 0.9rem; }
.calc-poke-types { display: flex; gap: 3px; margin-top: 2px; }
.calc-field-row {
    display: flex; align-items: center; gap: 6px;
    margin-bottom: 4px; font-size: 0.75rem;
}
.calc-field-row label { color: var(--text-muted); width: 36px; flex-shrink: 0; text-align: right; }
.calc-field-row select {
    flex: 1; height: 26px; font-size: 0.7rem;
    background: var(--bg-input); border: 1px solid var(--bg-border);
    border-radius: 4px; color: var(--text-primary); padding: 0 4px;
}
.calc-stat-row {
    display: flex; align-items: center; gap: 4px;
    margin-bottom: 3px; font-size: 0.75rem;
}
.calc-stat-label { width: 28px; color: var(--text-muted); text-align: right; flex-shrink: 0; }
.calc-stat-base { width: 24px; text-align: right; color: var(--text-muted); font-size: 0.65rem; flex-shrink: 0; }
.calc-stat-ev { width: 40px; flex-shrink: 0; }
.calc-stat-ev input {
    width: 100%; height: 22px; text-align: center; font-size: 0.7rem;
    background: var(--bg-input); border: 1px solid var(--bg-border);
    border-radius: 3px; color: var(--text-primary);
}
.calc-stat-val {
    width: 42px; text-align: right; font-weight: 700; font-size: 0.8rem;
    color: var(--text-primary); flex-shrink: 0;
}
.calc-moves-label { font-size: 0.7rem; color: var(--text-muted); margin: 6px 0 2px; }
.calc-moves-row { display: flex; gap: 3px; flex-wrap: wrap; }
.calc-move-chip {
    font-size: 0.65rem; padding: 1px 6px; border-radius: 10px;
    background: rgba(255,255,255,0.04); border: 1px solid var(--bg-border);
    color: var(--text-secondary); cursor: default;
}
.calc-result-box {
    background: var(--bg-card); border: 1px solid var(--bg-border);
    border-radius: var(--radius-md); padding: 12px; width: 100%; text-align: center;
}
.calc-result-grid { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-bottom: 8px; }
.calc-result-item { text-align: center; min-width: 60px; }
.calc-result-item .r-val { font-size: 1.1rem; font-weight: 700; color: var(--primary-yellow); }
.calc-result-item .r-label { font-size: 0.65rem; color: var(--text-muted); }
.calc-hp-bar {
    height: 8px; background: var(--bg-secondary); border-radius: 4px;
    overflow: hidden; margin: 4px 0;
}
.calc-hp-bar-fill {
    height: 100%; border-radius: 4px;
    background: linear-gradient(90deg, #10B981, #F59E0B, #EF4444);
    transition: width 0.3s;
}
.calc-info-line { font-size: 0.7rem; color: var(--text-muted); margin-top: 4px; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }



/* ==================== Damage Calculator ==================== */
.damage-layout {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: var(--space-lg);
    align-items: start;
    margin-bottom: var(--space-xl);
}
.damage-side {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--bg-border);
    padding: var(--space-lg);
}
.damage-side h3 {
    font-size: 1rem;
    margin-bottom: var(--space-md);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}
.damage-vs {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-muted);
    padding-top: 60px;
}
.damage-field {
    margin-bottom: var(--space-md);
}
.damage-field label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.damage-field select,
.damage-field input {
    width: 100%;
    height: 40px;
    padding: 0 14px;
    background: var(--bg-input);
    border: 1px solid var(--bg-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
}
.damage-field select { cursor: pointer; }
.damage-field select:focus,
.damage-field input:focus { outline: none; border-color: var(--primary-red); }

.stat-input-row {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: 6px;
}
.stat-input-row .stat-label {
    width: 40px;
    font-size: 0.8rem;
    color: var(--text-muted);
}
.stat-input-row input {
    width: 70px;
    height: 32px;
    padding: 0 8px;
    background: var(--bg-input);
    border: 1px solid var(--bg-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.85rem;
    text-align: right;
    font-family: inherit;
}

.damage-result {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--bg-border);
    padding: var(--space-xl);
}
.damage-result h3 {
    font-size: 1rem;
    margin-bottom: var(--space-md);
    text-align: center;
}
.damage-range {
    display: flex;
    justify-content: center;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}
.damage-range-item {
    text-align: center;
    padding: var(--space-md) var(--space-xl);
    background: rgba(255,255,255,0.03);
    border-radius: var(--radius-md);
}
.damage-range-item .dmg-val {
    font-size: 1.5rem;
    font-weight: 700;
}
.damage-range-item .dmg-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.damage-modifiers {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}
.modifier-btn {
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    background: rgba(255,255,255,0.04);
    color: var(--text-muted);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
}
.modifier-btn:hover { color: var(--text-primary); border-color: var(--bg-border); }
.modifier-btn.active { background: rgba(227,53,13,0.12); border-color: var(--primary-red); color: var(--primary-red); }

/* ==================== Team Builder ==================== */
.team-slots {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: var(--space-sm);
    margin-bottom: var(--space-xl);
}
.team-slot {
    background: var(--bg-card);
    border: 2px dashed var(--bg-border);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    text-align: center;
    min-height: 160px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
}
.team-slot:hover { border-color: var(--text-muted); background: var(--bg-card-hover); }
.team-slot.filled { border-style: solid; }
.team-slot img { width: 64px; height: 64px; image-rendering: pixelated; }
.team-slot .slot-name { font-size: 0.85rem; font-weight: 600; margin-top: 4px; }
.team-slot .slot-types { display: flex; gap: 3px; justify-content: center; margin-top: 4px; }
.team-slot .slot-remove {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 22px;
    height: 22px;
    border-radius: var(--radius-full);
    background: rgba(239,68,68,0.2);
    color: var(--accent-red);
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-fast);
}
.team-slot.filled:hover .slot-remove { opacity: 1; }

.team-analysis {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--bg-border);
    padding: var(--space-lg);
}
.team-analysis h3 { font-size: 1rem; margin-bottom: var(--space-md); }
.analysis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-md);
}
.analysis-item { font-size: 0.85rem; }
.analysis-item .ai-label { color: var(--text-muted); margin-bottom: 4px; }
.analysis-item .ai-value { font-weight: 600; }

.weakness-bars { margin-top: var(--space-sm); }
.weakness-bar-row {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: 4px;
}
.weakness-bar-row .wb-type {
    width: 60px;
    font-size: 0.75rem;
    text-align: right;
}
.weakness-bar-row .wb-bar {
    flex: 1;
    height: 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius-full);
    overflow: hidden;
}
.weakness-bar-row .wb-fill {
    height: 100%;
    border-radius: var(--radius-full);
    min-width: 0;
    transition: width 0.3s;
}

/* ==================== Moves Table ==================== */
.moves-table-wrap {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--bg-border);
    overflow: hidden;
}
.moves-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.moves-table th,
.moves-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.moves-table th {
    background: rgba(255,255,255,0.02);
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.8rem;
    cursor: pointer;
    user-select: none;
}
.moves-table th:hover { color: var(--text-primary); }
.moves-table tr:hover { background: rgba(255,255,255,0.02); }
.moves-table .category-badge {
    display: inline-block;
    padding: 1px 8px;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 600;
    color: white;
}
.category-physical { background: #F08030; }
.category-special { background: #6890F0; }
.category-status { background: #8899AA; }

/* Move description cell */
.move-desc-cell {
    max-width: 240px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Learner count badge */
.learner-count {
    font-size: 0.8rem;
    color: var(--primary-yellow);
    font-weight: 600;
    cursor: pointer;
}
.move-row-clickable:hover { background: rgba(255,255,255,0.03); }

/* Move learners popup */
.move-learners-popup {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    z-index: 1000;
    min-width: 200px;
    max-width: 320px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.move-learners-popup .popup-header {
    padding: 8px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}
.move-learners-popup .popup-body {
    padding: 4px 0;
}
.learner-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    cursor: pointer;
    transition: background 0.15s;
    font-size: 0.8rem;
}
.learner-item:hover { background: rgba(255,255,255,0.05); }
.learner-item span { flex: 1; }

/* ---- Top Pokemon Ranking (Home) ---- */
.ranking-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: var(--space-xl);
}
.ranking-row {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    background: var(--bg-card);
    border: 1px solid var(--bg-border);
    border-radius: var(--radius-md);
    padding: 0 var(--space-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    height: 64px;
}
.ranking-row:hover { border-color: var(--text-muted); background: var(--bg-card-hover); }
.ranking-row.gold {
    background: linear-gradient(135deg, rgba(255,215,0,0.08), rgba(255,215,0,0.02));
    border-color: rgba(255,215,0,0.3);
}
.ranking-row.silver {
    background: linear-gradient(135deg, rgba(192,192,192,0.06), rgba(192,192,192,0.02));
    border-color: rgba(192,192,192,0.2);
}
.ranking-row.bronze {
    background: linear-gradient(135deg, rgba(205,127,50,0.06), rgba(205,127,50,0.02));
    border-color: rgba(205,127,50,0.2);
}
.ranking-row.top4 {
    background: linear-gradient(135deg, rgba(107,114,128,0.06), rgba(107,114,128,0.02));
    border-color: rgba(107,114,128,0.2);
}
.ranking-row.top5 {
    background: linear-gradient(135deg, rgba(107,114,128,0.06), rgba(107,114,128,0.02));
    border-color: rgba(107,114,128,0.2);
}
.rr-rank {
    width: 72px;
    text-align: center;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6px 8px;
    border-radius: var(--radius-md);
    margin: 6px 0;
    align-self: stretch;
}
.rr-rank.gold { background: linear-gradient(135deg, #EF4444, #DC2626); }
.rr-rank.silver { background: linear-gradient(135deg, #F59E0B, #D97706); }
.rr-rank.bronze { background: linear-gradient(135deg, #10B981, #059669); }
.rr-rank.top4 { background: linear-gradient(135deg, #6B7280, #4B5563); }
.rr-rank.top5 { background: linear-gradient(135deg, #6B7280, #4B5563); }
.rr-rank .rank-top {
    font-size: 0.6rem;
    font-weight: 700;
    color: rgba(255,255,255,0.7);
    letter-spacing: 1px;
    line-height: 1;
}
.rr-rank .rank-num {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    line-height: 1.2;
}
/* First rank - lighter, smaller TOP */
.rr-rank.gold .rank-top {
    font-size: 0.55rem;
    color: rgba(255,255,255,0.55);
}
.rr-rank.gold .rank-num { font-size: 1.35rem; }
.rr-rank.gold .rank-num { color: white; }
.rr-rank.silver .rank-num { color: white; }
.rr-rank.bronze .rank-num { color: white; }
.rr-rank.top4 .rank-num { color: white; }
.rr-rank.top5 .rank-num { color: white; }
.rr-pokemon {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex: 1;
    min-width: 0;
}
.rr-pokemon img {
    width: 48px;
    height: 48px;
    image-rendering: pixelated;
    flex-shrink: 0;
    object-fit: contain;
    margin-top: 2px;
    margin-bottom: 2px;
}
.rr-info { min-width: 0; }
.rr-name { font-weight: 600; font-size: 0.9rem; }
.rr-types { display: flex; gap: 3px; margin-top: 2px; }
.rr-usage {
    text-align: right;
    min-width: 100px;
    flex-shrink: 0;
}
.rr-usage .usage-pct {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 4px;
}
.rr-usage.gold .usage-pct { color: #FFD700; font-size: 1.1rem; }
.rr-usage.silver .usage-pct { color: #C0C0C0; }
.rr-usage.bronze .usage-pct { color: #CD7F32; }
.rr-usage.top4 .usage-pct { color: #6B7280; }
.rr-usage.top5 .usage-pct { color: #6B7280; }
.usage-bar-track {
    height: 4px;
    background: var(--bg-secondary);
    border-radius: 2px;
    overflow: hidden;
}
.usage-bar-fill {
    height: 100%;
    border-radius: 2px;
    background: var(--text-muted);
    transition: width 0.5s ease;
}
.usage-bar-fill.gold { background: linear-gradient(90deg, #FFD700, #FFA500); }
.usage-bar-fill.silver { background: linear-gradient(90deg, #C0C0C0, #A9A9A9); }
.usage-bar-fill.bronze { background: linear-gradient(90deg, #CD7F32, #B8860B); }
.usage-bar-fill.top4 { background: linear-gradient(90deg, #6B7280, #4B5563); }
.usage-bar-fill.top5 { background: linear-gradient(90deg, #6B7280, #4B5563); }

/* ==================== Teams Page ==================== */
.teams-tabs {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
}
.teams-tab {
    padding: 8px 24px;
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    font-weight: 600;
    background: rgba(255,255,255,0.04);
    color: var(--text-secondary);
    border: 1px solid var(--bg-border);
    cursor: pointer;
    transition: all var(--transition-fast);
}
.teams-tab:hover { color: var(--text-primary); border-color: var(--text-muted); }
.teams-tab.active {
    background: rgba(227,53,13,0.12);
    border-color: var(--primary-red);
    color: var(--primary-red);
}
.team-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 12px;
}
.team-card {
    background: var(--bg-card);
    border: 1px solid var(--bg-border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
}
.team-card:hover {
    border-color: var(--primary-red);
    box-shadow: 0 4px 20px rgba(227,53,13,0.12);
    transform: translateY(-2px);
}
.team-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-md);
}
.team-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
}
.team-card-meta {
    display: flex;
    gap: var(--space-sm);
    align-items: center;
    flex-shrink: 0;
}
.team-format-badge {
    padding: 2px 10px;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 600;
    color: white;
}
.team-format-badge.singles { background: #F59E0B; }
.team-format-badge.doubles { background: #3B82F6; }
.team-view-count {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 3px;
}
.team-preview-row {
    display: flex;
    gap: 4px;
    justify-content: flex-start;
    flex-wrap: wrap;
    margin-bottom: var(--space-sm);
}
.team-preview-pokemon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.03);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}
.team-preview-pokemon img {
    width: 40px;
    height: 40px;
    image-rendering: pixelated;
    object-fit: contain;
}
.team-preview-pokemon .pokeball-placeholder {
    width: 28px;
    height: 28px;
    opacity: 0.25;
}
.team-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    padding-top: var(--space-sm);
    border-top: 1px solid rgba(255,255,255,0.04);
}
.team-card-owner {
    display: flex;
    align-items: center;
    gap: 4px;
}
.team-card-date { font-size: 0.75rem; color: var(--text-muted); }
.team-card-empty {
    text-align: center;
    padding: 48px;
    color: var(--text-muted);
    grid-column: 1 / -1;
}

/* ==================== Meta Page ==================== */
.meta-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
}
.meta-info-bar {
    display: flex;
    gap: var(--space-md);
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-lg);
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--bg-border);
    font-size: 0.8rem;
    color: var(--text-muted);
}
.meta-info-bar .mi-item {
    display: flex;
    align-items: center;
    gap: 4px;
}
.meta-info-bar .mi-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--accent-green);
}
.meta-panel {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--bg-border);
    padding: var(--space-lg);
}
.meta-panel.full-width {
    grid-column: 1 / -1;
}
.meta-panel h3 {
    font-size: 1.05rem;
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--bg-border);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}
.meta-panel h3 .panel-icon { font-size: 1.2rem; }

/* Species ranking */
.meta-species-row {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 6px 0;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}
.meta-species-row .ms-rank {
    width: 26px;
    text-align: right;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-muted);
    flex-shrink: 0;
}
.meta-species-row .ms-rank.top3 { color: var(--primary-yellow); }
.meta-species-row .ms-poke {
    width: 130px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    flex-shrink: 0;
    cursor: pointer;
}
.meta-species-row .ms-poke:hover { color: var(--primary-red); }
.meta-species-row .ms-poke img {
    width: 24px; height: 24px;
    image-rendering: pixelated;
}
.meta-species-row .ms-bar-wrap {
    flex: 1;
    height: 20px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    overflow: hidden;
    min-width: 60px;
}
.meta-species-row .ms-bar {
    height: 100%;
    border-radius: var(--radius-sm);
    background: linear-gradient(90deg, var(--primary-red), #ff6b4a);
    display: flex;
    align-items: center;
    padding-left: 8px;
    font-size: 0.7rem;
    font-weight: 600;
    color: white;
    min-width: fit-content;
    transition: width 0.6s cubic-bezier(0.34,1.56,0.64,1);
}
.meta-species-row .ms-delta {
    width: 55px;
    text-align: right;
    font-size: 0.75rem;
    font-weight: 600;
    flex-shrink: 0;
}
.meta-species-row .ms-delta.up { color: var(--accent-green); }
.meta-species-row .ms-delta.down { color: var(--accent-red); }

/* Move ranking */
.meta-move-row {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 5px 0;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}
.meta-move-row .mm-rank {
    width: 24px;
    text-align: right;
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text-muted);
    flex-shrink: 0;
}
.meta-move-row .mm-type {
    width: 28px;
    flex-shrink: 0;
}
.meta-move-row .mm-name {
    flex: 1;
    font-size: 0.85rem;
    font-weight: 500;
}
.meta-move-row .mm-rate {
    width: 50px;
    text-align: right;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    flex-shrink: 0;
}
.meta-move-row .mm-delta {
    width: 45px;
    text-align: right;
    font-size: 0.7rem;
    font-weight: 600;
    flex-shrink: 0;
}
.meta-move-row .mm-delta.up { color: var(--accent-green); }
.meta-move-row .mm-delta.down { color: var(--accent-red); }

/* Weakness bars */
.meta-weakness-row {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 3px 0;
}
.meta-weakness-row .mw-type {
    width: 60px;
    font-size: 0.75rem;
    text-align: right;
    flex-shrink: 0;
}
.meta-weakness-row .mw-bar-wrap {
    flex: 1;
    height: 14px;
    background: var(--bg-secondary);
    border-radius: var(--radius-full);
    overflow: hidden;
}
.meta-weakness-row .mw-bar {
    height: 100%;
    border-radius: var(--radius-full);
    background: #F87171;
    transition: width 0.5s ease;
}
.meta-weakness-row .mw-val {
    width: 40px;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: right;
    flex-shrink: 0;
}

/* Speed buckets */
.meta-speed-row {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 4px 0;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}
.meta-speed-row .msb-label {
    width: 80px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    flex-shrink: 0;
}
.meta-speed-row .msb-bar-wrap {
    flex: 1;
    height: 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius-full);
    overflow: hidden;
}
.meta-speed-row .msb-bar {
    height: 100%;
    border-radius: var(--radius-full);
    background: linear-gradient(90deg, #3B82F6, #60A5FA);
    transition: width 0.5s ease;
}
.meta-speed-row .msb-val {
    width: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: right;
    flex-shrink: 0;
}

/* History chart */
.meta-history-chart {
    position: relative;
    padding: 0 0 30px;
}
.meta-history-chart .chart-svg {
    width: 100%;
    height: auto;
}
.meta-history-chart .grid-line {
    stroke: rgba(255,255,255,0.06);
    stroke-dasharray: 4 4;
}
.meta-history-chart .axis-label {
    font-size: 10px;
    fill: #6B7280;
    font-family: inherit;
}
.meta-history-chart .dot-group { cursor: pointer; }
.meta-history-chart .dot-visible {
    transition: r 0.15s;
}
.meta-history-chart .dot-group:hover .dot-visible { r: 7; }
.chart-tooltip {
    pointer-events: none;
    position: absolute;
    background: var(--bg-card);
    border: 1px solid var(--bg-border);
    border-radius: var(--radius-sm);
    padding: 6px 12px;
    font-size: 0.75rem;
    color: var(--text-primary);
    white-space: nowrap;
    z-index: 10;
    transform: translate(-50%, -120%);
    box-shadow: var(--shadow-md);
}
.chart-tooltip .tt-name { font-weight: 700; display: block; }
.chart-tooltip .tt-val { color: var(--text-muted); font-size: 0.7rem; }
.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin-top: var(--space-sm);
}
.chart-legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}
.chart-legend-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
}
.chart-legend-link {
    cursor: pointer;
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}
.chart-legend-link:hover { color: var(--primary-red); }
.chart-empty { text-align: center; color: var(--text-muted); padding: 48px; }
.chart-error { text-align: center; color: var(--accent-red); padding: 24px; }

/* Meta Trends delta list */
.trend-delta-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
}
.trend-delta-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color var(--transition-fast);
    text-decoration: none;
}
.trend-delta-item:hover { color: var(--primary-red); }
.trend-delta-item span { font-weight: 700; font-size: 0.8rem; }
.trend-delta-item.up span { color: var(--accent-green); }
.trend-delta-item.down span { color: var(--accent-red); }
.meta-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: var(--space-md);
    line-height: 1.5;
}



/* ==================== Guides ==================== */
.guide-content {
    max-width: 800px;
    margin: 0 auto;
    padding: var(--space-xl) 0;
}
.guide-section {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--bg-border);
    padding: var(--space-xl);
    margin-bottom: var(--space-lg);
}
.guide-section h2 {
    font-size: 1.3rem;
    color: var(--primary-yellow);
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--bg-border);
}
.guide-section h3 {
    font-size: 1.05rem;
    margin: var(--space-md) 0 var(--space-sm);
}
.guide-section p { color: var(--text-secondary); line-height: 1.8; margin-bottom: var(--space-md); }
.guide-section ul {
    padding-left: var(--space-xl);
    color: var(--text-secondary);
}
.guide-section li { margin-bottom: var(--space-sm); line-height: 1.7; }
.guide-section .highlight-box {
    background: rgba(227,53,13,0.08);
    border-left: 3px solid var(--primary-red);
    padding: var(--space-md) var(--space-lg);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    margin: var(--space-md) 0;
}

/* ==================== News ==================== */
.news-list { max-width: 800px; margin: 0 auto; }
.news-item {
    display: flex;
    gap: var(--space-lg);
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--bg-border);
    padding: var(--space-lg);
    margin-bottom: var(--space-md);
    transition: all var(--transition-fast);
}
.news-item:hover { border-color: var(--primary-red); }
.news-item .news-icon-wrap {
    width: 56px;
    height: 56px;
    background: rgba(255,255,255,0.04);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.news-item .news-icon-wrap svg { width: 28px; height: 28px; color: var(--text-muted); }
.news-item .news-info { flex: 1; }
.news-item .news-title { font-size: 1.05rem; font-weight: 600; margin-bottom: 4px; }
.news-item .news-meta { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 6px; }
.news-item .news-summary { color: var(--text-secondary); font-size: 0.9rem; line-height: 1.6; }

/* ==================== Home Page ==================== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: var(--nav-height) var(--space-lg) var(--space-3xl);
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 30% 50%, rgba(227,53,13,0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 50%, rgba(59,92,168,0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(255,203,5,0.04) 0%, transparent 40%);
    pointer-events: none;
}
.hero-content { flex: 1; max-width: 600px; z-index: 1; }
.hero-badge {
    display: inline-block;
    padding: 4px 16px;
    background: linear-gradient(135deg, var(--primary-red), #ff6b4a);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--space-lg);
}
.hero h1 {
    font-size: 3.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fff 0%, var(--primary-yellow) 50%, var(--primary-red) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.15;
    margin-bottom: var(--space-md);
}
.hero-subtitle {
    font-size: 1.3rem;
    color: var(--primary-yellow);
    font-weight: 600;
    margin-bottom: var(--space-sm);
}
.hero-desc {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-xl);
    line-height: 1.7;
}
.hero-actions {
    display: flex;
    gap: var(--space-md);
    margin-bottom: var(--space-2xl);
}
.hero-stats { display: flex; gap: var(--space-2xl); }
.stat-item { text-align: center; }
.stat-number { display: block; font-size: 2.2rem; font-weight: 700; color: var(--primary-yellow); }
.stat-label { font-size: 0.85rem; color: var(--text-muted); }
.hero-visual {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}
.pokemon-carousel {
    position: relative;
    width: 350px;
    height: 350px;
}

/* Pokemon enter/exit */
.carousel-item {
    position: absolute;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.6s ease;
}
.carousel-item.active { opacity: 1; transform: scale(1); }
.carousel-item img { max-width: 300px; max-height: 300px; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 28px;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.95rem;
    transition: all var(--transition-normal);
}
.btn-primary {
    background: linear-gradient(135deg, var(--primary-red), #ff6b4a);
    color: white;
    box-shadow: var(--shadow-glow);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 0 30px rgba(227,53,13,0.4); }
.btn-secondary {
    background: rgba(255,255,255,0.06);
    color: var(--text-primary);
    border: 1px solid var(--bg-border);
}
.btn-secondary:hover { background: rgba(255,255,255,0.1); border-color: var(--text-muted); }
.btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 20px;
    border: 1px solid var(--primary-red);
    color: var(--primary-red);
    border-radius: var(--radius-full);
    font-weight: 500;
    font-size: 0.85rem;
    transition: all var(--transition-normal);
}
.btn-outline:hover { background: var(--primary-red); color: white; }

/* Features Section */
.features,
.top-pokemon,
.quick-guide,
.news-preview { padding: var(--space-3xl) 0; margin-top: var(--space-xl); }
.features-section { padding: var(--space-3xl) 0; background: var(--bg-secondary); }
.features-section .container > h2 {
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: var(--space-sm);
}
.features-section .container > .subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: var(--space-2xl);
}
.section-title { margin-bottom: var(--space-md); }
.section-subtitle { margin-bottom: 40px; color: var(--text-secondary); }
.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
}
.feature-card {
    background: var(--bg-card);
    padding: var(--space-xl);
    border-radius: var(--radius-lg);
    border: 1px solid var(--bg-border);
    transition: all var(--transition-normal);
    cursor: pointer;
    display: flex;
    flex-direction: column;
}
.feature-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary-red);
    box-shadow: var(--shadow-md);
}
.feature-card .fc-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary-red), var(--primary-yellow));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-md);
}
.feature-card .fc-icon svg { width: 24px; height: 24px; color: white; }

/* Search feature specific icon - large white magnifying glass */
.feature-card .feature-icon {
    width: 80px;
    height: 80px;
    background: none;
    border-radius: 0;
    margin-bottom: var(--space-lg);
}
.feature-card .feature-icon svg {
    width: 64px;
    height: 64px;
    color: white;
    stroke-width: 3;
}
.feature-card h3 { font-size: 1.1rem; margin-bottom: var(--space-sm); }
.feature-card p { color: var(--text-secondary); font-size: 0.9rem; flex: 1; }
.feature-card .fc-link { color: var(--primary-red); font-weight: 600; font-size: 0.85rem; margin-top: var(--space-md); }

/* ==================== Loading ==================== */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--bg-border);
    border-top-color: var(--primary-red);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: var(--space-xl); gap: var(--space-md); color: var(--text-muted); }
.loading-more { grid-column: 1 / -1; display: flex; justify-content: center; align-items: center; gap: var(--space-sm); padding: var(--space-xl); color: var(--text-muted); }

/* ==================== Footer ==================== */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--bg-border);
    padding: var(--space-3xl) 0 var(--space-xl);
    margin-top: var(--space-3xl);
}
.footer-content { display: flex; justify-content: space-between; gap: var(--space-3xl); margin-bottom: var(--space-xl); flex-wrap: wrap; }
.footer-brand h3 {
    font-size: 1.1rem;
    margin-bottom: var(--space-sm);
    color: var(--primary-red);
}
.footer-brand p { color: var(--text-secondary); max-width: 300px; font-size: 0.9rem; }
.footer-links { display: flex; gap: var(--space-3xl); }
.link-group h4 {
    font-size: 0.85rem;
    margin-bottom: var(--space-sm);
    color: var(--primary-yellow);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.link-group a {
    display: block;
    color: var(--text-secondary);
    font-size: 0.85rem;
    padding: 3px 0;
    transition: color var(--transition-fast);
}
.link-group a:hover { color: var(--text-primary); }
.footer-bottom {
    padding-top: var(--space-xl);
    border-top: 1px solid var(--bg-border);
    text-align: center;
}
.footer-bottom p { color: var(--text-muted); font-size: 0.8rem; line-height: 1.7; margin-bottom: 4px; }

/* ==================== Scrollbar ==================== */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--bg-border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ==================== Responsive ==================== */
@media (max-width: 1024px) {
    .feature-grid { grid-template-columns: repeat(2, 1fr); }
    .hero h1 { font-size: 2.5rem; }
    .team-slots { grid-template-columns: repeat(3, 1fr); }
    .damage-layout { grid-template-columns: 1fr; }
    .damage-vs { padding-top: var(--space-md); transform: rotate(90deg); }
    .compare-layout { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .nav-menu {
        display: none;
        position: fixed;
        top: var(--nav-height);
        left: 0; right: 0; bottom: 0;
        background: var(--bg-primary);
        flex-direction: column;
        justify-content: flex-start;
        padding: var(--space-lg);
        gap: var(--space-xs);
        overflow-y: auto;
        z-index: 1000;
    }
    .nav-menu.active { display: flex; }
    .nav-menu > li { width: 100%; }
    .nav-menu > li > a,
    .nav-menu > li > button { width: 100%; justify-content: flex-start; padding: 12px; }
    .nav-dropdown {
        position: static;
        transform: none !important;
        opacity: 1;
        visibility: visible;
        box-shadow: none;
        background: transparent;
        border: none;
        padding-left: var(--space-lg);
        display: none;
    }
    .nav-menu > li.expanded .nav-dropdown { display: block; transform: none !important; opacity: 1; visibility: visible; }
    .nav-right { order: 1; }
    .mobile-menu-btn { display: flex; margin-left: auto; order: 2; }
    .desktop-only { display: none; }
    .mobile-only { display: flex; }
    
    .lang-current { padding: 4px 8px; font-size: 0.75rem; min-width: 40px; }
    .lang-dropdown { left: 0; right: auto; min-width: 120px; }
    
    .hero { flex-direction: column; text-align: center; padding-top: calc(var(--nav-height) + var(--space-xl)); }
    .hero h1 { font-size: 2.2rem; }
    .hero-visual { margin-top: var(--space-xl); }
    .pokemon-carousel { width: 240px; height: 240px; }
    .carousel-item img { max-width: 180px; max-height: 180px; }
    .hero-actions { justify-content: center; }
    .hero-stats { justify-content: center; }
    
    .feature-grid { grid-template-columns: 1fr; }
    .filters-bar { flex-direction: column; }
    .search-box { width: 100%; }
    .filter-group { width: 100%; }
    .filter-group select { flex: 1; width: 100%; }
    .team-slots { grid-template-columns: repeat(2, 1fr); }
    .pokemon-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
    .pokemon-detail-top { flex-direction: column; text-align: center; }
    .footer-content { flex-direction: column; gap: var(--space-xl); }
    .footer-links { flex-direction: column; gap: var(--space-lg); }
    .compare-layout { grid-template-columns: 1fr; }
    .compare-slots { grid-template-columns: repeat(2, 1fr); }
    
    .calc-main { grid-template-columns: 1fr; }
    .calc-center { padding-top: 0; flex-direction: row; flex-wrap: wrap; justify-content: center; }
    
    .meta-grid { grid-template-columns: 1fr; }
    .meta-species-row .ms-poke { width: 100px; }
    
    .moves-table-wrap,
    .speed-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .compare-result { overflow-x: auto; }
    
    .team-card-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
    
    /* Task A: container padding */
    .container { padding: 0 var(--space-md); }
    
    /* Task B: modal padding */
    .modal { padding: var(--space-sm); }
    .modal-header { padding: var(--space-sm) var(--space-md); }
    .modal-body { padding: var(--space-md); }
    .modal-content { max-width: 100%; border-radius: var(--radius-md); }
    
    /* Task C: effectiveness-table scroll */
    .effectiveness-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    
    /* Task E: stat-ev-row compact */
    .stat-ev-row { grid-template-columns: 50px 1fr 40px auto; gap: var(--space-xs); font-size: 0.8rem; }
}

@media (max-width: 480px) {
    .container { padding: 0 var(--space-sm); }
    .page-header { padding: calc(var(--nav-height) + var(--space-md)) 0 var(--space-md); }
    .pokemon-detail-top img { width: 100px; height: 100px; }
    .guide-section { padding: var(--space-md); }
    .team-card-grid { grid-template-columns: 1fr; }
    .team-slots { grid-template-columns: 1fr; }
    .compare-slots { grid-template-columns: 1fr; }
    .meta-species-row .ms-poke { width: 80px; }
    .pokemon-carousel { width: 200px; height: 200px; }
}

/* ==================== Game Effects ==================== */

/* ---- 3D Card Tilt ---- */
.feature-card {
    transform-style: preserve-3d;
    perspective: 800px;
    transition: transform 0.1s ease-out, border-color 0.3s, box-shadow 0.3s;
    position: relative;
    overflow: hidden;
}
.feature-card::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--primary-red), var(--primary-yellow), var(--primary-blue));
    opacity: 0;
    z-index: -1;
    transition: opacity 0.4s;
}
.feature-card:hover::before { opacity: 0.15; }
.feature-card:hover {
    box-shadow: 0 0 30px rgba(227,53,13,0.25), 0 12px 40px rgba(0,0,0,0.5);
    border-color: rgba(227,53,13,0.4);
}
.feature-card .feature-icon {
    transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
.feature-card:hover .feature-icon { transform: scale(1.1) translateY(-3px); }

/* ---- Pokemon Card Hover ---- */
.pokemon-card {
    transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}
.pokemon-card:hover { transform: translateY(-6px); box-shadow: 0 8px 30px rgba(227,53,13,0.2); }

/* ---- Type Badge Pulse ---- */
.type-badge {
    transition: transform 0.2s, box-shadow 0.2s;
}
.type-badge:hover {
    transform: scale(1.1);
    box-shadow: 0 0 12px currentColor;
}
@keyframes type-shimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

/* ---- Button Glow ---- */
.btn-primary {
    position: relative;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.3s, background 0.3s;
}
.btn-primary::after {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.25) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.3s;
}
.btn-primary:hover::after { opacity: 1; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 25px rgba(227,53,13,0.4); }
.btn-primary:active { transform: translateY(0) scale(0.97); }

.btn-outline {
    transition: transform 0.2s, box-shadow 0.3s, border-color 0.3s, color 0.3s;
}
.btn-outline:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255,203,5,0.2);
    border-color: var(--primary-yellow);
    color: var(--primary-yellow);
}

/* ---- Nav Dropdown Smooth ---- */
.nav-dropdown {
    transition: opacity 0.25s cubic-bezier(0.4,0,0.2,1), visibility 0.25s, transform 0.25s cubic-bezier(0.34,1.56,0.64,1);
    transform-origin: top center;
}
.nav-menu > li:hover .nav-dropdown,
.nav-menu > li.expanded .nav-dropdown {
    transform: translateX(-50%) translateY(0) scale(1);
}
.nav-dropdown a {
    transition: background 0.2s, color 0.2s, transform 0.2s;
}
.nav-dropdown a:hover { transform: translateX(4px); }

/* ---- Flash Effect ---- */
.flash-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 60px;
    height: 60px;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 20;
    opacity: 0;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.9) 0%, rgba(255,203,5,0.6) 40%, transparent 70%);
}
.flash-overlay.active { animation: flash-burst 0.5s ease-out forwards; }
@keyframes flash-burst {
    0% { opacity: 0.9; width: 20px; height: 20px; }
    50% { opacity: 0.5; width: 200px; height: 200px; }
    100% { opacity: 0; width: 300px; height: 300px; }
}

/* ---- Hero Carousel ---- */
.carousel-item {
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.carousel-item.active { transform: scale(1); }
.carousel-item:not(.active) { transform: scale(0.92); }
.carousel-item img {
    transition: filter 0.4s, transform 0.4s;
}
.carousel-item.active img {
    animation: pokemon-float 3s ease-in-out infinite;
}
@keyframes pokemon-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}
.hero-badge {
    animation: badge-pulse 2s ease-in-out infinite;
}
@keyframes badge-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(227,53,13,0.4); }
    50% { box-shadow: 0 0 20px 4px rgba(227,53,13,0.2); }
}

/* ---- Scroll Reveal ---- */
.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.scroll-reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ---- Pokéball Particles ---- */
#particles-canvas {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 0;
}

/* ---- Usage Bar Animate ---- */
.rank-bar {
    transition: width 0.8s cubic-bezier(0.34,1.56,0.64,1);
    background: linear-gradient(90deg, var(--primary-red), var(--primary-yellow));
}

/* ---- Loading Spinner Game Style ---- */
@keyframes spin {
    to { transform: rotate(360deg); }
}
.loading-spinner {
    border-top-color: var(--primary-yellow) !important;
    animation: spin 0.6s linear infinite;
}

/* ---- Move Card Hover ---- */
.move-item {
    transition: transform 0.2s, background 0.2s;
}
.move-item:hover {
    transform: translateX(4px);
    background: rgba(255,255,255,0.03);
}

/* ---- Team Slot Hover ---- */
.team-slot {
    transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}
.team-slot:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(227,53,13,0.15);
    border-color: rgba(227,53,13,0.3);
}

/* ---- Stat Bar Animate ---- */
.stat-bar {
    transition: width 0.6s cubic-bezier(0.34,1.56,0.64,1);
}

/* ---- Speed Row Hover ---- */
.speed-table tbody tr {
    transition: background 0.2s;
}
.speed-table tbody tr:hover { background: rgba(255,255,255,0.03); }

/* ---- Meta Row Hover ---- */
.usage-bar-row {
    transition: transform 0.2s, background 0.2s;
}
.usage-bar-row:hover {
    transform: translateX(4px);
    background: rgba(255,255,255,0.03);
}

/* ---- Guide Card Hover ---- */
.guide-card {
    transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}
.guide-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
    border-color: rgba(255,203,5,0.3);
}

/* ==================== Back to Top ==================== */
#backToTop {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1500;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 2px solid var(--bg-border);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
}
#backToTop.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
#backToTop:hover {
    border-color: var(--primary-red);
    box-shadow: 0 0 16px rgba(227,53,13,0.3);
}
#backToTop svg {
    width: 28px;
    height: 28px;
}
/* ==================== Ad Containers ==================== */
.ad-container {
    overflow: hidden;
    text-align: center;
    margin: var(--space-xl) auto;
    min-height: 90px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--bg-border);
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 800px;
}
.ad-container[data-ad-format="auto"] {
    min-height: 90px;
}
.ad-container[data-ad-format="horizontal"] {
    min-height: 90px;
    max-width: 728px;
}
.ad-container.inline-ad {
    margin: var(--space-md) auto;
    min-height: 100px;
}
.ad-container.footer-ad {
    margin: var(--space-lg) auto 0;
    min-height: 90px;
    max-width: 728px;
}
.ad-container .ad-label {
    display: block;
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 4px 0;
    text-align: center;
}
/* 未加载广告时的占位样式 */
.ad-container:empty::after {
    content: '';
    display: block;
    min-height: 90px;
}
/* 移动端广告适配 */
@media (max-width: 480px) {
    .ad-container {
        min-height: 50px;
        margin: var(--space-md) auto;
    }
}

.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
