/* ========================
   GLOBAL VARIABLES (THEME)
   ======================== */
:root {
    --primary-color: #f7d53e;       
    --accent-color: #a3cbf5;        
    --ui-bg: rgba(16, 16, 16, 0.85); 
    --ui-border: #444;              
    --ui-radius: 4px;               
    --text-main: #e0e0e0;
    --text-dim: #888;
}

/* ОБНУЛЕННЯ */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background: #000;
    color: var(--text-main);
    font-family: 'Oxanium', monospace;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    cursor: none; 
}

/* ФОН */
.bg-layer {
    position: absolute; top: -5%; left: -5%; width: 110%; height: 110%; 
    background-image: url('../assets/bg.jpg'); background-size: cover; background-position: center;
    z-index: 1; filter: brightness(0.5); transition: transform 0.1s ease-out; 
}

.scanlines {
    position: absolute; inset: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    background-size: 100% 2px, 3px 100%; pointer-events: none; z-index: 2;
}

/* DUST EFFECT */
.dust-container {
    position: absolute; inset: 0; pointer-events: none; z-index: 3; overflow: hidden;
}
.dust-speck {
    position: absolute; width: 2px; height: 2px; 
    background: rgba(255, 255, 255, 0.15); 
    border-radius: 50%;
    animation: dustFloat 10s infinite linear;
}
@keyframes dustFloat {
    0% { transform: translateY(0) translateX(0); opacity: 0; }
    20% { opacity: 0.3; } 
    80% { opacity: 0.3; }
    100% { transform: translateY(-100px) translateX(20px); opacity: 0; }
}

.ui-layer {
    position: absolute; inset: 0; padding: 60px; padding-top: 80px;
    display: flex; flex-direction: column; justify-content: flex-start; z-index: 100; pointer-events: none;
}

.screen {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; padding: 60px; padding-top: 80px;
    display: flex; flex-direction: column; transition: opacity 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    opacity: 0; pointer-events: none; visibility: hidden;
}
.screen.active-screen { opacity: 1; pointer-events: auto; visibility: visible; }
.screen.hidden { display: none; }
.screen.dlc-centered { justify-content: center; align-items: center; padding-top: 0; }

/* HEADER */
.header-top-row { display: flex; align-items: center; gap: 20px; margin-bottom: 5px; pointer-events: auto; }

/* ЗАГОЛОВОК (TEKO) */
h1.glitch {
    font-family: 'Teko', sans-serif;
    font-size: 56px; line-height: 0.9; letter-spacing: 2px; color: var(--text-main); 
    text-shadow: 0 0 10px rgba(163, 203, 245, 0.1); 
    margin-bottom: 5px; text-transform: uppercase; position: relative; cursor: default; pointer-events: auto; transition: all 0.3s ease;
}
h1.glitch:hover {
    color: rgba(163, 203, 245, 0.3); -webkit-text-stroke: 1px rgba(163, 203, 245, 0.5); text-shadow: 0 0 10px rgba(163, 203, 245, 0.3);
}

.scene-3d-mini { width: 30px; height: 30px; perspective: 300px; pointer-events: none; }
.swarm-container { width: 100%; height: 100%; position: relative; transform-style: preserve-3d; }
.tri {
    position: absolute; width: 0; height: 0; border-left: 3px solid transparent; border-right: 3px solid transparent;
    border-bottom: 6px solid rgba(163, 203, 245, 0.7); animation: polyFloat 6s infinite ease-in-out alternate;
}
.t1 { top: 0; left: 5px; animation-delay: 0s; transform: rotate(15deg) translateZ(5px); }
.t2 { top: 10px; left: 0; border-bottom-color: rgba(247, 213, 62, 0.7); animation-delay: 0.5s; transform: rotate(-30deg) translateZ(-5px); }
.t3 { top: 5px; left: 10px; animation-delay: 1s; transform: rotate(45deg) translateZ(0px); }
.t4 { top: 12px; left: 8px; border-bottom-color: rgba(247, 213, 62, 0.7); animation-delay: 1.5s; transform: rotate(90deg); }
.t5 { top: 2px; left: 2px; animation-delay: 2.5s; transform: rotate(180deg) translateZ(8px); }
@keyframes polyFloat {
    0% { transform: translate3d(0, 0, 0) rotate(0deg); opacity: 0.5; }
    100% { transform: translate3d(10px, -5px, 10px) rotate(360deg); opacity: 1; }
}

