@import url('https://fonts.googleapis.com/css2?family=Oxanium:wght@400;800;900&display=swap');

:root {
    --neon-blue: #00d4ff; --neon-green: #39ff14; --neon-purple: #bc13fe;
    --neon-orange: #ff8c00; --neon-yellow: #f4ea10; --primary-neon: var(--neon-purple);
    --bg:#050713; --glass:rgba(15, 15, 15, 0.7); --text:#ffffff; 
    --muted:#aaa; --danger:#ff3333; --ok:#39ff14;
}

body.theme-blue { --primary-neon: var(--neon-purple); } /* Force par défaut pour Events */
body.theme-green { --primary-neon: var(--neon-green); }
body.theme-purple { --primary-neon: var(--neon-purple); }
body.theme-orange { --primary-neon: var(--neon-orange); }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font-family: 'Oxanium', sans-serif; overflow-x: hidden; display: flex; flex-direction: column; }

.site-bg { position: fixed; inset: 0; z-index: -3; pointer-events: none; background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url('../assets/Fond.jpg') center/cover no-repeat; }
.noise { position: fixed; inset: 0; pointer-events: none; opacity: .1; z-index: -2; background-size: 42px 42px; background-image: linear-gradient(rgba(255,255,255,.05) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.05) 1px,transparent 1px); }

/* LIVE TICKER */
.news-ticker { width: 100%; background: var(--neon-orange); color: black; font-weight: 900; font-size: 1.1rem; letter-spacing: 2px; padding: 8px 0; overflow: hidden; position: relative; z-index: 100; box-shadow: 0 0 20px var(--neon-orange); }
.ticker-content { display: inline-block; white-space: nowrap; padding-left: 100%; animation: ticker 25s linear infinite; }
@keyframes ticker { 0% { transform: translate(0, 0); } 100% { transform: translate(-100%, 0); } }
.hidden { display: none !important; }

/* TOPBAR TRANSPARENTE EN CAPSULES */
.topbar { 
    width: 100%; height: 90px; box-sizing: border-box; z-index: 950; 
    display: flex; align-items: center; justify-content: flex-end; 
    padding: 10px 3%; position: sticky; top: 0; transition: top 0.3s;
    background: transparent; pointer-events: none;
}

.nav-bubble { 
    position: absolute; left: 3%; top: 0; width: 140px; height: 120px; 
    background: rgba(15, 15, 15, 0.8); backdrop-filter: blur(20px); 
    border-radius: 0 0 70px 70px; box-shadow: 0 10px 30px rgba(0,0,0,0.5); 
    display: flex; justify-content: center; align-items: center; 
    pointer-events: auto; text-decoration: none; cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.05); border-top: none; 
    border-left: 1px solid rgba(255, 255, 255, 0.15); transition: 0.3s;
}
.nav-bubble:hover { background: rgba(20, 20, 20, 0.95); box-shadow: 0 15px 40px var(--primary-neon); transform: translateY(3px); }
.nav-logo { width: 95px; filter: drop-shadow(0 0 15px var(--primary-neon)); transition: 0.4s ease; margin-bottom: 10px; }
.nav-bubble:hover .nav-logo { transform: scale(1.05); }

.nav-tools-group { 
    pointer-events: auto;
    background: rgba(15, 15, 15, 0.8); backdrop-filter: blur(25px); 
    padding: 10px 25px; border-radius: 50px; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.5); 
    border: 1px solid rgba(255, 255, 255, 0.05); 
    border-top: 1px solid rgba(255, 255, 255, 0.2); 
    border-left: 1px solid rgba(255, 255, 255, 0.15); 
    display: flex; gap: 12px; align-items: center;
}

.nav-pill { display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); color: white; padding: 10px 20px; border-radius: 20px; font-weight: 800; text-transform: uppercase; font-size: 0.8rem; text-decoration: none; transition: 0.3s; }
.nav-pill:hover { background: rgba(255,255,255,0.1); box-shadow: 0 0 10px currentColor; transform: translateY(-2px); }

.btn-inscription-pulse { animation: pulseNeon 2s infinite; }
@keyframes pulseNeon { 
    0% { box-shadow: 0 0 5px rgba(188, 19, 254, 0.5); } 
    50% { box-shadow: 0 0 15px var(--neon-purple), inset 0 0 10px rgba(188, 19, 254, 0.3); } 
    100% { box-shadow: 0 0 5px rgba(188, 19, 254, 0.5); } 
}

