/* ================================================ */
/*            BARRY - UNIFIED STYLES               */
/* ================================================ */

/* ================================ */
/*    1. ROOT & GLOBAL STYLES      */
/* ================================ */
:root {
    --bg-color: #0A0A0A;
    --text-color: #B7B7B7;
    --glow-gradient: linear-gradient(90deg, #39FF14, #ADFF2F);
    --danger-color: #FF4500;
    --font-main: 'Roboto Mono', monospace;
    --font-display: 'VT323', monospace;
    --emergency-red: #FF0000;
    --neon-green: #39FF14;
}

* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    background-image: url('../img/motherboard_city_bg.webp');
    background-size: cover;
    background-position: center 0%;
    background-attachment: fixed;
    background-repeat: no-repeat;
    color: var(--text-color);
    font-family: var(--font-main);
    cursor: none;
    overflow-x: hidden;
    position: relative;
    padding-bottom: 80px;
    transition: padding-bottom 0.4s ease;
}

body::before {
    content: ''; 
    position: fixed; 
    top: 0; 
    left: 0; 
    right: 0; 
    bottom: 0;
    background: rgba(0, 0, 0, 0.75); 
    z-index: -1;
}

section {
    min-height: 100vh; 
    padding: 80px 5%;
    display: flex; 
    flex-direction: column; 
    justify-content: center; 
    align-items: center;
    border-bottom: 1px solid rgba(0, 255, 65, .1);
    position: relative; 
    z-index: 1;
}

h1, h2, h3 { 
    font-family: var(--font-display); 
    text-transform: uppercase; 
}

h2 { 
    font-size: 3rem; 
    color: #fff; 
    margin-bottom: 50px; 
    text-align: center; 
    text-shadow: 0 0 10px rgba(57, 255, 20, 0.5); 
}

/* ================================ */
/*    2. CUSTOM CURSOR             */
/* ================================ */
.cursor {
    width: 25px; 
    height: 25px; 
    border: 2px solid #39FF14; 
    border-radius: 50%;
    position: fixed; 
    pointer-events: none; 
    z-index: 99999;
    transform: translate(-50%, -50%); 
    transition: transform 0.1s;
}

/* ================================ */
/*    3. ANIMATIONS                */
/* ================================ */
@keyframes shake {
    0% { transform: translate(1px, 1px) rotate(0deg); }
    10% { transform: translate(-1px, -2px) rotate(-1deg); }
    20% { transform: translate(-3px, 0px) rotate(1deg); }
    30% { transform: translate(3px, 2px) rotate(0deg); }
    40% { transform: translate(1px, -1px) rotate(1deg); }
    50% { transform: translate(-1px, 2px) rotate(-1deg); }
    60% { transform: translate(-3px, 1px) rotate(0deg); }
    70% { transform: translate(3px, 1px) rotate(-1deg); }
    80% { transform: translate(-1px, -1px) rotate(1deg); }
    90% { transform: translate(1px, 2px) rotate(0deg); }
    100% { transform: translate(1px, -2px) rotate(-1deg); }
}

@keyframes wave-scan {
    0% { height: 0%; top: 100%; }
    50% { height: 100%; top: 0%; }
    100% { height: 0%; top: 100%; }
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 5px #39FF14; }
    50% { box-shadow: 0 0 20px #39FF14; }
}

@keyframes warning-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes textAppear {
    to { opacity: 1; transform: translateY(0); }
}

@keyframes cursor-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
    20% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
    30% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    80% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(1.2); }
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.shake-hard { animation: shake 0.5s infinite; }
body.shake-full { animation: shake 0.5s; }
.glitch-text { animation: shake 0.3s infinite; }
.emergency-mode { animation: shake 0.5s infinite; }

/* ================================ */
/*    4. MOOD WIDGET (ПК РАЗМЕР)   */
/* ================================ */
#mood-widget {
    position: fixed; 
    bottom: 90px;
    left: 30px; 
    width: 250px;
    background: #000; 
    border: 2px solid #39FF14; 
    padding: 15px;
    z-index: 900; 
    font-family: var(--font-display);
    box-shadow: 10px 10px 0 rgba(0,0,0,0.5); 
    transition: all 0.4s ease;
}

#mood-widget:hover { transform: scale(1.05); }
.mood-header { font-size: 0.9rem; }

#mood-img { 
    width: 100%; height: auto; border: 2px solid #333; display: block; margin-bottom: 10px; 
}

.mood-status { font-size: 1rem; margin: 5px 0; }
.mood-controls { display: flex; gap: 10px; }

.mood-btn { 
    font-size: 1rem; padding: 8px; flex: 1; cursor: pointer;
}

