/* ============================================================ */
/* ACCUEIL — DARK GAMING THEME                                  */
/* ============================================================ */

@keyframes glow-pulse   { 0%,100%{opacity:.25} 50%{opacity:.55} }
@keyframes float-a      { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-14px)} }
@keyframes float-b      { 0%,100%{transform:translateY(0) rotate(-4deg)} 50%{transform:translateY(-10px) rotate(-4deg)} }
@keyframes gradient-pan { 0%{background-position:0% 50%} 50%{background-position:100% 50%} 100%{background-position:0% 50%} }
@keyframes live-ring    { 0%,100%{transform:scale(1);box-shadow:0 0 0 0 rgba(0,230,118,.5)} 60%{transform:scale(1.15);box-shadow:0 0 0 7px rgba(0,230,118,0)} }
@keyframes pulse        { 0%,100%{opacity:1} 50%{opacity:.6} }
@keyframes card-in      { from{opacity:0;transform:translateY(20px)} to{opacity:1;transform:translateY(0)} }

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-page);
    color: var(--text-dark);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ============================================================ */
/* HERO SECTION                                                  */
/* ============================================================ */
.hero-section {
    position: relative;
    overflow: hidden;
    background: var(--bg);
    padding: 90px 24px 110px;
    min-height: 88vh;
    display: flex;
    align-items: center;
}

/* Spotlight glows */
.hero-spotlights { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.spotlight {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    animation: glow-pulse 5s ease-in-out infinite;
    will-change: opacity;
}
.sp-1 { width: 560px; height: 560px; background: rgba(0,212,255,.14); top: -120px; left: 18%; animation-delay: 0s; }
.sp-2 { width: 440px; height: 440px; background: rgba(110,50,220,.13); bottom: -60px; right: 8%; animation-delay: 2s; }
.sp-3 { width: 320px; height: 320px; background: rgba(0,212,255,.08); top: 50%; left: -60px; animation-delay: 3.5s; }

/* Hero grid */
.hero-inner {
    max-width: 1380px;
    margin: 0 auto;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 64px;
    align-items: center;
    position: relative;
    z-index: 1;
}

/* ---------- Hero text ---------- */
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 18px;
    background: rgba(0,212,255,.12);
    border: 1px solid rgba(0,212,255,.3);
    border-radius: 100px;
    color: var(--primary);
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 26px;
}

.hero-headline {
    font-size: clamp(2.6rem, 4.5vw, 4.4rem);
    font-weight: 900;
    line-height: 1.08;
    color: var(--text-main);
    margin-bottom: 22px;
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary) 0%, #00B8D9 40%, #7B6FF0 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-pan 5s ease infinite;
}

.hero-sub {
    font-size: 1.15rem;
    color: var(--text-secondary);
    line-height: 1.65;
    margin-bottom: 40px;
    max-width: 480px;
}

.hero-actions {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 36px;
}

