:root {
    /* Neon Colors */
    --neon-cyan: #00ffff;
    --neon-magenta: #ff00ff;
    --neon-yellow: #ffff00;
    --neon-green: #39ff14;
    --neon-blue: #0080ff;
    --neon-pink: #ff006e;
    
    /* Background Colors */
    --bg-dark: #0a0e27;
    --bg-darker: #050814;
    --bg-card: rgba(15, 23, 42, 0.8);
    
    /* Text Colors */
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --text-neon: var(--neon-cyan);
    
    /* Fonts */
    --font-display: 'Orbitron', sans-serif;
    --font-body: 'Rajdhani', sans-serif;
    
    /* Effects */
    --glow-cyan: 0 0 10px var(--neon-cyan),
                 0 0 20px var(--neon-cyan),
                 0 0 30px var(--neon-cyan),
                 0 0 40px var(--neon-cyan);
    
    --glow-magenta: 0 0 10px var(--neon-magenta),
                    0 0 20px var(--neon-magenta),
                    0 0 30px var(--neon-magenta);
    
    --glow-green: 0 0 10px var(--neon-green),
                  0 0 20px var(--neon-green);
}

/* RESET & BASE */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background: var(--bg-darker);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* RETRO EFFECTS */
.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.15) 0px,
        rgba(0, 0, 0, 0.15) 1px,
        transparent 1px,
        transparent 2px
    );
    animation: scanline 8s linear infinite;
}

.vignette {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9998;
    box-shadow: inset 0 0 200px rgba(0, 0, 0, 0.8);
}

@keyframes scanline {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(10px);
    }
}

/* CONTAINER */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
    position: relative;
    z-index: 1;
}

/* HEADER */
.game-header {
    text-align: center;
    margin-bottom: 40px;
}

.game-title {
    font-family: var(--font-display);
    font-size: 4rem;
    font-weight: 900;
    letter-spacing: 0.2em;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.title-glow {
    color: var(--neon-cyan);
    text-shadow: var(--glow-cyan);
    animation: pulse-glow 2s ease-in-out infinite;
}

.title-separator {
    color: var(--neon-magenta);
    text-shadow: var(--glow-magenta);
    font-size: 3rem;
}

.game-subtitle {
    font-family: var(--font-display);
    font-size: 1rem;
    letter-spacing: 0.3em;
    color: var(--text-secondary);
    text-transform: uppercase;
}

@keyframes pulse-glow {
    0%, 100% {
        text-shadow: var(--glow-cyan);
    }
    50% {
        text-shadow: 0 0 15px var(--neon-cyan),
                     0 0 25px var(--neon-cyan),
                     0 0 35px var(--neon-cyan),
                     0 0 50px var(--neon-cyan);
    }
}

/* STATS CONTAINER */
.stats-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

.stat-box {
    background: var(--bg-card);
    border: 2px solid var(--neon-cyan);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

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

.stat-box:hover::before {
    left: 100%;
}

.stat-box.highlight {
    border-color: var(--neon-magenta);
    box-shadow: 0 0 20px rgba(255, 0, 255, 0.3);
}

.stat-label {
    font-family: var(--font-display);
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.stat-value {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--neon-cyan);
    text-shadow: var(--glow-cyan);
}

.stat-box.highlight .stat-value {
    color: var(--neon-magenta);
    text-shadow: var(--glow-magenta);
}

/* GAME CONTAINER */
.game-container {
    position: relative;
    max-width: 800px;
    margin: 0 auto 40px;
    background: var(--bg-dark);
    border: 3px solid var(--neon-cyan);
    border-radius: 15px;
    padding: 10px;
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.3),
                inset 0 0 30px rgba(0, 0, 0, 0.5);
}

#gameCanvas {
    display: block;
    width: 100%;
    height: auto;
    background: var(--bg-darker);
    border-radius: 8px;
}

/* GAME OVERLAYS */
.game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 8, 20, 0.95);
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: 15px;
    z-index: 10;
    backdrop-filter: blur(10px);
}

.game-overlay.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.overlay-content {
    text-align: center;
    padding: 40px;
    max-width: 500px;
}

.overlay-icon {
    font-size: 5rem;
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
}

.gameover-icon {
    animation: shake 0.5s ease;
}

.overlay-title {
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 900;
    letter-spacing: 0.15em;
    color: var(--neon-cyan);
    text-shadow: var(--glow-cyan);
    margin-bottom: 15px;
}

.game-over-title {
    color: var(--neon-pink);
    text-shadow: 0 0 10px var(--neon-pink),
                 0 0 20px var(--neon-pink),
                 0 0 30px var(--neon-pink);
}

