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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    padding: 30px;
    text-align: center;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.trainer-info {
    background: rgba(255, 255, 255, 0.2);
    padding: 15px;
    border-radius: 10px;
    margin-top: 15px;
}

.trainer-info p {
    margin: 5px 0;
    font-size: 1.1rem;
}

main {
    padding: 30px;
}

section {
    margin-bottom: 40px;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

h2 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.8rem;
    border-bottom: 3px solid #667eea;
    padding-bottom: 10px;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

select {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s;
}

select:hover, select:focus {
    border-color: #667eea;
    outline: none;
}

.btn {
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
}

.btn-battle {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    width: 100%;
    margin-top: 10px;
}

.btn-battle:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(245, 87, 108, 0.4);
}

.btn-battle:active {
    transform: translateY(0);
}

.btn-battle:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.battle-result {
    margin-top: 25px;
    padding: 25px;
    background: white;
    border-radius: 12px;
    border-left: 5px solid #667eea;
}

.battle-result.hidden {
    display: none;
}

.battle-result h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.battle-result.win h3 {
    color: #28a745;
}

.battle-result.loss h3 {
    color: #dc3545;
}

.battle-details {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.battle-move {
    text-align: center;
    flex: 1;
}

.vs {
    font-size: 1.5rem;
    font-weight: bold;
    color: #667eea;
    margin: 0 20px;
}

.new-stats {
    margin-top: 15px;
    padding: 15px;
    background: #e7f3ff;
    border-radius: 8px;
    font-weight: 600;
    color: #0066cc;
}

.trainers-list, .leaderboard, .battles-list {
    display: grid;
    gap: 15px;
}

.trainer-card, .battle-card {
    background: white;
    padding: 15px;
    border-radius: 10px;
    border-left: 4px solid #667eea;
    transition: transform 0.2s;
}

.trainer-card:hover, .battle-card:hover {
    transform: translateX(5px);
}

.trainer-card h3 {
    color: #667eea;
    margin-bottom: 8px;
    font-size: 1.2rem;
}

.trainer-card p, .battle-card p {
    margin: 5px 0;
    color: #666;
}

.leaderboard {
    display: block;
}

.leaderboard-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 10px;
    border-left: 4px solid #667eea;
}

.leaderboard-item:nth-child(1) {
    border-left-color: #ffd700;
    background: linear-gradient(90deg, #fff9e6 0%, white 100%);
}

.leaderboard-item:nth-child(2) {
    border-left-color: #c0c0c0;
    background: linear-gradient(90deg, #f5f5f5 0%, white 100%);
}

.leaderboard-item:nth-child(3) {
    border-left-color: #cd7f32;
    background: linear-gradient(90deg, #fff4e6 0%, white 100%);
}

.leaderboard-rank {
    font-size: 1.5rem;
    font-weight: bold;
    color: #667eea;
    margin-right: 15px;
    min-width: 40px;
}

.leaderboard-info {
    flex: 1;
}

.leaderboard-name {
    font-weight: 600;
    font-size: 1.1rem;
    color: #333;
}

.leaderboard-stats {
    color: #666;
    font-size: 0.9rem;
}

.global-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    border-top: 4px solid #667eea;
}

.stat-card h3 {
    font-size: 2rem;
    color: #667eea;
    margin-bottom: 5px;
}

.stat-card p {
    color: #666;
    font-size: 0.9rem;
}

.loading {
    text-align: center;
    color: #999;
    font-style: italic;
}

.error {
    color: #dc3545;
    padding: 15px;
    background: #ffe6e6;
    border-radius: 8px;
    border-left: 4px solid #dc3545;
}

.status-online {
    color: #28a745;
    font-weight: bold;
}

.status-offline {
    color: #999;
}

footer {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    color: #666;
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    header h1 {
        font-size: 1.8rem;
    }

    .battle-details {
        flex-direction: column;
        gap: 15px;
    }

    .vs {
        margin: 10px 0;
    }

    .global-stats {
        grid-template-columns: 1fr;
    }
}
