/* ── Series page layout ─────────────────────────────────────── */

.series-deck {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.series-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
    padding: 24px 16px 60px;
    min-height: 80vh;
}

/* ── Header ─────────────────────────────────────────────────── */

.series-header {
    position: relative;
    overflow: hidden;
    width: clamp(20rem, 94%, 1100px);
    background: var(--deep-steel);
    border: 1px solid var(--slate-steel);
    border-left: 4px solid var(--series-accent, var(--slate-steel));
    border-radius: 10px;
    box-sizing: border-box;
    padding: 28px 32px;
    box-shadow: 0 0 24px var(--series-accent-glow, transparent);
}

.series-header .series-bg-blur {
    position: absolute;
    inset: -10%;
    background-size: cover;
    background-position: center;
    filter: blur(12px) brightness(0.4);
    z-index: 0;
    pointer-events: none;
}

.series-header::before {
    content: attr(data-initial);
    position: absolute;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 140px;
    font-weight: 900;
    font-family: Montserrat;
    color: var(--series-accent, #444);
    opacity: 0.07;
    line-height: 1;
    pointer-events: none;
    user-select: none;
    z-index: 1;
}

.series-header-inner {
    display: flex;
    align-items: center;
    gap: 20px;
    position: relative;
    z-index: 2;
}

.series-icon {
    width: 80px;
    height: 80px;
    background: var(--slate-steel);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.series-icon img {
    width: 100%;
}

.series-icon--logo {
    padding: 0;
    overflow: hidden;
}

.series-logo-img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}

.series-header-desc {
    font-size: 13px;
    color: #aaa;
    font-family: Montserrat;
    margin: 0 0 4px;
}

.series-eyebrow {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #888;
    font-family: Montserrat;
}

.series-header-txt {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.series-header-txt h1 {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
    font-family: Montserrat;
    color: var(--cloudy-white);
    line-height: 1.2;
}

.series-header-txt p {
    margin: 0;
    font-size: 13px;
    color: #888;
    font-family: Montserrat;
}

.series-header-txt p a {
    color: #bbb;
    text-decoration: none;
    font-weight: 600;
}

.series-header-txt p a:hover {
    color: var(--cloudy-white);
}

/* ── Section ─────────────────────────────────────────────────── */

.series-section {
    width: clamp(20rem, 94%, 1100px);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.series-section-title {
    font-size: 14px;
    font-weight: 700;
    font-family: Montserrat;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #888;
    margin: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--slate-steel);
}

.series-empty {
    color: #666;
    font-size: 14px;
    font-family: Montserrat;
    padding: 24px 0;
    text-align: center;
}

/* ── Tournament cards ────────────────────────────────────────── */

.series-trn-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

.series-trn-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--deep-steel);
    border: 1px solid var(--slate-steel);
    border-radius: 8px;
    text-decoration: none;
    overflow: hidden;
    transition: border-color 180ms, transform 180ms;
}

.series-trn-card:hover {
    border-color: #555;
    transform: translateY(-2px);
}

.series-trn-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: .35;
    pointer-events: none;
}

.series-trn-thumb {
    width: 42px;
    height: 42px;
    border-radius: 5px;
    object-fit: cover;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    border: 1px solid var(--slate-steel);
}

.series-trn-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
    min-width: 0;
    position: relative;
    z-index: 1;
}