.icon-btn { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.2); color: white; padding: 10px; border-radius: 8px; transition: 0.3s; cursor: pointer; display: flex; align-items: center; justify-content: center; width: 38px; height: 38px; }
.icon-btn:hover { border-color: var(--primary-neon); color: var(--primary-neon); box-shadow: 0 0 10px var(--primary-neon); }

.theme-switcher { display: flex; gap: 8px; background: rgba(0,0,0,0.4); padding: 5px 10px; border-radius: 20px; border: 1px solid rgba(255,255,255,0.1); margin-right: 10px;}
.theme-dot { width: 15px; height: 15px; border-radius: 50%; border: 2px solid transparent; transition: 0.3s; cursor: pointer; }
.theme-dot:hover { transform: scale(1.3); }
.theme-dot-blue { background: var(--neon-blue); box-shadow: 0 0 8px var(--neon-blue); }
.theme-dot-green { background: var(--neon-green); box-shadow: 0 0 8px var(--neon-green); }
.theme-dot-purple { background: var(--neon-purple); box-shadow: 0 0 8px var(--neon-purple); }
.theme-dot-orange { background: var(--neon-orange); box-shadow: 0 0 8px var(--neon-orange); }

.datetime-widget { display: flex; flex-direction: column; align-items: flex-end; justify-content: center; padding-left: 15px; border-left: 1px solid rgba(255,255,255,0.1); }
#current-date { font-size: 0.6rem; color: #ccc; text-transform: uppercase; letter-spacing: 1px; }
#current-time { font-size: 1rem; font-weight: 800; color: white; text-shadow: 0 0 10px var(--primary-neon); }

/* LAYOUT */
.main-grid { display: grid; grid-template-columns: 280px 1fr; gap: 25px; margin-top: 30px; margin-bottom: 30px; align-items: start; width: 100%; max-width: 1800px; margin-left: auto; margin-right: auto; padding: 0 20px;}

/* CORRECTION CRUCIALE : Empêche la colonne de droite de "casser" la page et force l'apparition de la barre de scroll */
.right-col { min-width: 0; width: 100%; }

