/* Стили версии для игроков.
 * В основе — те же стили, что и в основной системе,
 * чтобы страница выглядела знакомо.
 */

@import url('https://fonts.googleapis.com/css2?family=Play:wght@400;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Play', sans-serif;
}

body {
    font-family: 'Play', sans-serif;
    background: #1a1a1a;
    min-height: 100vh;
    padding: 20px;
    color: white;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Заголовок */
header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.subtitle {
    font-size: 1.1em;
    opacity: 0.9;
}

/* Основной контент */
.main-content {
    background: #2a2a2a;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

/* Табы */
.tabs {
    display: flex;
    background: #1a1a1a;
    border-bottom: 2px solid #424242;
}

.tab-btn {
    flex: 1;
    padding: 15px 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    color: #ccc;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
}

.tab-btn:hover {
    background: #333;
    color: white;
}

.tab-btn.active {
    background: #2a2a2a;
    color: #2196f3;
    border-bottom-color: #2196f3;
}

/* Контент табов */
.tab-content {
    display: none;
    padding: 30px;
    background: #2a2a2a;
    color: white;
}

.tab-content.active {
    display: block;
}

/* Пустые сообщения */
.empty-message {
    text-align: center;
    padding: 40px;
    color: #999;
    font-style: italic;
}

/* Рейтинг */
.rating-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.sort-btn {
    padding: 10px 20px;
    border: 2px solid #2196f3;
    background: transparent;
    color: #2196f3;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 500;
    transition: all 0.3s;
}

.sort-btn:hover {
    background: #2196f3;
    color: white;
}

.sort-btn.active {
    background: #2196f3;
    color: white;
}

.rating-table-container {
    overflow-x: auto;
}

#rating-table {
    width: 100%;
    border-collapse: collapse;
    background: #2a2a2a;
    color: white;
}

#rating-table thead {
    background: #1a1a1a;
    color: white;
}

#rating-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #424242;
}

#rating-table tbody tr {
    border-bottom: 1px solid #424242;
    transition: background 0.2s;
}

#rating-table tbody tr:hover {
    background: #333;
}

#rating-table tbody tr.first-place {
    background: linear-gradient(135deg, #fff9c4 0%, #fff59d 100%);
    font-weight: 600;
    color: #856404;
}

#rating-table tbody tr.first-place td {
    color: #856404;
}

#rating-table tbody tr.second-place {
    background: linear-gradient(135deg, #e8e8e8 0%, #d0d0d0 100%);
    font-weight: 600;
    color: #555;
}

#rating-table tbody tr.second-place td {
    color: #555;
}

#rating-table tbody tr.third-place {
    background: linear-gradient(135deg, #e8d5b7 0%, #d4a574 100%);
    font-weight: 600;
    color: #6d4c1f;
}

#rating-table tbody tr.third-place td {
    color: #6d4c1f;
}

#rating-table td {
    padding: 12px 15px;
    color: white;
}

.rank {
    font-weight: bold;
    color: #2196f3;
    width: 60px;
}

.team-name {
    font-weight: 500;
    color: white;
}

.rating-value {
    font-weight: bold;
    font-size: 1.1em;
    color: white;
}

.wins {
    color: #4caf50;
    font-weight: 500;
}

.losses {
    color: #f44336;
    font-weight: 500;
}

/* Команды по буквам */
.teams-letter-block {
    margin-bottom: 25px;
}

.teams-letter-heading {
    font-size: 1.4em;
    margin-bottom: 10px;
    color: #2196f3;
}

.teams-letter-list {
    list-style: none;
    border-radius: 10px;
    border: 1px solid #424242;
    background: #333;
    padding: 10px 15px;
}

.teams-letter-item {
    display: flex;
    flex-direction: column;
    padding: 8px 0;
    border-bottom: 1px solid #424242;
}

.teams-letter-item:last-child {
    border-bottom: none;
}

.teams-letter-item-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.teams-letter-name {
    font-weight: 500;
}

.teams-letter-city {
    font-size: 0.9em;
    color: #ccc;
}

.teams-letter-item-stats {
    display: flex;
    gap: 10px;
    font-size: 0.85em;
    color: #aaa;
    flex-wrap: wrap;
}

/* Турниры */
.tournaments-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    padding: 20px 0;
    border-bottom: 2px solid #424242;
}

.tournaments-page-title h2 {
    margin: 0 0 10px 0;
    color: white;
    font-size: 1.8em;
}

.tournaments-description {
    color: #ccc;
    font-size: 0.95em;
    margin: 0;
}

.tournaments-table-container {
    overflow-x: auto;
}

.tournaments-table {
    width: 100%;
    border-collapse: collapse;
    background: #2a2a2a;
    color: white;
}

.tournaments-table thead {
    background: #1a1a1a;
}

.tournaments-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: white;
    border-bottom: 2px solid #424242;
    font-size: 0.95em;
    white-space: nowrap;
}

.tournaments-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #424242;
    font-size: 0.9em;
    color: white;
}

.tournaments-table tbody tr:hover {
    background: #333;
}

.tournament-name-cell {
    font-weight: 500;
    color: #2196f3;
}

/* Матчи */
.matches-table-container {
    overflow-x: auto;
    border: 1px solid #424242;
    border-radius: 8px;
    background: #2a2a2a;
    width: 100%;
}

.matches-table {
    width: 100%;
    min-width: 900px;
    border-collapse: collapse;
    background: #2a2a2a;
    color: white;
}

.matches-table thead {
    background: #1a1a1a;
}

.matches-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: white;
    border-bottom: 2px solid #424242;
    font-size: 0.9em;
    white-space: nowrap;
}

.matches-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #424242;
    font-size: 0.9em;
    color: white;
}

.matches-table tbody tr:hover {
    background: #333;
}

.team-winner {
    color: #4caf50 !important;
    font-weight: 700;
}

.team-loser {
    color: #f44336 !important;
}

/* Модальное окно команды */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: #1a1a1a;
    border-radius: 10px;
    padding: 0;
    max-width: 1000px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    border: 1px solid #424242;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #424242;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.4em;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #ccc;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.modal-close:hover {
    background: #333;
    color: white;
}

.modal-body {
    padding: 20px;
}

.team-summary {
    margin-bottom: 20px;
    font-size: 0.95em;
    color: #ddd;
}

.team-summary p {
    margin: 4px 0;
}

/* Адаптивность */
@media (max-width: 768px) {
    header h1 {
        font-size: 2em;
    }

    .tab-content {
        padding: 20px;
    }

    .rating-table-container {
        overflow-x: scroll;
    }

    #rating-table {
        font-size: 0.9em;
    }

    #rating-table th,
    #rating-table td {
        padding: 8px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    .tabs {
        flex-direction: column;
    }

    .tab-btn {
        border-bottom: 1px solid #424242;
        border-right: none;
    }

    .tab-btn.active {
        border-bottom-color: #424242;
        border-left: 3px solid #2196f3;
    }
}

