/* ═══════════════════════════════════════════════════
   MUR DE COMPTEURS — Modern dark interface
   ═══════════════════════════════════════════════════ */

/* ── Variables ─────────────────────────────────────── */
:root {
    --bg:           #080c14;
    --bg-panel:     rgba(255,255,255,0.025);
    --bg-card:      rgba(255,255,255,0.038);
    --bg-card-h:    rgba(255,255,255,0.065);
    --border:       rgba(255,255,255,0.07);
    --border-h:     rgba(139,92,246,0.45);
    --accent:       #8b5cf6;
    --accent-dim:   rgba(139,92,246,0.15);
    --gold:         #f59e0b;
    --gold-dim:     rgba(245,158,11,0.12);
    --green:        #22c55e;
    --text:         #e2e8f0;
    --text-sub:     #94a3b8;
    --text-muted:   #475569;
    --header-h:     52px;
    --panel-w:      282px;
    --footer-h:     52px;
    --radius-card:  10px;
}

/* ── Reset ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

/* ── Ambient background blobs ───────────────────────── */
.bg-blob {
    position: fixed;
    border-radius: 50%;
    filter: blur(90px);
    pointer-events: none;
    z-index: 0;
    animation: blobDrift 20s ease-in-out infinite alternate;
}
.bg-blob-1 {
    width: 500px; height: 500px;
    background: rgba(139,92,246,0.07);
    top: -150px; left: -100px;
    animation-delay: 0s;
}
.bg-blob-2 {
    width: 360px; height: 360px;
    background: rgba(59,130,246,0.05);
    bottom: -60px; right: 25%;
    animation-delay: -7s;
}
.bg-blob-3 {
    width: 280px; height: 280px;
    background: rgba(16,185,129,0.04);
    top: 45%; left: 45%;
    animation-delay: -13s;
}
@keyframes blobDrift {
    0%   { transform: translate(0, 0) scale(1); }
    100% { transform: translate(20px, 30px) scale(1.08); }
}

/* ── Header stats bar ───────────────────────────────── */
.stats-header {
    position: relative;
    z-index: 10;
    height: var(--header-h);
    background: rgba(0,0,0,0.55);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 0;
}
.stats-brand {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    margin-right: 24px;
    flex-shrink: 0;
}
.stats-items {
    display: flex;
    align-items: center;
    gap: 0;
    flex: 1;
}
.stat-sep {
    width: 1px;
    height: 24px;
    background: var(--border);
    margin: 0 18px;
}
.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
}
.stat-icon {
    font-size: 15px;
    line-height: 1;
}
.stat-body {
    display: flex;
    flex-direction: column;
    line-height: 1;
}
.stat-label {
    font-size: 9px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 1px;
}
.stat-value {
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
}

/* ── Main layout ────────────────────────────────────── */
.main-layout {
    position: relative;
    z-index: 1;
    display: flex;
    height: calc(100vh - var(--header-h) - var(--footer-h));
    overflow: hidden;
}

/* ── Raid panel ─────────────────────────────────────── */
.raid-panel {
    width: var(--panel-w);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 10px 10px 10px;
    background: var(--bg-panel);
    border-right: 1px solid var(--border);
    overflow: hidden;
}

/* ── Raid spotlight ─────────────────────────────────── */
.raid-spotlight {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px 14px 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.spotlight-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
    background: var(--accent-dim);
    border: 1px solid rgba(139,92,246,0.25);
    border-radius: 20px;
    padding: 4px 10px;
}
.spotlight-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 6px var(--accent);
    animation: dotPulse 1.6s ease-in-out infinite;
}
@keyframes dotPulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 6px var(--accent); }
    50%       { opacity: 0.5; box-shadow: 0 0 2px var(--accent); }
}