.glass-panel { background: var(--glass); backdrop-filter: blur(15px); border: 1px solid rgba(255,255,255,0.1); border-radius: 20px; box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
.sticky-panel { position: sticky; top: 120px; transition: top 0.3s; }

/* TUILES JEUX */
.game-grid-vertical { display: flex; flex-direction: column; gap: 10px; }
.game-card { background: rgba(0,0,0,0.4); border: 1px solid rgba(255,255,255,0.1); border-radius: 12px; padding: 15px; display: flex; align-items: center; gap: 15px; cursor: pointer; transition: 0.3s; }
.game-card img { height: 35px; width: 35px; object-fit: contain; filter: drop-shadow(0 0 5px rgba(255,255,255,0.2)); transition: 0.3s; }
.game-card h3 { margin: 0; font-size: 0.9rem; text-transform: uppercase; text-align: left; transition: 0.3s; }
.game-card:hover, .game-card.active { background: rgba(255,255,255,0.05); border-color: var(--card-color, var(--primary-neon)); box-shadow: inset 0 0 15px rgba(var(--card-color, var(--primary-neon)), 0.1); transform: translateX(5px); }
.game-card.active h3 { text-shadow: 0 0 8px var(--card-color, var(--primary-neon)); }

/* ONGLETS MODERNES & PHASES */
.modern-tabs { display: flex; gap: 15px; margin-bottom: 20px; }
.tab-btn { background: rgba(0,0,0,0.4); border: 1px solid rgba(255,255,255,0.1); color: #ccc; padding: 12px 25px; border-radius: 12px; font-family: 'Oxanium'; font-weight: 800; font-size: 0.95rem; cursor: pointer; transition: 0.3s; display: flex; align-items: center; gap: 10px; text-transform: uppercase;}
.tab-btn:hover { background: rgba(255,255,255,0.05); color: white; transform: translateY(-2px); }
.tab-btn.active { background: rgba(var(--primary-neon), 0.1); border-color: var(--primary-neon); color: var(--primary-neon); box-shadow: 0 0 15px rgba(var(--primary-neon), 0.2); }

.tab-btn-phase { background: transparent; border: 1px solid transparent; color: #aaa; padding: 8px 20px; border-radius: 8px; font-family: 'Oxanium'; font-weight: 800; font-size: 0.9rem; cursor: pointer; transition: 0.3s; text-transform: uppercase;}
.tab-btn-phase:hover { color: white; background: rgba(255,255,255,0.05); }
.tab-btn-phase.active { background: rgba(var(--primary-neon), 0.1); border-color: var(--primary-neon); color: var(--primary-neon); box-shadow: 0 0 10px rgba(var(--primary-neon), 0.2); }

.status-badge { padding: 5px 12px; border-radius: 50px; font-size: 0.75rem; font-weight: 900; text-transform: uppercase; border: 1px solid; }
.status-badge.draft { background: rgba(170,170,170,0.1); border-color: #aaa; color: #aaa; }
.status-badge.ongoing { background: rgba(57,255,20,0.1); border-color: var(--neon-green); color: var(--neon-green); box-shadow: 0 0 10px var(--neon-green); animation: pulseStatus 2s infinite; }
.status-badge.finished { background: rgba(255,140,0,0.1); border-color: var(--neon-orange); color: var(--neon-orange); }
@keyframes pulseStatus { 0% { opacity: 1; } 50% { opacity: 0.5; } 100% { opacity: 1; } }

.tab-content { display: none; }
.tab-content.active { display: flex; flex-direction: column; animation: fadeIn 0.4s ease; }
@keyframes fadeIn { from{opacity:0; transform:translateY(10px);} to{opacity:1; transform:translateY(0);} }

/* SÉLECTEUR DE VUE (TOGGLE) */
.tab-header-actions { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; flex-wrap: wrap; gap: 15px; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 15px;}
.view-toggle { display: inline-flex; background: rgba(0,0,0,0.5); border-radius: 50px; padding: 4px; border: 1px solid rgba(255,255,255,0.1); }
.toggle-btn { background: transparent; color: #aaa; border: none; padding: 8px 20px; border-radius: 50px; cursor: pointer; font-family: 'Oxanium'; font-weight: 800; font-size: 0.85rem; transition: 0.3s; text-transform: uppercase; }
.toggle-btn.active { background: var(--primary-neon); color: black; box-shadow: 0 0 15px rgba(var(--primary-neon), 0.5); }
.toggle-btn:hover:not(.active) { color: white; }

/* VUE GLOBALE - CARTES MINIATURES */
.global-day-title { font-size: 1rem; text-transform: uppercase; letter-spacing: 2px; margin-top: 30px; margin-bottom: 15px; border-bottom: 2px solid; padding-bottom: 5px; font-weight: 900;}
.global-cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.global-card { background: rgba(0,0,0,0.4); border: 1px solid rgba(255,255,255,0.1); border-top: 3px solid; border-radius: 12px; padding: 15px; transition: 0.3s; }
.global-card:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0,0,0,0.5); }
.global-card-header { display: flex; align-items: center; gap: 10px; margin-bottom: 15px; font-weight: 800; font-size: 1rem; border-bottom: 1px dashed rgba(255,255,255,0.1); padding-bottom: 10px; }
.global-card-header img { height: 25px; filter: drop-shadow(0 0 5px rgba(255,255,255,0.2)); object-fit: contain; }

.mini-rank { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 0.9rem; padding: 8px; border-radius: 8px; background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.05); }
.mini-rank.rank-1 { color: gold; border-color: rgba(255, 215, 0, 0.3); background: rgba(255, 215, 0, 0.05); }
.mini-rank.rank-2 { color: silver; border-color: rgba(192, 192, 192, 0.3); background: rgba(192, 192, 192, 0.05); }
.mini-rank.rank-3 { color: #cd7f32; border-color: rgba(205, 127, 50, 0.3); background: rgba(205, 127, 50, 0.05); }

.mini-stat-row { display: flex; align-items: center; justify-content: space-between; padding: 8px; border-bottom: 1px solid rgba(255,255,255,0.05); font-size: 0.9rem; }
.mini-stat-row:last-child { border-bottom: none; }
.mini-stat-row .pos { font-weight: 900; color: #666; width: 25px; }
.mini-stat-row .name { font-weight: 800; color: white; flex-grow: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-stat-row .score { font-weight: 900; color: var(--card-color); text-shadow: 0 0 5px var(--card-color); }

/* ZONE DU BRACKET */
.bracket-area { 
    width: 100%; overflow: auto; padding: 40px; padding-bottom: 60px; box-sizing: border-box; 
    cursor: grab; display: flex; align-items: flex-start; gap: 80px; min-height: 600px;
    background: radial-gradient(circle at center, rgba(255,255,255,0.02) 0%, transparent 70%);
}
.bracket-area:active { cursor: grabbing; }

/* SCROLLBAR SPECIFIQUE POUR L'ARBRE DU TOURNOI */
.bracket-area::-webkit-scrollbar { height: 14px; width: 14px; }
.bracket-area::-webkit-scrollbar-track { background: rgba(0,0,0,0.4); border-radius: 10px; margin: 10px; border: 1px solid rgba(255,255,255,0.05); }
.bracket-area::-webkit-scrollbar-thumb { background: var(--primary-neon); border-radius: 10px; border: 3px solid #0f0f0f; }
.bracket-area::-webkit-scrollbar-thumb:hover { background: white; }

/* IMPORTANT : Empêche le chevauchement ou l'écrasement */
.bracket-column { display: flex; flex-direction: column; justify-content: space-around; gap: 30px; min-width: 280px; flex-shrink: 0; }

/* NOEUDS DE MATCHS PUBLIC */
.match-node { 
    background: rgba(10, 10, 15, 0.85); border: 1px solid rgba(255,255,255,0.1); 
    border-radius: 12px; padding: 0; box-shadow: 0 5px 15px rgba(0,0,0,0.5); 
    position: relative; transition: 0.3s; overflow: hidden;
}
.match-node:hover { border-color: var(--primary-neon); box-shadow: 0 5px 20px rgba(var(--primary-neon), 0.2); transform: translateY(-2px); }

.match-header { background: rgba(255,255,255,0.05); padding: 8px 12px; font-size: 0.75rem; color: var(--primary-neon); text-transform: uppercase; font-weight: 800; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid rgba(255,255,255,0.1); }

.team-slot { display: flex; align-items: center; padding: 10px 12px; border-bottom: 1px solid rgba(255,255,255,0.05); transition: 0.3s; background: rgba(0,0,0,0.3); }
.team-slot:last-child { border-bottom: none; }
.team-slot.winner { background: rgba(57, 255, 20, 0.1); border-left: 4px solid var(--neon-green); }
.team-slot.loser { opacity: 0.5; filter: grayscale(80%); }
.team-slot.is-bye { background: rgba(255, 255, 255, 0.05); color: #666; font-style: italic; }

.score-display { width: 30px; font-family: 'Oxanium'; font-size: 1.1rem; font-weight: 900; text-align: center; margin-right: 12px; color: white; background: rgba(0,0,0,0.5); padding: 3px; border-radius: 6px; border: 1px solid rgba(255,255,255,0.1); }
.team-slot.is-bye .score-display { display: none; }
.team-slot.winner .score-display { color: var(--neon-green); text-shadow: 0 0 10px var(--neon-green); border-color: var(--neon-green); }

.team-name { font-size: 0.95rem; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex-grow: 1;}

.bo-badge { background: rgba(0, 212, 255, 0.2); color: var(--neon-blue); border: 1px solid var(--neon-blue); padding: 2px 6px; border-radius: 4px; font-size: 0.65rem; }
.third-place-badge { position: absolute; top: -10px; right: 10px; background: var(--neon-orange); color: black; font-size: 0.65rem; padding: 3px 8px; border-radius: 20px; font-weight: 900; box-shadow: 0 0 10px var(--neon-orange); z-index: 2; }

/* CONNECTEURS */
.match-node::before { content: ""; position: absolute; top: 50%; left: -40px; width: 40px; height: 2px; background: rgba(255,255,255,0.1); z-index: -1; }
.match-node[data-next]::after { content: ""; position: absolute; top: 50%; right: -40px; width: 40px; height: 2px; background: rgba(255,255,255,0.1); z-index: -1; border-right: 2px solid rgba(255,255,255,0.2); }
.bracket-column:last-child .match-node::after { display: none; }
.bracket-column:first-child .match-node::before { display: none; }

/* GROUPES / POULES */
.groups-container { display: flex; flex-wrap: wrap; gap: 30px; width: 100%; align-items: flex-start; }
.group-card { background: rgba(0,0,0,0.6); border: 1px solid rgba(255,255,255,0.1); border-radius: 12px; width: 300px; overflow: hidden; box-shadow: 0 5px 15px rgba(0,0,0,0.5); }
.group-header { background: var(--primary-neon); color: black; font-weight: 900; text-align: center; padding: 10px; text-transform: uppercase; }
.group-matches { display: flex; flex-direction: column; padding: 15px; gap: 15px; }

/* PODIUM 3D PREMIUM */
.podium-container { display: flex; align-items: flex-end; justify-content: center; gap: 20px; height: 100%; padding-bottom: 50px; margin-top: 50px; }
.podium-pillar { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; width: 180px; position: relative; border-radius: 15px 15px 0 0; border: 1px solid rgba(255,255,255,0.1); border-bottom: none; box-shadow: 0 -10px 30px rgba(0,0,0,0.5); transition: 0.3s; }
.podium-pillar:hover { transform: scale(1.02); }
.podium-pillar::before { content: ''; position: absolute; inset: 0; border-radius: 15px 15px 0 0; background: linear-gradient(to bottom, rgba(255,255,255,0.1), transparent); z-index: 0; }
.podium-rank { font-size: 5rem; font-weight: 900; opacity: 0.2; position: absolute; bottom: 20px; z-index: 1; }
.podium-team { font-size: 1.3rem; font-weight: 900; text-transform: uppercase; color: white; text-align: center; z-index: 2; margin-bottom: 40px; text-shadow: 0 0 10px rgba(0,0,0,0.8); width: 100%; word-break: break-word;}
.podium-avatar { width: 80px; height: 80px; border-radius: 50%; background: #111; border: 3px solid #ccc; display: flex; justify-content: center; align-items: center; font-size: 2rem; color: #ccc; position: absolute; top: -40px; z-index: 3; box-shadow: 0 10px 20px rgba(0,0,0,0.5); }

.place-1 { height: 350px; background: linear-gradient(to top, rgba(255, 215, 0, 0.1), rgba(255, 215, 0, 0.3)); border-color: gold; box-shadow: 0 -10px 40px rgba(255, 215, 0, 0.2); z-index: 3; }
.place-1 .podium-rank { color: gold; opacity: 0.4; }
.place-1 .podium-avatar.glow-gold { border-color: gold; color: gold; box-shadow: 0 0 30px gold; background: rgba(255, 215, 0, 0.1); }

.place-2 { height: 250px; background: linear-gradient(to top, rgba(192, 192, 192, 0.1), rgba(192, 192, 192, 0.2)); border-color: silver; }
.place-2 .podium-rank { color: silver; }
.place-2 .podium-avatar { border-color: silver; color: silver; }

.place-3 { height: 200px; background: linear-gradient(to top, rgba(205, 127, 50, 0.1), rgba(205, 127, 50, 0.2)); border-color: #cd7f32; }
.place-3 .podium-rank { color: #cd7f32; }
.place-3 .podium-avatar { border-color: #cd7f32; color: #cd7f32; }

/* STATS GRID */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; width: 100%; }
.stat-card { background: rgba(0,0,0,0.4); padding: 20px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.05); transition: 0.3s; }
.stat-card:hover { transform: translateY(-3px); box-shadow: 0 5px 15px rgba(0,0,0,0.5); border-color: rgba(255,255,255,0.15); }
.stat-row { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 0.9rem; }
.stat-row strong { font-size: 1.1rem; color: white; }

/* FOOTER CAPSULE */
.glass-footer { 
    width: calc(100% - 40px); max-width: 1760px; margin: auto auto 20px auto; 
    border-radius: 50px; 
    border: 1px solid rgba(255, 255, 255, 0.05); 
    border-top: 1px solid rgba(255, 255, 255, 0.2); 
    border-left: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(15, 15, 15, 0.8); backdrop-filter: blur(20px);
    display: flex; align-items: center; justify-content: center; gap: 15px; 
    padding: 10px 5%; box-shadow: 0 10px 30px rgba(0,0,0,0.5); 
}
.glass-footer img { height: 40px; border-radius: 5px; }

@media (max-width: 1200px) {
    .main-grid { grid-template-columns: 1fr; }
    .sticky-panel { position: static; }
    .podium-container { flex-direction: column; align-items: center; gap: 50px;}
    .podium-pillar { width: 100%; height: auto !important; padding-top: 60px; padding-bottom: 20px; border-radius: 15px;}
    .podium-rank { position: static; opacity: 1; font-size: 2rem;}
}

@media (max-width: 900px) {
    .topbar { position: relative !important; top: 0 !important; height: auto; flex-direction: column; align-items: center; justify-content: center; gap: 20px; padding: 15px; }
    .nav-bubble { position: relative; left: auto; top: auto; border-radius: 20px; height: 90px; width: 120px; border: 1px solid rgba(255,255,255,0.1); margin-top: 15px; }
    .nav-tools-group { flex-wrap: wrap; justify-content: center; border-radius: 25px; padding: 15px; }
    .sticky-panel { top: 0; }
}