/* 
========================================================
STYLE.CSS - RANK YOUR FIGHT (Design System Master)
========================================================
*/

:root {
    /* Variabili Architetturali - Design System Definitivo */
    --alpha-vetro: 0.4;
    --alpha-etichetta: 0.4;
    --alpha-base: 0.01;
    --radius-scheda: 24px;
    --radius-box: 10px;
    --radius-pill: 50px; 
    --radius-bottone: 50px;
    
    /* TRIADE COLORI MINIMALISTA */
    --glory-orange: #FF5500;
    --optic-white: #ffffff;
    --pure-black: #000000;
    
    /* Ridefinizione Variabili Legacy */
    --holo-cyan-rgb: 255, 255, 255; 
    --cyan-hud: #ffffff; 
    --red-alert: #FF5500; 
    --gold-elo: #FF5500; 
    --earth-blue: #ffffff;
    --earth-glow: #ffffff;
    
    /* Font Master */
    --font-text: 'Share Tech Mono', monospace;
    --font-data: 'Share Tech Mono', monospace;
    --font-main: 'Share Tech Mono', monospace; 
    --font-mono: 'Share Tech Mono', monospace;
}

/* ========================================================
   1. RESET E FORZATURA GLOBALE
   ======================================================== */
* { 
    margin: 0; padding: 0; box-sizing: border-box; user-select: none; -webkit-tap-highlight-color: transparent; 
    font-family: var(--font-text) !important; 
    font-weight: 400 !important; /* Elimina ogni grassetto non voluto */
    -webkit-font-smoothing: antialiased; 
    -moz-osx-font-smoothing: grayscale;
}

html, body {
    width: 100%; 
    height: 100vh;
    height: 100lvh;
    overflow-x: hidden;
    background-color: #2a2a2a; 
    color: var(--optic-white); 
    display: flex; justify-content: center; align-items: center;
    overscroll-behavior: none !important; /* Blocca rimbalzo elastico */
}

/* Paralizza il tocco e lo scorrimento nei menu iniziali */
body:not(:has(.dashboard-view.active)) {
    overflow: hidden !important; 
    touch-action: none !important; 
}

/* ========================================================
   2. MASTER OVERRIDE E NUOVI BOTTONI UNIVERSALI
   ======================================================== */
/* FIX: Le classi dei bottoni universali (.ryf-standard-btn) 
   NON devono essere incluse nella regola globale dei 18px per non sfasarle */
html, body, 
.modal-desc, .sub-tag, .header-subtitle, .box-content p, .status-lbl,
.event-meta, .event-spot, .poi-meta, .auth-warning,
[style*="#aaa"], [style*="#888"], [style*="font-size"], 
.channel-handle, .sync-badge, .badge-verified,
.ethereal-btn, .yt-connect-btn,
.box-title, .box-title::after, .hud-input, .hud-select, .geosearch-item, 
.event-name, .status-tag, .ledger-item, .live-indicator, .vod-indicator, 
.video-title, .video-meta {
    font-size: 18px !important;
}

/* 
====================================================================
  MODELLI BOTTONI UNIVERSALI - ZERO TRASPARENZE AGGIUNTE (NO GLASS)
  Bordo Arancione fisso, Testo Bianco Fisso, Stessa Dimensione.
====================================================================
*/
.ryf-standard-btn {
    background: transparent !important; /* TRASPARENTE PURO, SFRUTTA LO SFONDO DEL MODALE */
    color: #ffffff !important; 
    border: 1px solid var(--glory-orange) !important; 
    font-family: 'Share Tech Mono', monospace !important; 
    font-size: 14px !important; 
    font-weight: bold !important; 
    width: 100%; 
    padding: 12px !important; 
    letter-spacing: 2px !important; 
    cursor: pointer !important; 
    text-transform: uppercase !important; 
    border-radius: 6px !important;
    backdrop-filter: none !important; /* NESSUN EFFETTO VETRO */
    -webkit-backdrop-filter: none !important;
    transition: none !important; /* NESSUN EFFETTO MOUSEOVER */
    outline: none !important;
    text-align: center !important;
    display: flex !important; 
    justify-content: center !important; 
    align-items: center !important; 
    gap: 8px;
    box-sizing: border-box !important;
    text-shadow: none !important;
    box-shadow: none !important;
    margin: 0 auto !important;
}

