/* Main Retro Styling */

/* CSS Reset and Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    line-height: 1.5;
}

body {
    font-family: 'Press Start 2P', monospace;
    color: #ffffff;
    overflow-x: hidden;
    user-select: none;
    cursor: crosshair;
}

/* Retro Background Gradient */
.bg-retro-gradient {
    background: linear-gradient(180deg, 
        #1a0a2e 0%,    /* Dark purple */
        #16213e 25%,   /* Charcoal purple */
        #0f3460 50%,   /* Deep blue-purple */
        #16213e 75%,   /* Charcoal purple */
        #1a0a2e 100%   /* Dark purple */
    );
    background-size: 100% 100%;
    animation: gradientShift 20s ease-in-out infinite alternate;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    100% { background-position: 100% 50%; }
}

/* Pixel Perfect Layout */
.pixel-perfect {
    image-rendering: -moz-crisp-edges;
    image-rendering: -webkit-crisp-edges;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

/* Starfield Container */
.starfield-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

/* SVG Star Fallback */
.starfield-fallback {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.6;
}

/* Scan Lines Effect */
.scanlines-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        transparent 50%,
        rgba(0, 0, 0, 0.1) 50%
    );
    background-size: 100% 4px;
    animation: scanlines 0.1s linear infinite;
    pointer-events: none;
    z-index: 5;
}

@keyframes scanlines {
    0% { transform: translateY(0); }
    100% { transform: translateY(4px); }
}

/* CRT Monitor Flicker Effect */
.bg-retro-gradient::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.02);
    animation: flicker 0.15s infinite linear;
    pointer-events: none;
    z-index: 2;
}

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

/* Logo Styling */
.logo-text {
    font-family: "Jersey 10", sans-serif;
    color: #ffffff;
    text-shadow: 
        0 0 5px #a855f7,
        0 0 10px #a855f7,
        0 0 20px #a855f7,
        0 0 40px #a855f7,
        2px 2px 4px rgba(0, 0, 0, 0.8),
        4px 4px 8px rgba(168, 85, 247, 0.6),
        6px 6px 12px rgba(139, 92, 246, 0.4);
    animation: logoGlow 3s ease-in-out infinite alternate;
    margin-bottom: 2rem;
    text-transform: none;
    letter-spacing: 4px;
    font-weight: normal;
    filter: drop-shadow(0 0 10px #a855f7) 
            drop-shadow(0 0 20px #a855f7)
            drop-shadow(0 0 30px #8b5cf6);
}

@media (max-width: 768px) {
    .logo-text {
        letter-spacing: 3px;
        margin-bottom: 1.5rem;
    }
}

@media (max-width: 480px) {
    .logo-text {
        letter-spacing: 2px;
        margin-bottom: 1rem;
    }
}

@keyframes logoGlow {
    0% {
        text-shadow: 
            0 0 5px #a855f7,
            0 0 10px #a855f7,
            0 0 15px #a855f7,
            2px 2px 4px rgba(0, 0, 0, 0.8);
    }
    100% {
        text-shadow: 
            0 0 8px #a855f7,
            0 0 16px #a855f7,
            0 0 24px #a855f7,
            2px 2px 4px rgba(0, 0, 0, 0.8);
    }
}

/* Subtitle Styling */
.subtitle-text {
    font-size: clamp(0.7rem, 2.5vw, 1rem);
    color: #d1d5db;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
    margin-bottom: 3rem;
    max-width: 600px;
    line-height: 1.8;
}

/* Pixel Buttons */
.pixel-button {
    font-family: 'Press Start 2P', monospace;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 3px solid;
    position: relative;
    overflow: hidden;
    transform: translateY(0);
    transition: all 0.15s ease;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.pixel-button:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 0 10px rgba(168, 85, 247, 0.6),
        0 4px 8px rgba(0, 0, 0, 0.3);
}

.pixel-button:active {
    transform: translateY(0);
    box-shadow: 
        0 0 5px rgba(168, 85, 247, 0.4),
        0 2px 4px rgba(0, 0, 0, 0.3);
}

.pixel-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: left 0.5s;
}

.pixel-button:hover::before {
    left: 100%;
}

/* Loading Animation */
.loading-dots {
    background: rgba(0, 0, 0, 0.3);
    padding: 0.5rem;
    border: 2px solid #a855f7;
    border-radius: 4px;
    backdrop-filter: blur(4px);
}

.loading-dot {
    border-radius: 50%;
    animation: dotPulse 1.4s ease-in-out infinite both;
}

.loading-dot:nth-child(1) { animation-delay: -0.32s; }
.loading-dot:nth-child(2) { animation-delay: -0.16s; }
.loading-dot:nth-child(3) { animation-delay: 0s; }

@keyframes dotPulse {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .logo-text {
        font-size: clamp(1.2rem, 10vw, 2.5rem);
        margin-bottom: 1.5rem;
    }
    
    .subtitle-text {
        font-size: clamp(0.6rem, 3vw, 0.9rem);
        margin-bottom: 2rem;
        padding: 0 1rem;
    }
    
    .pixel-button {
        font-size: 0.7rem;
        padding: 0.6rem 1.5rem;
    }
    
    .button-group {
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .logo-text {
        font-size: clamp(1rem, 8vw, 2rem);
        line-height: 1.4;
    }
    
    .pixel-button {
        font-size: 0.6rem;
        padding: 0.5rem 1rem;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .bg-retro-gradient,
    .scanlines-overlay,
    .bg-retro-gradient::before,
    .logo-text,
    .pixel-button,
    .loading-dot {
        animation: none !important;
    }
    
    .starfield-container {
        display: none;
    }
    
    .starfield-fallback {
        opacity: 0.8;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .bg-retro-gradient {
        background: #000000;
    }
    
    .logo-text {
        color: #ffffff;
        text-shadow: none;
    }
    
    .subtitle-text {
        color: #ffffff;
    }
}

/* Print styles */
@media print {
    .scanlines-overlay,
    .starfield-container,
    .loading-container {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .logo-text,
    .subtitle-text {
        text-shadow: none !important;
        color: black !important;
    }
}