.btn-hero-primary {
    padding: 15px 32px;
    background: linear-gradient(135deg, var(--primary) 0%, rgba(0,180,220,1) 100%);
    color: var(--bg);
    border-radius: 12px;
    text-decoration: none;
    font-weight: 800;
    font-size: 1.05rem;
    transition: all .3s ease;
    box-shadow: var(--glow-primary);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.btn-hero-primary:hover { transform: translateY(-3px); box-shadow: var(--glow-primary-strong); }

.btn-hero-secondary {
    padding: 15px 32px;
    background: transparent;
    color: var(--text-main);
    border: 2px solid rgba(255,255,255,.18);
    border-radius: 12px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.05rem;
    transition: all .3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.btn-hero-secondary:hover {
    background: rgba(255,255,255,.07);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-3px);
}

.btn-hero-tertiary {
    padding: 15px 32px;
    background: transparent;
    color: var(--text-secondary);
    border: none;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all .3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}
.btn-hero-tertiary:hover {
    color: var(--primary);
    transform: translateY(-2px);
}

/* Quick-nav pills (logged-in users) */
.hero-quick-nav {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.hero-pill {
    padding: 8px 16px;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 100px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: .85rem;
    font-weight: 600;
    transition: all .25s;
}
.hero-pill:hover {
    background: rgba(0,212,255,.12);
    border-color: rgba(0,212,255,.35);
    color: var(--primary);
}

/* ---------- Hero floating card ---------- */
.hero-preview-wrap { position: relative; display: flex; justify-content: center; }

.hero-floating-card {
    background: rgba(20,20,48,.92);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(0,212,255,.22);
    border-radius: 20px;
    padding: 22px 24px;
    min-width: 310px;
    max-width: 370px;
    width: 100%;
    box-shadow: 0 28px 64px rgba(0,0,0,.55), var(--glow-primary);
    animation: float-a 5.5s ease-in-out infinite;
}

.hfc-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    color: var(--text-main);
    font-size: .95rem;
    margin-bottom: 18px;
}
.hfc-view-all {
    margin-left: auto;
    color: var(--primary);
    text-decoration: none;
    font-size: .78rem;
    font-weight: 600;
    opacity: .8;
    transition: opacity .2s;
}
.hfc-view-all:hover { opacity: 1; }

.live-dot {
    width: 9px;
    height: 9px;
    background: var(--success);
    border-radius: 50%;
    flex-shrink: 0;
    animation: live-ring 2.2s ease-in-out infinite;
}

.hfc-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 10px;
    margin-bottom: 6px;
    transition: background .2s;
}
.hfc-row:hover { background: rgba(0,212,255,.06); }
.hfc-row.current-user {
    background: rgba(0,212,255,.1);
    border: 1px solid rgba(0,212,255,.22);
}

