/* ==========================================================================
   Nitro Simracing - Tournament Rounds
   ========================================================================== */

.tor-rondas--v2 {
    position: relative;
    display: grid;
    gap: 18px;
    padding: 22px;
    border-radius: 28px;
    background:
        radial-gradient(circle at 0% 0%, rgba(209, 17, 8, 0.18), transparent 28%),
        radial-gradient(circle at 100% 100%, rgba(30, 76, 168, 0.24), transparent 28%),
        linear-gradient(155deg, rgba(8, 13, 24, 0.96), rgba(10, 16, 28, 0.98));
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.03),
        0 24px 56px rgba(0, 0, 0, 0.42);
}

.tor-rondas--v2::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.025), transparent 42%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 28%);
}

.tor-rondas-header {
    display: grid;
    gap: 8px;
}

.tor-rondas-eyebrow {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    width: fit-content;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid rgba(209, 17, 8, 0.28);
    background: rgba(209, 17, 8, 0.12);
    color: #ffb7b2;
    font: 800 0.78rem/1 var(--sn-font-sans, system-ui);
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.tor-rondas-title {
    margin: 0;
    color: #f7fbff;
    font: 800 clamp(1.7rem, 2.6vw, 2.35rem)/0.96 "Akshar", var(--sn-font-sans, system-ui);
    text-transform: uppercase;
}

.tor-rondas-subtitle {
    max-width: 760px;
    margin: 0;
    color: rgba(221, 231, 247, 0.72);
    font: 500 1rem/1.45 var(--sn-font-sans, system-ui);
}

.tor-rondas-content {
    display: grid;
    gap: 18px;
}

.tor-rondas-dim {
    padding: 18px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.014)),
        linear-gradient(155deg, rgba(11, 17, 30, 0.98), rgba(15, 22, 38, 0.98));
}

.tor-rondas-dim__title {
    margin-bottom: 14px;
}

.tor-rondas-dim__title span {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.035);
    color: #dfe8f8;
}

.tor-rondas-group-head {
    margin: 0 0 12px;
}

.tor-rondas-group-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(82, 21, 22, 0.72), rgba(56, 14, 15, 0.82));
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #f5f8ff;
    font: 800 0.78rem/1 var(--sn-font-sans, system-ui);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.tor-rondas-group-badge i {
    color: #ff5243;
}

.tor-rondas-group-tabs {
    margin-bottom: 14px;
}

.tor-rondas-group-tab.is-active {
    color: inherit;
    box-shadow: none;
}

.tor-rondas-group-panel {
    min-width: 0;
}

.tor-rondas-table-wrap {
    overflow-x: auto;
    border-radius: 18px;
}

.tor-rondas-table {
    width: max-content;
    min-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
    font-size: 0.9rem;
}

.tor-rondas-table th,
.tor-rondas-table td {
    padding: 14px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    text-align: center;
    vertical-align: middle;
    color: #eef4ff;
}

.tor-rondas-table th:last-child,
.tor-rondas-table td:last-child {
    border-right: 0;
}

.tor-rondas-table thead th {
    background: rgba(8, 13, 24, 0.8);
    color: #aebdd6;
    font: 800 0.74rem/1 var(--sn-font-sans, system-ui);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.tor-rondas-table__round {
    color: #f5f8ff !important;
}

.tor-rondas-table__comp {
    min-width: 72px;
    white-space: nowrap;
}

.tor-rondas-table tbody tr:nth-child(odd) {
    background: rgba(255, 255, 255, 0.012);
}

.tor-rondas-table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.018);
}

.tor-rondas-table tbody tr:nth-child(1) {
    background:
        linear-gradient(90deg, rgba(255, 208, 74, 0.08), transparent 22%),
        rgba(255, 255, 255, 0.018);
}

.tor-rondas-table tbody tr:nth-child(2) {
    background:
        linear-gradient(90deg, rgba(175, 189, 214, 0.08), transparent 22%),
        rgba(255, 255, 255, 0.015);
}

.tor-rondas-table tbody tr:nth-child(3) {
    background:
        linear-gradient(90deg, rgba(196, 124, 74, 0.09), transparent 22%),
        rgba(255, 255, 255, 0.015);
}

.tor-rondas-pos {
    color: #f7fbff;
    font: 900 1.05rem/1 var(--sn-font-sans, system-ui);
}