/* NIENTE EFFETTI MOUSEOVER */
.ryf-standard-btn:hover, 
.ryf-standard-btn:focus, 
.ryf-standard-btn:active {
    background: transparent !important; 
    color: #ffffff !important; 
    border: 1px solid var(--glory-orange) !important; 
    box-shadow: none !important;
    transform: none !important;
}

/* Regole colori forzate restanti */
.modal-title, .box-title, .brand-title, .header-title, .teletype-text, .arena-title,
.channel-details .channel-name, #bioFighterName, #orgBioName, .f-name, .slot-name {
    color: var(--pure-black) !important; text-shadow: none !important;
}
.stat-num, .podium-rank, #hubAvgElo, .elo-display .elo-label, #negReward, .status-val { color: var(--glory-orange) !important; }
.hash-code { color: var(--optic-white) !important; }
a.yt-channel-link, #scoutingYtLink { color: var(--glory-orange) !important; border-color: var(--glory-orange) !important; }

/* FIX CHIRURGICO: BARRA SUPERIORE SCURA E SCHEDE TRASPARENTI */
.nav-header .brand-title, .nav-header div[style*="#888"] { color: #F0F0F0 !important; }
.dashboard-view div[style*="color: var(--cyan-hud)"]:not(button), .dashboard-view div[style*="color: #fff"]:not(button),
.modal-card div[style*="color: var(--cyan-hud)"]:not(button), .modal-card div[style*="color: #fff"]:not(button),
.ryf-glass-panel div[style*="color: var(--cyan-hud)"]:not(button), .ryf-glass-panel div[style*="color: #fff"]:not(button),
.dashboard-view span[style*="color: var(--cyan-hud)"]:not(button), .modal-card span[style*="color: var(--cyan-hud)"]:not(button) {
    color: var(--pure-black) !important; text-shadow: none !important;
}

/* ========================================================
   3. SFONDO VIDEO A TUTTO SCHERMO
   ======================================================== */
.reality-bg {
    position: fixed !important; 
    top: 0 !important; 
    left: 0 !important; 
    width: 100vw !important; 
    height: var(--bg-height, 100vh) !important; 
    object-fit: cover !important; 
    z-index: 1 !important; 
    pointer-events: none !important;
    transition: filter 2s ease-in-out !important; 
}
.video-darkened {
    filter: brightness(0.3) !important; 
}

/* ========================================================
   4. START OVERLAY E NUOVO MENU "GLASS PILLS"
   ======================================================== */
#startOverlay { 
    position: fixed; inset: 0; z-index: 100; 
    display: flex; flex-direction: column; justify-content: center; align-items: center; 
    cursor: default; padding: 20px; 
    background: transparent !important; 
    backdrop-filter: none !important;
    transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.7s; 
}
#startOverlay.fade-out { opacity: 0; pointer-events: none; visibility: hidden; }

.portal-content { 
    z-index: 10; width: 100%;
    display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; 
    transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1); 
}
#startOverlay.fade-out .portal-content { transform: scale(1.05); }

.glass-item {
    background: rgba(255, 255, 255, 0.15); 
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); 
    border-radius: 50px; 
    border: none !important; 
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2); 
    transition: background 2s ease-in-out, box-shadow 2s ease-in-out;
}
.magic-glow .glass-item {
    background: rgba(255, 255, 255, 0.80); 
    box-shadow: 0 0 50px rgba(255, 255, 255, 0.4); 
}

.portal-typed-text { font-family: var(--font-text); font-size: clamp(24px, 5.5vw, 48px); font-weight: 800; letter-spacing: 2px; color: var(--optic-white); text-transform: uppercase; text-shadow: 0 4px 15px rgba(0,0,0,0.8); }

/* ========================================================
   5. MENU AUTENTICAZIONE GLOBO E BOTTONI INIZIALI
   ======================================================== */
