/* Стили для страницы рейтинга */

/* Селектор сезона */
.season-selector-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding: 15px;
}

.season-selector-container label {
    color: #ffd700;
    font-weight: bold;
    font-size: 14px;
    margin: 0;
}

.season-selector-container select {
    padding: 8px 12px;
    background: #3a3a3a;
    color: white;
    border: 1px solid #555;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 150px;
}

.season-selector-container select:hover {
    background: #4a4a4a;
    border-color: #ffd700;
}

.season-selector-container select:focus {
    outline: none;
    background: #454545;
    border-color: #ffd700;
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.3);
}

.season-selector-container select option {
    background: #1a1a1a;
    color: white;
    padding: 8px;
}

.rating-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    table-layout: fixed;
}

.rating-table th,
.rating-table td {
    padding: 12px 8px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    white-space: nowrap;
}

.rating-table th:last-child,
.rating-table td:last-child {
    border-right: none;
}

.rating-table th {
    background: rgba(255, 255, 255, 0.2);
    font-weight: bold;
    font-size: 16px;
}

.rating-table td {
    font-size: 16px;
}

.rating-table tr:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Фиксированная ширина столбцов */
.rating-table th:first-child,
.rating-table td:first-child {
    width: 60px;
    min-width: 60px;
    max-width: 60px;
    text-align: center;
    padding: 12px 12px;
}

.rating-table th:nth-child(2),
.rating-table td:nth-child(2) {
    width: 120px;
    min-width: 120px;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
    padding: 12px 8px;
}

.rating-table th:nth-child(3),
.rating-table td:nth-child(3) {
    width: 100px;
    min-width: 100px;
    max-width: 100px;
    text-align: center;
    padding: 12px 8px;
}

.rating-table th:nth-child(4),
.rating-table td:nth-child(4) {
    width: 90px;
    min-width: 90px;
    max-width: 90px;
    text-align: center;
    padding: 12px 8px;
}

.rating-table th:nth-child(5),
.rating-table td:nth-child(5) {
    width: 80px;
    min-width: 80px;
    max-width: 80px;
    text-align: center;
    padding: 12px 8px;
}

.stats-card {
    padding: 10px 0px;
    margin: 7px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.stats-card h2 {
    color: #ffd700;
    margin: 0 0 20px 0;
    font-size: 20px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.stat-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    background: rgba(255, 255, 255, 0.08);
}

.stat-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: var(--accent-color, #ffd700);
}

.stat-icon {
    font-size: 20px;
    margin-bottom: 8px;
    display: block;
}

.stat-value {
    font-size: 28px;
    font-weight: bold;
    color: #ffd700;
    margin-bottom: 5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.stat-label {
    font-size: 13px;
    opacity: 0.9;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.position-badge {
    background: #ffd700;
    color: #333;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}

/* Диаграмма распределения ролей */
.role-chart {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 30px 0;
    gap: 20px;
    flex-wrap: wrap;
}

.pie-chart {
    width: 190px;
    height: 190px;
    border-radius: 50%;
    position: relative;
    flex-shrink: 0;
}

.chart-legend {
    margin-left: 0;
    flex-shrink: 0;
}

.legend-item {
    display: flex;
    align-items: center;
    margin: 8px 0;
    font-size: 14px;
}

.legend-color {
    width: 15px;
    height: 15px;
    border-radius: 3px;
    margin-right: 8px;
}

.role-tag {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 4px 10px;
    font-size: 12px;
    color: #ffd700;
    display: inline-block;
}

.table-container {
    margin: 0 -20px;
    padding: 0 20px;
    border-radius: 10px;
}

/* Кнопка просмотра результатов вечера */
.view-results-btn {
    background: rgba(255, 215, 0, 0.2);
    border: 1px solid #ffd700;
    color: #ffd700;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
}

.view-results-btn:hover {
    background: rgba(255, 215, 0, 0.3);
    transform: translateY(-1px);
}

/* Стили для истории вечеров */
.evening-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.evening-button {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 15px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 16px;
    text-align: left;
    transition: all 0.3s ease;
    width: 100%;
}

.evening-button:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Адаптивность */
@media (max-width: 768px) {
    .container {
        padding: 15px;
        margin: 0;
        border-radius: 15px;
    }

    .rating-table {
        font-size: 14px;
        min-width: 450px;
        table-layout: fixed;
        backdrop-filter: blur(7px) !important;
    }

    .rating-table th,
    .rating-table td {
        padding: 8px 4px;
        border-right: 1px solid rgba(255, 255, 255, 0.1);
    }

    .rating-table th:last-child,
    .rating-table td:last-child {
        border-right: none;
    }

    .rating-table th {
        font-size: 14px;
    }

    .rating-table td {
        font-size: 14px;
    }

    .rating-table th:first-child,
    .rating-table td:first-child {
        width: 55px;
        min-width: 55px;
        max-width: 55px;
        padding: 8px 10px;
    }

    .rating-table th:nth-child(2),
    .rating-table td:nth-child(2) {
        width: 110px;
        min-width: 110px;
        max-width: 110px;
        padding: 8px 4px;
    }

    .rating-table th:nth-child(3),
    .rating-table td:nth-child(3) {
        width: 90px;
        min-width: 90px;
        max-width: 90px;
        padding: 8px 4px;
    }

    .rating-table th:nth-child(4),
    .rating-table td:nth-child(4) {
        width: 80px;
        min-width: 80px;
        max-width: 80px;
        padding: 8px 4px;
    }

    .rating-table th:nth-child(5),
    .rating-table td:nth-child(5) {
        width: 70px;
        min-width: 70px;
        max-width: 70px;
        padding: 8px 4px;
    }

    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -16px;
        padding: 0px;
        border-radius: 10px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .role-chart {
        flex-direction: column;
        text-align: center;
    }

    .chart-legend {
        margin-left: 0;
        display: flex;
        justify-content: center;
        flex-wrap: wrap;
        gap: 15px;
    }

    .legend-item {
        margin: 5px 0;
    }
}

@media (max-width: 480px) {
    .rating-table {
        min-width: 400px;
        table-layout: fixed;
    }

    .rating-table th,
    .rating-table td {
        padding: 6px 3px;
        border-right: 1px solid rgba(255, 255, 255, 0.1);
    }

    .rating-table th:last-child,
    .rating-table td:last-child {
        border-right: none;
    }

    .rating-table th:first-child,
    .rating-table td:first-child {
        width: 50px;
        min-width: 50px;
        max-width: 50px;
        padding: 6px 12px;
    }

    .rating-table th:nth-child(2),
    .rating-table td:nth-child(2) {
        width: 100px;
        min-width: 100px;
        max-width: 100px;
        padding: 6px 3px;
    }

    .rating-table th:nth-child(3),
    .rating-table td:nth-child(3) {
        width: 80px;
        min-width: 80px;
        max-width: 80px;
        padding: 6px 3px;
    }

    .rating-table th:nth-child(4),
    .rating-table td:nth-child(4) {
        width: 70px;
        min-width: 70px;
        max-width: 70px;
        padding: 6px 3px;
    }

    .rating-table th:nth-child(5),
    .rating-table td:nth-child(5) {
        width: 60px;
        min-width: 60px;
        max-width: 60px;
        padding: 6px 3px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .stat-item {
        padding: 12px;
    }

    .stat-value {
        font-size: 24px;
    }

    .stat-icon {
        font-size: 18px;
    }

    .role-chart {
        margin: 15px 0;
    }

    .chart-legend {
        gap: 10px;
    }

    .legend-item {
        font-size: 12px;
    }

    .legend-color {
        width: 12px;
        height: 12px;
    }
}