.tor-rondas-table tbody tr:nth-child(1) .tor-rondas-pos { color: #ffd95c; }
.tor-rondas-table tbody tr:nth-child(2) .tor-rondas-pos { color: #d7e1f0; }
.tor-rondas-table tbody tr:nth-child(3) .tor-rondas-pos { color: #efb286; }

.tor-rondas-pilot-cell {
    text-align: left;
    min-width: 210px;
}

.tor-rondas-pilot {
    display: grid !important;
    grid-template-columns: 44px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
}

.tor-rondas-avatar,
.tor-rondas-pilot__avatar-wrap {
    width: 44px;
    height: 44px;
    border-radius: 14px;
}

.tor-rondas-pilot__meta .sn-pilot-meta-main {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.tor-rondas-pilot__meta .sn-pilot-link,
.tor-rondas-pilot__meta .sn-pilot-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 1rem;
    min-width: 0;
    max-width: 100%;
}

.tor-rondas-pilot__meta .sn-pilot-link span,
.tor-rondas-pilot__meta .sn-pilot-label span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tor-rondas-pilot__meta .sn-pilot-flag {
    flex: 0 0 auto;
}

.tor-rondas-team {
    margin-top: 4px;
}

.tor-rondas-score,
.tor-rondas-chase,
.tor-rondas-total {
    font: 800 0.9rem/1.1 var(--sn-font-sans, system-ui);
    font-variant-numeric: tabular-nums;
}

.tor-rondas-chase {
    background: rgba(15, 48, 102, 0.4);
    color: #cfe0ff;
}

.tor-rondas-total {
    background: rgba(255, 255, 255, 0.04);
    color: #eef4ff;
}

.tor-rondas-flag {
    display: inline-block;
    width: 24px;
    height: 18px;
    border-radius: 4px;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    vertical-align: middle;
}

.tor-rondas-mobile-list {
    display: none;
    gap: 14px;
}

.tor-rondas-mobile-card {
    display: grid;
    gap: 14px;
    padding: 14px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.024), rgba(255, 255, 255, 0.008)),
        linear-gradient(155deg, rgba(11, 18, 32, 0.96), rgba(9, 15, 27, 0.98));
}

.tor-rondas-mobile-card__top {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
}

.tor-rondas-mobile-card__label {
    color: rgba(174, 189, 214, 0.82);
    font: 800 0.68rem/1 var(--sn-font-sans, system-ui);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.tor-rondas-mobile-card__pos-wrap {
    display: grid;
    gap: 4px;
}

.tor-rondas-mobile-card__pos {
    color: #f7fbff;
    font: 900 1.3rem/1 "Akshar", var(--sn-font-sans, system-ui);
}

.tor-rondas-mobile-card:nth-child(1) .tor-rondas-mobile-card__pos { color: #ffd95c; }
.tor-rondas-mobile-card:nth-child(2) .tor-rondas-mobile-card__pos { color: #d7e1f0; }
.tor-rondas-mobile-card:nth-child(3) .tor-rondas-mobile-card__pos { color: #efb286; }

.tor-rondas-mobile-card__pilot .tor-rondas-pilot {
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 10px;
}

.tor-rondas-mobile-card__pilot .tor-rondas-avatar,
.tor-rondas-mobile-card__pilot .tor-rondas-pilot__avatar-wrap {
    width: 42px;
    height: 42px;
    border-radius: 12px;
}

.tor-rondas-mobile-card__stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.tor-rondas-mobile-stat {
    display: grid;
    gap: 5px;
    padding: 10px 11px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.tor-rondas-mobile-stat span {
    color: rgba(174, 189, 214, 0.8);
    font: 800 0.68rem/1 var(--sn-font-sans, system-ui);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.tor-rondas-mobile-stat strong {
    color: #eef4ff;
    font: 800 1rem/1 "Akshar", var(--sn-font-sans, system-ui);
}

.tor-rondas-mobile-stat--total {
    background: rgba(255, 255, 255, 0.05);
}

.tor-rondas-mobile-card__breakdown {
    display: grid;
    gap: 10px;
}

.tor-rondas-mobile-round {
    display: grid;
    gap: 8px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.tor-rondas-mobile-round__head {
    color: #f5f8ff;
    font: 800 0.9rem/1.1 var(--sn-font-sans, system-ui);
}

.tor-rondas-mobile-round__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tor-rondas-mobile-round__chip {
    display: inline-grid;
    gap: 4px;
    min-width: 90px;
    padding: 8px 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.tor-rondas-mobile-round__chip strong {
    color: rgba(174, 189, 214, 0.9);
    font: 800 0.7rem/1 var(--sn-font-sans, system-ui);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.tor-rondas-mobile-round__chip em {
    color: #eef4ff;
    font: 800 0.96rem/1 "Akshar", var(--sn-font-sans, system-ui);
    font-style: normal;
}

@media (max-width: 1024px) {
    .tor-rondas--v2 .tor-rondas-table-wrap {
        display: none;
    }

    .tor-rondas--v2 .tor-rondas-mobile-list {
        display: grid;
    }
}

@media (max-width: 760px) {
    .tor-rondas--v2 {
        gap: 14px;
        padding: 14px;
        border-radius: 20px;
    }

    .tor-rondas-header {
        gap: 6px;
    }

    .tor-rondas-eyebrow {
        min-height: 28px;
        padding: 0 11px;
        font-size: 0.7rem;
    }

    .tor-rondas-title {
        font-size: 1.32rem;
    }

    .tor-rondas-subtitle {
        font-size: 0.84rem;
        line-height: 1.4;
    }

    .tor-rondas-group-tabs {
        padding-bottom: 2px;
        scrollbar-width: none;
    }

    .tor-rondas-group-tabs::-webkit-scrollbar {
        display: none;
    }

    .tor-rondas-dim {
        padding: 14px;
        border-radius: 20px;
    }

    .tor-rondas-mobile-card {
        padding: 12px;
        border-radius: 18px;
    }

    .tor-rondas-mobile-card__top {
        grid-template-columns: 52px minmax(0, 1fr);
        gap: 10px;
    }

    .tor-rondas-mobile-card__stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .tor-rondas-mobile-card__pilot .tor-rondas-pilot {
        grid-template-columns: 38px minmax(0, 1fr);
    }

    .tor-rondas-mobile-card__pilot .tor-rondas-avatar,
    .tor-rondas-mobile-card__pilot .tor-rondas-pilot__avatar-wrap {
        width: 38px;
        height: 38px;
    }

    .tor-rondas-mobile-round__chips {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .tor-rondas-mobile-card__stats,
    .tor-rondas-mobile-round__chips {
        grid-template-columns: 1fr;
    }

    .tor-rondas-mobile-round__chip {
        min-width: 0;
    }

    .tor-rondas-mobile-card__pilot,
    .tor-rondas-mobile-card__pilot .tor-rondas-pilot,
    .tor-rondas-mobile-card__top {
        min-width: 0;
    }
}
