:root {
    --roster-red: #ff003c;
    --roster-red-glow: rgba(255, 0, 60, 0.5);
    --roster-red-dark: #4a0014;
    --roster-card: #111115;
    --roster-card-border: rgba(255, 255, 255, 0.06);
    --roster-line: rgba(255, 255, 255, 0.08);
    --roster-bg: #0a0a0c;
    --roster-muted: #a8a8b8;
    --roster-green: #00ff66;
    --roster-gold: #ffcc00;
    --roster-font: 'Montserrat', sans-serif;
}

body.roster-page {
    min-height: 100vh;
    background-color: var(--roster-bg);
    color: #fff;
    font-family: var(--roster-font);
    overflow-x: hidden;
    padding-bottom: 100px;
}

.roster-page * {
    box-sizing: border-box;
}

.roster-ambient {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 1000px;
    height: 1000px;
    z-index: 0;
    pointer-events: none;
    background: radial-gradient(ellipse at top, rgba(255, 0, 60, 0.05) 0%, transparent 70%);
}

.roster-page .container {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.roster-page .page-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 40px;
    animation: rosterFadeDown 0.8s ease;
}

@keyframes rosterFadeDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.roster-page .pt-title h1 {
    font-size: 32px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: -0.5px;
    line-height: 1.1;
    margin: 0 0 4px;
}

.roster-page .pt-title h1 span {
    color: var(--roster-red);
}

.roster-page .pt-title p {
    margin: 0;
    font-size: 11px;
    color: var(--roster-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.roster-page .server-tabs {
    display: flex;
    gap: 10px;
    background: rgba(0, 0, 0, 0.5);
    padding: 6px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    flex-wrap: wrap;
}

.roster-page .s-tab {
    padding: 10px 20px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--roster-muted);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    font-family: var(--roster-font);
}

.roster-page .s-tab svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
    flex-shrink: 0;
}

.roster-page .s-tab .server-emoji-img {
    width: 16px;
    height: 16px;
    object-fit: contain;
}

.roster-page .s-tab:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.03);
}

.roster-page .s-tab.active {
    background: rgba(255, 0, 60, 0.1);
    color: #fff;
    border-color: var(--roster-red);
    box-shadow: 0 0 15px var(--roster-red-glow);
}

.roster-page .toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 18px;
    margin-bottom: 32px;
}

.roster-page .stats-mini {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.roster-page .stat-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.roster-page .stat-item span {
    font-size: 10px;
    color: var(--roster-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.roster-page .stat-item strong {
    font-size: 18px;
    font-weight: 900;
    color: #fff;
}

.roster-page .search-box {
    position: relative;
    width: 320px;
    max-width: 100%;
}

.roster-page .search-box input {
    width: 100%;
    background: var(--roster-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 10px 15px 10px 40px;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    outline: none;
    transition: 0.3s;
    font-family: var(--roster-font);
}

.roster-page .search-box input:focus {
    border-color: var(--roster-red);
    box-shadow: 0 0 15px rgba(255, 0, 60, 0.2);
}

.roster-page .search-box svg {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    fill: var(--roster-muted);
}

.roster-page .empty-state {
    padding: 40px;
    text-align: center;
    color: var(--roster-muted);
    font-size: 14px;
    font-weight: 600;
}

.roster-page .page-empty {
    margin-top: 60px;
    text-align: center;
    color: var(--roster-muted);
}

/* --- Pyramid layout --- */
.roster-pyramid-wrap {
    position: relative;
    padding: 8px 0 24px;
    min-height: 240px;
}

.roster-pyramid {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.roster-pyramid::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    background: linear-gradient(to bottom, var(--roster-gold), var(--roster-red), rgba(255, 255, 255, 0.1), transparent);
    z-index: 0;
    opacity: 0.5;
    pointer-events: none;
}

.pyramid-tier {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
    margin-bottom: 60px;
}

.pyramid-tier:last-child {
    margin-bottom: 0;
}

.tier-divider {
    background: var(--roster-bg);
    padding: 8px 24px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 30px;
    position: relative;
    z-index: 3;
    border: 1px solid var(--div-border);
    box-shadow: 0 0 20px var(--div-glow);
}

.tier-divider::before,
.tier-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: min(250px, 28vw);
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--div-border), transparent);
}

.tier-divider::before { right: 100%; }
.tier-divider::after { left: 100%; }

.tier-name {
    font-size: 13px;
    font-weight: 900;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 2px;
    white-space: nowrap;
}

.tier-count {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 800;
    background: var(--count-bg);
    color: var(--count-text);
    flex-shrink: 0;
}

.div-t1 {
    --div-border: rgba(255, 204, 0, 0.4);
    --div-glow: rgba(255, 204, 0, 0.1);
    --count-bg: var(--roster-gold);
    --count-text: #000;
}

.div-t1 .tier-name { color: var(--roster-gold); }

.div-t2 {
    --div-border: var(--roster-red-dark);
    --div-glow: rgba(255, 0, 60, 0.1);
    --count-bg: var(--roster-red);
    --count-text: #fff;
}

.div-t3 {
    --div-border: rgba(255, 255, 255, 0.1);
    --div-glow: rgba(255, 255, 255, 0.02);
    --count-bg: #333;
    --count-text: #fff;
}

.div-t3 .tier-name { color: var(--roster-muted); }

.div-t4 {
    --div-border: rgba(177, 66, 245, 0.35);
    --div-glow: rgba(177, 66, 245, 0.08);
    --count-bg: #b142f5;
    --count-text: #fff;
}

.div-t4 .tier-name { color: #d9a8ff; }

.pyramid-tier-grid {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
    width: 100%;
    align-items: center;
    position: relative;
    z-index: 2;
}

.roster-empty-state {
    padding: 48px 20px;
    text-align: center;
}

@media (max-width: 768px) {
    .roster-page .container { padding: 20px 14px 40px; }
    .pyramid-tier-grid { gap: 20px; }
    .tier-divider::before,
    .tier-divider::after { width: 80px; }
}

@media (prefers-reduced-motion: reduce) {
    .roster-page .page-top {
        animation: none !important;
        transition-duration: 0.15s !important;
    }
}