.holo-earth { 
    position: relative; z-index: 10; width: 90%; max-width: 440px; 
    height: auto !important; min-height: 360px !important; 
    padding: 15px 20px 25px 20px !important;
    display: flex; flex-direction: column; align-items: center; justify-content: flex-start !important; 
    opacity: 1; transition: opacity 0.8s ease, transform 0.8s ease; 
    overflow: hidden !important; touch-action: none !important; 
    background: rgba(255, 255, 255, var(--alpha-vetro)) !important;
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
    border-radius: var(--radius-scheda) !important;
    box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.05), 0 25px 40px rgba(0,0,0,0.4) !important;
}
.holo-earth.hidden-alpha { opacity: 0; pointer-events: none; transform: scale(0.95); }
body:has(.dashboard-view.active) #globeContainer { display: none !important; }

.holo-header { width: 100%; text-align: center; min-height: 60px !important; margin-top: 15px !important; margin-bottom: 3px !important; }
.teletype-text { font-family: var(--font-data); font-size: 15px !important; letter-spacing: 4px !important; font-weight: 400 !important; text-transform: uppercase; color: #ffffff !important; text-shadow: none !important; }
.cursor { display: none !important; }
@keyframes blink { 50% { opacity: 0; } }

.options-container { width: 100%; display: flex; flex-direction: column; gap: 12px !important; opacity: 0; transform: translateY(15px); pointer-events: none; transition: opacity 0.8s ease, transform 0.8s ease; }
.options-container.visible { opacity: 1; transform: translateY(0); pointer-events: auto !important; }
.btn-wrapper { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 100%; }

#globeContainer .sub-tag { font-size: 13px !important; color: #000000 !important; letter-spacing: 1px !important; font-weight: 600 !important; display: block !important; margin-bottom: 4px !important; margin-top: 6px !important; }
#globeContainer .btn-wrapper:first-child .sub-tag { margin-top: 0px !important; }

/* Bottoni Menu Iniziale e YouTube Intatti */
.ethereal-btn { 
    width: 100% !important; background: rgba(0, 0, 0, 0.10) !important; color: var(--optic-white) !important; 
    border: 1px solid rgba(255, 255, 255, 0.15) !important; padding: 16px !important; border-radius: var(--radius-pill) !important; 
    font-size: 14px !important; font-weight: 400 !important; text-transform: uppercase !important; letter-spacing: 2px !important; 
    cursor: pointer !important; backdrop-filter: blur(4px) !important; -webkit-backdrop-filter: blur(4px) !important;
    transition: all 0.3s ease !important; display: block !important;
}
.ethereal-btn:hover { transform: translateY(-2px) !important; background: var(--optic-white) !important; color: var(--glory-orange) !important; border-color: var(--optic-white) !important; box-shadow: 0 5px 15px rgba(0,0,0,0.3) !important; }
.ethereal-btn.info-btn { background: transparent !important; border: 1px dashed rgba(255, 255, 255, 0.2) !important; color: rgba(255, 255, 255, 0.7) !important; padding: 12px !important; box-shadow: none !important; position: relative !important; z-index: 50 !important; }
.ethereal-btn.info-btn:hover { color: var(--optic-white) !important; border-style: solid !important; }

.yt-connect-btn { width: 100%; background: #ffffff !important; color: #FF0000 !important; border: none !important; border-radius: var(--radius-bottone) !important; font-size: 14px !important; text-transform: uppercase !important; letter-spacing: 1px !important; padding: 14px 20px !important; box-shadow: 0 0 15px rgba(255,0,0,0.2) !important; transition: all 0.3s ease !important; cursor: pointer; display: flex; justify-content: center; align-items: center; gap: 10px; }
.yt-connect-btn:hover { transform: translateY(-2px) !important; background: #FF0000 !important; color: #ffffff !important; box-shadow: 0 5px 20px rgba(255,0,0,0.4) !important; }
.yt-connect-btn span { color: inherit !important; }

/* ========================================================
   6. COMPONENTI UI E TENDINA DASHBOARD
   ======================================================== */
.ryf-glass-panel { background: rgba(255, 255, 255, var(--alpha-vetro)) !important; backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid rgba(255, 255, 255, 0.25) !important; border-radius: var(--radius-scheda) !important; box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.05), 0 25px 40px rgba(0,0,0,0.4) !important; }
.ryf-data-box { background: rgba(255, 255, 255, var(--alpha-etichetta)); border-radius: var(--radius-box); border: 1px solid rgba(255, 255, 255, 0.15); }
.channel-handle { background: rgba(0, 0, 0, 0.15) !important; backdrop-filter: blur(4px); padding: 4px 8px !important; border-radius: 6px !important; border: 1px solid rgba(255, 255, 255, 0.1) !important; display: inline-block; color: var(--optic-white) !important; text-shadow: none !important; }
.sync-badge, .badge-verified { position: absolute !important; top: 18px !important; left: 50% !important; transform: translateX(-50%) !important; background: rgba(255, 255, 255, 0.1) !important; color: var(--pure-black) !important; border: 1px solid rgba(0, 0, 0, 0.1) !important; padding: 4px 10px !important; border-radius: 20px !important; backdrop-filter: blur(6px); letter-spacing: 1px; z-index: 100; }

/* Tendina Magica Dashboard */
.dashboard-view { width: 100% !important; overflow-x: hidden !important; display: none !important; position: fixed; inset: 0; z-index: 80; overflow-y: auto; padding: 20px 15px; flex-direction: column; align-items: center; }
.dashboard-view.active { display: flex !important; }
.dashboard-view.active::before { content: ""; position: fixed; inset: 0; z-index: 9999; background: rgba(0, 0, 0, 0.15); pointer-events: none; animation: curtainReveal 0.5s ease-out forwards; }
@keyframes curtainReveal { 0% { opacity: 1; } 50% { opacity: 1; } 100% { opacity: 0; visibility: hidden; } }

.dashboard-container { position: relative; width: 100%; max-width: 950px; z-index: 10; display: flex; flex-direction: column; gap: 20px; padding-bottom: 40px; }
.nav-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid rgba(255, 255, 255, 0.4); padding: 12px 16px; background: rgba(0, 0, 0, 0.15); backdrop-filter: blur(4px); border-radius: 12px; }

.section-box { position: relative; padding: 18px 20px; display: flex; flex-direction: column; gap: 15px; }
.section-box.dropdown-active { z-index: 99999 !important; }
.box-title { font-size: 14px; letter-spacing: 1.5px; display: flex; align-items: center; justify-content: space-between; cursor: pointer; user-select: none; padding: 4px 0; }
.box-title::after { content: '\25B2'; font-size: 14px; color: var(--pure-black); transition: transform 0.3s ease; margin-left: 10px; }
.section-box.collapsed .box-title::after { transform: rotate(180deg); }
.box-content { display: flex; flex-direction: column; gap: 15px; margin-top: 5px; }
.section-box.collapsed .box-content { display: none; }

/* Input e Filtri */
.hud-input, .hud-select { background: rgba(0, 0, 0, 0.3) !important; border: 1px solid rgba(255, 255, 255, 0.4) !important; border-radius: 8px !important; padding: 0 14px !important; height: 44px !important; color: var(--optic-white) !important; font-size: 14px !important; outline: none !important; width: 100% !important; box-sizing: border-box !important; display: flex; align-items: center; }
.hud-input:focus, .hud-select:focus { border-color: var(--glory-orange) !important; }
.hud-select option { background: #000; color: #fff; }
.hud-input:disabled { background: rgba(255, 255, 255, 0.02) !important; border-color: rgba(255, 255, 255, 0.1) !important; color: var(--optic-white) !important; }
.hud-input::placeholder, .hud-select::placeholder { color: var(--optic-white) !important; opacity: 0.7 !important; letter-spacing: 0.5px; }
.filter-grid { display: grid; grid-template-columns: repeat(3, 1fr) !important; gap: 12px; width: 100%; } 
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.geosearch-container { position: relative; width: 100%; }
.geosearch-container.active-search { z-index: 99999 !important; }
.geosearch-results { position: absolute; top: calc(100% - 2px); left: 0; right: 0; border-top: none; z-index: 99999 !important; max-height: 200px; overflow-y: auto; display: none; background: rgba(0,0,0,0.6); }
.geosearch-item { padding: 12px 14px; cursor: pointer; border-bottom: 1px dashed rgba(255,255,255,0.1); font-size: 14px; color: var(--optic-white); }
.geosearch-item:hover { background: rgba(255, 255, 255, 0.05); color: var(--glory-orange); }

/* Modali e Overlay Sicurezza */
body:has(.modal-overlay.active) #globeContainer, body:has(.modal-overlay.active) .dashboard-container { pointer-events: none !important; }
.modal-overlay { position: fixed; inset: 0; z-index: 100000; background: transparent !important; backdrop-filter: blur(8px); display: flex; justify-content: center; align-items: center; padding: 20px; opacity: 0; pointer-events: none; transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1); }
.modal-overlay.active { opacity: 1; pointer-events: auto; }
.modal-card { width: 100%; max-width: 450px; padding: 35px 25px; display: flex; flex-direction: column; gap: 18px; text-align: center; transform: scale(0.96) translateY(10px); transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1); max-height: 85vh; overflow-y: auto; }
.modal-overlay.active .modal-card { transform: scale(1) translateY(0); }

