* {
    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: 1400px;
    margin: 0 auto;
}

.header {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.header h1 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 2.5em;
}

.match-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.info-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.info-card h3 {
    font-size: 0.9em;
    opacity: 0.9;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.info-card .value {
    font-size: 1.8em;
    font-weight: bold;
}

.teams-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.team-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.team-card.team1 {
    border-left: 5px solid #4CAF50;
}

.team-card.team2 {
    border-left: 5px solid #f44336;
}

.team-card h2 {
    margin-bottom: 20px;
    font-size: 1.8em;
}

.team-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.stat-item {
    text-align: center;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 8px;
}

.stat-item .label {
    font-size: 0.85em;
    color: #666;
    margin-bottom: 5px;
}

.stat-item .value {
    font-size: 1.5em;
    font-weight: bold;
    color: #333;
}

.controls {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
}

.controls input,
.controls select {
    padding: 10px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s;
}

.controls input:focus,
.controls select:focus {
    outline: none;
    border-color: #667eea;
}

.controls label {
    font-weight: 600;
    color: #333;
}

.stats-table {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    position: relative;
}

th:hover {
    background: rgba(255, 255, 255, 0.1);
}

th::after {
    content: ' ↕';
    opacity: 0.5;
    font-size: 0.8em;
}

th.sorted-asc::after {
    content: ' ↑';
    opacity: 1;
}

th.sorted-desc::after {
    content: ' ↓';
    opacity: 1;
}

td {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
}

tbody tr {
    transition: background-color 0.2s;
}

tbody tr:hover {
    background-color: #f5f5f5;
}

tbody tr.team1 {
    background-color: rgba(76, 175, 80, 0.05);
}

tbody tr.team2 {
    background-color: rgba(244, 67, 54, 0.05);
}

.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: 600;
}

.badge.leader {
    background: #ffd700;
    color: #333;
}

.badge.disconnected {
    background: #ccc;
    color: #666;
}

.kdr {
    font-weight: bold;
}

.kdr.positive {
    color: #4CAF50;
}

.kdr.negative {
    color: #f44336;
}

.vehicles-list {
    font-size: 0.9em;
    color: #666;
}

.kits-list {
    font-size: 0.9em;
    color: #666;
}

.loading {
    text-align: center;
    padding: 50px;
    font-size: 1.2em;
    color: white;
}

.error {
    background: #f44336;
    color: white;
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
    text-align: center;
}

@media (max-width: 768px) {
    .teams-comparison {
        grid-template-columns: 1fr;
    }

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

    .match-info {
        grid-template-columns: 1fr;
    }

    table {
        font-size: 0.9em;
    }

    th, td {
        padding: 8px;
    }
}