.spotlight-avatar-wrap {
    position: relative;
    width: 108px;
    height: 108px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.spotlight-ring {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: conic-gradient(var(--accent), #ec4899, #f59e0b, var(--accent));
    animation: ringRotate 4s linear infinite;
    z-index: 0;
}
.spotlight-ring::after {
    content: '';
    position: absolute;
    inset: 3px;
    border-radius: 50%;
    background: var(--bg);
}
@keyframes ringRotate {
    to { transform: rotate(360deg); }
}
.spotlight-avatar-inner {
    position: absolute;
    inset: 4px;
    border-radius: 50%;
    overflow: hidden;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.05);
}
.spotlight-placeholder {
    font-size: 38px;
    line-height: 1;
}
.spotlight-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.spotlight-info {
    text-align: center;
    width: 100%;
}
.spotlight-name {
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}
.spotlight-subs-wrap {
    display: flex;
    align-items: baseline;
    gap: 5px;
    justify-content: center;
    margin-top: 2px;
}
.spotlight-subs {
    font-size: 22px;
    font-weight: 800;
    color: var(--accent);
    line-height: 1;
}
.spotlight-subs-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 0.04em;
}
.spotlight-pts {
    font-size: 12px;
    color: var(--gold);
    font-weight: 600;
    margin-top: 3px;
    min-height: 16px;
}

.spotlight-timer {
    width: 100%;
}
.timer-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}
.timer-label {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 0.05em;
}
.timer-value {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.05em;
}
.timer-track {
    height: 4px;
    background: rgba(255,255,255,0.08);
    border-radius: 99px;
    overflow: hidden;
}
.timer-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #ec4899);
    border-radius: 99px;
    transition: width 1s linear;
}

/* ── Leaderboard ────────────────────────────────────── */
.leaderboard {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px 12px;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.leaderboard-head {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-sub);
    margin-bottom: 6px;
    flex-shrink: 0;
}
.leaderboard-empty {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
    padding: 14px 0;
    line-height: 1.6;
}
.leaderboard-empty strong {
    color: var(--accent);
}
#leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}
.lb-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 8px;
    background: rgba(255,255,255,0.03);
    border: 1px solid transparent;
    transition: all 0.25s;
}
.lb-item.lb-leader {
    background: var(--gold-dim);
    border-color: rgba(245,158,11,0.2);
}
.lb-rank {
    font-size: 15px;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
}
.lb-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.lb-avatar-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    background: rgba(255,255,255,0.08);
}
.lb-name {
    flex: 1;
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.lb-pts {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-sub);
    flex-shrink: 0;
}
.lb-leader .lb-pts {
    color: var(--gold);
}
.lb-skip {
    font-size: 10px;
    margin-left: 3px;
}
.lb-streak {
    font-size: 11px;
    margin-left: 3px;
}

/* ── Points popup ───────────────────────────────────── */
.points-popup {
    min-height: 0;
    flex-shrink: 0;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.popup-item {
    background: linear-gradient(135deg, rgba(139,92,246,0.25), rgba(245,158,11,0.18));
    border: 1px solid rgba(139,92,246,0.4);
    border-radius: 8px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    text-align: center;
    animation: popupIn 0.3s ease;
    transition: opacity 0.5s ease, transform 0.5s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
.popup-item.popup-exit {
    opacity: 0;
    transform: translateY(-6px);
}
.popup-item strong {
    color: var(--accent);
}
@keyframes popupIn {
    from { opacity: 0; transform: translateY(6px) scale(0.95); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Channel wall ───────────────────────────────────── */
.channel-wall {
    flex: 1;
    padding: 10px 10px 10px 10px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    align-content: start;
    overflow: hidden;
}

/* ── Channel cards ──────────────────────────────────── */
.card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    height: 82px;
    overflow: hidden;
    transition: background 0.25s, border-color 0.25s, transform 0.2s;
    opacity: 0;
    animation: cardEntry 0.4s ease forwards;
}
.card:hover {
    background: var(--bg-card-h);
    border-color: var(--border-h);
    transform: translateY(-1px);
}
.card.activee {
    border-color: rgba(139,92,246,0.5);
    background: rgba(139,92,246,0.07);
    animation: cardEntry 0.4s ease forwards, newPulse 2.5s ease-in-out 0.5s infinite;
}

.channelImage {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: rgba(255,255,255,0.06);
}

.card-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
}
.channelName {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}
.subscriberCount {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    line-height: 1;
}

/* ── Footer bar ─────────────────────────────────────── */
.footer-bar {
    position: relative;
    z-index: 10;
    height: var(--footer-h);
    background: rgba(0,0,0,0.6);
    border-top: 1px solid var(--border);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    font-size: 14px;
    color: var(--text-muted);
    flex-wrap: wrap;
    padding: 0 16px;
}
.footer-bar strong {
    color: var(--accent);
    font-weight: 700;
}
.footer-sep {
    color: var(--text-muted);
    opacity: 0.4;
    font-size: 16px;
}

/* ── Winner splash overlay — shared container ────────── */
#raid-winner-splash {
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 0;
    opacity: 0;
}
#raid-winner-splash.active {
    animation: splashBg 5.1s ease forwards;
}