/* ========================================================
   7. GESTIONE SCHERMI PICCOLI (MOBILE OVERRIDES)
   ======================================================== */
@media (max-width: 768px) {
    #startOverlay .portal-content { margin-top: 2vh !important; }
    .holo-earth {
        background: rgba(255, 255, 255, 0.05) !important;
        backdrop-filter: blur(24px) !important; 
        -webkit-backdrop-filter: blur(24px) !important;
        min-height: 330px !important;
        margin-top: -20vh !important; 
    }
}
@media (max-width: 600px) { 
    .filter-grid, .form-grid { grid-template-columns: 1fr !important; } 
    .challenge-row { flex-direction: column; } 
}

#yt-player-container, 
#regiaControlBar {
    display: none !important; 
}

/* ========================================================
   INTRO SEQUENZA CINEMATOGRAFICA A CASCATA SUL NERO
   ======================================================== */
.sequence-overlay {
    position: fixed; inset: 0; z-index: 99999 !important; 
    display: flex; justify-content: center; align-items: center;
    background: transparent;
}

.phase-stack {
    display: flex; flex-direction: column; align-items: center; gap: 20px;
    transition: opacity 0.5s ease, transform 0.5s ease;
}
.phase-stack.hide { opacity: 0; transform: scale(0.95); pointer-events: none; }

