/* ========================================================
   LHDSR THEATER MODE (NATIVE FULLSCREEN ENGINE)
   ======================================================== */

/* 1. COMPORTEMENT DU LECTEUR EN PLEIN ÉCRAN NATIF */
#arming-player-stage:fullscreen,
#arming-player-stage:-webkit-full-screen {
    background: #000 !important;
    width: 100vw !important;
    height: 100vh !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* L'iframe YT prend toute la place */
#arming-player-stage:fullscreen iframe,
#arming-player-stage:-webkit-full-screen iframe {
    width: 100vw !important;
    height: 100vh !important;
    position: absolute !important;
    top: 0 !important; 
    left: 0 !important;
    pointer-events: auto;
}

/* On cache l'overlay YouTube natif du desktop en mode theater */
#arming-player-stage:fullscreen #global-player-overlay {
    display: none !important;
}

/* Les sous-titres remontent pour ne pas taper dans le dock, qu'on soit en plein écran ou juste en theater mode */
body.theater-active #global-player-subtitles-overlay,
#arming-player-stage:fullscreen #global-player-subtitles-overlay,
#arming-player-stage:-webkit-full-screen #global-player-subtitles-overlay {
    display: block !important;
    bottom: 220px !important; /* Réduction de la marge pour coller au-dessus du dock */
    z-index: 2000000 !important;
    left: 50% !important;
    transform: translateX(-50%) translateY(0px) !important;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1), bottom 0.8s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1) !important;
    will-change: transform, opacity, bottom;
    width: max-content !important;
    max-width: 90% !important;
    text-align: center !important;
}

/* Chorégraphie d'esquive : Les sous-titres descendent en même temps que le dock */
body.theater-active.controls-idle #global-player-subtitles-overlay {
    transform: translateX(-50%) translateY(80px) !important;
}

/* --- LUX SIGNATURE THEATER --- */
.th-lux-signature {
    width: 24px;
    height: 24px;
    background-color: var(--neon-gold);
    -webkit-mask: url('assets/lhdsr_lux.svg') no-repeat center;
    mask: url('assets/lhdsr_lux.svg') no-repeat center;
    -webkit-mask-size: contain;
    mask-size: contain;
    animation: lux-breathing-gold 3s ease-in-out infinite;
    margin: 0 15px;
}
@keyframes lux-breathing-gold {
    0%, 100% { filter: drop-shadow(0 0 2px var(--neon-gold)); opacity: 0.5; }
    50% { filter: drop-shadow(0 0 12px var(--neon-gold)); opacity: 1; transform: scale(1.05); }
}

body.theater-active #global-player-subtitles-overlay span,
body.theater-active #global-player-subtitles-overlay .srt-text,
#arming-player-stage:fullscreen #global-player-subtitles-overlay span,
#arming-player-stage:-webkit-full-screen #global-player-subtitles-overlay span {
    font-size: calc(24px * var(--srt-scale, 1.0)) !important; /* Le scale est géré dynamiquement par la police */
}

@media screen and (max-width: 600px) {
    body.theater-active #global-player-subtitles-overlay,
    #arming-player-stage:fullscreen #global-player-subtitles-overlay,
    #arming-player-stage:-webkit-full-screen #global-player-subtitles-overlay {
        bottom: 180px !important; /* Adapté au dock compact sur mobile */
    }
    
    body.theater-active #global-player-subtitles-overlay span,
    body.theater-active #global-player-subtitles-overlay .srt-text,
    #arming-player-stage:fullscreen #global-player-subtitles-overlay span,
    #arming-player-stage:-webkit-full-screen #global-player-subtitles-overlay span {
        font-size: calc(16px * var(--srt-scale, 1.0)) !important;
    }
}

/* 2. LE SUPER OVERLAY LHDSR (Contrôles & Forensic) */
#theater-super-overlay {
    position: absolute !important;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 2147483647 !important; /* Max level */
    pointer-events: none; /* Le clic traverse vers la vidéo par défaut */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    font-family: 'Roboto Mono', monospace;
}