.series-trn-name {
    font-size: 13px;
    font-weight: 600;
    font-family: Montserrat;
    color: var(--cloudy-white);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.series-trn-meta {
    font-size: 11px;
    color: #777;
    font-family: Montserrat;
}

.series-trn-status {
    font-size: 10px;
    font-weight: 700;
    font-family: Montserrat;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 3px 7px;
    border-radius: 4px;
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}

.series-trn-status--upcoming  { background: #2a2d35; color: #888; }
.series-trn-status--active    { background: rgba(30,160,80,.15); color: #2ecc71; border: 1px solid rgba(46,204,113,.2); }
.series-trn-status--finished  { background: rgba(60,80,130,.2); color: #7ca0e0; border: 1px solid rgba(90,120,180,.2); }

.series-trn-weight-badge { color: #f0c040; font-weight: 700; }

/* ── Standings table ─────────────────────────────────────────── */

.series-pts-legend {
    font-family: Montserrat;
    background: var(--deep-steel);
    border: 1px solid var(--slate-steel);
    border-radius: 8px;
    overflow: hidden;
}

.spl-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 16px;
}

.spl-divider {
    height: 1px;
    background: var(--slate-steel);
}

.spl-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #555;
    flex-shrink: 0;
    min-width: 150px;
}

.spl-places {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.spl-place {
    font-size: 11px;
    color: #777;
    background: #1a1c20;
    border: 1px solid #2a2d35;
    border-radius: 5px;
    padding: 3px 9px;
    white-space: nowrap;
}
.spl-place b { color: #aaa; margin-left: 3px; }

.spl-place--gold   { border-color: rgba(200,160,20,.3); }
.spl-place--gold b { color: #f0c040; }

.spl-place--silver   { border-color: rgba(160,160,160,.2); }
.spl-place--silver b { color: #bbb; }

.spl-place--bronze   { border-color: rgba(160,100,40,.3); }
.spl-place--bronze b { color: #c07a40; }

.spl-weight-info {
    font-size: 11px;
    color: #666;
    line-height: 1.5;
}

.spl-weight-example {
    font-weight: 700;
    color: #f0c040;
}

.series-standings {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--slate-steel);
    border-radius: 8px;
    overflow: hidden;
}

.ss-head,
.ss-row {
    display: grid;
    grid-template-columns: 48px 1fr 90px 110px 64px 64px;
    column-gap: 8px;
    align-items: center;
}

.ss-head {
    background: #1a1c20;
    border-bottom: 1px solid var(--slate-steel);
}

.ss-row {
    border-bottom: 1px solid #1e2026;
    background: var(--deep-steel);
    animation: ss-fade-in 300ms ease both;
    transition: background 150ms;
}

.ss-row:last-child { border-bottom: none; }
.ss-row:hover { background: #282c33; }

@keyframes ss-fade-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.ss-row--gold   { border-left: 3px solid #f0c040; }
.ss-row--silver { border-left: 3px solid #aaaaaa; }
.ss-row--bronze { border-left: 3px solid #c07a40; }

.ss-col {
    padding: 10px 12px;
    font-size: 13px;
    font-family: Montserrat;
    color: var(--cloudy-white);
}

.ss-head .ss-col {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #666;
    padding: 9px 12px;
}

.ss-rank {
    text-align: center;
    font-weight: 700;
    font-size: 14px;
    color: #999;
}

.ss-medal-img {
    width: 22px;
    height: 22px;
}

.ss-player { min-width: 0; }

.ss-player-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
    font-weight: 600;
}

.ss-player-link:hover { color: var(--cloudy-white); }

.ss-pfp-wrap {
    position: relative;
    width: 30px;
    height: 30px;
    flex-shrink: 0;
}

.ss-pfp {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    border: 1px solid var(--slate-steel);
}

.ss-pts {
    font-size: 15px;
    font-weight: 700;
    color: var(--cloudy-white);
}

.ss-col.ss-medals {
    padding-right: 0;
    position: relative;
}

.ss-medals-inner {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 4px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
    scrollbar-color: #3a3d42 transparent;
}
.ss-medals-inner::-webkit-scrollbar { height: 3px; }
.ss-medals-inner::-webkit-scrollbar-track { background: transparent; }
.ss-medals-inner::-webkit-scrollbar-thumb { background: #3a3d42; border-radius: 2px; }

.ss-col.ss-medals::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 28px;
    background: linear-gradient(to right, transparent, var(--deep-steel));
    pointer-events: none;
    opacity: var(--fade-opacity, 0);
    transition: opacity 200ms;
}

.ss-medal {
    font-size: 12px;
    font-weight: 700;
    font-family: Montserrat;
    padding: 2px 7px;
    border-radius: 4px;
}

.ss-medal--gold   { background: rgba(200,160,20,.15); color: #f0c040; border: 1px solid rgba(200,160,20,.3); }
.ss-medal--silver { background: rgba(160,160,160,.1); color: #aaa;    border: 1px solid rgba(160,160,160,.25); }
.ss-medal--bronze { background: rgba(160,100,40,.15); color: #c07a40; border: 1px solid rgba(160,100,40,.3); }

a.ss-medal { text-decoration: none; transition: filter 150ms, transform 150ms; display: inline-block; }
a.ss-medal:hover { filter: brightness(1.3); transform: translateY(-1px); }

.ss-no-medal { color: #444; font-size: 13px; }

.ss-trns,
.ss-best {
    color: #888;
    text-align: center;
}

/* ── View toggle (player / team) ────────────────────────────── */

.ss-view--hidden { display: none; }

.ss-view-toggle {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
    background: var(--deep-steel);
    border: 1px solid var(--slate-steel);
    border-radius: 8px;
    padding: 4px;
    width: fit-content;
}

.ss-toggle-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 5px;
    border: none;
    background: none;
    color: #666;
    font-size: 12px;
    font-weight: 600;
    font-family: Montserrat;
    cursor: pointer;
    transition: background 150ms, color 150ms;
}

.ss-toggle-btn.active {
    background: var(--graphite);
    color: var(--cloudy-white);
    box-shadow: 0 1px 4px rgba(0,0,0,0.35);
}

.ss-toggle-btn:not(.active):hover { color: #aaa; }

/* ── Team standings cell ─────────────────────────────────────── */

.ss-team-note {
    font-size: 11px;
    color: #555;
    font-family: Montserrat;
    margin: 0 0 10px;
}

.ss-team-cell {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

.ss-team-top {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.ss-team-cap-pfp {
    display: block;
    flex-shrink: 0;
    text-decoration: none;
}

.ss-team-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.ss-team-name-label {
    font-size: 13px;
    font-weight: 700;
    font-family: Montserrat;
    color: var(--cloudy-white);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 5px;
}

.ss-team-names-badge {
    font-size: 10px;
    font-weight: 600;
    color: #666;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 4px;
    padding: 1px 5px;
    white-space: nowrap;
    flex-shrink: 0;
    cursor: help;
}

.ss-team-cap-label {
    font-size: 11px;
    color: #555;
    font-family: Montserrat;
}

.ss-team-cap-label a {
    color: #777;
    text-decoration: none;
    transition: color 120ms;
}

.ss-team-cap-label a:hover { color: var(--cloudy-white); }

/* Roster mini-pfps */

.ss-roster {
    display: flex;
    align-items: center;
    gap: 3px;
    padding-left: 40px;
}

.ss-roster-pfp {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    border: 1px solid rgba(255,255,255,0.1);
    flex-shrink: 0;
}

.ss-roster-extra {
    font-size: 10px;
    color: #555;
    font-family: Montserrat;
    font-weight: 600;
    margin-left: 2px;
}

/* ── Responsive ─────────────────────────────────────────────── */

@media (max-width: 700px) {
    .series-header { padding: 18px 16px; }
    .series-header-txt h1 { font-size: 20px; }

    .series-standings {
        overflow-x: auto;
    }

    /* Fixed widths — no 1fr, so grid is wider than screen and scrolls */
    .ss-head,
    .ss-row {
        grid-template-columns: 38px 150px 72px 100px 54px 54px;
        width: max(100%, 508px);
    }

    /* Remove stagger delay — rows with long delays appear invisible on mobile */
    .ss-row {
        animation-delay: 0ms !important;
    }

    .series-trn-grid {
        grid-template-columns: 1fr;
    }
}
