/* Custom Scrollbar Styles */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Glass Panel Effect - Cyberpunk */
.glass-panel {
    background: rgba(30, 15, 61, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(176, 38, 255, 0.2);
    box-shadow: 0 0 20px rgba(176, 38, 255, 0.1);
}

/* Neon Shadow Effect - Cyberpunk */
.neon-shadow {
    box-shadow: 0 0 15px rgba(0, 217, 255, 0.3), 0 0 30px rgba(176, 38, 255, 0.2);
}

/* Cyberpunk Neon Glow */
.neon-glow {
    animation: neon-pulse 2s ease-in-out infinite;
}

@keyframes neon-pulse {

    0%,
    100% {
        box-shadow: 0 0 10px rgba(0, 217, 255, 0.5), 0 0 20px rgba(176, 38, 255, 0.3);
    }

    50% {
        box-shadow: 0 0 20px rgba(0, 217, 255, 0.8), 0 0 40px rgba(176, 38, 255, 0.5);
    }
}

/* Neon Tubes Background - Panel Borders */
.neon-tubes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.neon-tubes::before,
.neon-tubes::after {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: min(448px, 100%);
    height: 2px;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(0, 217, 255, 0.6) 20%,
            rgba(176, 38, 255, 0.6) 50%,
            rgba(0, 217, 255, 0.6) 80%,
            transparent 100%);
    box-shadow:
        0 0 10px rgba(0, 217, 255, 0.5),
        0 0 20px rgba(176, 38, 255, 0.3);
    animation: neon-border-pulse 3s ease-in-out infinite;
}

.neon-tubes::before {
    top: 0;
    animation-delay: 0s;
}

.neon-tubes::after {
    bottom: 96px;
    animation-delay: 1.5s;
}

@keyframes neon-border-pulse {

    0%,
    100% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }
}

/* Speed Lines Effect */
.speed-lines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    background:
        linear-gradient(90deg, transparent 0%, rgba(0, 217, 255, 0.05) 50%, transparent 100%),
        linear-gradient(180deg, transparent 0%, rgba(176, 38, 255, 0.05) 50%, transparent 100%);
    background-size: 200% 200%;
    animation: speed-move 3s linear infinite;
}

@keyframes speed-move {
    0% {
        background-position: 0% 0%;
    }

    100% {
        background-position: 100% 100%;
    }
}

/* Cyberpunk Grid Background */
.cyber-grid {
    background-color: #0a0015;
    background-image:
        linear-gradient(rgba(0, 217, 255, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(176, 38, 255, 0.1) 1px, transparent 1px);
    background-size: 30px 30px;
    animation: grid-pulse 4s ease-in-out infinite;
}

@keyframes grid-pulse {

    0%,
    100% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }
}

/* Float Animation */
.animate-float {
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-5px);
    }

    100% {
        transform: translateY(0px);
    }
}

/* Rack Background Pattern - Cyberpunk */
.rack-bg {
    background-color: #1a0b2e;
    background-image:
        linear-gradient(rgba(0, 217, 255, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(176, 38, 255, 0.08) 1px, transparent 1px);
    background-size: 20px 20px;
}

/* Global Scrollbar & Resets */
html,
body {
    overflow-x: hidden !important;
    width: 100%;
    margin: 0;
    padding: 0;
    position: relative;
    touch-action: manipulation;
}

/* Ensure minimum height and no double vertical scroll */
body {
    min-height: 100dvh;
}

.page-section {
    width: 100%;
    max-width: 448px;
    /* max-w-md */
    margin: 0 auto;
    overflow-x: hidden;
}

/* Smooth transitions for interactive elements */
button {
    transition: all 0.2s ease-in-out;
}

button:active {
    transform: scale(0.95);
}

/* Pulse animation for status indicators */
@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}


/* Hover effects for cards */
.group:hover .group-hover\:opacity-20 {
    opacity: 0.2;
}

/* Loading Screen - Cyberpunk */
#loading-screen {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #0a0015 0%, #1a0b2e 50%, #0a0015 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.3s ease-out;
}

#loading-screen.fade-out {
    opacity: 0;
    pointer-events: none;
}

/* Hide material icons until font loads */
.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* Prevent icon text flash */
body:not(.fonts-loaded) .material-symbols-outlined {
    visibility: hidden;
}

body.fonts-loaded .material-symbols-outlined {
    visibility: visible;
}

/* Page transition */
body {
    opacity: 0;
    transition: opacity 0.2s ease-in;
}

body.page-loaded {
    opacity: 1;
}

/* Cyberpunk Glass Effect */
.glass-effect {
    background: rgba(30, 15, 61, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 217, 255, 0.2);
    box-shadow: 0 0 30px rgba(176, 38, 255, 0.2);
}

/* --------------------------------------------------------------------------------------- */
/* BOX OPENING ANIMATIONS */
/* --------------------------------------------------------------------------------------- */

@keyframes shake-hard {
    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 flash-burst {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }

    50% {
        opacity: 1;
        transform: scale(2);
        background: white;
    }

    100% {
        opacity: 0;
        transform: scale(3);
    }
}

@keyframes pop-in-bounce {
    0% {
        opacity: 0;
        transform: scale(0.3) translateY(50px);
    }

    50% {
        opacity: 1;
        transform: scale(1.1) translateY(-10px);
    }

    70% {
        transform: scale(0.95) translateY(5px);
    }

    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes god-rays {
    0% {
        transform: rotate(0deg);
        opacity: 0.5;
    }

    50% {
        opacity: 0.8;
    }

    100% {
        transform: rotate(360deg);
        opacity: 0.5;
    }
}

.box-shake {
    animation: shake-hard 0.5s cubic-bezier(.36, .07, .19, .97) infinite;
}

.animate-pop-in {
    animation: pop-in-bounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.flash-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: white;
    opacity: 0;
    z-index: 100;
}

.animate-flash {
    animation: flash-burst 0.5s ease-out forwards;
}

.god-rays-bg {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200%;
    height: 200%;
    transform: translate(-50%, -50%);
    background: conic-gradient(from 0deg,
            transparent 0%,
            rgba(255, 215, 0, 0.1) 10%,
            transparent 20%,
            rgba(255, 215, 0, 0.1) 30%,
            transparent 40%,
            rgba(255, 215, 0, 0.1) 50%,
            transparent 60%,
            rgba(255, 215, 0, 0.1) 70%,
            transparent 80%,
            rgba(255, 215, 0, 0.1) 90%,
            transparent 100%);
    z-index: 0;
    pointer-events: none;
    animation: god-rays 10s linear infinite;
}

/* --------------------------------------------------------------------------------------- */
/* MODAL SYSTEM (Restored) */
/* --------------------------------------------------------------------------------------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: #1e0f3d;
    /* card-dark */
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
    border-radius: 1rem;
    width: 90%;
    max-width: 448px;
    max-height: 90vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    animation: modal-pop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modal-pop {
    0% {
        transform: scale(0.9) translateY(20px);
        opacity: 0;
    }

    100% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(0, 0, 0, 0.2);
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.5);
    transition: all 0.2s;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.modal-title {
    font-weight: 800;
    font-size: 1.125rem;
    color: white;
}

/* --------------------------------------------------------------------------------------- */
/* SPRITE ANIMATIONS - REMOVED (Replaced by JS Image Swap) */
/* --------------------------------------------------------------------------------------- */
/* Previously contained .sprite-box definitions. 
   Now handled by changing img src in shop_v15.js */