.hfc-rank {
    width: 26px; height: 26px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: .75rem;
    background: var(--bg-hover); color: var(--text-secondary);
    flex-shrink: 0;
}
.hfc-rank.gold   { background: rgba(255,179,0,.18); color: var(--warning); }
.hfc-rank.silver { background: rgba(185,185,205,.15); color: #B8B8CC; }
.hfc-rank.bronze { background: rgba(180,100,0,.18); color: #CD7F32; }

.hfc-team { flex: 1; font-weight: 600; font-size: .88rem; color: var(--text-dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hfc-pts  { font-weight: 800; color: var(--primary); font-size: .92rem; white-space: nowrap; }
.hfc-skeleton { padding: 4px 0; }

/* Decorative chips */
.hero-stat-chip {
    position: absolute;
    background: rgba(20,20,48,.9);
    border: 1px solid rgba(0,212,255,.28);
    border-radius: 100px;
    padding: 8px 16px;
    display: flex; align-items: center; gap: 8px;
    font-size: .82rem; font-weight: 700; color: var(--text-main);
    box-shadow: var(--glow-primary);
    white-space: nowrap;
}
.chip-1 { top: -18px; right: -24px; animation: float-b 4.5s ease-in-out infinite; }
.chip-2 { bottom: -12px; left: -28px; animation: float-a 6s ease-in-out infinite 1.2s; }
.chip-icon { font-size: 1rem; }

/* ============================================================ */
/* ALERTS STRIP                                                  */
/* ============================================================ */
.alerts-strip { max-width: 1200px; margin: 20px auto 0; padding: 0 20px; }

.alert {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 20px;
    background: linear-gradient(135deg, rgba(245,158,11,.15), rgba(245,158,11,.08));
    border-left: 4px solid var(--warning);
    border-radius: 10px;
    cursor: pointer;
    transition: all .2s ease;
    margin-bottom: 10px;
}
.alert:hover { transform: translateX(4px); background: linear-gradient(135deg, rgba(245,158,11,.22), rgba(245,158,11,.12)); }
.alert-icon    { font-size: 1.3rem; }
.alert-message { font-size: .95rem; font-weight: 600; color: var(--text-dark); }

/* ============================================================ */
/* SHARED SECTION STYLES                                         */
/* ============================================================ */
.home-section    { padding: 72px 24px; }
.leaderboard-section  { background: var(--bg-page); }
.top-players-section  { background: var(--bg); }

.section-container { max-width: 1200px; margin: 0 auto; }

.section-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    gap: 16px;
}
.section-title-row.center { justify-content: center; text-align: center; }

.section-title-group {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.section-icon    { font-size: 1.7rem; }
.section-title   { font-size: 1.75rem; font-weight: 800; color: var(--text-main); }
.section-subtitle {
    font-size: .85rem; color: var(--text-gray);
    padding: 4px 12px; background: var(--bg-hover);
    border-radius: 100px; font-weight: 500;
}
.section-pool-name {
    font-size: .82rem; color: var(--primary);
    padding: 4px 12px; background: rgba(0,212,255,.1);
    border: 1px solid rgba(0,212,255,.25); border-radius: 100px;
    font-weight: 700;
}

.section-link {
    color: var(--primary); font-weight: 600;
    text-decoration: none; font-size: .95rem;
    white-space: nowrap; transition: all .2s;
    display: inline-flex; align-items: center; gap: 4px;
}
.section-link:hover { color: var(--text-main); }

/* ============================================================ */
/* LEADERBOARD                                                   */
/* ============================================================ */
.leaderboard-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: var(--card-white);
    border: 1px solid var(--border-light);
    border-radius: 14px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all .25s ease;
    animation: card-in .4s ease both;
}
.leaderboard-row:hover {
    border-color: var(--primary);
    box-shadow: var(--glow-primary);
    transform: translateX(5px);
}
.leaderboard-row.user-row {
    border-color: rgba(0,212,255,.4);
    background: rgba(0,212,255,.06);
}

.lb-rank {
    width: 38px; height: 38px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 1rem;
    flex-shrink: 0;
    background: var(--bg-hover); color: var(--text-secondary);
}
.lb-rank.gold   { background: rgba(255,179,0,.15); color: var(--warning); box-shadow: 0 0 14px rgba(255,179,0,.3); }
.lb-rank.silver { background: rgba(185,185,205,.15); color: #B8B8CC; }
.lb-rank.bronze { background: rgba(180,100,0,.15); color: #CD7F32; }

.lb-team        { flex: 1; min-width: 0; }
.lb-team-name   { font-weight: 700; color: var(--text-dark); font-size: 1rem; margin-bottom: 3px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lb-team-members { font-size: .78rem; color: var(--text-gray); }

.lb-trend { font-size: 1.1rem; flex-shrink: 0; width: 20px; text-align: center; }

.lb-pts        { text-align: right; flex-shrink: 0; }
.lb-pts-value  { font-size: 1.35rem; font-weight: 800; color: var(--primary); display: block; line-height: 1; }
.lb-pts-label  { font-size: .7rem; color: var(--text-gray); text-transform: uppercase; letter-spacing: .5px; }

.lb-you-badge {
    padding: 2px 9px;
    background: rgba(0,212,255,.15); color: var(--primary);
    border-radius: 100px; font-size: .65rem; font-weight: 800; letter-spacing: 1px;
}

.lb-empty {
    text-align: center; padding: 48px 24px;
    background: var(--card-white); border: 1px solid var(--border-light);
    border-radius: 14px; color: var(--text-secondary);
}
.lb-empty a { color: var(--primary); font-weight: 600; text-decoration: none; }

/* ============================================================ */
/* TOP PLAYERS                                                   */
/* ============================================================ */
.players-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
}

.player-card {
    background: var(--card-white);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 22px 16px 18px;
    text-align: center;
    cursor: pointer;
    transition: all .3s ease;
    position: relative;
    overflow: hidden;
    animation: card-in .4s ease both;
}
.player-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, var(--primary), rgba(0,180,220,1));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .35s ease;
}
.player-card:hover { border-color: var(--primary); box-shadow: var(--glow-primary); transform: translateY(-5px); }
.player-card:hover::before { transform: scaleX(1); }

/* Rank badge (top-left) */
.player-rank-badge {
    position: absolute; top: 12px; left: 12px;
    width: 24px; height: 24px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: .68rem; font-weight: 800;
}
.player-rank-badge.gold   { background: rgba(255,179,0,.2); color: var(--warning); }
.player-rank-badge.silver { background: rgba(185,185,205,.2); color: #B8B8CC; }
.player-rank-badge.bronze { background: rgba(180,100,0,.2); color: #CD7F32; }
.player-rank-badge.normal { background: var(--bg-hover); color: var(--text-gray); }

/* Hot streak (top-right) */
.hot-streak { position: absolute; top: 10px; right: 10px; font-size: .95rem; }

/* Photo */
.player-card-photo {
    width: 76px; height: 76px;
    border-radius: 50%;
    margin: 0 auto 14px;
    overflow: hidden;
    border: 2px solid var(--border-light);
    background: var(--bg-hover);
    display: flex; align-items: center; justify-content: center;
    transition: border-color .3s, box-shadow .3s;
}
.player-card:hover .player-card-photo {
    border-color: var(--primary);
    box-shadow: 0 0 18px rgba(0,212,255,.25);
}
.player-card-photo img  { width: 100%; height: 100%; object-fit: cover; }
.player-card-photo .no-photo { font-size: 2.2rem; color: var(--text-gray); }

/* Text */
.player-card-name {
    font-weight: 700; color: var(--text-dark);
    font-size: .88rem; margin-bottom: 5px; line-height: 1.2;
}
.player-card-team {
    font-size: .72rem; color: var(--primary);
    font-weight: 700; margin-bottom: 14px;
    text-transform: uppercase; letter-spacing: .5px;
}

/* Stat cells */
.player-card-stats {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 6px;
}
.pc-stat {
    display: flex; flex-direction: column;
    align-items: center; padding: 7px 4px;
    background: var(--bg-hover); border-radius: 8px;
}
.pc-stat-val   { font-weight: 800; color: var(--text-dark); font-size: 1.05rem; line-height: 1; }
.pc-stat-val.pts { color: var(--primary); font-size: 1.15rem; }
.pc-stat-label { font-size: .6rem; color: var(--text-gray); text-transform: uppercase; margin-top: 3px; letter-spacing: .5px; }

/* ============================================================ */
/* HOW IT WORKS                                                  */
/* ============================================================ */
.how-it-works-section {
    padding: 84px 24px;
    background: var(--bg-page);
}

.steps-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr auto 1fr;
    gap: 0;
    align-items: start;
    margin-top: 20px;
}

.step-card {
    background: var(--card-white);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    padding: 38px 28px 32px;
    text-align: center;
    transition: all .3s ease;
    display: flex; flex-direction: column; align-items: center;
    position: relative;
    overflow: hidden;
}
.step-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 0%, rgba(0,212,255,.08), transparent 60%);
    opacity: 0;
    transition: opacity .3s;
    pointer-events: none;
}
.step-card:hover { border-color: var(--primary); box-shadow: var(--glow-primary); transform: translateY(-5px); }
.step-card:hover::after { opacity: 1; }

.step-number {
    font-size: .72rem; font-weight: 800; color: var(--primary);
    letter-spacing: 2px; text-transform: uppercase;
    margin-bottom: 18px; opacity: .75;
}
.step-icon-wrap {
    font-size: 3.2rem; margin-bottom: 20px;
    display: block; line-height: 1;
}
.step-title {
    font-size: 1.1rem; font-weight: 800;
    color: var(--text-dark); margin-bottom: 12px; line-height: 1.3;
}
.step-desc {
    font-size: .9rem; color: var(--text-secondary);
    line-height: 1.65; margin-bottom: 20px; flex: 1;
}
.step-cta {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 9px 18px;
    background: rgba(0,212,255,.1);
    border: 1px solid rgba(0,212,255,.25);
    border-radius: 100px;
    color: var(--primary); text-decoration: none;
    font-size: .85rem; font-weight: 700;
    transition: all .25s;
    margin-top: auto;
    position: relative;
    z-index: 1;
    cursor: pointer;
}
.step-cta:hover {
    background: rgba(0,212,255,.18);
    border-color: var(--primary);
    transform: translateX(3px);
}

/* Connector arrow */
.step-connector {
    display: flex; align-items: center;
    justify-content: center;
    padding: 0 8px;
    padding-top: 90px;
}
.connector-line {
    position: relative;
    height: 2px; width: 36px;
    background: linear-gradient(90deg, var(--primary), rgba(0,212,255,.25));
}
.connector-line::after {
    content: '▶';
    position: absolute;
    right: -9px; top: 50%;
    transform: translateY(-50%);
    color: var(--primary); font-size: .6rem;
    line-height: 1;
}

/* ============================================================ */
/* RESPONSIVE                                                    */
/* ============================================================ */
@media (max-width: 1100px) {
    .hero-inner { grid-template-columns: 1fr; text-align: center; gap: 48px; }
    .hero-text   { display: flex; flex-direction: column; align-items: center; }
    .hero-sub    { max-width: 560px; }
    .hero-preview-wrap { justify-content: center; }

    .players-grid { grid-template-columns: repeat(3, 1fr); }

    .steps-grid { grid-template-columns: 1fr; }
    .step-connector { display: none; }
}

@media (max-width: 768px) {
    .hero-section { padding: 64px 20px 80px; min-height: auto; }
    .hero-headline { font-size: 2.4rem; }
    .hero-floating-card { min-width: 280px; }
    .chip-1, .chip-2 { display: none; }

    .players-grid { grid-template-columns: repeat(2, 1fr); }

    .section-title-row { flex-direction: column; align-items: flex-start; }
    .section-title-row.center { align-items: center; }
    .section-title { font-size: 1.45rem; }

    .home-section { padding: 52px 16px; }
    .how-it-works-section { padding: 60px 16px; }
}

@media (max-width: 480px) {
    .hero-headline { font-size: 2rem; }
    .hero-actions { flex-direction: column; width: 100%; }
    .btn-hero-primary, .btn-hero-secondary { justify-content: center; }
    .players-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .leaderboard-row { padding: 12px 14px; gap: 10px; }
    .lb-pts-value { font-size: 1.1rem; }
}

/* ============================================================ */
/* TIME RANGE FILTERS                                           */
/* ============================================================ */
.time-filters,
.time-range-filters {
    display: flex;
    gap: 8px;
    align-items: center;
}

.time-filter {
    padding: 8px 16px;
    background: var(--bg-hover);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.time-filter:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.time-filter.active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--bg);
    box-shadow: var(--glow-primary);
}

@media (max-width: 768px) {
    .section-title-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .time-range-filters {
        width: 100%;
        justify-content: flex-start;
    }
    
    .time-filter {
        flex: 1;
        text-align: center;
    }
}

/* ============================================================ */
/* LIGHT MODE — hardcoded rgba overrides                         */
/* ============================================================ */
html[data-theme="light"] .hero-floating-card {
    background: rgba(255, 255, 255, 0.95);
}
html[data-theme="light"] .hero-stat-chip {
    background: rgba(255, 255, 255, 0.95);
}
html[data-theme="light"] .hero-pill {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.10);
}
html[data-theme="light"] .hero-pill:hover {
    background: rgba(0, 136, 170, 0.10);
    border-color: rgba(0, 136, 170, 0.30);
}
html[data-theme="light"] .btn-hero-secondary {
    border-color: rgba(0, 0, 0, 0.20);
    color: var(--text-main);
}
html[data-theme="light"] .btn-hero-secondary:hover {
    background: rgba(0, 0, 0, 0.04);
}
html[data-theme="light"] .hfc-row:hover {
    background: rgba(0, 136, 170, 0.05);
}

/* ============================================================ */
/* REDUCED MOTION — disable animations for users who prefer it  */
/* ============================================================ */
@media (prefers-reduced-motion: reduce) {
    .spotlight,
    .sp-1, .sp-2, .sp-3 { animation: none; }
    .hero-floating-card { animation: none; }
    .chip-1, .chip-2 { animation: none; }
    .live-dot { animation: none; }
    .hero-pill, .btn-hero-primary, .btn-hero-secondary, .btn-hero-tertiary { transition: none; }
}
