:root {
    --bg: #07111f;
    --panel: #0f1c2a;
    --panel-soft: #101d2d;
    --line: rgba(255, 255, 255, 0.08);
    --text: #ffffff;
    --muted: #b8c2d1;
    --accent: #ff8c00;
    --accent-2: #7289da;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(255, 140, 0, 0.12), transparent 28%),
        radial-gradient(circle at bottom right, rgba(114, 137, 218, 0.12), transparent 30%),
        var(--bg);
    background-repeat: no-repeat, no-repeat, no-repeat;
    background-size: 1400px 900px, 1300px 900px, cover;
    background-position: top left, top right, center;
    color: var(--text);
    overflow-x: hidden;
}

button {
    font: inherit;
}

.ranking-page {
    max-width: 1400px;
    margin: 0 auto;
    padding: 150px 30px 80px;
}

.ranking-hero {
    margin-bottom: 32px;
}

.eyebrow {
    margin: 0 0 12px;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 13px;
    font-weight: 700;
}

.ranking-hero h1 {
    margin: 0;
    font-size: clamp(34px, 4vw, 60px);
    line-height: 1.05;
}

.hero-text {
    max-width: 760px;
    margin: 18px 0 0;
    color: var(--muted);
    font-size: 18px;
    line-height: 1.6;
}

.ranking-switch {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
}

.ranking-switch button {
    border: 1px solid var(--line);
    background: #0c1724;
    color: var(--muted);
    border-radius: 12px;
    padding: 12px 18px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease, color 0.25s ease;
}

.ranking-switch button:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 140, 0, 0.7);
    color: var(--text);
}

.ranking-switch button.active {
    color: #ffffff;
    border-color: rgba(255, 140, 0, 0.72);
    background: linear-gradient(135deg, rgba(255, 140, 0, 0.28), rgba(114, 137, 218, 0.16));
}

.ranking-switch button:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

.ranking-panel {
    display: none;
}

.ranking-panel.is-active {
    display: block;
}

.ranking-grid {
    display: grid;
    gap: 18px;
}

.ranking-grid--team {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ranking-grid--individual {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ranking-card {
    background: rgba(15, 28, 42, 0.92);
    border: 1px solid var(--line);
    border-radius: 20px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(14px);
    overflow: hidden;
}

.card-header {
    padding: 18px;
    border-bottom: 1px solid var(--line);
}

.card-header h2 {
    margin: 0;
    font-size: 38px;
    line-height: 1.06;
    text-transform: uppercase;
    letter-spacing: 0.01em;
}

.card-header span {
    display: inline-block;
    margin-top: 6px;
    font-size: 28px;
    color: var(--muted);
    font-weight: 600;
}

.card-header.blue {
    background: linear-gradient(180deg, rgba(70, 132, 214, 0.5), rgba(46, 90, 150, 0.44));
}

.card-header.gold {
    background: linear-gradient(180deg, rgba(204, 157, 52, 0.45), rgba(122, 94, 33, 0.4));
}

.card-header.bronze {
    background: linear-gradient(180deg, rgba(170, 118, 82, 0.45), rgba(102, 69, 50, 0.4));
}

.table-container {
    padding: 12px;
    max-height: 460px;
    overflow-y: auto;
    overflow-x: auto;
    scrollbar-gutter: stable;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead th {
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
    text-align: left;
    letter-spacing: 0.02em;
    padding: 10px 8px 12px;
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    background: #101d2e;
    z-index: 1;
}

tbody td {
    color: #dbe5f3;
    font-size: 20px;
    padding: 10px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

tbody tr:last-child td {
    border-bottom: 0;
}

.empty-row {
    color: var(--muted);
    text-align: center;
    font-size: 16px;
    padding: 18px 8px;
}

tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.rank-1,
.rank-2,
.rank-3 {
    color: #ffcc74;
}

.value {
    color: #ffd27f;
    font-weight: 700;
}

.team-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.team-cell img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.team-name {
    line-height: 1;
}

@media (max-width: 1260px) {
    .ranking-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .ranking-page {
        padding: 160px 16px 50px;
    }

    .ranking-switch {
        flex-wrap: wrap;
    }

    .card-header h2 {
        font-size: 30px;
    }

    .card-header span {
        font-size: 22px;
    }

    tbody td {
        font-size: 17px;
    }
}

@media (max-width: 640px) {
    .hero-text {
        font-size: 16px;
    }

    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        min-width: 620px;
    }
}