/* --- A. LE HUD FORENSIC (HOLOGRAM) --- */
.th-forensic-hud {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 1s ease-out;
}

body.theater-forensic-mode .th-forensic-hud { opacity: 1; }

/* 1. PANNEAU DROIT : FLUX DE DONNEES (THE DATA STREAM) */
.th-intel-panel {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 140px; 
    width: 40vw;
    max-width: 600px;
    
    /* [NETTOYAGE CRISTAL] Plus de fond, plus de flou, plus de masque global */
    background: transparent;
    backdrop-filter: none;
    -webkit-mask-image: none;
    mask-image: none;

    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 40px 40px 0 40px;
    gap: 30px;
    z-index: 10;
    pointer-events: none;
}

.th-typewriter {
    font-family: 'Roboto Mono', monospace;
    font-size: 16px;
    line-height: 1.6;
    color: #fff;
    font-weight: 500;
    text-shadow: 0 1px 3px rgba(0,0,0,0.9), 0 0 10px rgba(0,0,0,0.8);
    
    /* [CHIRURGIE] Inversion : Liseré et Dégradé à Gauche */
    background: linear-gradient(90deg, rgba(0, 5, 10, 0.6) 0%, rgba(0, 5, 10, 0.4) 70%, transparent 100%);
    border-radius: 0 4px 4px 0; 
    padding: 15px 20px;
    border-left: 3px solid var(--neon-cyan);
    text-align: left;
    
    white-space: pre-wrap; 
    word-break: break-word; 
    height: fit-content; 
    flex-shrink: 0; 
    min-height: 40px;
    pointer-events: auto;
    margin-top: 20px;
    transition: opacity 0.5s ease;
}

/* 2. LES CARTES DE SIGNAUX (STACK CHOREGRAPHY) */
.th-signal-feed {
    display: flex;
    flex-direction: column;
    /* La marge est gérée par les cartes pour le collapse fluide */
    overflow: visible; 
}

.th-signal-card {
    background: linear-gradient(90deg, rgba(0, 5, 10, 0.95) 0%, rgba(0, 5, 10, 0.85) 80%, transparent 100%);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-left: 3px solid var(--neon-cyan);
    border-radius: 0 6px 6px 0;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    animation: slideInRight 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transform-origin: right center;
    position: relative;
    overflow: hidden;
    text-align: left;
    margin-bottom: 15px; 
    
    /* PHYSIQUE COLLAPSE FLUIDE (Ease In & Ease Out parfait pour la remontée) */
    max-height: 800px; /* Safe upper bound */
    opacity: 1;
    /* Base transition : recovery rapide pour le rewind ou l'entrée */
    transition: opacity 0.3s ease, max-height 0.3s ease, margin-bottom 0.3s ease, padding 0.3s ease, border-width 0.3s ease;
}

.th-signal-card.fading {
    opacity: 0 !important;
    /* Phase 2: Le Fade Out optique exclusif en 5 secondes linéaires. Dimensions intactes. */
    transition: opacity 5s linear, max-height 0.3s ease, margin-bottom 0.3s ease, padding 0.3s ease, border-width 0.3s ease;
}

.th-signal-card.collapsing {
    max-height: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    border-width: 0 !important;
    opacity: 0 !important;
    /* Phase 3: Le vide est comblé. Opacité forcée, et effondrement physique fluide sur 2 secondes (ease-in-out) */
    transition: max-height 2s cubic-bezier(0.4, 0, 0.2, 1), margin-bottom 2s cubic-bezier(0.4, 0, 0.2, 1), padding 2s cubic-bezier(0.4, 0, 0.2, 1), border-width 2s cubic-bezier(0.4, 0, 0.2, 1), opacity 0s !important;
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(50px) scale(0.95); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}