.btn-green { background: #39FF14; color: #000; border: none; }
.btn-red { background: #FF4500; color: #000; border: none; }
.btn-green:hover { box-shadow: 0 0 15px #39FF14; }
.btn-red:hover { box-shadow: 0 0 15px #FF4500; }
.btn-green:active, .btn-red:active { transform: translateY(2px); }

@keyframes green-flash {
    0% { box-shadow: 0 0 0 rgba(57, 255, 20, 0); }
    50% { box-shadow: 0 0 50px rgba(57, 255, 20, 0.8), 0 0 100px rgba(57, 255, 20, 0.6); }
    100% { box-shadow: 0 0 0 rgba(57, 255, 20, 0); }
}

.pump-flash { animation: green-flash 0.5s ease-out; }
body.terminal-open #mood-widget { transform: translateY(300px); opacity: 0; pointer-events: none; }

/* ================================ */
/*    5. BUTTONS                   */
/* ================================ */
.btn {
    font-family: var(--font-display); font-size: 1.5rem; color: var(--bg-color); 
    text-decoration: none; padding: 15px 40px; background: var(--glow-gradient); 
    border: none; cursor: pointer; transition: all 0.3s; display: inline-block;
}
.btn:hover { box-shadow: 0 0 25px #39FF14; transform: translateY(-5px); }

/* ================================ */
/*    6. HERO SECTION              */
/* ================================ */
#hero { text-align: center; }
.logo-container { margin-bottom: 30px; }
.logo-img { width: 180px; height: 180px; border-radius: 50%; border: 4px solid #39FF14; box-shadow: 0 0 30px #39FF14; }
#hero-title { font-size: 4rem; color: #39FF14; margin-bottom: 10px; }
#hero-subtitle { font-size: 1.5rem; margin-bottom: 40px; max-width: 600px; }

/* ================================ */
/*    7. CA BOX                    */
/* ================================ */
.ca-box {
    background: rgba(0, 0, 0, 0.8); border: 1px dashed #39FF14; padding: 15px 30px; margin-top: 30px;
    cursor: pointer; font-family: var(--font-display); position: relative; transition: all 0.2s;
}
.ca-box:hover { background: rgba(57, 255, 20, 0.1); border-style: solid; }
.ca-text { color: #fff; font-size: 1.2rem; word-break: break-all; }
.ca-label { font-size: 0.8rem; color: #ADFF2F; display: block; margin-bottom: 5px; }

/* ================================ */
/*    8. STORY SECTIONS            */
/* ================================ */
.story-block { display: flex; align-items: center; gap: 50px; max-width: 1200px; width: 100%; }
.story-block.reverse { flex-direction: row-reverse; }
.story-text { flex: 1; font-size: 1.3rem; line-height: 1.6; background: rgba(0,0,0,0.5); padding: 30px; border-left: 2px solid #39FF14; }
.story-visual { flex: 1; }
.story-img { width: 100%; border: 2px solid #39FF14; box-shadow: 10px 10px 0px rgba(57, 255, 20, 0.2); transition: transform 0.3s; }
.story-img:hover { transform: scale(1.02); }

/* ================================ */
/*    9. EPISODE 3 STYLES          */
/* ================================ */
#episode3 {
    background: linear-gradient(180deg, rgba(20, 0, 0, 0.9) 0%, rgba(40, 0, 0, 0.7) 50%, rgba(0, 0, 0, 0.9) 100%);
    border-left: 5px solid #FF4500; border-right: 5px solid #FF4500; position: relative; padding: 80px 5% 100px; min-height: auto;
}
#episode3::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: linear-gradient(90deg, transparent, #FF4500, transparent); }
#episode3 h2 { font-size: 3.5rem; color: #FF4500; text-align: center; margin-bottom: 50px; text-shadow: 0 0 15px #FF4500, 0 0 30px rgba(255, 69, 0, 0.5); position: relative; z-index: 1; }
.trigger-warning {
    position: absolute; top: 20px; right: 20px; background: #FF4500; color: #000; padding: 8px 15px; font-family: 'Roboto Mono', monospace;
    font-size: 0.8rem; font-weight: bold; border-radius: 3px; transform: rotate(5deg); animation: warning-pulse 2s infinite; z-index: 2; pointer-events: auto; cursor: default;
}
#episode3 .story-block { display: flex; align-items: center; gap: 50px; max-width: 1200px; width: 100%; margin: 40px 0; }
#episode3 .story-block.reverse { flex-direction: row-reverse; }
#episode3 .story-text { flex: 1; font-size: 1.3rem; line-height: 1.6; background: rgba(0,0,0,0.5); padding: 30px; border-left: 2px solid #FF4500; }
#episode3 .story-block.reverse .story-text { border-left: 2px solid #FF4500; border-right: none; }
#episode3 .story-visual { flex: 1; }
#episode3 .story-img { width: 100%; border: 2px solid #FF4500; box-shadow: 10px 10px 0px rgba(255, 69, 0, 0.2); transition: transform 0.3s; }
#episode3 .story-img:hover { transform: scale(1.02); }
#episode3 p { font-family: var(--font-main); color: var(--text-color); opacity: 0; transform: translateY(20px); animation: textAppear 0.8s forwards; animation-delay: 0.3s; }

/* ================================ */
/*    10. SUBJECT ANALYSIS         */
/* ================================ */
#subject-analysis {
    background: linear-gradient(180deg, rgba(0,0,0,0.9) 0%, rgba(10,30,0,0.8) 100%);
    border-top: 3px solid #39FF14; border-bottom: 3px solid #39FF14; position: relative; overflow: hidden; min-height: 90vh;
}
#subject-analysis::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: linear-gradient(90deg, transparent, #39FF14, transparent); }
#subject-analysis h2 { color: #39FF14; text-shadow: 0 0 15px #39FF14; margin-bottom: 40px; }
.analysis-container { display: flex; flex-wrap: wrap; align-items: stretch; gap: 40px; max-width: 1400px; width: 100%; margin: 0 auto; }
.scanner-panel { flex: 1; min-width: 300px; background: rgba(0, 0, 0, 0.7); border: 2px solid rgba(57, 255, 20, 0.3); border-radius: 8px; padding: 25px; box-shadow: 0 0 20px rgba(57, 255, 20, 0.2), inset 0 0 15px rgba(0, 0, 0, 0.5); }
.scanner-header { margin-bottom: 25px; padding-bottom: 15px; border-bottom: 1px solid rgba(57, 255, 20, 0.2); }
.scanner-title { font-family: var(--font-display); font-size: 1.3rem; color: #39FF14; text-transform: uppercase; margin-bottom: 5px; }
.scanner-status { font-family: var(--font-main); font-size: 0.9rem; color: #B7B7B7; }
.status-active { color: #39FF14; font-weight: bold; text-shadow: 0 0 5px #39FF14; }
.access-prompt { font-family: var(--font-main); color: #888; font-size: 0.9rem; margin-bottom: 20px; font-style: italic; }
.scan-parameters { list-style: none; padding: 0; margin: 0; }
.scan-parameters li { margin-bottom: 12px; }
.scan-btn { width: 100%; background: transparent; border: 1px solid rgba(57, 255, 20, 0.2); color: #B7B7B7; padding: 12px 15px; font-family: var(--font-display); font-size: 1.1rem; text-align: left; cursor: pointer; transition: all 0.3s; display: flex; align-items: center; gap: 10px; }
.scan-btn:hover { background: rgba(57, 255, 20, 0.1); border-color: #39FF14; color: #fff; transform: translateX(5px); box-shadow: 0 0 15px rgba(57, 255, 20, 0.3); }
.scan-icon { color: #39FF14; font-size: 0.8rem; }
.model-viewer-container { flex: 1; min-width: 300px; background: rgba(0, 0, 0, 0.7); border: 2px solid rgba(57, 255, 20, 0.3); border-radius: 8px; overflow: hidden; box-shadow: 0 0 20px rgba(57, 255, 20, 0.2), inset 0 0 15px rgba(0, 0, 0, 0.5); padding: 20px; }
.model-viewer-container model-viewer { width: 100%; height: 450px; --poster-color: transparent; --progress-bar-color: #FF4500; --progress-bar-height: 5px; }

/* ================================ */
/*    11. SCANNER POP-UP WINDOWS   */
/* ================================ */
.scan-window { display: none; position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 90%; max-width: 700px; max-height: 80vh; overflow-y: auto; background: rgba(5, 5, 5, 0.98); border: 3px solid #39FF14; padding: 30px; z-index: 1002; color: #fff; font-family: var(--font-main); box-shadow: 0 0 50px rgba(57, 255, 20, 0.4), inset 0 0 20px rgba(0, 0, 0, 0.8); animation: window-appear 0.3s ease-out; }
@keyframes window-appear { from { opacity: 0; transform: translate(-50%, -50%) scale(0.9); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
.scan-window.visible { display: block; }
.close-scan-btn { position: absolute; top: 15px; right: 15px; background: rgba(57, 255, 20, 0.1); border: 1px solid #39FF14; color: #39FF14; width: 30px; height: 30px; border-radius: 50%; cursor: pointer; font-family: var(--font-display); font-size: 1.2rem; display: flex; align-items: center; justify-content: center; transition: all 0.2s; }
.close-scan-btn:hover { background: #39FF14; color: #000; transform: rotate(90deg); }
.scan-window h4 { color: #39FF14; font-family: var(--font-display); font-size: 1.4rem; margin: 20px 0 10px; text-transform: uppercase; }
.scan-window h4:first-of-type { margin-top: 0; }
.scan-window pre { background: rgba(0, 0, 0, 0.5); border: 1px solid rgba(57, 255, 20, 0.2); padding: 15px; margin: 15px 0; overflow-x: auto; font-family: 'VT323', monospace; font-size: 1.1rem; line-height: 1.4; color: #ADFF2F; white-space: pre-wrap; }
.analyst-text { font-family: 'Roboto Mono', monospace; font-size: 1rem; line-height: 1.6; color: #ccc; margin: 15px 0 25px; padding: 15px; background: rgba(57, 255, 20, 0.05); border-left: 3px solid #39FF14; }
.mission-footer { margin-top: 30px; padding-top: 20px; border-top: 1px solid rgba(57, 255, 20, 0.2); text-align: center; }
.mission-footer p { font-family: var(--font-display); color: #39FF14; margin-bottom: 15px; font-size: 1.2rem; }
.social-btn { display: inline-block; padding: 10px 20px; margin: 0 5px; background: rgba(57, 255, 20, 0.1); border: 1px solid #39FF14; color: #39FF14; text-decoration: none; font-family: var(--font-display); font-size: 1.1rem; transition: all 0.3s; }
.social-btn:hover { background: #39FF14; color: #000; transform: translateY(-3px); box-shadow: 0 5px 15px rgba(57, 255, 20, 0.3); }

/* ================================ */
/*    12. EPILOGUE & SOCIAL LINKS  */
/* ================================ */
#epilogue-launch { min-height: 100vh; padding: 80px 5%; display: flex; flex-direction: column; justify-content: center; align-items: center; background-color: transparent; background-image: url('../img/motherboard_city_bg.webp'); background-size: cover; background-position: center; background-attachment: fixed; border-bottom: 1px solid rgba(57, 255, 20, .2); border-top: none; position: relative; z-index: 1; }
#epilogue-launch::before { content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.75); z-index: -1; }
#epilogue-launch h3 { font-family: 'VT323', monospace; font-size: 3rem; color: #39FF14; text-align: center; margin-bottom: 50px; text-shadow: 0 0 10px rgba(57, 255, 20, 0.5); text-transform: uppercase; }
#epilogue-launch .scene { display: flex; flex-direction: column; align-items: center; gap: 30px; max-width: 1200px; width: 100%; }
#epilogue-launch .scene img { width: 100%; max-width: 600px; border: 3px solid #39FF14; box-shadow: none; transition: transform 0.3s; }
#epilogue-launch .scene img:hover { transform: scale(1.02); }
#epilogue-launch .caption { font-family: 'VT323', monospace; font-size: 1.8rem; color: #fff; text-align: center; line-height: 1.6; background: rgba(0, 0, 0, 0.7); padding: 30px; border-left: 2px solid #39FF14; border-right: 2px solid #39FF14; width: 100%; max-width: 800px; margin-top: 20px; position: relative; white-space: pre-wrap; }
.protocol-text { color: #FF4500; font-weight: bold; text-shadow: 0 0 10px rgba(255, 69, 0, 0.5); }
.cursor-symbol { color: #39FF14; font-weight: bold; display: inline-block; animation: cursor-blink 1s step-end infinite; font-family: 'VT323', monospace; font-size: 1.2em; }
#epilogue-text { opacity: 0; transform: translateY(20px); animation: textAppear 0.8s forwards; animation-delay: 0.5s; }
.cursor-blink { color: #39FF14; font-weight: bold; display: inline-block; font-family: 'VT323', monospace; font-size: 1.2em; text-shadow: 0 0 10px #39FF14, 0 0 20px rgba(57, 255, 20, 0.5); animation: cursor-blink-animation 1s step-end infinite; }
@keyframes cursor-blink-animation { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
.social-links { text-align: center; padding-top: 50px; margin-top: 30px; border-top: 1px dashed rgba(57, 255, 20, 0.3); width: 100%; max-width: 800px; }
.social-links a { position: relative; display: inline-block; margin: 0 20px; transition: all 0.3s ease; text-decoration: none; }
.social-links a:hover { transform: translateY(-5px) scale(1.1); filter: drop-shadow(0 0 10px #39FF14); }
.social-links img { width: 64px; height: 64px; border: 2px solid rgba(57, 255, 20, 0.3); border-radius: 8px; padding: 8px; background: rgba(0, 0, 0, 0.5); transition: all 0.3s; }
.social-links a:hover img { border-color: #39FF14; background: rgba(57, 255, 20, 0.1); box-shadow: 0 0 20px rgba(57, 255, 20, 0.4); }
.social-links a[data-tooltip]::after { content: attr(data-tooltip); position: absolute; bottom: 125%; left: 50%; transform: translateX(-50%); background: rgba(10, 10, 10, 0.95); color: #39FF14; font-family: 'VT323', monospace; font-size: 1rem; padding: 10px 15px; border: 1px solid #39FF14; border-radius: 4px; white-space: nowrap; opacity: 0; visibility: hidden; transition: opacity 0.3s, visibility 0.3s, transform 0.3s; z-index: 1000; pointer-events: none; box-shadow: 0 0 15px rgba(57, 255, 20, 0.3); text-shadow: 0 0 5px #39FF14; }
.social-links a[data-tooltip]:hover::after { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(-5px); }

/* ================================ */
/*    13. ROADMAP STYLES           */
/* ================================ */
#roadmap { background: linear-gradient(180deg, rgba(0, 10, 0, 0.9) 0%, rgba(0, 20, 5, 0.8) 50%, rgba(0, 10, 0, 0.9) 100%); border-top: 3px solid #39FF14; border-bottom: 3px solid #39FF14; min-height: 90vh; }
#roadmap h2 { color: #39FF14; text-shadow: 0 0 15px #39FF14; margin-bottom: 60px; }
.roadmap-container { display: flex; flex-direction: row; width: 100%; max-width: 1400px; gap: 60px; align-items: flex-start; position: relative; }
.barry-charge-visual { flex: 1; order: 1; display: flex; flex-direction: column; align-items: center; gap: 20px; }
.charge-image-container { position: relative; width: 300px; height: 500px; border: 3px solid #39FF14; border-radius: 15px; overflow: hidden; background: linear-gradient(90deg, rgba(57, 255, 20, 0.05) 1px, transparent 1px), linear-gradient(0deg, rgba(57, 255, 20, 0.05) 1px, transparent 1px), radial-gradient(circle at 50% 50%, rgba(57, 255, 20, 0.1) 0%, rgba(0, 0, 0, 0.8) 70%), #0A0A0A; background-size: 30px 30px, 30px 30px, 100% 100%; background-position: center; box-shadow: 0 0 30px rgba(57, 255, 20, 0.3), inset 0 0 20px rgba(0, 0, 0, 0.5); }
.barry-layer { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-size: contain; background-repeat: no-repeat; background-position: center; background-color: transparent !important; transition: opacity 1.2s cubic-bezier(0.4, 0, 0.2, 1); pointer-events: none; }
#barry-layer-0 { z-index: 1; }
#barry-layer-25 { z-index: 2; }
#barry-layer-50 { z-index: 3; }
#barry-layer-75 { z-index: 4; }
#barry-layer-100 { z-index: 5; }
.charge-wave { position: absolute; top: 100%; left: 0; width: 100%; height: 0%; background: linear-gradient(to bottom, transparent, rgba(57, 255, 20, 0.3), rgba(57, 255, 20, 0.6), rgba(57, 255, 20, 0.3), transparent); z-index: 10; pointer-events: none; opacity: 0; }
.charge-status { text-align: center; font-family: var(--font-display); }
#charge-percent { font-size: 3rem; color: #39FF14; text-shadow: 0 0 10px #39FF14; margin-bottom: 5px; }
#charge-text { font-size: 1.2rem; color: #ADFF2F; opacity: 0.8; }
.roadmap-stages { flex: 1.5; order: 2; display: flex; flex-direction: column; gap: 15px; position: relative; }
.roadmap-stage { display: flex; align-items: center; gap: 20px; padding: 20px 25px; background: rgba(0, 0, 0, 0.6); border: 2px solid #333; border-radius: 8px; cursor: pointer; transition: all 0.3s; position: relative; overflow: hidden; }
.roadmap-stage::before { content: ''; position: absolute; top: 0; left: 0; width: 0; height: 100%; background: rgba(57, 255, 20, 0.1); transition: width 0.3s; z-index: 0; }
.roadmap-stage:hover::before { width: 100%; }
.roadmap-stage:hover { border-color: #39FF14; transform: translateX(5px); box-shadow: 0 0 20px rgba(57, 255, 20, 0.2); }
.stage-indicator { font-size: 2rem; font-family: var(--font-display); width: 40px; text-align: center; position: relative; z-index: 1; }
.roadmap-stage.completed .stage-indicator { color: #39FF14; text-shadow: 0 0 10px #39FF14; }
.roadmap-stage.active .stage-indicator { color: #FFD700; animation: pulse-glow 1s infinite; text-shadow: 0 0 10px #FFD700; }
.roadmap-stage.upcoming .stage-indicator { color: #666; }
.stage-content { flex: 1; position: relative; z-index: 1; }
.roadmap-stage h3 { font-size: 1.4rem; margin-bottom: 5px; color: #fff; transition: color 0.3s; }
.roadmap-stage.completed h3 { color: #39FF14; }
.roadmap-stage.active h3 { color: #FFD700; }
.roadmap-stage:hover h3 { color: #fff; }
.stage-subtitle { font-family: var(--font-main); font-size: 0.9rem; color: #888; font-style: italic; }
.roadmap-stage.completed .stage-subtitle { color: #ADFF2F; }

/* ================================ */
/*    PHASE INFO WINDOW            */
/* ================================ */
.phase-info-window { position: fixed; z-index: 99998; width: 400px; max-width: 90vw; background: rgba(0, 0, 0, 0.95); border: 2px solid #39FF14; border-radius: 8px; padding: 0; box-shadow: 0 0 30px rgba(57, 255, 20, 0.4), 0 0 60px rgba(57, 255, 20, 0.2), inset 0 0 10px rgba(57, 255, 20, 0.1); font-family: var(--font-main); font-size: 0.9rem; overflow: hidden; pointer-events: auto; left: auto; top: auto; right: auto; bottom: auto; margin: 0; opacity: 0; transform: scale(0.95); transition: opacity 0.2s ease, transform 0.2s ease; }
.phase-info-window:not(.hidden) { opacity: 1; transform: scale(1); }
.phase-header { background: rgba(57, 255, 20, 0.1); padding: 15px 20px; border-bottom: 1px solid #39FF14; display: flex; justify-content: space-between; align-items: center; }
#phase-title { font-family: var(--font-display); font-size: 1.3rem; color: #39FF14; text-transform: uppercase; }
.close-info-btn { background: none; border: 1px solid #39FF14; color: #39FF14; width: 30px; height: 30px; border-radius: 50%; cursor: pointer; font-family: var(--font-display); font-size: 1.2rem; display: flex; align-items: center; justify-content: center; transition: all 0.2s; }
.close-info-btn:hover { background: #39FF14; color: #000; }
.phase-content { padding: 20px; line-height: 1.6; color: #B7B7B7; }
.phase-content > div { margin-bottom: 15px; }
.phase-status, .phase-objective { color: #39FF14; font-weight: bold; }
#phase-status-value { color: #FFD700; }
#phase-objective-text { color: #ADFF2F; }
.phase-metrics, .phase-current { color: #777; }
.phase-metrics ul { margin-left: 20px; margin-top: 5px; }
.phase-metrics li { margin-bottom: 3px; color: #B7B7B7; }
.phase-note { margin-top: 20px; padding: 10px; background: rgba(57, 255, 20, 0.05); border-left: 3px solid #39FF14; font-style: italic; color: #ADFF2F; }
.hidden { display: none !important; }

/* ================================ */
/*    14. REWARD PROTOCOL          */
/* ================================ */

@keyframes core-flicker {
    0%, 100% { opacity: 1; }
    92% { opacity: 1; }
    93% { opacity: 0.4; }
    94% { opacity: 1; }
    96% { opacity: 0.7; }
    97% { opacity: 1; }
}

@keyframes core-pulse-icon {
    0%, 100% { text-shadow: 0 0 5px #39FF14, 0 0 10px #39FF14; opacity: 1; }
    50% { text-shadow: 0 0 15px #39FF14, 0 0 30px #ADFF2F, 0 0 50px #39FF14; opacity: 0.8; }
}

@keyframes glitch-corner {
    0%, 100% { opacity: 0.3; }
    20% { opacity: 1; transform: translate(2px, -1px); }
    40% { opacity: 0.5; transform: translate(-1px, 2px); }
    60% { opacity: 0.8; transform: translate(1px, 1px); }
    80% { opacity: 0.4; transform: translate(-2px, -1px); }
}

@keyframes rewardAppear {
    from { opacity: 0; transform: translate(-50%, -50%) scale(0.92); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@keyframes overload-pulse {
    from { text-shadow: 0 0 10px rgba(0, 255, 255, 0.4); }
    to { text-shadow: 0 0 25px rgba(0, 255, 255, 0.8), 0 0 50px rgba(0, 255, 255, 0.3); }
}

@keyframes status-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* REWARD OVERLAY */
#reward-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    display: none;
    backdrop-filter: blur(8px);
}

#reward-overlay.visible {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* REWARD SECTION */
#reward-section {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: auto;
    max-width: 750px;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 10001;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#reward-section.visible {
    display: block;
    opacity: 1;
    animation: rewardAppear 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#reward-section::-webkit-scrollbar { width: 6px; }
#reward-section::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.5); }
#reward-section::-webkit-scrollbar-thumb { background: rgba(57, 255, 20, 0.3); border-radius: 3px; }
#reward-section::-webkit-scrollbar-thumb:hover { background: rgba(57, 255, 20, 0.5); }

/* REWARD WINDOW */
.reward-window {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.98) 0%, rgba(0, 15, 5, 0.96) 100%);
    border: 3px solid #39FF14;
    outline: 2px solid rgba(57, 255, 20, 0.15);
    outline-offset: 4px;
    border-radius: 10px;
    padding: 35px 30px 30px;
    position: relative;
    box-shadow:
        0 0 40px rgba(57, 255, 20, 0.4),
        0 0 80px rgba(57, 255, 20, 0.15),
        inset 0 0 30px rgba(0, 0, 0, 0.8);
}

.reward-window::before,
.reward-window::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid #39FF14;
    animation: glitch-corner 3s infinite steps(5);
    pointer-events: none;
    z-index: 5;
}

.reward-window::before {
    top: -4px;
    left: -4px;
    border-right: none;
    border-bottom: none;
}

.reward-window::after {
    bottom: -4px;
    right: -4px;
    border-left: none;
    border-top: none;
}

/* REWARD CLOSE BUTTON */
.reward-close-container {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
}

.close-reward-btn {
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #39FF14;
    color: #39FF14;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-family: var(--font-display);
    font-size: 1.4rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-reward-btn:hover {
    background: #39FF14;
    color: #000;
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 0 20px #39FF14;
}

/* REWARD TITLE */
.reward-title {
    color: #39FF14;
    font-size: 1.8rem;
    text-align: center;
    margin-bottom: 25px;
    text-shadow: 0 0 10px rgba(57, 255, 20, 0.5);
    letter-spacing: 2px;
}

/* REWARD BLOCKS  */
.reward-block {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(57, 255, 20, 0.25);
    border-radius: 6px;
    padding: 18px;
    margin-bottom: 18px;
}

.reward-block:last-child {
    margin-bottom: 0;
}

.reward-block-header {
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: #39FF14;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px dashed rgba(57, 255, 20, 0.2);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/*  А: TREASURY */
.treasury-display {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.treasury-amount {
    text-align: center;
}

#treasury-count {
    font-family: var(--font-display);
    font-size: 3rem;
    color: #fff;
    text-shadow: 0 0 10px #39FF14, 0 0 20px rgba(57, 255, 20, 0.3);
    letter-spacing: 3px;
}

.treasury-ticker {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: #ADFF2F;
    margin-left: 10px;
    text-shadow: 0 0 5px rgba(57, 255, 20, 0.4);
}

.treasury-wallet {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 10px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(57, 255, 20, 0.15);
    border-radius: 4px;
}

.wallet-label {
    color: #888;
    font-family: var(--font-main);
    font-size: 0.85rem;
}

.wallet-address {
    color: #ADFF2F;
    font-family: var(--font-main);
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

.copy-addr-btn {
    background: transparent;
    border: 1px solid rgba(57, 255, 20, 0.4);
    color: #39FF14;
    padding: 4px 10px;
    font-family: var(--font-display);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 3px;
}

.copy-addr-btn:hover {
    background: rgba(57, 255, 20, 0.15);
    border-color: #39FF14;
    box-shadow: 0 0 10px rgba(57, 255, 20, 0.3);
}

/* B: LEDGER */
.ledger-table-header {
    display: flex;
    padding: 8px 10px;
    border-bottom: 2px solid rgba(57, 255, 20, 0.3);
    margin-bottom: 5px;
    font-family: var(--font-display);
    font-size: 0.95rem;
    color: #39FF14;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.ledger-scroll {
    max-height: 180px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(57, 255, 20, 0.1);
    border-radius: 3px;
    padding: 5px 0;
}

.ledger-scroll::-webkit-scrollbar { width: 6px; }
.ledger-scroll::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.3); }
.ledger-scroll::-webkit-scrollbar-thumb { background: rgba(57, 255, 20, 0.3); border-radius: 3px; }
.ledger-scroll::-webkit-scrollbar-thumb:hover { background: rgba(57, 255, 20, 0.5); }

.ledger-row {
    display: flex;
    padding: 6px 10px;
    font-family: 'VT323', monospace;
    font-size: 1rem;
    border-bottom: 1px solid rgba(57, 255, 20, 0.05);
    transition: background 0.2s;
}

.ledger-row:hover {
    background: rgba(57, 255, 20, 0.05);
}

.ledger-row:last-child {
    border-bottom: none;
}

.ledger-col {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.col-time {
    flex: 0 0 110px;
    color: #888;
}

.col-dest {
    flex: 1;
    color: #B7B7B7;
    padding: 0 10px;
}

.col-qty {
    flex: 0 0 140px;
    text-align: right;
}

.ledger-row.income .col-qty {
    color: #39FF14;
    text-shadow: 0 0 5px rgba(57, 255, 20, 0.4);
}

.ledger-row.payout .col-qty {
    color: rgba(173, 255, 47, 0.6);
}

/* C: SYNC COUNTDOWN */
.sync-clock-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 12px;
}

.sync-segment {
    text-align: center;
    padding: 12px 8px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(57, 255, 20, 0.2);
    border-radius: 5px;
    transition: all 0.3s;
}

.sync-segment:hover {
    border-color: #39FF14;
    box-shadow: 0 0 10px rgba(57, 255, 20, 0.2);
}

.sync-value {
    font-family: var(--font-display);
    font-size: 2.8rem;
    color: #39FF14;
    text-shadow: 0 0 8px rgba(57, 255, 20, 0.5);
    line-height: 1;
    margin-bottom: 5px;
}

.sync-label {
    font-family: var(--font-main);
    font-size: 0.8rem;
    color: #ADFF2F;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.sync-event-label {
    text-align: center;
    font-family: var(--font-display);
    font-size: 1rem;
    color: #ADFF2F;
    padding: 8px;
    background: rgba(57, 255, 20, 0.05);
    border: 1px solid rgba(57, 255, 20, 0.15);
    border-radius: 4px;
    letter-spacing: 1px;
}

/* D: CORE INTERACTION FEED */
.core-feed-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.core-progress-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.core-bar-label {
    font-family: var(--font-main);
    font-size: 0.85rem;
    color: #888;
    white-space: nowrap;
}

.core-bar-visual {
    font-family: var(--font-display);
    font-size: 1.3rem;
    color: #39FF14;
    text-shadow: 0 0 5px rgba(57, 255, 20, 0.4);
    letter-spacing: 1px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.core-bar-percent {
    font-family: var(--font-display);
    font-size: 1.4rem;
    color: #fff;
    text-shadow: 0 0 8px #39FF14;
    min-width: 45px;
    text-align: right;
}

.core-status-text {
    font-family: var(--font-display);
    font-size: 1.1rem;
    letter-spacing: 2px;
    padding: 8px 12px;
    border-left: 3px solid #39FF14;
    background: rgba(57, 255, 20, 0.05);
    transition: all 0.3s;
}

.core-status-text.status-critical {
    color: #FF4500;
    border-left-color: #FF4500;
    background: rgba(255, 69, 0, 0.05);
    animation: status-blink 1s infinite;
}

.core-status-text.status-low {
    color: #FFA500;
    border-left-color: #FFA500;
    background: rgba(255, 165, 0, 0.05);
}

.core-status-text.status-stable {
    color: #39FF14;
    border-left-color: #39FF14;
    background: rgba(57, 255, 20, 0.05);
}

.core-status-text.status-overload {
    color: #00FFFF;
    border-left-color: #00FFFF;
    background: rgba(0, 255, 255, 0.08);
    text-shadow: 0 0 15px rgba(0, 255, 255, 0.6);
    animation: overload-pulse 0.8s infinite alternate;
}

/* ================================ */
/*    15. DESKTOP TERMINAL         */
/* ================================ */
footer { position: fixed; bottom: 0; left: 0; right: 0; z-index: 1000; background: linear-gradient(180deg, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.98) 100%); border-top: 3px solid #39FF14; padding: 0; margin: 0; box-shadow: 0 -10px 40px rgba(57, 255, 20, 0.2); transition: all 0.4s ease; }
.terminal-container { max-width: 1400px; margin: 0 auto; padding: 15px 40px; }
.terminal-header { display: flex; align-items: center; justify-content: space-between; padding-bottom: 10px; border-bottom: 1px solid rgba(57, 255, 20, 0.3); margin-bottom: 15px; cursor: pointer; user-select: none; transition: background 0.3s; }
.terminal-header:hover { background: rgba(57, 255, 20, 0.05); }
.terminal-title { font-family: 'VT323', monospace; font-size: 1.3rem; color: #39FF14; text-transform: uppercase; letter-spacing: 2px; display: flex; align-items: center; }
.terminal-controls { display: flex; align-items: center; gap: 15px; }
.terminal-status { font-family: 'Roboto Mono', monospace; font-size: 0.9rem; color: #ADFF2F; }
.status-indicator { display: inline-block; width: 8px; height: 8px; background: #39FF14; border-radius: 50%; margin-right: 8px; animation: pulse-dot 2s infinite; }
.terminal-toggle-btn { background: transparent; border: 1px solid rgba(57, 255, 20, 0.3); color: #39FF14; width: 30px; height: 30px; border-radius: 4px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.3s; font-family: 'VT323', monospace; font-size: 1rem; }
.terminal-toggle-btn:hover { background: rgba(57, 255, 20, 0.1); border-color: #39FF14; box-shadow: 0 0 10px rgba(57, 255, 20, 0.3); }
.toggle-icon { transition: transform 0.3s ease; display: inline-block; }
.terminal-content { max-height: 300px; opacity: 1; overflow: hidden; transition: max-height 0.4s ease, opacity 0.3s ease; }
footer.terminal-collapsed .terminal-content { max-height: 0; opacity: 0; }
footer.terminal-collapsed .terminal-header { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }
footer.terminal-expanded .terminal-content { max-height: 300px; opacity: 1; }
.console-line { display: flex; align-items: center; gap: 15px; margin-bottom: 15px; background: rgba(0, 0, 0, 0.5); padding: 12px 20px; border: 1px solid rgba(57, 255, 20, 0.3); border-radius: 0; font-family: 'Roboto Mono', monospace; position: relative; }
.console-line::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: #39FF14; }
.console-line .prompt { color: #39FF14; font-weight: bold; font-size: 1rem; white-space: nowrap; text-shadow: 0 0 5px rgba(57, 255, 20, 0.5); }
#command-input { flex: 1; background: transparent; border: none; color: #fff; font-family: 'Roboto Mono', monospace; font-size: 1rem; outline: none; padding: 0; caret-color: #39FF14; }
#command-input::placeholder { color: #555; font-style: italic; }
#command-input:focus { color: #ADFF2F; }
#terminal-output { background: rgba(0, 0, 0, 0.3); border: 1px solid rgba(57, 255, 20, 0.2); border-radius: 0; padding: 15px 20px; max-height: 180px; overflow-y: auto; font-family: 'VT323', monospace; font-size: 1.05rem; line-height: 1.6; color: #ADFF2F; white-space: pre-wrap; word-wrap: break-word; }
.terminal-typing { animation: terminal-typing 0.1s steps(1) infinite; }
.command-processing::before { content: "[ "; animation: processing-dots 1.5s infinite; color: #FF4500; }

/* ================================ */
/*    16. MOBILE TERMINAL & LOGS   */
/* ================================ */

.terminal-mini-log {
    flex: 1;
    margin: 0 20px;
    font-family: 'Roboto Mono', monospace;
    font-size: 0.9rem;
    color: #ADFF2F;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
    border-left: 2px solid rgba(57, 255, 20, 0.3);
    padding-left: 15px;
    opacity: 0.8;
}

.terminal-mini-log.flash-log {
    animation: textFlash 0.5s ease-out;
}

@keyframes textFlash {
    0% { color: #fff; text-shadow: 0 0 10px #fff; transform: translateX(5px); }
    100% { color: #ADFF2F; text-shadow: none; transform: translateX(0); }
}

#mobile-terminal-wrapper {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 899;
    display: none; 
    flex-direction: column;
    align-items: flex-end;
}

.mobile-float-log {
    background: rgba(0, 0, 0, 0.85);
    border: 1px solid #39FF14;
    color: #39FF14;
    padding: 6px 12px;
    font-family: 'VT323', monospace;
    font-size: 0.9rem;
    border-radius: 4px;
    margin-bottom: 10px;
    box-shadow: 0 0 10px rgba(57, 255, 20, 0.3);
    white-space: nowrap;
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    pointer-events: none;
    display: none;
}

.mobile-float-log.show {
    opacity: 1;
    transform: translateY(0);
}

.mobile-terminal-btn { position: fixed; bottom: 20px; right: 20px; z-index: 899; width: 60px; height: 60px; border-radius: 50%; background: linear-gradient(135deg, #000 0%, #1a1a1a 100%); border: 2px solid #39FF14; color: #39FF14; font-family: 'VT323', monospace; font-size: 1.5rem; cursor: pointer; box-shadow: 0 0 20px rgba(57, 255, 20, 0.3), 0 5px 15px rgba(0, 0, 0, 0.5); transition: all 0.3s ease; animation: terminal-pulse 2s infinite; display: none; }
.mobile-terminal-btn:hover { transform: scale(1.1); box-shadow: 0 0 30px rgba(57, 255, 20, 0.5), 0 5px 20px rgba(0, 0, 0, 0.7); }
.mobile-terminal-btn:active { transform: scale(0.95); }
.terminal-icon { display: flex; align-items: center; justify-content: center; }

.terminal-mobile-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.8); z-index: 10002; backdrop-filter: blur(5px); }
.terminal-mobile-overlay.active { display: block; animation: fadeIn 0.3s ease; }
.terminal-mobile-panel { position: fixed; bottom: -100%; left: 0; width: 100%; height: 70%; background: linear-gradient(180deg, rgba(0, 0, 0, 0.98) 0%, rgba(0, 0, 0, 0.95) 100%); border-top: 3px solid #39FF14; border-radius: 20px 20px 0 0; z-index: 10003; transition: bottom 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); box-shadow: 0 -10px 50px rgba(57, 255, 20, 0.3); overflow: hidden; }
.terminal-mobile-panel.active { bottom: 0; }
.terminal-drag-handle { width: 50px; height: 5px; background: rgba(57, 255, 20, 0.3); border-radius: 3px; margin: 10px auto; cursor: grab; transition: background 0.3s; }
.terminal-mobile-header { padding: 15px 20px; border-bottom: 1px solid rgba(57, 255, 20, 0.3); display: flex; justify-content: space-between; align-items: center; }
.terminal-mobile-header .terminal-title { font-size: 1.1rem; }
.terminal-mobile-close { position: absolute; top: 15px; right: 15px; background: transparent; border: 1px solid #39FF14; color: #39FF14; width: 35px; height: 35px; border-radius: 50%; cursor: pointer; font-size: 1.2rem; display: flex; align-items: center; justify-content: center; transition: all 0.3s; font-family: 'VT323', monospace; z-index: 10; }
.terminal-mobile-content { padding: 20px; height: calc(100% - 80px); overflow-y: auto; }
#command-input-mobile { flex: 1; background: transparent; border: none; color: #fff; font-family: 'Roboto Mono', monospace; font-size: 0.9rem; outline: none; padding: 0; caret-color: #39FF14; }
#terminal-output-mobile { background: rgba(0, 0, 0, 0.3); border: 1px solid rgba(57, 255, 20, 0.2); border-radius: 0; padding: 15px; max-height: calc(100% - 80px); overflow-y: auto; font-family: 'VT323', monospace; font-size: 1rem; line-height: 1.6; color: #ADFF2F; white-space: pre-wrap; word-wrap: break-word; margin-top: 15px; }

/* ================================ */
/*    17. CORE SIGNAL BUTTON       */
/* ================================ */

#core-signal-btn {
    position: fixed;
    bottom: 90px;
    right: 30px;
    z-index: 900;
    width: 160px;
    height: 60px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid #39FF14;
    box-shadow:
        0 0 10px rgba(57, 255, 20, 0.4),
        0 0 30px rgba(57, 255, 20, 0.2),
        inset 0 0 15px rgba(57, 255, 20, 0.05);
    color: #39FF14;
    font-family: var(--font-display);
    cursor: pointer;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    animation: core-flicker 4s infinite;
    user-select: none;
    -webkit-user-select: none;
    padding: 0 15px;
}

#core-signal-btn:hover {
    box-shadow:
        0 0 20px rgba(57, 255, 20, 0.6),
        0 0 50px rgba(57, 255, 20, 0.3),
        inset 0 0 20px rgba(57, 255, 20, 0.1);
    border-color: #ADFF2F;
    transform: scale(1.05);
}

#core-signal-btn:active {
    transform: scale(0.97);
}

.core-icon {
    font-size: 1.6rem;
    animation: core-pulse-icon 2s infinite ease-in-out;
    line-height: 1;
}

.core-readout {
    font-size: 1.4rem;
    font-weight: bold;
    letter-spacing: 1px;
    text-shadow: 0 0 5px rgba(57, 255, 20, 0.5);
}

.core-label {
    font-size: 1rem;
    opacity: 0.8;
}

#core-btn-percent {
    font-size: 1.4rem;
    color: #fff;
    text-shadow: 0 0 8px #39FF14;
}

.core-tooltip {
    position: absolute;
    top: -45px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.95);
    color: #39FF14;
    padding: 8px 14px;
    border: 1px solid #39FF14;
    border-radius: 4px;
    font-size: 0.85rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 0 15px rgba(57, 255, 20, 0.3);
    text-shadow: 0 0 5px #39FF14;
}

#core-signal-btn:hover .core-tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(-5px);
}

body.terminal-open #core-signal-btn {
    transform: translateY(300px);
    opacity: 0;
    pointer-events: none;
}

/* ================================ */
/*    18. FLASH OVERLAYS           */
/* ================================ */
#red-flash-overlay { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: radial-gradient(circle at center, rgba(255, 0, 0, 0.9) 0%, rgba(255, 69, 0, 0.7) 30%, rgba(139, 0, 0, 0.5) 60%, transparent 80%); z-index: 9999; opacity: 0; pointer-events: none; transition: opacity 0.1s; mix-blend-mode: screen; }
#red-flash-overlay.active { opacity: 1; animation: flash-fade 0.5s forwards; }
#green-flash-overlay { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: radial-gradient(circle at center, rgba(57, 255, 20, 0.6) 0%, rgba(173, 255, 47, 0.4) 30%, rgba(0, 100, 0, 0.3) 60%, transparent 80%); z-index: 9999; opacity: 0; pointer-events: none; transition: opacity 0.1s; mix-blend-mode: screen; }
#green-flash-overlay.active { opacity: 1; animation: flash-fade 0.5s forwards; }

/* ================================ */
/*    19. GOD MODE STYLES          */
/* ================================ */
body.god-mode { filter: hue-rotate(90deg) saturate(1.5); transition: filter 0.5s ease; }
body.god-mode #core-signal-btn { border-color: var(--neon-green); box-shadow: 0 0 20px var(--neon-green), 0 0 40px rgba(57, 255, 20, 0.3); }
body.god-mode #core-signal-btn:hover { box-shadow: 0 0 30px var(--neon-green), 0 0 60px rgba(57, 255, 20, 0.5); }
body.god-mode .cursor { border-color: var(--neon-green); box-shadow: 0 0 10px var(--neon-green); }
body.god-mode #red-flash-overlay.active { background: radial-gradient(circle at center, rgba(57, 255, 20, 0.9) 0%, rgba(173, 255, 47, 0.7) 30%, rgba(0, 100, 0, 0.5) 60%, transparent 80%); }

/* ================================ */
/*    20. SCROLLBAR STYLES         */
/* ================================ */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.3); }
::-webkit-scrollbar-thumb { background: rgba(57, 255, 20, 0.3); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(57, 255, 20, 0.5); }

/* ================================ */
/*    21. ACCESSIBILITY            */
/* ================================ */
*:focus-visible { outline: 2px solid #39FF14; outline-offset: 2px; }
button, a, input { transition: all 0.3s ease; }

/* ================================ */
/*    22. PRINT STYLES             */
/* ================================ */
@media print {
    body { background: white; color: black; }
    .cursor, #mood-widget, #core-signal-btn, footer, .mobile-terminal-btn { display: none !important; }
}

/* ================================ */
/*    23. HIGH CONTRAST MODE       */
/* ================================ */
@media (prefers-contrast: high) {
    :root { --neon-green: #00FF00; --text-color: #FFFFFF; }
    body { background-color: #000; }
}

/* ================================ */
/*    24. REDUCED MOTION           */
/* ================================ */
@media (prefers-reduced-motion: reduce) {
    * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* ================================ */
/*    28. BIOS PRELOADER           */
/* ================================ */
#bios-preloader {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: #000; z-index: 999999; 
    display: flex; align-items: center; justify-content: center; transition: opacity 0.8s ease, visibility 0.8s ease;
}
#bios-preloader.fade-out { opacity: 0; visibility: hidden; pointer-events: none; }
.bios-content { font-family: 'VT323', monospace; font-size: 1.4rem; color: #39FF14; text-shadow: 0 0 10px rgba(57, 255, 20, 0.5); max-width: 600px; padding: 20px; position: relative; z-index: 2; }
.bios-line { opacity: 0; transform: translateY(5px); margin-bottom: 12px; white-space: nowrap; }
.bios-line.visible { opacity: 1; transform: translateY(0); transition: opacity 0.3s ease, transform 0.3s ease; }
.bios-line .status-success { color: #39FF14; text-shadow: 0 0 10px #39FF14; }
.bios-line .status-fail { color: #FF4500; text-shadow: 0 0 10px #FF4500; }
.bios-cursor { animation: bios-blink 0.7s step-end infinite; font-size: 1.6rem; }
#bios-preloader::before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.15) 1px, transparent 1px, transparent 2px); pointer-events: none; z-index: 1; }

/* ================================ */
/*    29. ARCADE SECTION           */
/* ================================ */
#arcade-terminal {
    min-height: 80vh; background: linear-gradient(180deg, rgba(0, 0, 0, 0.95) 0%, rgba(10, 20, 10, 0.9) 50%, rgba(0, 0, 0, 0.95) 100%);
    border-top: 3px solid #39FF14; border-bottom: 3px solid #39FF14; position: relative; overflow: hidden; padding: 60px 20px; font-family: 'VT323', monospace;
}
#arcade-terminal::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle at 20% 30%, rgba(57, 255, 20, 0.05) 0%, transparent 50%), radial-gradient(circle at 80% 70%, rgba(255, 69, 0, 0.03) 0%, transparent 50%);
    pointer-events: none;
}
.terminal-container { max-width: 800px; margin: 0 auto; position: relative; z-index: 1; }
.terminal-container h3 { color: #39FF14; font-size: 2.5em; margin-bottom: 30px; text-shadow: 0 0 10px rgba(57, 255, 20, 0.5); text-align: center; }
.terminal-grid { display: flex; align-items: center; justify-content: center; gap: 50px; flex-wrap: wrap; }
.terminal-text p { color: #fff; font-size: 1.4em; line-height: 1.4; margin: 5px 0; text-align: left; }
.terminal-text .warning { color: #FF4500; margin-top: 15px; font-weight: bold; text-shadow: 0 0 5px #FF4500; }
.floppy-btn { background: transparent; border: none; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 15px; transition: transform 0.2s; }
.floppy-btn:hover { transform: scale(1.1) rotate(-2deg); }
.floppy-icon { width: 100px; height: 100px; background: #333; border-radius: 5px; position: relative; border: 2px solid #39FF14; box-shadow: 5px 5px 0px #111; }
.floppy-label { position: absolute; top: 10px; left: 10%; width: 80%; height: 50px; background: #fff; color: #000; font-size: 14px; display: flex; align-items: center; justify-content: center; transform: rotate(-5deg); border: 1px solid #000; font-weight: bold; }
.floppy-shutter { position: absolute; bottom: 0; left: 20%; width: 60%; height: 30px; background: #555; border-top: 2px solid #39FF14; border-left: 2px solid #39FF14; border-right: 2px solid #39FF14; }
.btn-text { color: #39FF14; font-size: 1.5em; text-transform: uppercase; animation: pulse-text 2s infinite; }
@keyframes pulse-text { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

/* ================================ */
/*    30. GAME MODAL               */
/* ================================ */
.game-modal { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0, 0, 0, 0.95); z-index: 100000; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(10px); }
.game-modal.hidden { display: none; }
.game-modal-content { width: 95%; height: 90%; max-width: 1400px; background: #0a0a0a; border: 3px solid #39FF14; border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 0 50px rgba(57, 255, 20, 0.3), 0 0 100px rgba(57, 255, 20, 0.1); }
.game-modal-header { display: flex; justify-content: space-between; align-items: center; padding: 15px 25px; background: linear-gradient(90deg, rgba(57, 255, 20, 0.1), transparent); border-bottom: 1px solid #39FF14; }
.game-modal-title { font-family: var(--font-display); font-size: 1.5rem; color: #39FF14; text-shadow: 0 0 10px #39FF14; letter-spacing: 3px; }
.close-game-btn { font-family: var(--font-display); font-size: 1.2rem; padding: 10px 20px; background: transparent; border: 2px solid #FF4500; color: #FF4500; cursor: pointer; transition: all 0.3s ease; }
.close-game-btn:hover { background: #FF4500; color: #000; box-shadow: 0 0 20px #FF4500; }
#game-iframe { flex: 1; width: 100%; height: 100%; background: #000; }

/* ================================ */
/*    31. VIDEO ARCHIVES (VERTICAL) */
/* ================================ */
#video-archives {
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.9) 0%, rgba(10, 20, 10, 0.8) 100%);
    border-top: 1px dashed rgba(57, 255, 20, 0.4);
    border-bottom: 2px solid #39FF14;
    padding: 80px 5%;
    font-family: 'VT323', monospace;
    position: relative;
    z-index: 1;
}

.video-header {
    text-align: center;
    margin-bottom: 50px;
}

#video-archives h2 {
    color: #39FF14;
    text-shadow: 0 0 10px rgba(57, 255, 20, 0.7);
    font-size: 3rem;
    margin-bottom: 10px;
    letter-spacing: 2px;
}

.access-prompt {
    color: #B7B7B7;
    font-size: 1.2rem;
    font-family: 'Roboto Mono', monospace;
}

.blink {
    animation: blinker 1s linear infinite;
    color: #39FF14;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 40px;
    max-width: 1050px;
    margin: 0 auto;
    width: 100%;
}

.video-item {
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid rgba(57, 255, 20, 0.3);
    padding: 15px;
    transition: all 0.3s ease;
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.8);
}

.video-item:hover {
    border-color: #39FF14;
    box-shadow: 0 0 20px rgba(57, 255, 20, 0.4), inset 0 0 10px rgba(57, 255, 20, 0.2);
    transform: translateY(-5px);
}

.video-thumbnail {
    position: relative;
    width: 100%;
    aspect-ratio: 9 / 16;
    overflow: hidden;
    background: #000;
    border: 1px solid #111;
    cursor: pointer;
}

.video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(80%) sepia(30%) hue-rotate(80deg) brightness(0.7);
    transition: all 0.4s ease;
}

.video-item:hover .video-thumbnail img {
    filter: grayscale(0%) brightness(1);
}

.play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #39FF14;
    background: rgba(0, 0, 0, 0.7);
    padding: 10px 15px;
    border: 1px solid #39FF14;
    font-size: 1.5rem;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 3;
}

.video-item:hover .play-overlay {
    opacity: 1;
    box-shadow: 0 0 10px #39FF14;
    background: rgba(57, 255, 20, 0.1);
}

.scanline {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 10px;
    background: rgba(57, 255, 20, 0.3);
    opacity: 0;
    box-shadow: 0 0 15px rgba(57, 255, 20, 0.6);
    z-index: 2;
}

.video-item:hover .scanline {
    opacity: 1;
    animation: scan 2s linear infinite;
}

@keyframes scan {
    0% { top: -10%; }
    100% { top: 110%; }
}

.video-info {
    margin-top: 15px;
    border-top: 1px dashed rgba(57, 255, 20, 0.3);
    padding-top: 15px;
}

.video-info h3 {
    color: #ADFF2F;
    font-size: 1.4rem;
    margin: 0 0 15px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
}

.platform-links {
    display: flex;
    align-items: center;
    gap: 15px;
}

.platform-links p {
    color: #B7B7B7;
    margin: 0;
    font-size: 1.1rem;
    font-family: 'Roboto Mono', monospace;
}

.social-btn {
    display: inline-block;
    width: 35px;
    height: 35px;
    border-radius: 5px;
    transition: transform 0.2s, filter 0.2s;
    filter: grayscale(100%) opacity(0.6);
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
}

.social-btn img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.social-btn:hover {
    transform: scale(1.1);
    filter: grayscale(0%) opacity(1);
    box-shadow: none !important;
}

/* ================================ */
/*    25. MOBILE RESPONSIVE        */
/* ================================ */

.video-grid::-webkit-scrollbar {
    height: 6px;
}
.video-grid::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.5);
    border-radius: 3px;
    border: 1px solid rgba(57, 255, 20, 0.1);
}
.video-grid::-webkit-scrollbar-thumb {
    background: rgba(57, 255, 20, 0.4);
    border-radius: 3px;
}
.video-grid::-webkit-scrollbar-thumb:hover {
    background: #39FF14;
}

@media (max-width: 768px) {
    
    body { padding-bottom: 0 !important; }
    h2 { font-size: 2rem; }
    #hero-title { font-size: 2.5rem; }
    footer { display: none; }
    
    .terminal-mini-log { display: none; }
    .hide-mobile { display: none !important; }
    #mobile-terminal-wrapper { display: flex; }
    .mobile-terminal-btn { position: static; display: flex; align-items: center; justify-content: center; }
    
    /* CORE SIGNAL BUTTON — MOBILE */
    #core-signal-btn {
        bottom: 80px;
        right: 15px;
        width: 130px;
        height: 50px;
        padding: 0 10px;
        border-width: 2px;
    }

    .core-icon {
        font-size: 1.2rem;
    }

    .core-readout {
        font-size: 1.1rem;
    }

    #core-btn-percent {
        font-size: 1.1rem;
    }

    .core-label {
        font-size: 0.8rem;
    }

    .core-tooltip {
        display: none;
    }
    
    /* MOOD WIDGET — MOBILE */
    #mood-widget { bottom: 20px; left: 10px; width: 130px; padding: 8px; }
    .mood-header { font-size: 0.6rem; }
    .mood-status { font-size: 0.7rem; margin: 3px 0; }
    .mood-btn { font-size: 0.6rem; padding: 4px; }
    
    .story-block, .story-block.reverse { flex-direction: column; }
    
    /* ROADMAP — MOBILE */
    .roadmap-container { flex-direction: column; gap: 30px; }
    .barry-charge-visual { order: 1; }
    .roadmap-stages { order: 2; }
    .charge-image-container { width: 250px; height: 400px; }
    #charge-percent { font-size: 2.5rem; }
    #charge-text { font-size: 1rem; }
    .roadmap-stage { padding: 15px; }
    .roadmap-stage h3 { font-size: 1.2rem; }
    .stage-subtitle { font-size: 0.8rem; }
    
    /* REWARD PROTOCOL — MOBILE */
    #reward-section {
        width: 95%;
        max-width: 95%;
        max-height: 88vh;
        padding: 0;
    }

    .reward-window {
        padding: 25px 15px 20px;
    }

    .reward-title {
        font-size: 1.3rem;
        margin-bottom: 18px;
    }

    .reward-block {
        padding: 14px 12px;
        margin-bottom: 14px;
    }

    .reward-block-header {
        font-size: 0.95rem;
    }

    #treasury-count {
        font-size: 2rem;
    }

    .treasury-ticker {
        font-size: 1.1rem;
    }

    .treasury-wallet {
        flex-direction: column;
        gap: 6px;
        text-align: center;
    }

    .wallet-address {
        font-size: 0.8rem;
    }

    .ledger-table-header {
        font-size: 0.8rem;
    }

    .ledger-row {
        font-size: 0.85rem;
    }

    .col-time {
        flex: 0 0 85px;
    }

    .col-qty {
        flex: 0 0 110px;
    }

    .ledger-scroll {
        max-height: 140px;
    }

    .sync-clock-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .sync-value {
        font-size: 2rem;
    }

    .sync-label {
        font-size: 0.7rem;
    }

    .sync-event-label {
        font-size: 0.85rem;
    }

    .core-bar-visual {
        font-size: 1rem;
    }

    .core-bar-percent {
        font-size: 1.1rem;
    }

    .core-status-text {
        font-size: 0.95rem;
    }
    
    /* SCANNER — MOBILE */
    .analysis-container { flex-direction: column; }
    .scanner-panel, .model-viewer-container { width: 100%; }
    .model-viewer-container { height: 350px; }
    .model-viewer-container model-viewer { height: 300px; }
    .scan-window { width: 95%; padding: 20px; max-height: 70vh; }
    .scan-window pre { font-size: 0.9rem; padding: 10px; }
    .analyst-text { font-size: 0.9rem; padding: 10px; }
    
    /* EPISODE 3 — MOBILE */
    #episode3 h2 { font-size: 2.2rem; margin-bottom: 30px; }
    .trigger-warning { position: relative; top: 0; right: 0; margin-bottom: 20px; transform: rotate(0); width: 100%; text-align: center; }
    #episode3 .story-block, #episode3 .story-block.reverse { flex-direction: column; gap: 20px; }
    #episode3 .story-text { font-size: 1.1rem; padding: 20px; }
    #episode3 .story-block.reverse .story-text { border-right: none; border-left: 2px solid #FF4500; }
    
    /* EPILOGUE & ARCADE — MOBILE */
    #epilogue-launch h3 { font-size: 2rem; }
    #epilogue-launch .caption { font-size: 1.4rem; padding: 20px; }
    .social-links { padding-top: 30px; }
    .social-links a { margin: 0 10px; }
    .social-links img { width: 48px; height: 48px; }
    .social-links a[data-tooltip]::after { font-size: 0.8rem; padding: 8px 12px; white-space: normal; width: 200px; bottom: 140%; }
    
    .bios-content { font-size: 1.1rem; padding: 15px; }
    .bios-line { white-space: normal; margin-bottom: 10px; }
    
    #arcade-terminal h2 { font-size: 1.8rem; }
    .terminal-text p { text-align: center; }
    .terminal-grid { flex-direction: column; gap: 30px; text-align: center; }
    
    .game-modal-content { width: 100%; height: 100%; border-radius: 0; border-width: 0; border-top: 3px solid #39FF14; }
    .game-modal-header { padding: 10px 15px; }
    .game-modal-title { font-size: 1.1rem; }
    .close-game-btn { font-size: 1rem; padding: 8px 15px; }

    /* VIDEO ARCHIVES — MOBILE */
    #video-archives { padding: 60px 5%; }
    
    .video-header {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 10px;
        margin-bottom: 30px;
    }
    
    #video-archives h2 {
        font-size: 1.8rem; 
        text-align: center;
        line-height: 1.2;
        margin-bottom: 10px;
    }

    .access-prompt {
        text-align: center;
        font-size: 1rem;
    }

    .video-grid {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 25px;
        gap: 20px;
        justify-content: flex-start;
    }

    .video-item {
        flex: 0 0 85%;
        max-width: 320px;
        scroll-snap-align: center;
    }
}

/* ================================ */
/*    26. TABLET ADJUSTMENTS       */
/* ================================ */
@media (min-width: 769px) and (max-width: 1024px) {
    .terminal-container { padding: 15px 30px; }
    
    /* CORE SIGNAL BUTTON — TABLET */
    #core-signal-btn {
        width: 150px;
        height: 55px;
    }

    /* REWARD PROTOCOL — TABLET */
    .sync-value {
        font-size: 2.5rem;
    }

    .sync-clock-grid {
        gap: 10px;
    }

    #treasury-count {
        font-size: 2.5rem;
    }

    /* ROADMAP — TABLET */
    .roadmap-container { gap: 40px; }
    .charge-image-container { width: 280px; height: 460px; }
}

/* ================================ */
/*    27. LARGE SCREENS            */
/* ================================ */
@media (min-width: 1440px) {
    .roadmap-container { max-width: 1600px; }
    .charge-image-container { width: 350px; height: 550px; }
}

/* ================================================= */

/* ================================================= */
@media (hover: none) and (pointer: coarse), (max-width: 768px) {
    body {
        cursor: auto !important; 
    }
    
    .cursor {
        display: none !important; 
    }
}
        