* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #0d0d1a;
    font-family: 'VT323', monospace;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

.font-pixel {
    font-family: 'Press Start 2P', cursive;
}

.font-lcd {
    font-family: 'VT323', monospace;
}

/* CRT Scanline Overlay */
.crt-overlay {
    pointer-events: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.03) 2px,
        rgba(0, 0, 0, 0.03) 4px
    );
}

/* Vignette Effect */
.vignette {
    pointer-events: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9998;
    background: radial-gradient(ellipse at center, transparent 60%, rgba(0, 0, 0, 0.6) 100%);
}

/* Pixel grid background */
.pixel-grid {
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 16px 16px;
}

/* Neon glow animations */
@keyframes pulse-cyan {
    0%, 100% { box-shadow: 0 0 5px #00f0ff, 0 0 10px #00f0ff, 0 0 20px #00f0ff; }
    50% { box-shadow: 0 0 10px #00f0ff, 0 0 20px #00f0ff, 0 0 40px #00f0ff; }
}

@keyframes pulse-green {
    0%, 100% { box-shadow: 0 0 3px #00ff66, 0 0 6px #00ff66; }
    50% { box-shadow: 0 0 6px #00ff66, 0 0 12px #00ff66, 0 0 20px #00ff66; }
}

@keyframes shimmer {
    0% { opacity: 0.8; }
    50% { opacity: 1; }
    100% { opacity: 0.8; }
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-5px); }
}

@keyframes glitch {
    0% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); }
    40% { transform: translate(-2px, -2px); }
    60% { transform: translate(2px, 2px); }
    80% { transform: translate(2px, -2px); }
    100% { transform: translate(0); }
}

@keyframes confetti-fall {
    0% { transform: translateY(-10px) rotate(0deg); opacity: 1; }
    100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

@keyframes title-glow {
    0%, 100% { text-shadow: 0 0 10px #00f0ff, 0 0 20px #00f0ff, 0 0 40px #00f0ff; }
    50% { text-shadow: 0 0 5px #00f0ff, 0 0 10px #00f0ff, 0 0 20px #00f0ff; }
}

@keyframes lock-sparkle {
    0% { opacity: 0; transform: scale(0.5); }
    50% { opacity: 1; transform: scale(1.2); }
    100% { opacity: 0; transform: scale(0.5); }
}

@keyframes star-drift {
    0% { transform: translateY(0) translateX(0); opacity: 0.3; }
    50% { opacity: 0.8; }
    100% { transform: translateY(-100vh) translateX(20px); opacity: 0.3; }
}

.animate-pulse-cyan {
    animation: pulse-cyan 1.5s ease-in-out infinite;
}

.animate-pulse-green {
    animation: pulse-green 2s ease-in-out infinite;
}

.animate-shimmer {
    animation: shimmer 2s ease-in-out infinite;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

.animate-glitch {
    animation: glitch 0.3s ease-in-out;
}

.animate-title-glow {
    animation: title-glow 3s ease-in-out infinite;
}

/* Tile styles */
.tile {
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease;
    cursor: pointer;
    image-rendering: pixelated;
}

.tile:hover {
    z-index: 10;
}

.tile-selected {
    animation: pulse-cyan 1.5s ease-in-out infinite;
    z-index: 20;
}

.tile-correct {
    filter: brightness(1.1) saturate(1.2);
    box-shadow: 0 0 4px #00ff66, inset 0 0 2px rgba(0, 255, 102, 0.3);
}

/* Star particles */
.star-particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: #ffffff;
    border-radius: 0;
    animation: star-drift linear infinite;
}

/* Confetti particle */
.confetti {
    position: fixed;
    width: 8px;
    height: 8px;
    animation: confetti-fall linear forwards;
}

/* Button styles */
.retro-btn {
    font-family: 'Press Start 2P', cursive;
    text-transform: uppercase;
    border: 2px solid;
    padding: 12px 20px;
    cursor: pointer;
    transition: all 0.15s ease;
    background: #2a2a3e;
    position: relative;
    overflow: hidden;
}

.retro-btn:hover {
    transform: translateY(-1px);
}

.retro-btn:active {
    transform: translateY(1px);
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #1a1a2e;
}

::-webkit-scrollbar-thumb {
    background: #333355;
    border: 1px solid #00f0ff;
}

/* Loading bar */
.loading-bar {
    background: #1a1a2e;
    border: 1px solid #00f0ff;
    height: 20px;
    position: relative;
    overflow: hidden;
}

.loading-bar-fill {
    background: linear-gradient(90deg, #00f0ff, #00ff66);
    height: 100%;
    transition: width 0.3s ease;
}

/* Arcade cabinet frame for desktop */
@media (min-width: 900px) {
    .arcade-frame {
        border-left: 8px solid #1a1a2e;
        border-right: 8px solid #1a1a2e;
        box-shadow: 
            inset 4px 0 0 #2a2a3e,
            inset -4px 0 0 #2a2a3e,
            -8px 0 20px rgba(0, 240, 255, 0.05),
            8px 0 20px rgba(0, 240, 255, 0.05);
    }
}