@keyframes splashBg {
    0%   { opacity: 0; background: transparent; }
    8%   { opacity: 1; background: rgba(0,0,0,0.82); }
    88%  { opacity: 1; background: rgba(0,0,0,0.82); }
    100% { opacity: 0; background: transparent; }
}

/* Shared enter/exit animation for inner elements */
@keyframes splashEnter {
    0%   { opacity: 0; transform: scale(0.85) translateY(16px); }
    12%  { opacity: 1; transform: scale(1.02) translateY(0); }
    86%  { opacity: 1; transform: scale(1) translateY(0); }
    100% { opacity: 0; transform: scale(0.95) translateY(-8px); }
}
@keyframes splashEnterDelay {
    0%   { opacity: 0; transform: translateY(12px); }
    18%  { opacity: 1; transform: translateY(0); }
    86%  { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-6px); }
}

/* ── Podium — Scenario A ─────────────────────────────── */
.podium-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    padding: 28px 32px;
    animation: splashEnter 5.1s ease forwards;
}
.podium-header {
    font-size: 22px;
    font-weight: 900;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--gold);
    text-shadow: 0 0 30px rgba(245,158,11,0.8), 0 0 60px rgba(245,158,11,0.4);
}
.podium-wrap {
    display: flex;
    align-items: flex-end;
    gap: 16px;
}
.podium-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 20px 14px;
    border-radius: 14px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    min-width: 120px;
    max-width: 160px;
    opacity: 0.7;
}
.podium-slot.podium-empty {
    visibility: hidden;
    opacity: 0;
}
/* 1st place — center, gold glow */
.podium-slot.podium-rank-1 {
    opacity: 1;
    min-width: 160px;
    padding: 22px 26px 18px;
    border-radius: 18px;
    background: rgba(245,158,11,0.13);
    border-color: rgba(245,158,11,0.45);
    box-shadow: 0 0 40px rgba(245,158,11,0.35), 0 0 80px rgba(245,158,11,0.18);
    animation: podiumGoldPulse 1.4s ease-in-out 0.6s infinite;
}
/* 2nd & 3rd — slightly dimmed */
.podium-slot.podium-rank-2,
.podium-slot.podium-rank-3 {
    opacity: 0.72;
    transform: translateY(12px);
}
@keyframes podiumGoldPulse {
    0%, 100% { box-shadow: 0 0 40px rgba(245,158,11,0.35), 0 0 80px rgba(245,158,11,0.18); }
    50%       { box-shadow: 0 0 60px rgba(245,158,11,0.65), 0 0 120px rgba(245,158,11,0.32); }
}
/* ── Podium avatars ─────────────────────────────────── */
.podium-avatar-wrap {
    position: relative;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.podium-rank-1 .podium-avatar-wrap {
    width: 88px;
    height: 88px;
}

.podium-avatar-ring {
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    background: conic-gradient(#f59e0b, #fbbf24, #f59e0b, #d97706, #f59e0b);
    animation: ringRotate 3s linear infinite;
    z-index: 0;
}
.podium-avatar-ring::after {
    content: '';
    position: absolute;
    inset: 3px;
    border-radius: 50%;
    background: rgba(245,158,11,0.13);
}

.podium-avatar-inner {
    position: absolute;
    inset: 3px;
    border-radius: 50%;
    overflow: hidden;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.15);
}
.podium-rank-1 .podium-avatar-inner {
    inset: 4px;
}

.podium-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}
.podium-avatar-placeholder {
    font-size: 22px;
    line-height: 1;
}
.podium-rank-1 .podium-avatar-placeholder {
    font-size: 32px;
}