.role-subtitle { font-size: 16px; color: var(--primary-color); font-weight: bold; letter-spacing: 2px; text-transform: uppercase; margin-bottom: 30px; text-shadow: 0 0 5px rgba(247, 213, 62, 0.4); }

/* --- ЗАГОЛОВКИ --- */
h2 { 
    font-size: 32px; color: var(--primary-color); margin: 0; padding: 0; 
    border-bottom: 2px solid var(--primary-color); display: block; width: 100%; 
    padding-bottom: 5px; margin-bottom: 25px; text-transform: uppercase; line-height: 1; 
}

.sidebar-header-container h2 { margin-bottom: 0; width: 100%; }
.sidebar-header-container {
    height: 60px; width: 100%; display: block; padding-top: 25px; padding-bottom: 5px; margin-bottom: 25px; flex-shrink: 0; box-sizing: border-box;
}
.header-spacer {
    height: 60px; width: 100%; margin-bottom: 25px; border-bottom: 2px solid transparent; flex-shrink: 0; display: block; 
}

.menu-list { list-style: none; margin-top: 20px; pointer-events: auto; }
.menu-item {
    font-size: 28px; color: rgba(255,255,255,0.5); margin-bottom: 12px; cursor: pointer; transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); 
    text-transform: uppercase; width: fit-content; pointer-events: auto; display: flex; align-items: center; position: relative; line-height: 1; 
}
.menu-item.active { color: #fff; transform: translateX(20px); text-shadow: 0 0 8px #b5cced; }
.menu-item.active::before { content: "▶"; color: var(--primary-color); font-size: 12px; margin-right: 15px; transform: translateY(-2px); }

/* --- GALLERY --- */
.gallery-layout { display: flex !important; flex-direction: row !important; height: 100%; gap: 60px; align-items: flex-start; } 
.gallery-sidebar { width: 500px; display: flex; flex-direction: column; pointer-events: auto; flex-shrink: 0; }

.projects-scroll-area { flex-grow: 0; height: 70vh; overflow-y: auto; padding-right: 25px; }
.projects-scroll-area::-webkit-scrollbar { width: 6px; }
.projects-scroll-area::-webkit-scrollbar-track { background: transparent; }
.projects-scroll-area::-webkit-scrollbar-thumb { background: linear-gradient(to bottom, #f7d53e 0%, #f7d53e 40%, rgba(247, 213, 62, 0) 100%); border-radius: 5px; }
.projects-scroll-area::-webkit-scrollbar-thumb:hover { background: linear-gradient(to bottom, #ffe066 0%, #ffe066 50%, rgba(255, 224, 102, 0) 100%); }

.project-slot {
    padding: 10px; border: 1px solid #333; background: rgba(0,0,0,0.5); margin-bottom: 8px; cursor: pointer; 
    display: flex; align-items: center; gap: 15px; pointer-events: auto; border-radius: 0px; transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.project-slot:hover, .project-slot.selected { border-color: var(--primary-color); background: rgba(247, 213, 62, 0.1); border-radius: 6px; transform: translateX(10px); }
.slot-thumb { width: 80px; height: 50px; background-color: #222; background-size: cover; background-position: center; border: 1px solid #444; transition: 0.2s; border-radius: 2px;}
.project-slot:hover .slot-thumb { border-color: #fff; border-radius: 4px; }

.slot-text { display: flex; flex-direction: column; align-items: flex-start; }
.p-title { font-size: 16px; color: #fff; font-weight: bold; }
.p-desc { font-size: 11px; color: var(--text-dim); text-transform: uppercase; margin-top: 2px; }

.gallery-viewport { flex-grow: 1; max-width: 1200px; pointer-events: auto; display: flex; flex-direction: column; }
.viewport-frame { 
    height: 70vh; background: linear-gradient(to bottom, rgba(16, 16, 16, 0.6) 0%, rgba(16, 16, 16, 0.2) 100%);
    display: flex; flex-direction: column; border: 1px solid #444; border-radius: 6px; box-shadow: 0 0 20px rgba(0,0,0,0.3); overflow: hidden; 
}
.vp-header { 
    background: transparent; color: var(--primary-color); padding: 15px 20px; font-weight: bold; letter-spacing: 2px; font-size: 14px;
    border-bottom: none; display: flex; align-items: center; justify-content: space-between; flex-shrink: 0;
}
.vp-header::before { content: "📂"; margin-right: 10px; font-size: 12px; filter: grayscale(1); }
.vp-link { font-size: 12px; color: #aaa; text-decoration: none; border: 1px solid #555; padding: 2px 8px; transition: 0.2s; border-radius: 4px; }
.vp-link:hover { color: var(--primary-color); border-color: var(--primary-color); }
.vp-footer { background: transparent; color: #666; padding: 10px 20px; font-size: 10px; border-top: none; text-align: right; flex-shrink: 0; }

.vp-content { flex-grow: 1; overflow-y: auto; padding: 0; text-align: center; display: block; }
.vp-content img, .vp-content video, .vp-content iframe {
    max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; display: block; margin: 0 auto 10px auto; box-shadow: 0 5px 15px rgba(0,0,0,0.5);
}
.vp-content iframe { width: 100%; aspect-ratio: 16 / 9; }
.vp-placeholder { margin-top: 250px; color: #444; animation: blink 2s infinite; font-size: 18px;}

/* ICONS */
.wod-thumb { background-image: url('../assets/images/icons/wod_icon.jpg'); }
.seq-thumb { background-image: url('../assets/images/icons/sequoia_icon.jpg'); }
.mer-thumb { background-image: url('../assets/images/icons/Mermeid_icon.jpg'); } 
.sci-thumb { background-image: url('../assets/images/icons/sf_icon.jpg'); }
.wolv-thumb { background-image: url('../assets/images/icons/wolverine_icon.jpg'); }
.boy-thumb { background-image: url('../assets/images/icons/boy_icon.jpg'); } 
.queen-thumb { background-image: url('../assets/images/icons/queen_icon.jpg'); }
.hal-thumb { background-image: url('../assets/images/icons/Halloween_icon.jpg'); }
.jinx-thumb { background-image: url('../assets/images/icons/jinxrbg_icon.jpg'); background-position: top; }
.project-slot:hover .jinx-thumb, .project-slot.selected .jinx-thumb { background-image: url('../assets/images/icons/jinxr_icon.jpg') !important; }

/* CREDITS & SHOP & OPTIONS */
.shop-container, .text-content, .scroll-container {
    max-width: 800px; background: var(--ui-bg); 
    padding: 30px; border: 1px solid var(--ui-border); border-radius: var(--ui-radius); 
    max-height: 70vh; 
    overflow-y: auto; 
    padding-right: 20px; 
    pointer-events: auto; 
    margin-bottom: 20px; 
}
.shop-container::-webkit-scrollbar, .text-content::-webkit-scrollbar, .scroll-container::-webkit-scrollbar { width: 6px; }
.shop-container::-webkit-scrollbar-track, .text-content::-webkit-scrollbar-track, .scroll-container::-webkit-scrollbar-track { background: transparent; }
.shop-container::-webkit-scrollbar-thumb, .text-content::-webkit-scrollbar-thumb, .scroll-container::-webkit-scrollbar-thumb { 
    background: linear-gradient(to bottom, #f7d53e 0%, #f7d53e 40%, rgba(247, 213, 62, 0) 100%); border-radius: 5px; 
}

.role-title { font-size: 32px; color: #fff; font-weight: bold; margin-bottom: 5px; }
.role-sub { color: var(--primary-color); letter-spacing: 2px; font-size: 14px; margin-bottom: 20px; display: block; }
.bio-intro { font-size: 18px; line-height: 1.5; color: #ddd; margin-bottom: 25px; border-left: 3px solid var(--primary-color); padding-left: 15px; }
.section-header { color: var(--primary-color); margin-bottom: 10px; border-bottom: 1px solid #444; display: inline-block; font-weight: bold; letter-spacing: 1px; margin-top: 15px;}
.cv-list { list-style: none; margin-left: 0; }
.cv-list li { margin-bottom: 12px; color: #ccc; line-height: 1.4; font-size: 16px; }
.cv-list strong { color: #fff; font-weight: bold; }
.contact-link { color: #89b4fa; text-decoration: none; font-weight: bold; letter-spacing: 1px; border-bottom: 1px dashed #89b4fa; transition: 0.2s; }
.contact-link:hover { color: #b4befe; border-bottom: 1px solid #b4befe; text-shadow: 0 0 8px rgba(137, 180, 250, 0.6); }

.shop-item { display: flex; justify-content: space-between; align-items: center; background: rgba(0,0,0,0.6); border: 1px solid #333; padding: 15px; margin-bottom: 15px; border-radius: 8px; transition: 0.2s; }
.shop-item.inactive { opacity: 0.6; filter: grayscale(0.8); }
.shop-icon { width: 50px; height: 50px; background: #333; border-radius: 4px; margin-right: 20px; }
.shop-info { display: flex; flex-direction: column; flex-grow: 1; }
.shop-title { color: var(--primary-color); font-weight: bold; font-size: 18px; }
.shop-desc { color: #aaa; font-size: 12px; }
.shop-btn { padding: 10px 20px; border: 1px solid #555; color: #555; font-size: 12px; letter-spacing: 1px; font-weight: bold; cursor: not-allowed; }

.settings-list { list-style: none; width: 550px; border-left: 2px solid #333; padding-left: 20px; }
.setting-category { color: #666; font-size: 14px; margin-top: 20px; margin-bottom: 8px; letter-spacing: 2px; }
.setting-item { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 18px; color: #aaa; border-bottom: 1px solid #222; padding-bottom: 2px; }
.set-val { color: #ccc; } 
.set-val.on { color: #4caf50; font-weight: bold; } 
.set-val.max { color: #ff3d00; font-weight: bold; } 
.set-val.disabled { color: #444; text-decoration: line-through; font-size: 14px;}

.footer-hint { position: fixed; bottom: 45px; left: 0; width: 100%; text-align: center; color: #666; font-size: 14px; letter-spacing: 2px; z-index: 200; pointer-events: none; }
.back-hint { margin-top: 20px; margin-bottom: 50px; color: #666; font-size: 14px; cursor: pointer; pointer-events: auto;}
.back-hint:hover { color: #fff; }

.dlc-wrapper { position: fixed; bottom: 50px; left: 60px; z-index: 101; pointer-events: auto;}
.dlc-btn { font-size: 16px; color: #666; cursor: pointer; transition: 0.3s; padding: 8px; font-weight: bold; letter-spacing: 1px; }
.dlc-btn.active-dlc, .dlc-btn:hover { color: var(--primary-color); text-shadow: 0 0 5px var(--primary-color); }
.buy-btn { display: inline-block; background: var(--primary-color); color: #000; padding: 15px 30px; text-decoration: none; font-weight: bold; margin-top: 20px; border: 2px solid var(--primary-color); transition: 0.2s; pointer-events: auto;}
.buy-btn:hover { background: transparent; color: var(--primary-color); }
.centered { text-align: center; }

.coffee-hud { position: absolute; top: 40px; right: 60px; display: flex; flex-direction: column; align-items: flex-end; font-family: 'Oxanium', monospace; z-index: 10; }
.hud-row { display: flex; gap: 10px; align-items: center; margin-bottom: 5px; }
.hud-label { font-size: 12px; color: #888; letter-spacing: 2px; }
.hud-value { font-size: 16px; font-weight: bold; color: #ff3d00; text-shadow: 0 0 10px rgba(255, 61, 0, 0.5); }
.battery-icon { display: flex; align-items: center; }
.battery-body { width: 60px; height: 30px; border: 2px solid #555; border-radius: 4px; padding: 2px; position: relative; background: rgba(0, 0, 0, 0.5); }
.battery-cap { width: 4px; height: 12px; background: #555; border-radius: 0 2px 2px 0; margin-left: 2px; }
.battery-fill { width: 12%; height: 100%; background: #ff3d00; box-shadow: 0 0 10px #ff3d00; border-radius: 2px; animation: lowBattery 1s infinite alternate; }
.battery-symbol { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 18px; height: 18px; z-index: 2; color: #fff; filter: drop-shadow(0 0 2px rgba(0,0,0,0.8)); opacity: 0.8; }
.hud-msg { margin-top: 5px; font-size: 10px; color: #ff3d00; letter-spacing: 1px; }
.blinking { animation: textBlink 0.5s infinite alternate; }
@keyframes lowBattery { 0% { opacity: 0.5; box-shadow: 0 0 5px #ff3d00; } 100% { opacity: 1; box-shadow: 0 0 15px #ff3d00; } }
@keyframes textBlink { 0% { opacity: 0.4; } 100% { opacity: 1; } }

/* GLOBAL CURSOR */
a, button, .menu-item, .project-slot, .back-hint, .shop-btn { cursor: none; }
.cursor-dot, .cursor-circle { position: fixed; top: 0; left: 0; border-radius: 50%; pointer-events: none; z-index: 9999; transform: translate(-50%, -50%); }
.cursor-dot { width: 8px; height: 8px; background: var(--accent-color); }
.cursor-circle { width: 30px; height: 30px; border: 1px solid rgba(163, 203, 245, 0.5); transition: width 0.2s, height 0.2s, background-color 0.2s, border-color 0.2s; }
body.hovered .cursor-circle { width: 35px; height: 35px; background: rgba(163, 203, 245, 0.1); border-color: var(--accent-color); }

/* MISC */
#preloader { position: fixed; inset: 0; background: #000; z-index: 10000; display: flex; align-items: center; justify-content: center; font-family: 'Oxanium', monospace; }
.loader-content { width: 300px; text-align: center; }
.loader-text { color: #f7d53e; margin-bottom: 10px; letter-spacing: 2px; font-size: 14px; }
.loader-bar { width: 100%; height: 4px; background: #222; margin-bottom: 10px; position: relative; overflow: hidden; }
.bar-fill { width: 0%; height: 100%; background: #f7d53e; transition: width 0.1s linear; }
.loader-percentage { color: #666; font-size: 12px; }
#gallery-preloader { position: absolute; inset: 0; background: rgba(0,0,0,0.9); z-index: 500; display: flex; align-items: center; justify-content: center; pointer-events: none; transition: opacity 0.5s ease; }
#gallery-preloader.hidden { opacity: 0; pointer-events: none; }
.ticker-wrap { position: fixed; bottom: 0; left: 0; width: 100%; background: rgba(247, 213, 62, 0.7); color: #000; font-family: 'Share Tech Mono', monospace; font-weight: bold; font-size: 14px; letter-spacing: 2px; padding: 8px 0; z-index: 500; pointer-events: none; overflow: hidden; white-space: nowrap; }
.ticker { display: inline-block; animation: ticker 20s linear infinite; }
.ticker-item { display: inline-block; padding-right: 50px; }
@keyframes ticker { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }
#achievement-popup { position: fixed; bottom: 50px; right: -400px; background: #111; border: 2px solid #f7d53e; border-radius: 10px; padding: 15px; display: flex; align-items: center; gap: 15px; box-shadow: 0 0 20px rgba(247, 213, 62, 0.3); z-index: 9000; transition: right 0.5s cubic-bezier(0.25, 0.8, 0.25, 1); }
#achievement-popup.show { right: 20px; }
.ach-icon { font-size: 30px; }
.ach-title { font-size: 12px; color: #888; letter-spacing: 1px; }
.ach-desc { font-size: 16px; font-weight: bold; color: #f7d53e; }

/* SCROLLBAR (FALLBACK) */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: linear-gradient(to bottom, #f7d53e 0%, #f7d53e 40%, rgba(247, 213, 62, 0) 100% ); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: linear-gradient(to bottom, #ffe066 0%, #ffe066 50%, rgba(255, 224, 102, 0) 100%); }

@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }

/* BANNER STYLE */
#mobile-banner {
    display: none; /* За замовчуванням приховано */
    position: fixed; inset: 0; background: rgba(0,0,0,0.95); z-index: 20000; align-items: center; justify-content: center; text-align: center;
}
#mobile-banner.active { display: flex; } /* Показуватиметься через JS */

.banner-content { background: #111; border: 2px solid var(--primary-color); padding: 30px; max-width: 90%; border-radius: 10px; box-shadow: 0 0 30px rgba(247, 213, 62, 0.3); }
.banner-icon { font-size: 40px; margin-bottom: 15px; }
.banner-btn { margin-top: 20px; border: 1px solid var(--primary-color); padding: 10px 20px; color: var(--primary-color); font-weight: bold; display: inline-block; cursor: pointer; }

/* =========================================
   MOBILE ADAPTATION (MAX-WIDTH: 1000px)
   ========================================= */
@media (max-width: 1000px) {
    .ui-layer { padding: 15px; padding-top: 20px; }
    .header-top-row { flex-direction: column; align-items: flex-start; gap: 5px; }
    h1.glitch { font-size: 32px; letter-spacing: 1px; margin-bottom: 5px; }
    .role-subtitle { font-size: 12px; margin-bottom: 10px; }
    
    /* HIDE DECORATIONS */
    .scene-3d-mini, .cursor-dot, .cursor-circle, .footer-hint, .ticker-wrap { display: none !important; }
    .coffee-hud { top: 20px; right: 20px; transform: scale(0.8); transform-origin: top right; }
    .dlc-wrapper { bottom: 20px; left: 20px; }

    /* MENU */
    .menu-list { margin-top: 5px; }
    .menu-item { font-size: 20px; margin-bottom: 8px; }
    
    /* GALLERY RESTRUCTURE */
    .gallery-layout { flex-direction: column !important; gap: 0; }
    .gallery-sidebar { width: 100%; height: 75vh; display: flex; }
    .projects-scroll-area { height: 100%; padding-right: 5px; }

    .gallery-viewport { display: none; width: 100%; height: 75vh; margin-top: 0; }
    .viewport-frame { height: 100%; }
    
    /* NO SPACERS ON MOBILE */
    .header-spacer, .back-hint { display: none; }
    .sidebar-header-container { height: auto; margin-bottom: 10px; padding-top: 0; }
    h2 { font-size: 22px; margin-bottom: 15px; }

    /* MOBILE BUTTONS STYLE */
    .mobile-nav-btn {
        display: block !important;
        background: #222;
        color: var(--primary-color);
        text-align: center;
        padding: 12px;
        border: 1px solid var(--primary-color);
        margin-bottom: 15px;
        font-weight: bold;
        text-transform: uppercase;
        border-radius: 4px;
        font-size: 14px;
        pointer-events: auto;
    }

    /* OTHER WINDOWS (COMPACT) */
    .shop-container, .text-content, .scroll-container { 
        width: 100%; max-width: 100%; max-height: 70vh; padding: 15px; margin-bottom: 10px;
    }
    
    .settings-list { width: 100%; }
    .setting-item { font-size: 14px; }
    
    /* RESTORE CURSOR */
    * { cursor: auto !important; }
}

/* Hide buttons on desktop */
.mobile-nav-btn { display: none; }