/* Pokemon Gen 3 Emerald Style CSS */
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

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

body {
    font-family: 'Press Start 2P', cursive;
    background: linear-gradient(135deg, #2a5d31 0%, #1a3d21 50%, #0d1f11 100%);
    color: #ffffff;
    min-height: 100vh;
    font-size: 8px;
    overflow-x: auto;
}

.game-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: 
        radial-gradient(circle at 20% 20%, rgba(255,255,255,0.1) 1px, transparent 1px),
        radial-gradient(circle at 80% 80%, rgba(255,255,255,0.05) 1px, transparent 1px),
        linear-gradient(135deg, #2a5d31 0%, #1a3d21 50%, #0d1f11 100%);
    min-height: 100vh;
}

/* Header Styling */
.pokemon-header {
    background: linear-gradient(45deg, #4a7c59 0%, #2a5d31 50%, #1a3d21 100%);
    border: 4px solid #ffffff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    text-align: center;
    box-shadow: 
        0 0 0 2px #000000,
        inset 0 2px 4px rgba(255,255,255,0.3),
        0 4px 8px rgba(0,0,0,0.5);
    position: relative;
}

.pokemon-header::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 20px;
    background: #ff6b6b;
    border-radius: 50%;
    border: 2px solid #ffffff;
    box-shadow: 0 0 0 2px #000000;
}

.game-title {
    font-size: clamp(10px, 4vw, 16px);
    color: #ffff00;
    text-shadow: 2px 2px 0px #000000, -1px -1px 0px #000000;
    margin-bottom: 10px;
    letter-spacing: 2px;
}

.game-title a:hover {
    color: #ffff99;
    transition: color 0.2s ease;
}

.subtitle {
    font-size: 10px;
    color: #ffffff;
    text-shadow: 1px 1px 0px #000000;
    letter-spacing: 1px;
}

/* Stats Panel */
.stats-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.stat-box {
    background: linear-gradient(145deg, #3a6b41 0%, #2a5d31 100%);
    border: 3px solid #ffffff;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    box-shadow: 
        0 0 0 1px #000000,
        inset 0 1px 2px rgba(255,255,255,0.2),
        0 2px 4px rgba(0,0,0,0.3);
}

.stat-label {
    display: block;
    font-size: 7px;
    color: #cccccc;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 14px;
    color: #ffff00;
    text-shadow: 1px 1px 0px #000000;
}

/* Command Stats */
.command-stats {
    background: linear-gradient(145deg, #3a6b41 0%, #2a5d31 100%);
    border: 3px solid #ffffff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 
        0 0 0 1px #000000,
        inset 0 1px 3px rgba(255,255,255,0.2),
        0 3px 6px rgba(0,0,0,0.3);
}

.section-title {
    font-size: 12px;
    color: #ffff00;
    text-shadow: 1px 1px 0px #000000;
    text-align: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(255,255,255,0.3);
}

.command-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: 1fr;
}

@media (min-width: 480px) {
    .command-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 768px) {
    .command-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.command-item {
    display: flex;
    align-items: center;
    gap: 15px;
    background: linear-gradient(90deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 6px;
    padding: 8px 12px;
}

.command-name {
    font-size: 9px;
    color: #ffffff;
    min-width: 60px;
    text-shadow: 1px 1px 0px #000000;
}

.command-bar {
    flex: 1;
    background: #1a3d21;
    border: 1px solid #ffffff;
    border-radius: 4px;
    height: 12px;
    position: relative;
    overflow: hidden;
}

.command-fill {
    background: linear-gradient(90deg, #4CAF50 0%, #66BB6A 50%, #81C784 100%);
    height: 100%;
    transition: width 0.5s ease;
    box-shadow: inset 0 1px 2px rgba(255,255,255,0.3);
}

.command-count {
    font-size: 8px;
    color: #ffffff;
    min-width: 30px;
    text-align: right;
}

/* Leaderboard Container */
.leaderboard-container {
    background: linear-gradient(145deg, #3a6b41 0%, #2a5d31 100%);
    border: 4px solid #ffffff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 
        0 0 0 2px #000000,
        inset 0 2px 4px rgba(255,255,255,0.2),
        0 4px 8px rgba(0,0,0,0.4);
}

/* Champion Card */
.champion-card {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4a 50%, #f1c40f 100%);
    color: #000000;
    border: 4px solid #ffffff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 
        0 0 0 2px #000000,
        inset 0 2px 4px rgba(255,255,255,0.4),
        0 6px 12px rgba(255,215,0,0.3),
        0 0 20px rgba(255,215,0,0.2);
    position: relative;
    display: flex;
    align-items: center;
    gap: 20px;
}

.champion-card::before {
    content: '⭐';
    position: absolute;
    top: -12px;
    left: -12px;
    font-size: 24px;
    animation: sparkle 2s infinite;
}

.champion-card::after {
    content: '⭐';
    position: absolute;
    bottom: -12px;
    right: -12px;
    font-size: 24px;
    animation: sparkle 2s infinite 1s;
}

@keyframes sparkle {
    0%, 100% { opacity: 1; transform: scale(1) rotate(0deg); }
    50% { opacity: 0.5; transform: scale(1.2) rotate(180deg); }
}

.rank-badge {
    font-size: 24px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    text-shadow: 1px 1px 0px #000000;
    border: 3px solid #ffffff;
    box-shadow: 0 0 0 1px #000000;
}

.rank-badge.champion {
    background: linear-gradient(45deg, #ffd700, #ffed4a);
    color: #000000;
    font-size: 30px;
}

.trainer-name {
    font-size: clamp(8px, 2.5vw, 14px);
    font-weight: bold;
    text-shadow: 1px 1px 0px rgba(0,0,0,0.5);
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.trainer-title {
    font-size: 8px;
    opacity: 0.8;
    margin-bottom: 5px;
}

.vote-count {
    font-size: clamp(6px, 2vw, 10px);
    font-weight: bold;
    white-space: nowrap;
}

.command-breakdown {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 7px;
}

.breakdown-item {
    background: rgba(0,0,0,0.2);
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid rgba(0,0,0,0.3);
}

/* Elite Four */
.elite-four {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.elite-card {
    background: linear-gradient(135deg, #8e44ad 0%, #9b59b6 50%, #a569bd 100%);
    border: 3px solid #ffffff;
    border-radius: 10px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 
        0 0 0 1px #000000,
        inset 0 1px 2px rgba(255,255,255,0.2),
        0 3px 6px rgba(142,68,173,0.3);
}

.rank-badge.elite {
    background: linear-gradient(45deg, #8e44ad, #9b59b6);
    color: #ffffff;
    font-size: 16px;
}

.command-summary {
    font-size: 7px;
    opacity: 0.9;
}

/* Gym Leaders */
.gym-leaders {
    margin-top: 20px;
}

.gym-title {
    font-size: 10px;
    color: #ffff00;
    text-shadow: 1px 1px 0px #000000;
    text-align: center;
    margin-bottom: 15px;
}

.gym-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}

.gym-card {
    background: linear-gradient(135deg, #34495e 0%, #2c3e50 100%);
    border: 2px solid #ffffff;
    border-radius: 8px;
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 
        0 0 0 1px #000000,
        inset 0 1px 2px rgba(255,255,255,0.1),
        0 2px 4px rgba(0,0,0,0.3);
    transition: transform 0.2s ease;
}

.gym-card:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 0 0 1px #000000,
        inset 0 1px 2px rgba(255,255,255,0.1),
        0 4px 8px rgba(0,0,0,0.4);
}

.rank-badge.gym {
    background: linear-gradient(45deg, #34495e, #2c3e50);
    color: #ffffff;
    font-size: 12px;
    width: 30px;
    height: 30px;
}

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

.gym-name {
    font-size: 8px;
    color: #ffffff;
}

.gym-votes {
    font-size: clamp(4px, 1.5vw, 6px);
    color: #bdc3c7;
    white-space: nowrap;
}

/* Footer */
.pokemon-footer {
    background: linear-gradient(45deg, #2c3e50 0%, #34495e 100%);
    border: 3px solid #ffffff;
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    margin-bottom: 20px;
    box-shadow: 
        0 0 0 1px #000000,
        inset 0 1px 2px rgba(255,255,255,0.1);
}

.footer-text p {
    font-size: 8px;
    margin-bottom: 5px;
    color: #ecf0f1;
}

/* Refresh Indicator */
.refresh-indicator {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(0,0,0,0.8);
    color: #ffffff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 7px;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        font-size: 7px;
    }
    
    .game-title {
        font-size: 12px;
    }
    
    .subtitle {
        font-size: 8px;
    }
    
    .champion-card {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .elite-four {
        grid-template-columns: 1fr;
    }
    
    .gym-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
    
    .stats-panel {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .game-container {
        padding: 10px;
    }
    
    body {
        font-size: 6px;
    }
    
    .game-title {
        font-size: 10px;
    }
}

/* Loading Animation */
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.loading {
    animation: pulse 1.5s infinite;
}