body, html {
    margin: 0; padding: 0; width: 100vw; height: 100vh; overflow: hidden;
    background-color: #121212; 
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased; overscroll-behavior-y: none;
}

canvas { 
    display: block; cursor: crosshair; touch-action: none; 
    image-rendering: -moz-crisp-edges; image-rendering: -webkit-crisp-edges;
    image-rendering: pixelated; image-rendering: crisp-edges;
}

#splashScreen {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: #000000; 
    display: flex; justify-content: center; align-items: center;
    z-index: 10000; transition: opacity 0.8s ease-in-out, filter 0.8s ease-in-out;
    padding: 20px; box-sizing: border-box;
}
.splash-fade { opacity: 0; filter: blur(15px); pointer-events: none; }
.quote-container { max-width: 800px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 20px; }
.quote-text { font-size: 28px; color: #F5F5F7; font-weight: 500; letter-spacing: -0.5px; line-height: 1.4; margin: 0; font-family: Georgia, serif; font-style: italic; }

.apple-loader { display: flex; justify-content: center; height: 40px; align-items: center; }
.spinner { width: 22px; height: 22px; border: 3px solid rgba(255,255,255,0.15); border-top-color: #ffffff; border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.hidden-ui { opacity: 0; pointer-events: none; transition: opacity 1.5s ease; }
.show-ui { opacity: 1; pointer-events: auto; }
.hidden { display: none !important; }

/* --- COMPONENTE BAZA UI --- */
.menu-burger-btn {
    position: absolute; top: 20px; left: 20px; width: 42px; height: 42px;
    display: flex; align-items: center; justify-content: center; border-radius: 50%;
    background: rgba(30, 30, 32, 0.7); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1); color: white; cursor: pointer; z-index: 10001; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.15); transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1), background 0.2s;
}
.menu-burger-btn:hover { transform: scale(1.05); background: rgba(50, 50, 52, 0.85); }
.menu-burger-btn:active { transform: scale(0.95); }