.overlay-text {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 30px;
    line-height: 1.6;
}

/* BUTTONS */
.btn-primary {
    position: relative;
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    padding: 18px 50px;
    background: transparent;
    color: var(--neon-cyan);
    border: 2px solid var(--neon-cyan);
    border-radius: 50px;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: var(--neon-cyan);
    transform: translate(-50%, -50%);
    transition: width 0.5s, height 0.5s;
    z-index: -1;
}

.btn-primary:hover {
    color: var(--bg-darker);
    box-shadow: 0 0 20px var(--neon-cyan);
}

.btn-primary:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary:active {
    transform: scale(0.95);
}

.btn-glow {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.btn-primary:hover .btn-glow {
    left: 100%;
}

/* KEYBOARD KEYS */
kbd {
    font-family: var(--font-display);
    font-size: 1rem;
    padding: 8px 12px;
    background: var(--bg-card);
    border: 2px solid var(--neon-cyan);
    border-radius: 6px;
    color: var(--neon-cyan);
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.2);
    display: inline-block;
    min-width: 40px;
    text-align: center;
}

.controls-hint {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.key-row {
    display: flex;
    gap: 10px;
}

.key-small {
    font-size: 0.85rem;
    padding: 6px 10px;
    min-width: 35px;
}

/* FINAL STATS */
.final-stats {
    display: grid;
    gap: 15px;
    margin: 30px 0;
}

.final-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: var(--bg-card);
    border: 1px solid var(--neon-cyan);
    border-radius: 8px;
}

.final-stat-label {
    font-family: var(--font-display);
    font-size: 0.9rem;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
}

.final-stat-value {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--neon-cyan);
    text-shadow: var(--glow-cyan);
}

.new-high-score {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px;
    margin: 20px 0;
    background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.1), transparent);
    border: 2px solid var(--neon-yellow);
    border-radius: 8px;
    color: var(--neon-yellow);
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-shadow: 0 0 10px var(--neon-yellow);
    animation: blink 1s ease-in-out infinite;
}

.new-high-score.show {
    display: flex;
}

.trophy-icon {
    font-size: 2rem;
    animation: spin 2s linear infinite;
}

/* INFO CONTAINER */
.info-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

.info-box {
    background: var(--bg-card);
    border: 2px solid var(--neon-cyan);
    border-radius: 10px;
    padding: 25px;
    backdrop-filter: blur(10px);
}

.info-title {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    color: var(--neon-magenta);
    text-shadow: var(--glow-magenta);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--neon-magenta);
}

.info-content {
    color: var(--text-secondary);
}

.control-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    font-size: 1rem;
}

.game-rules {
    list-style: none;
}

.game-rules li {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 1rem;
    line-height: 1.5;
}

.rule-icon {
    font-size: 1.5rem;
}

.scoring-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding: 10px;
    background: rgba(0, 255, 255, 0.05);
    border-radius: 5px;
}

.score-label {
    font-size: 1rem;
}

.score-points {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--neon-green);
    text-shadow: var(--glow-green);
}

/* FOOTER */
.game-footer {
    text-align: center;
    padding: 30px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    border-top: 1px solid rgba(0, 255, 255, 0.2);
}

.tech-badges {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.badge {
    font-family: var(--font-display);
    font-size: 0.75rem;
    padding: 5px 15px;
    background: var(--bg-card);
    border: 1px solid var(--neon-cyan);
    border-radius: 20px;
    color: var(--neon-cyan);
    letter-spacing: 0.1em;
}

/* ANIMATIONS */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-10px);
    }
    75% {
        transform: translateX(10px);
    }
}

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

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* RESPONSIVE DESIGN */
@media (max-width: 1200px) {
    .info-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .game-title {
        font-size: 2.5rem;
        flex-direction: column;
        gap: 10px;
    }
    
    .title-separator {
        font-size: 2rem;
    }
    
    .stats-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .stat-value {
        font-size: 2rem;
    }
    
    .overlay-title {
        font-size: 2rem;
    }
    
    .overlay-icon {
        font-size: 3.5rem;
    }
    
    .btn-primary {
        font-size: 1rem;
        padding: 15px 40px;
    }
}

@media (max-width: 480px) {
    .game-title {
        font-size: 2rem;
    }
    
    .stats-container {
        grid-template-columns: 1fr;
    }
    
    .overlay-content {
        padding: 20px;
    }
}

/* PRINT STYLES (HIDE GAME) */
@media print {
    .game-container,
    .stats-container,
    .info-container {
        display: none;
    }
}