.stacked-phase {
    opacity: 0; transform: translateY(-15px);
    transition: opacity 1s ease, transform 1s ease;
}
.stacked-phase.active { opacity: 1; transform: translateY(0); }

.cyber-panel {
    background: rgba(255, 255, 255, 0.15) !important; 
    backdrop-filter: blur(10px);
    padding: 15px 35px;
    letter-spacing: -1px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2); 
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.shared-title-text {
    font-family: 'Share Tech Mono', monospace, sans-serif;
    font-size: clamp(16px, 4.5vw, 32px); 
    white-space: nowrap; 
    letter-spacing: 4px;
    text-transform: uppercase;
    font-weight: 600;
    text-shadow: 0 2px 10px rgba(0,0,0,0.8);
}

.seq-phase-menu {
    position: absolute; display: flex; flex-direction: column; align-items: center;
    opacity: 0; visibility: hidden; transform: scale(0.95);
    transition: opacity 1s ease, transform 1s ease, visibility 1s;
}
.seq-phase-menu.active { opacity: 1; visibility: visible; transform: scale(1); }

.ghost-btn {
    cursor: pointer; padding: 10px 15px; position: relative;
    transition: color 0.3s ease; pointer-events: auto; z-index: 1000;
}
.ghost-btn::after {
    content: ''; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
    width: 0%; height: 2px; background-color: var(--glory-orange);
    transition: width 0.3s ease;
}
.ghost-btn[style*="var(--glory-orange)"]:hover { text-shadow: 0 0 15px rgba(255, 85, 0, 0.8); }
.ghost-btn:not([style*="var(--glory-orange)"]):hover { color: var(--optic-white); text-shadow: 0 0 10px rgba(255, 85, 0, 0.5); }
.ghost-btn:hover::after { width: 100%; }

.menu-opt { font-family: var(--font-data); font-size: 18px; font-weight: bold; color: var(--optic-white); letter-spacing: 2px; text-transform: uppercase; }