/* ── Podium medals ───────────────────────────────────── */
.podium-medal {
    font-size: 28px;
    line-height: 1;
}
.podium-rank-1 .podium-medal { font-size: 40px; }
.podium-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    text-align: center;
    max-width: 140px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.podium-rank-1 .podium-name {
    font-size: 20px;
    color: var(--gold);
    text-shadow: 0 0 18px rgba(245,158,11,0.6);
}
.podium-pts {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-sub);
}
.podium-rank-1 .podium-pts {
    font-size: 15px;
    font-weight: 700;
    color: var(--gold);
}
.podium-announce {
    font-size: 26px;
    font-weight: 900;
    color: #fff;
    text-align: center;
    text-shadow: 0 0 30px rgba(139,92,246,0.9), 0 0 60px rgba(245,158,11,0.5);
    animation: splashEnterDelay 5.1s ease 0.2s forwards;
    padding: 0 20px;
}
.podium-stars {
    font-size: 22px;
    letter-spacing: 8px;
    color: var(--gold);
    animation: splashEnterDelay 5.1s ease 0.35s forwards;
    opacity: 0;
}

/* ── Roulette — Scenario B ───────────────────────────── */
.roulette-title {
    font-size: 20px;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    text-shadow: 0 0 24px rgba(139,92,246,0.8);
    margin-bottom: 24px;
    animation: splashEnter 5.1s ease forwards;
}
.roulette-frame {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    animation: splashEnter 5.1s ease 0.1s forwards;
    opacity: 0;
}
.roulette-arrow {
    font-size: 18px;
    color: var(--accent);
    line-height: 1;
    opacity: 0.7;
}
.roulette-display {
    width: 380px;
    max-width: 90vw;
    padding: 18px 28px;
    border-radius: 14px;
    border: 2px solid rgba(139,92,246,0.4);
    background: rgba(139,92,246,0.1);
    font-size: 28px;
    font-weight: 800;
    color: var(--text);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-variant-numeric: tabular-nums;
    transition: color 0.08s;
}
.roulette-display.roulette-blink {
    animation: rouletteBlink 0.09s ease;
}
.roulette-display.roulette-selected {
    border-color: var(--gold);
    background: rgba(245,158,11,0.15);
    color: var(--gold);
    box-shadow: 0 0 40px rgba(245,158,11,0.4), 0 0 80px rgba(245,158,11,0.2);
    text-shadow: 0 0 20px rgba(245,158,11,0.7);
    font-size: 30px;
    animation: rouletteWin 0.4s ease forwards;
}
@keyframes rouletteBlink {
    0%   { transform: scaleY(0.94); }
    50%  { transform: scaleY(1.04); }
    100% { transform: scaleY(1); }
}
@keyframes rouletteWin {
    0%   { transform: scale(0.95); }
    40%  { transform: scale(1.06); }
    70%  { transform: scale(0.98); }
    100% { transform: scale(1); }
}
.roulette-hint {
    margin-top: 22px;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-sub);
    animation: splashEnterDelay 5.1s ease 0.2s forwards;
    opacity: 0;
}

/* ── Animations ─────────────────────────────────────── */
@keyframes cardEntry {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes newPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(139,92,246,0); }
    50%       { box-shadow: 0 0 0 3px rgba(139,92,246,0.2); }
}

/* ── Odometer override for dark theme ───────────────── */
.odometer.odometer-auto-theme,
.odometer.odometer-theme-default {
    font-family: 'Inter', monospace;
    font-weight: 700;
    color: var(--text);
}
.odometer.odometer-auto-theme .odometer-digit,
.odometer.odometer-theme-default .odometer-digit {
    padding: 0;
}