.th-signal-header {
    display: flex;
    justify-content: space-between;
    font-family: 'Orbitron', sans-serif;
    font-size: 10px;
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.th-signal-text {
    font-family: 'Inter', sans-serif;
    font-size: 18px; 
    line-height: 1.6;
    color: #e2e8f0;
    font-weight: 500;
}

/* Curseur Machine à écrire */
.th-cursor {
    display: inline-block;
    width: 8px;
    height: 16px;
    background: currentColor;
    margin-left: 4px;
    animation: th-blink 0.8s steps(2, start) infinite;
    vertical-align: middle;
}
@keyframes th-blink { to { visibility: hidden; } }

body.theater-paused .th-cursor { animation-play-state: paused !important; }

/* La barre est pilotée mathématiquement par JS (Interpolation fluide) */
.th-signal-lifeline {
    position: absolute;
    bottom: 0; left: 0;
    height: 2px;
    width: 100%;
    transition: width 0.1s linear; 
}

/* --- THEMES VISUELS (LIÉS À LA TIMELINE) --- */
.th-card-propaganda { border-left-color: #ff00ff; }
.th-card-propaganda .th-signal-header { color: #ff00ff; }
.th-card-propaganda .th-signal-lifeline { background: #ff00ff; box-shadow: 0 0 8px #ff00ff; }

.th-card-coherence { border-left-color: #00ff9d; }
.th-card-coherence .th-signal-header { color: #00ff9d; }
.th-card-coherence .th-signal-lifeline { background: #00ff9d; box-shadow: 0 0 8px #00ff9d; }

.th-card-credibility { border-left-color: #00f3ff; }
.th-card-credibility .th-signal-header { color: #00f3ff; }
.th-card-credibility .th-signal-lifeline { background: #00f3ff; box-shadow: 0 0 8px #00f3ff; }

.th-card-aggression { border-left-color: #ff2a2a; }
.th-card-aggression .th-signal-header { color: #ff2a2a; }
.th-card-aggression .th-signal-lifeline { background: #ff2a2a; box-shadow: 0 0 8px #ff2a2a; }

.th-card-anxiety { border-left-color: #ff8800; }
.th-card-anxiety .th-signal-header { color: #ff8800; }
.th-card-anxiety .th-signal-lifeline { background: #ff8800; box-shadow: 0 0 8px #ff8800; }

.th-card-gravity { border-left-color: #ffd700; }
.th-card-gravity .th-signal-header { color: #ffd700; }
.th-card-gravity .th-signal-lifeline { background: #ffd700; box-shadow: 0 0 8px #ffd700; }

/* MACHIAVEL (Hellfire Shadow Calibré) */
.th-card-machiavel { 
    border-left-color: #ff4d00; 
    box-shadow: -4px 0 10px rgba(255,0,0,0.4), -8px 0 15px rgba(255,136,0,0.2), 0 10px 30px rgba(0,0,0,0.5); 
}
.th-card-machiavel .th-signal-header { color: #ff4d00; }
.th-card-machiavel .th-signal-lifeline { background: #ff4d00; box-shadow: 0 0 10px #ff0000, 0 0 15px #ff8800; }

.th-card-dark_narcissism { border-left-color: #a020f0; }
.th-card-dark_narcissism .th-signal-header { color: #a020f0; }
.th-card-dark_narcissism .th-signal-lifeline { background: #a020f0; box-shadow: 0 0 8px #a020f0; }

.th-card-dark_psychopathy { border-left-color: #ff0000; }
.th-card-dark_psychopathy .th-signal-header { color: #ff0000; }
.th-card-dark_psychopathy .th-signal-lifeline { background: #ff0000; box-shadow: 0 0 8px #ff0000; }

.th-card-generic { border-left-color: #ffffff; }
.th-card-generic .th-signal-header { color: #ffffff; }
.th-card-generic .th-signal-lifeline { background: #ffffff; box-shadow: 0 0 8px #ffffff; }

/* 3. PANNEAU GAUCHE : RADAR ET LOGS */
.th-left-panel {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 100px;
    width: 300px;
    padding: 60px 40px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.th-radar-box {
    width: 250px; height: 250px;
    background: radial-gradient(circle at center, rgba(0, 15, 25, 0.4) 0%, transparent 70%);
    border-radius: 50%;
}

/* Comportement IDLE (Fantome - HUD Uniquement) */
body.theater-active.hud-idle.theater-forensic-mode .th-intel-panel,
body.theater-active.hud-idle.theater-forensic-mode .th-left-panel {
    opacity: 0.15;
    transition: opacity 4s ease-in-out;
}

/* --- B. LE DOCK DE CONTRÔLE (MODE SIMPLE) --- */
.th-controls-dock {
    pointer-events: auto;
    margin: 0 auto 40px auto;
    background: rgba(2, 4, 6, 0.85);
    backdrop-filter: blur(25px);
    border: 1px solid rgba(0, 243, 255, 0.15);
    border-radius: 12px;
    padding: 20px 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.9), inset 0 0 15px rgba(255,255,255,0.05);
    transform: translateY(0px) scale(1) !important;
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1) !important;
    will-change: transform, opacity;
    width: 900px;
    max-width: 95vw;
}

/* L'ÉCRAN TACTIQUE (STYLE QUARTZ / SKMEI WATCH) */
.th-quartz-screen {
    width: 100%;
    background: rgba(1, 3, 2, 0.95); /* Vert d'eau quasi noir */
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.9);
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 10px 15px;
    opacity: 0; /* Caché par défaut */
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
    overflow: hidden;
    position: relative;
    font-family: 'Roboto Mono', monospace;
    height: 0;
    margin-bottom: -15px; /* Compense le gap quand il est caché */
}

/* Effet Scanline interne pour l'écran LCD */
.th-quartz-screen::after {
    content: '';
    position: absolute; inset: 0;
    background: repeating-linear-gradient(to bottom, transparent, transparent 2px, rgba(0,0,0,0.3) 2px, rgba(0,0,0,0.3) 4px);
    pointer-events: none;
}

.th-quartz-screen.visible {
    opacity: 1;
    height: 60px;
    margin-bottom: 5px;
    border-color: var(--neon-cyan); /* Surpassé par le JS via style.borderColor */
}

.th-quartz-line-top {
    font-size: 10px;
    font-weight: 700;
    margin-bottom: 4px;
    letter-spacing: 2px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 2;
}

.th-quartz-line-bottom {
    font-size: 11px;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    z-index: 2;
    text-shadow: 0 0 5px rgba(255,255,255,0.4);
}

/* TIMELINE WRAPPER (PLEINE LARGEUR) */
.th-timeline-wrapper {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 15px;
}

.th-progress-bar {
    flex: 1; /* Prend tout l'espace disponible */
    height: 6px;
    background: rgba(255,255,255,0.1);
    border-radius: 3px; cursor: pointer; position: relative;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.5);
}

/* CONTROLES LECTEUR (ALIGNEMENT BAS) */
.th-controls-row {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 15px;
    margin-top: 5px;
}

/* Inactivité (Idle) : Disparition Totale du Dock */
body.theater-active.controls-idle .th-controls-dock {
    opacity: 0 !important;
    transform: translateY(100px) scale(0.95) !important;
    pointer-events: none !important;
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

/* --- THEATER REPORT DE VIEW (PREMIUM) --- */
.th-report-wrapper {
    width: 100%;
    z-index: 50;
    pointer-events: auto !important; /* FORCE L'INTERACTIVITÉ */
}

#th-btn-report-toggle {
    pointer-events: auto !important;
    cursor: pointer !important;
}

.th-report-drawer {
    max-height: 0;
    opacity: 0;
    overflow-y: auto;
    scrollbar-width: none;
    transition: max-height 0.8s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.6s ease;
    /* CHIRURGIE : Verre teinté noir à 80% avec distorsion (flou + contraste vidéo) */
    background: rgba(0, 0, 0, 0.80);
    backdrop-filter: blur(12px) contrast(1.2) saturate(1.2);
    -webkit-backdrop-filter: blur(12px) contrast(1.2) saturate(1.2);
    border: 1px solid transparent;
    border-top: none;
    border-radius: 0 0 8px 8px;
    margin-top: -2px; /* Colle au bouton */
    position: relative;
}
.th-report-drawer::-webkit-scrollbar { display: none; }

.th-report-drawer.open {
    max-height: 400px; /* Valeur généreuse pour desktop */
    opacity: 1;
    border-color: rgba(255, 215, 0, 0.3);
    box-shadow: 0 30px 60px rgba(0,0,0,0.9), inset 0 -30px 40px rgba(0,0,0,0.6), inset 0 0 20px rgba(255, 215, 0, 0.05);
    padding: 30px;
}

.th-report-content {
    font-family: 'Inter', sans-serif;
    color: #e2e8f0;
    font-size: 13.5px;
    line-height: 1.8;
    text-align: left;
    font-weight: 300;
}

/* [CHIRURGIE] Normalisation typographique des balises HTML injectées par l'IA */
.th-report-content h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: 16px;
    color: var(--neon-gold);
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    border-bottom: 1px solid rgba(255, 215, 0, 0.3);
    padding-bottom: 8px;
}

.th-report-content h2 {
    font-size: 14px;
    color: var(--neon-cyan);
    margin-top: 25px;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.th-report-content h3 {
    font-size: 13px;
    color: #fff;
    margin-top: 20px;
    margin-bottom: 10px;
    font-weight: 600;
}

.th-report-content p {
    margin-bottom: 15px;
}

.th-report-content ul, .th-report-content ol {
    margin-bottom: 15px;
    padding-left: 20px;
}

.th-report-content li {
    margin-bottom: 8px;
}

.th-report-content strong {
    color: #fff;
    font-weight: 600;
}

.th-report-section.intro {
    color: #fff;
    font-size: 15px;
    line-height: 1.7;
    font-weight: 400;
    border-bottom: 1px solid rgba(255, 215, 0, 0.15);
    padding-bottom: 20px;
    margin-bottom: 20px;
    letter-spacing: 0.3px;
}

.th-report-section.data-block {
    margin-bottom: 20px;
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.06) 0%, transparent 100%);
    border-left: 3px solid var(--neon-gold);
    padding: 15px 20px;
    border-radius: 0 6px 6px 0;
}

.th-rs-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 11px;
    color: var(--neon-gold);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 10px;
    font-weight: 700;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
}

.th-magic-timecode {
    cursor: pointer;
    color: #000;
    font-family: 'Roboto Mono', monospace;
    font-weight: bold;
    background: var(--neon-cyan);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    display: inline-flex;
    align-items: center;
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.4);
    transition: all 0.2s ease;
    margin: 0 4px;
    vertical-align: text-bottom;
}
.th-magic-timecode:hover {
    background: #fff;
    box-shadow: 0 0 15px var(--neon-cyan);
    transform: scale(1.05);
}

/* --- THEATER FILTERS & TUTORIAL --- */
.th-filters-row {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 5px;
    margin-bottom: 15px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    /* Soft fade effect on right edge pour inviter au scroll */
    mask-image: linear-gradient(90deg, #000 85%, transparent 100%);
    -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent 100%);
}
.th-filters-row::-webkit-scrollbar { display: none; }

.th-filter-chip {
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #888;
    font-size: 10px;
    font-family: 'Orbitron', sans-serif;
    padding: 6px 14px;
    border-radius: 20px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    letter-spacing: 1px;
}

.th-filter-chip:hover {
    border-color: rgba(255,255,255,0.4);
    color: #fff;
}

.th-filter-chip.active {
    background: rgba(0, 243, 255, 0.15);
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.2);
}

/* Animation Flash Résonance (Déclenchée en JS) */
@keyframes filterFlashSync {
    0% { transform: scale(1); box-shadow: 0 0 10px var(--flash-color, var(--neon-cyan)); background: rgba(0, 243, 255, 0.15); color: var(--neon-cyan); }
    15% { transform: scale(1.15); box-shadow: 0 0 40px var(--flash-color, var(--neon-cyan)), inset 0 0 20px var(--flash-color, var(--neon-cyan)); background: var(--flash-color, var(--neon-cyan)); color: #000; border-color: #fff; }
    100% { transform: scale(1); box-shadow: 0 0 10px var(--flash-color, var(--neon-cyan)); background: rgba(0, 243, 255, 0.15); color: var(--neon-cyan); border-color: var(--neon-cyan); }
}

.th-filter-chip.flash-sync {
    animation: filterFlashSync 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    z-index: 10;
}

.th-tutorial-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(5px);
    z-index: 2000000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.5s ease-out;
    pointer-events: auto;
}

.th-tuto-box {
    background: #05070a;
    border: 1px solid var(--neon-cyan);
    box-shadow: 0 0 30px rgba(0, 243, 255, 0.2), inset 0 0 15px rgba(0, 243, 255, 0.05);
    padding: 25px;
    border-radius: 8px;
    text-align: center;
    max-width: 300px;
}

/* BLOCK REDONDANT PURGÉ POUR STABILITÉ INTERACTIVE */

/* --- C. TIMELINE MARKERS THEATER --- */
.th-timeline-marker {
    position: absolute;
    top: -6px;
    width: 4px;
    height: 8px;
    border-radius: 4px;
    z-index: 5;
    cursor: pointer;
    opacity: 0.8;
    transition: all 0.2s ease;
    box-shadow: 0 0 4px currentColor; 
    background-color: currentColor;
}

.th-timeline-marker:hover {
    transform: scale(1.5) translateY(-2px);
    z-index: 10;
    opacity: 1;
    filter: drop-shadow(0 0 5px currentColor);
}

.th-timeline-marker::after {
    content: ''; position: absolute; bottom: -4px; left: 50%;
    transform: translateX(-50%); width: 1px; height: 4px;
    background: rgba(255,255,255,0.3); pointer-events: none;
}

.th-marker-propaganda { color: #ff00ff; }
.th-marker-coherence  { color: #00ff9d; }
.th-marker-credibility{ color: #00f3ff; }
.th-marker-aggression { color: #ff2a2a; }
.th-marker-anxiety    { color: #ff8800; }
.th-marker-gravity    { color: #ffd700; }
.th-marker-machiavel  { color: #ff4d00; }
.th-marker-forensic   { color: #ff0000; animation: th-marker-strobe 0.4s infinite; width:6px; height:10px; top:-7px; }
.th-marker-generic    { color: #ffffff; }

@keyframes th-marker-strobe {
    0%, 49% { background: #ff0000; box-shadow: 0 0 8px #ff0000; }
    50%, 99% { background: #0000ff; box-shadow: 0 0 8px #0000ff; }
    100% { background: #ff0000; box-shadow: 0 0 8px #ff0000; }
}

.th-btn {
    background: transparent; border: none; color: #fff;
    cursor: pointer; transition: all 0.2s;
    display: flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border-radius: 50%;
}
.th-btn:hover { background: rgba(255,255,255,0.1); color: var(--neon-cyan); }

.th-progress-bar {
    width: 450px; height: 6px;
    background: rgba(255,255,255,0.2);
    border-radius: 3px; cursor: pointer; position: relative;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.5);
}
.th-progress-fill {
    height: 100%; width: 0%;
    background: var(--neon-cyan);
    box-shadow: 0 0 10px var(--neon-cyan);
    border-radius: 3px; pointer-events: none;
}
.th-time { font-family: var(--font-code); font-size: 13px; color: #ccc; font-weight: bold; }

.th-badge-forensic {
    font-family: 'Orbitron', sans-serif;
    font-size: 11px; letter-spacing: 2px; font-weight: bold;
    color: var(--neon-magenta); border: 1px solid var(--neon-magenta);
    background: transparent;
    padding: 8px 15px; border-radius: 4px; cursor: pointer; transition: 0.3s;
}
.th-badge-forensic.active {
    background: rgba(255,0,255,0.15);
    box-shadow: 0 0 20px rgba(255,0,255,0.3);
    color: #fff;
}

/* ========================================================
   RESPONSIVENESS - (MOBILE & TABLET THEATER)
   ======================================================== */

@media screen and (max-width: 900px) {
    #theater-super-overlay .th-intel-panel { width: 50vw; padding: 30px 20px 0 20px !important; }
    #theater-super-overlay .th-left-panel { width: 40vw; padding: 30px 20px !important; }
    #theater-super-overlay .th-controls-dock { width: 95% !important; transform: scale(0.85); bottom: 10px; }
}

@media screen and (max-width: 600px) {
    /* RESTRUCTURATION EXTRÊME DU HUD POUR MOBILE (PORTRAIT) */
    #theater-super-overlay .th-forensic-hud { flex-direction: column; }
    
    /* On garde le panneau gauche visible pour le Rapport, mais on le place en bas */
    #theater-super-overlay .th-left-panel {
        display: flex !important; position: absolute !important; top: auto !important; bottom: 80px !important;
        width: 100vw !important; padding: 0 15px !important; z-index: 1000; pointer-events: none;
    }
    
    /* On cache le Radar spécifiquement pour gagner de la place */
    #theater-super-overlay .th-radar-box { display: none !important; }
    
    /* Le tiroir du rapport gagne en hauteur max sur mobile */
    .th-report-drawer.open { max-height: 45vh !important; pointer-events: auto; }
    
    #theater-super-overlay .th-intel-panel {
        width: 100vw !important; max-width: 100vw !important; bottom: auto !important; top: 10px !important;
        padding: 15px !important; transform: scale(1) !important; justify-content: flex-start !important;
    }
    #theater-super-overlay .th-typewriter { font-size: 13px !important; padding: 10px 15px !important; background: rgba(0, 5, 10, 0.9) !important; border-radius: 4px !important; }
    #theater-super-overlay .th-signal-card { padding: 12px !important; margin-bottom: 8px !important; background: rgba(0, 5, 10, 0.95) !important; border-radius: 4px !important; box-shadow: 0 5px 15px rgba(0,0,0,0.8) !important; }
    #theater-super-overlay .th-signal-text { font-size: 14px !important; }
    
    /* DOCK MOBILE */
    #theater-super-overlay .th-controls-dock {
        width: 100vw !important; max-width: 100vw !important; padding: 10px !important; border-radius: 0 !important;
        border-left: none !important; border-right: none !important; border-bottom: none !important;
        transform: scale(1) !important; margin-bottom: 0 !important; gap: 10px !important;
        background: rgba(2, 4, 6, 0.95) !important; z-index: 1001; /* Au-dessus du rapport */
    }
    
    .th-timeline-wrapper { gap: 6px; width: 100%; padding: 0 5px; margin-bottom: 0 !important; }
    .th-time { font-size: 10px; }
    .th-controls-row { flex-wrap: nowrap !important; justify-content: space-between !important; gap: 5px !important; width: 100%; padding: 0; margin-top: 0 !important; }
    .th-controls-row > div { flex: 1 1 auto !important; display: flex; align-items: center; justify-content: center; gap: 6px !important; }
    .th-btn { width: 34px !important; height: 34px !important; }
    .th-btn svg { width: 18px !important; height: 18px !important; }
    
    #sonic-reactor-container { display: block !important; transform: scale(0.65); transform-origin: left center; margin-right: -10px !important; }
    .speed-control-group { margin-left: 0 !important; padding: 2px 8px !important; height: 26px !important; }
    .cyber-range-speed { width: 50px !important; }
    #speed-display { font-size: 10px !important; }
    .th-badge-forensic { padding: 5px 8px !important; font-size: 9px !important; letter-spacing: 1px !important; margin: 0 !important;}
    .th-controls-row > div > div[style*="width:1px"] { margin: 0 4px !important; }
    #th-marker-display { display: none !important; }
}

/* LANDSCAPE MOBILE (HORIZONTAL) */
@media screen and (max-height: 500px) and (orientation: landscape) {
    #theater-super-overlay .th-left-panel { display: none !important; } /* Cacher le rapport/radar pour laisser place à la vidéo */
    #theater-super-overlay .th-intel-panel {
        bottom: auto !important; top: 10px !important; right: 10px !important; left: auto !important;
        width: 320px !important; padding: 0 !important;
    }
    #theater-super-overlay .th-signal-card { padding: 8px 12px !important; font-size: 11px !important; background: rgba(0, 5, 10, 0.8) !important; border-width: 1px !important; border-left-width: 2px !important; }
    #theater-super-overlay .th-signal-text { font-size: 12px !important; line-height: 1.3 !important; }
    #theater-super-overlay .th-controls-dock {
        position: absolute; bottom: 0; left: 50%; transform: translateX(-50%) scale(0.85) !important;
        width: 100vw !important; max-width: 600px !important; padding: 8px 15px !important;
        background: rgba(0, 0, 0, 0.7) !important; border: none !important; border-radius: 8px 8px 0 0 !important;
        z-index: 1001;
    }
}

/* --- MENU SOUS-TITRES PREMIUM (THEATER MODE) --- */
.cc-dropdown-menu {
    position: fixed;
    background: rgba(5, 8, 12, 0.95);
    border: 1px solid var(--neon-cyan);
    min-width: 180px;
    z-index: 2147483647; /* MAX LEVEL : Au-dessus de tout overlay */
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.9), 0 0 15px rgba(0, 243, 255, 0.15);
    border-radius: 4px;
    backdrop-filter: blur(10px);
    overflow: hidden;
    pointer-events: auto !important; /* Force l'interactivité */
}

.cc-dropdown-header {
    background: rgba(0, 243, 255, 0.05);
    color: var(--neon-cyan);
    padding: 8px 12px;
    font-size: 9px;
    font-weight: 900;
    border-bottom: 1px solid rgba(0, 243, 255, 0.2);
    letter-spacing: 2px;
    text-transform: uppercase;
    font-family: 'Orbitron', sans-serif;
}

.cc-size-row {
    display: flex;
    padding: 10px;
    gap: 6px;
    border-bottom: 1px dashed rgba(255,255,255,0.1);
    background: rgba(0,0,0,0.5);
}

.cc-size-btn {
    flex: 1;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: #ccc;
    font-family: 'Orbitron', sans-serif;
    font-size: 11px;
    padding: 8px 0;
    cursor: pointer;
    border-radius: 2px;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.cc-size-btn:hover, .cc-size-btn.active {
    background: rgba(0, 243, 255, 0.15);
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.3);
    transform: scale(1.05);
}

.cc-lang-item {
    padding: 12px 15px;
    font-size: 11px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: all 0.2s ease;
    display: flex;
    justify-content: space-between;
    color: #888;
    font-family: 'Inter', sans-serif;
    font-weight: bold;
}

.cc-lang-item:hover {
    background: rgba(0, 243, 255, 0.1);
    color: #fff;
    padding-left: 20px; /* Effet de glissement latéral tactique */
}