.nav-side-menu {
    position: absolute; top: 70px; left: 20px; width: 280px; 
    background: rgba(35, 35, 38, 0.85); backdrop-filter: saturate(200%) blur(40px); -webkit-backdrop-filter: saturate(200%) blur(40px);
    border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 24px; box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    z-index: 10000; display: flex; flex-direction: column; padding: 8px;
    transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1); transform-origin: top left;
}
.nav-side-menu.hidden { opacity: 0; pointer-events: none; transform: translateY(-10px) scale(0.96); }
.side-menu-header { padding: 8px 12px; font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; color: rgba(255, 255, 255, 0.4); }
.side-menu-item { display: flex; align-items: center; gap: 12px; margin-bottom: 2px; padding: 12px 14px; color: #ffffff; text-decoration: none; font-size: 15px; font-weight: 500; border-radius: 14px; transition: background 0.2s, transform 0.1s; }
.side-menu-item svg { color: #0A84FF; opacity: 0.9; }
.side-menu-item:hover { background: rgba(255, 255, 255, 0.12); transform: scale(0.98); }

.info-floating-btn {
    position: absolute; top: 20px; right: 120px; z-index: 110; display: flex; align-items: center; justify-content: flex-start;
    background: rgba(30, 30, 32, 0.7); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
    color: white; border: 1px solid rgba(255, 255, 255, 0.1); box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    cursor: pointer; overflow: hidden; height: 42px; border-radius: 21px; width: 220px; 
    transition: all 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.info-floating-btn.corner-shrunk { width: 42px !important; justify-content: center !important; padding: 0 !important; }
.info-floating-btn.corner-shrunk:hover { transform: scale(1.05); background: rgba(50, 50, 52, 0.85); }
.info-icon-letter { font-family: Georgia, serif; font-style: italic; font-size: 20px; font-weight: bold; display: flex; align-items: center; justify-content: center; width: 42px; height: 100%; flex-shrink: 0; color: #0A84FF; }
.info-text-label { font-weight: 500; font-size: 13px; white-space: nowrap; opacity: 1; transition: opacity 0.3s ease; padding-right: 15px; color: #E5E5EA; }
.info-floating-btn.corner-shrunk .info-text-label { opacity: 0; width: 0; padding: 0; }

.nav-cart-btn {
    position: absolute; top: 20px; right: 20px; display: flex; align-items: center; gap: 10px; height: 42px; box-sizing: border-box;
    padding: 0 18px; border-radius: 999px; color: #ffffff; font-weight: 500; font-size: 15px; cursor: pointer; z-index: 100;
    background: rgba(30, 30, 32, 0.7); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1); box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1), background 0.2s, width 0.3s ease;
}
.nav-cart-btn:hover { transform: scale(1.03); background: rgba(50, 50, 52, 0.85); }
.cart-price-text { font-weight: 600; }
.top-timer-wrapper { display: flex; align-items: center; gap: 10px; }
.cart-divider { width: 1px; height: 18px; background: rgba(255, 255, 255, 0.2); border-radius: 1px; }
.top-timer-text { color: #ff453a; font-variant-numeric: tabular-nums; font-weight: 700; font-size: 14px; }

.nav-dropdown {
    position: absolute; top: 75px; right: 20px; width: 300px; 
    background: rgba(30, 30, 32, 0.85); backdrop-filter: saturate(200%) blur(40px); -webkit-backdrop-filter: saturate(200%) blur(40px);
    border: 1px solid rgba(255, 255, 255, 0.1); box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    border-radius: 24px; color: white; z-index: 9997; display: flex; flex-direction: column; overflow: hidden;
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.nav-dropdown.hidden { opacity: 0; pointer-events: none; transform: translateY(-10px) scale(0.96); }
.dropdown-header { padding: 16px 20px; font-weight: 600; font-size: 16px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); letter-spacing: -0.3px;}
.cart-scroll-area { max-height: 300px; overflow-y: auto; padding: 10px 20px; }
.cart-scroll-area::-webkit-scrollbar { width: 6px; }
.cart-scroll-area::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 3px; }
.cart-item { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; font-size: 14px; border-bottom: 1px solid rgba(255,255,255,0.05); }
.cart-item:last-child { border-bottom: none; }
.cart-color-box { width: 16px; height: 16px; border-radius: 4px; border: 1px solid rgba(255,255,255,0.2); margin-right: 12px; display: inline-block; vertical-align: middle; }
.dropdown-footer { padding: 16px 20px; background: rgba(0, 0, 0, 0.15); border-top: 1px solid rgba(255, 255, 255, 0.08); }
.cart-total { font-size: 15px; font-weight: 600; text-align: right; margin-bottom: 15px; color: rgba(235, 235, 245, 0.8);}
.ui-pay-btn { width: 100%; padding: 14px; background: #0A84FF; color: white; border: none; border-radius: 14px; font-weight: 600; font-size: 15px; cursor: pointer; transition: background 0.2s, transform 0.1s; letter-spacing: -0.2px;}
.ui-pay-btn:hover { background: #0077ed; }

/* --- BARA JOS (DOCK) --- */
.dock-palette {
    position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; 
    gap: 12px; padding: 10px 14px; border-radius: 28px; z-index: 100; 
    background: rgba(30, 30, 32, 0.7); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1); box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2); 
    transition: opacity 0.3s; flex-wrap: nowrap; overflow-x: auto;
}
.dock-palette::-webkit-scrollbar { display: none; }
.dock-palette.hidden { opacity: 0; pointer-events: none; }
.dock-action-btn {
    display: flex; align-items: center; justify-content: center; gap: 6px; border: none; color: #ffffff;
    font-family: inherit; font-size: 14px; font-weight: 600; padding: 10px 18px; border-radius: 18px; cursor: pointer;
    transition: background 0.2s ease, transform 0.15s cubic-bezier(0.2, 0.8, 0.2, 1); white-space: nowrap; flex-shrink: 0; letter-spacing: -0.2px;
}
.allocate-action-btn { background: #30D158; color: white; } 
.allocate-action-btn:hover { background: #2fb350; }
.upload-action-btn { background: #0A84FF; color: white; } 
.upload-action-btn:hover { background: #0062c3; }
.clear-action-btn { background: rgba(255, 69, 58, 0.15); color: #FF453A !important; }
.clear-action-btn:hover { background: rgba(255, 69, 58, 0.25); }
.palette-divider { width: 1px; height: 28px; background: rgba(255, 255, 255, 0.15); border-radius: 1px; margin: 0 4px; flex-shrink: 0; }

/* =======================================================
   NOUL POPUP SELECTIE ZONA (Contrast Premium & Fluiditate)
======================================================= */
.global-upload-popup {
    position: absolute; bottom: 100px; left: 50%;
    transform: translate(-50%, 20px) scale(0.97); 
    background: rgba(20, 20, 22, 0.9); 
    backdrop-filter: blur(25px) saturate(180%); -webkit-backdrop-filter: blur(25px) saturate(180%);
    border: 1px solid rgba(255,255,255,0.2); 
    box-shadow: 0 15px 35px rgba(0,0,0,0.4), inset 0 1px 1px rgba(255,255,255,0.1); 
    border-radius: 28px; opacity: 0; pointer-events: none;
    transition: opacity 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1); 
    z-index: 1000; display: flex; flex-direction: column; gap: 18px; padding: 25px; width: 320px; box-sizing: border-box;
}
.global-upload-popup.show { transform: translate(-50%, 0) scale(1); opacity: 1; pointer-events: auto; }

.modal-close-btn-red {
    position: absolute; top: 16px; right: 16px; 
    width: 26px; height: 26px;
    background: rgba(255, 255, 255, 0.1); color: #8E8E93; border: none; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1); z-index: 10;
}
.modal-close-btn-red:hover { background: rgba(255, 255, 255, 0.2); color: #FFF; transform: scale(1.05); }
.modal-close-btn-red:active { transform: scale(0.95); }

.popup-title { color: #FFFFFF; font-size: 18px; font-weight: 700; margin-bottom: 0; text-align: center; letter-spacing: -0.3px; }

.slider-group { display: flex; flex-direction: column; gap: 10px; }
.slider-header { display: flex; justify-content: space-between; align-items: center; }
.slider-header label { color: rgba(255, 255, 255, 0.8); font-size: 14px; font-weight: 500; }
.slider-value { color: white; font-size: 13px; font-weight: 600; background: rgba(255,255,255,0.15); padding: 4px 10px; border-radius: 8px; }
.ui-slider { -webkit-appearance: none; width: 100%; height: 6px; background: rgba(255,255,255,0.2); border-radius: 3px; outline: none; transition: background 0.2s; }
.ui-slider::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 22px; height: 22px; border-radius: 50%; background: #30D158; cursor: pointer; box-shadow: 0 2px 5px rgba(0,0,0,0.3); border: 2px solid #FFF; }

.popup-link-group { width: 100%; display: flex; flex-direction: column; gap: 10px; margin-top: 5px; border-top: 1px solid rgba(255,255,255,0.1); padding-top: 20px;}
.ui-text-input { 
    width: 100%; box-sizing: border-box; background: rgba(0, 0, 0, 0.4); border: 1px solid rgba(255,255,255,0.25); 
    color: #FFFFFF; padding: 14px 16px; border-radius: 12px; font-size: 14px; outline: none; transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1); font-family: inherit;
}
.ui-text-input::placeholder { color: rgba(255,255,255,0.5); }
.ui-text-input:focus { border-color: #30D158; background: rgba(0,0,0,0.6); box-shadow: 0 0 0 3px rgba(48, 209, 88, 0.2);}
.info-mini-icon { display: inline-flex; justify-content: center; align-items: center; width: 20px; height: 20px; background: rgba(10, 132, 255, 0.15); color: #0A84FF; font-family: Georgia, serif; font-style: italic; font-size: 12px; font-weight: bold; border-radius: 50%; cursor: pointer; transition: background 0.2s; }

.popup-actions-row { display: flex; gap: 8px; margin-top: 5px; }
.ui-confirm-btn { padding: 15px; border-radius: 14px; font-weight: 600; font-size: 16px; cursor: pointer; transition: background 0.2s, transform 0.1s; border: none; font-family: inherit; letter-spacing: -0.2px;}
.manual-btn { background: #30D158; color: white; box-shadow: 0 4px 15px rgba(48, 209, 88, 0.25); }
.manual-btn:hover { background: #2fb350; transform: translateY(-1px);}

/* --- MANUAl PLACEMENT UI --- */
.manual-placement-ui {
    position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%);
    background: rgba(30, 30, 32, 0.8); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
    padding: 15px 20px; border-radius: 24px; border: 1px solid rgba(255,255,255,0.1); display: flex; flex-direction: column; align-items: center; gap: 12px; z-index: 1000; box-shadow: 0 15px 35px rgba(0,0,0,0.2);
    transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.manual-placement-ui.hidden { opacity: 0; pointer-events: none; transform: translateX(-50%) translateY(20px); }
.manual-placement-message { color: white; font-size: 14px; font-weight: 500; text-align: center; }
.manual-placement-actions { display: flex; gap: 10px; width: 100%; justify-content: center;}
.cancel-btn { background: rgba(255, 69, 58, 0.15); color: #FF453A; }
.confirm-btn { background: #30D158; color: white; }
.confirm-btn-disabled { background: rgba(255,255,255,0.05) !important; color: rgba(255,255,255,0.3) !important; pointer-events: none; box-shadow: none; }

/* --- TUTORIAL MODAL --- */
.checkout-modal {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    display: flex; justify-content: center; align-items: center; z-index: 9999; transition: opacity 0.3s ease;
}
.checkout-modal.hidden { opacity: 0; pointer-events: none; }
.checkout-content {
    background: rgba(30, 30, 32, 0.85); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
    border: 1px solid rgba(255,255,255,0.15); border-radius: 24px; padding: 30px; width: 90%; max-width: 400px; position: relative;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3); transform: translateY(0) scale(1); transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.checkout-modal.hidden .checkout-content { transform: translateY(20px) scale(0.96); }
.checkout-content h2 { margin: 0 0 15px 0; color: white; font-size: 20px; text-align: center; letter-spacing: -0.3px;}
.tutorial-content { max-width: 450px; padding: 40px 25px 25px 25px; }
.tutorial-steps { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; max-height: 60vh; overflow-y: auto; padding-right: 5px; }
.tutorial-steps::-webkit-scrollbar { width: 4px; }
.tutorial-steps::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 2px; }
.step-item { background: rgba(255,255,255,0.05); padding: 16px; border-radius: 16px; border: 1px solid rgba(255,255,255,0.05); color: rgba(235, 235, 245, 0.8); font-size: 14px; line-height: 1.5; }
.step-item strong { display: block; color: #0A84FF; font-size: 14px; margin-bottom: 4px; font-weight: 600; }

/* =======================================================
   ANNOUNCEMENT MODAL (Noul Sistem de Anunțuri)
======================================================= */
.announcement-overlay { 
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; 
    background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); 
    display: flex; justify-content: center; align-items: center; z-index: 10005; 
    opacity: 0; pointer-events: none; transition: opacity 0.4s ease; 
}
.announcement-overlay.show { opacity: 1; pointer-events: auto; }
.announcement-modal { 
    background: rgba(30, 30, 32, 0.85); backdrop-filter: blur(40px) saturate(200%); -webkit-backdrop-filter: blur(40px) saturate(200%); 
    border: 1px solid rgba(255, 255, 255, 0.15); border-radius: 28px; width: 90%; max-width: 420px; overflow: hidden; 
    box-shadow: 0 30px 60px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.1); 
    transform: translateY(30px) scale(0.95); transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1); position: relative; 
}
.announcement-overlay.show .announcement-modal { transform: translateY(0) scale(1); }
.ann-img-wrapper { width: 100%; height: 220px; background: #000; position: relative; overflow: hidden; }
.ann-img { width: 100%; height: 100%; object-fit: cover; opacity: 0.9;}
.ann-close-btn { 
    position: absolute; top: 16px; right: 16px; width: 32px; height: 32px; 
    background: rgba(0,0,0,0.5); backdrop-filter: blur(10px); border-radius: 50%; 
    display: flex; align-items: center; justify-content: center; color: #FFF; border: none; 
    cursor: pointer; transition: 0.2s; z-index: 10; font-size: 14px;
}
.ann-close-btn:hover { background: rgba(0,0,0,0.8); transform: scale(1.05); }
.ann-content { padding: 30px 25px 25px 25px; text-align: center; }
.ann-title { color: #FFF; font-size: 24px; font-weight: 700; margin: 0 0 12px 0; letter-spacing: -0.5px; }
.ann-text { color: rgba(235, 235, 245, 0.7); font-size: 15px; line-height: 1.5; margin: 0 0 25px 0; }
.ann-action-btn { 
    width: 100%; background: #0A84FF; color: #FFF; border: none; padding: 16px; 
    border-radius: 16px; font-size: 16px; font-weight: 600; cursor: pointer; 
    transition: 0.2s; box-shadow: 0 10px 20px rgba(10,132,255,0.25); 
}
.ann-action-btn:hover { background: #0077ed; transform: translateY(-2px); }


/* =======================================================
   RESPONSIVE DESIGN (MOBILE) 
======================================================= */
@media (max-width: 768px) {
    .quote-text { font-size: 20px; padding: 0 15px; }
    .nav-cart-btn { top: 15px; right: 15px; padding: 0 14px; font-size: 14px; height: 38px; z-index: 9999; }
    .nav-dropdown { width: calc(100vw - 30px); right: 15px; top: 65px; z-index: 9998; }
    
    .menu-burger-btn { top: 15px; left: 15px; width: 38px; height: 38px; z-index: 10001; }
    .nav-side-menu { top: 60px; left: 15px; width: calc(100vw - 30px); max-width: 280px; z-index: 10000; }
    
    .info-floating-btn { top: 15px; height: 38px; }
    .info-floating-btn.corner-shrunk { width: 38px !important; }
    
    /* Bara de jos pe un rând */
    .dock-palette { 
        width: auto; 
        max-width: 95vw; 
        padding: 8px 10px; 
        gap: 6px; 
        bottom: 15px; 
        justify-content: center; 
        flex-wrap: nowrap !important; 
        border-radius: 20px; 
        box-sizing: border-box;
    }
    
    .dock-action-btn { 
        padding: 8px 10px; 
        font-size: 12px; 
        flex-shrink: 1; 
        min-width: 0; 
        gap: 4px; 
    }
    
    @media (max-width: 360px) {
        .dock-action-btn span { display: none; }
        .dock-action-btn { padding: 10px; }
    }

    .palette-divider { margin: 0 2px; }
    
    /* POPUP SELECTIE ZONA PE MOBIL (Bottom Sheet style) */
    .global-upload-popup { 
        top: auto !important; left: 0 !important; bottom: 0 !important; 
        transform: translateY(100%) scale(1) !important; 
        width: 100vw; max-width: 100vw; 
        border-radius: 32px 32px 0 0; padding: 25px 20px 40px 20px; 
        border-bottom: none; border-left: none; border-right: none;
        background: rgba(25, 25, 27, 0.95); 
        box-shadow: 0 -10px 40px rgba(0,0,0,0.25);
    }
    .global-upload-popup.show { transform: translateY(0) scale(1) !important; opacity: 1; }
    
    .manual-placement-ui { bottom: 20px; width: 85vw; }
}