@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@500;700;900&display=swap');

body {
    background-color: #020617;
    color: #e2e8f0;
    font-family: 'Rajdhani', sans-serif;
    overflow: hidden;
    touch-action: none;
    user-select: none;
    margin: 0;
}

/* Background */
.stars { position: fixed; inset: 0; z-index: -1; background: radial-gradient(circle at center, #0f172a 0%, #000000 100%); }

/* UI */
.glass-panel {
    background: rgba(11, 17, 32, 0.85); /* Darker blue */
    border: 1px solid rgba(56, 189, 248, 0.2); /* Light blue border */
    backdrop-filter: blur(12px);
    border-radius: 12px;
    box-shadow: 0 4px 30px rgba(0,0,0,0.8), inset 0 0 20px rgba(56, 189, 248, 0.05);
}

.btn-tool {
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    border: 1px solid rgba(255,255,255,0.05);
}
.btn-tool:active { transform: scale(0.95); }
.btn-tool.selected {
    background: rgba(6, 182, 212, 0.15);
    border-color: #22d3ee;
    box-shadow: 0 0 15px rgba(34, 211, 238, 0.3);
}

/* Canvas Crispness */
canvas { image-rendering: pixelated; }
.no-scrollbar::-webkit-scrollbar { display: none; }

/* Animations */
@keyframes floatUp { 
    0% { opacity:1; transform:translateY(0) scale(1); } 
    100% { opacity:0; transform:translateY(-50px) scale(1.2); } 
}
.float-anim { animation: floatUp 0.6s ease-out forwards; }
.hidden { display: none !important; }
.safe-area-top { padding-top: env(safe-area-inset-top); }
.safe-area-bottom { padding-bottom: env(safe-area-inset-bottom); }

/* FORCE MODAL STYLES */
.modal-overlay {
    position: fixed !important; /* Фіксуємо на екрані */
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.85);
    z-index: 9999 !important; /* Поверх ВСЬОГО */
    display: flex !important; /* Завжди flex, якщо немає класу hidden */
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

/* Цей клас має вищий пріоритет */
.modal-overlay.hidden {
    display: none !important;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-fade-in {
    animation: fadeIn 0.2s ease-out;
}
button {
    touch-action: manipulation; /* Прибирає затримку кліку */
}