* {
    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;
}

.diagonal-cell {
    background: repeating-linear-gradient(
            45deg,
            #e9ecef,
            #e9ecef 3px,
            #dee2e6 3px,
            #dee2e6 6px
    );
    color: #6c757d;
    font-weight: bold;
    position: relative;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 2.5rem;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

a {
    text-decoration: none;
}

.tournament-info {
    text-align: center;
    background: linear-gradient(45deg, #3498db, #2980b9);
    color: white;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 30px;
    font-size: 1.1rem;
    font-weight: 500;
}

.group-section {
    margin-bottom: 40px;
}

.group-title {
    background: linear-gradient(45deg, #e74c3c, #c0392b);
    background: linear-gradient(45deg, #3498db, #2980b9);
    color: white;
    padding: 15px 20px;
    border-radius: 10px 10px 0 0;
    font-size: 1.5rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 0;
}

.table-container {
    overflow-x: auto;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    font-size: 0.9rem;
}

th, td {
    padding: 12px 8px;
    text-align: center;
    border: 1px solid #e0e0e0;
    transition: all 0.3s ease;
}

th {
    background: linear-gradient(135deg, #34495e, #2c3e50);
    color: white;
    font-weight: 600;
    position: relative;
    cursor: pointer;
    user-select: none;
}

th:hover {
    background: linear-gradient(135deg, #2c3e50, #34495e);
}

th.sortable::after {
    content: ' ^v';
    opacity: 0.5;
}

th.sort-asc::after {
    content: ' ^';
    opacity: 1;
    color: #3498db;
}

th.sort-desc::after {
    content: ' v';
    opacity: 1;
    color: #3498db;
}

.player-name {
    background: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
    text-align: left;
    min-width: 150px;
}

.match-result {
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    background: #e8f5e8;
    color: #27ae60;
}

.points-cell {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
    font-weight: bold;
    font-size: 1.1rem;
}

.empty-cell {
    background: #ecf0f1;
}

tbody tr:hover {
    background: #f1c40f;
    transform: scale(1.02);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.back-button {
    display: inline-block;
    margin-top: 30px;
    padding: 15px 30px;
    background: linear-gradient(45deg, #9b59b6, #8e44ad);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.back-button:hover {
    background: linear-gradient(45deg, #8e44ad, #9b59b6);
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 20px;
    }

    h1 {
        font-size: 2rem;
    }

    table {
        font-size: 0.8rem;
    }

    th, td {
        padding: 8px 4px;
    }

    .player-name {
        min-width: 120px;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.5rem;
    }

    table {
        font-size: 0.75rem;
    }

    th, td {
        padding: 6px 3px;
    }

    .tournament-info {
        font-size: 1rem;
        padding: 10px;
    }
}
