/* ============================================
   BREAKOUT OF HERE - CRT 90s Style
   ============================================ */

/* --- Reset & Base --- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-color: #0a0a1a;
    --neon-pink: #ff006e;
    --cyan: #00f5d4;
    --yellow: #fee440;
    --hot-pink: #f15bb5;
    --purple: #9b5de5;
    --orange: #ff924c;
    --green: #00f56f;
    --white: #f0f0f0;
    --dark-gray: #2a2a3a;
    --metallic: #8a8a9a;
}

html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--bg-color);
    font-family: 'Press Start 2P', monospace;
    color: var(--white);
    user-select: none;
    -webkit-user-select: none;
}

[hidden] {
    display: none !important;
}

/* --- CRT Container --- */
#crt-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}

/* --- Game Canvas --- */
#gameCanvas {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 3px solid var(--dark-gray);
    border-radius: 20px;
    touch-action: none;
    box-shadow:
        0 0 20px rgba(0, 245, 212, 0.3),
        0 0 60px rgba(255, 0, 110, 0.2),
        inset 0 0 80px rgba(0, 0, 0, 0.5);
}

/* --- Scanlines --- */
#scanlines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
    background: repeating-linear-gradient(0deg,
            rgba(0, 0, 0, 0.15) 0px,
            rgba(0, 0, 0, 0.15) 1px,
            transparent 1px,
            transparent 3px);
    border-radius: 20px;
}

/* --- Vignette --- */
#vignette {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 99;
    background: radial-gradient(ellipse at center,
            transparent 50%,
            rgba(0, 0, 0, 0.5) 100%);
    border-radius: 20px;
}

/* --- Screen Flicker --- */
#screen-flicker {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 101;
    animation: flicker 0.15s infinite;
    opacity: 0;
    background: rgba(255, 255, 255, 0.02);
}

@keyframes flicker {
    0% {
        opacity: 0;
    }

    5% {
        opacity: 1;
    }

    10% {
        opacity: 0;
    }

    50% {
        opacity: 0;
    }

    55% {
        opacity: 1;
    }

    60% {
        opacity: 0;
    }

    100% {
        opacity: 0;
    }
}

/* --- Menu Overlay --- */
#menu-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    background: rgba(10, 10, 26, 0.85);
    pointer-events: auto;
}

#menu-content {
    text-align: center;
}

#game-title {
    font-size: 36px;
    color: var(--neon-pink);
    text-shadow:
        0 0 10px var(--neon-pink),
        0 0 20px var(--neon-pink),
        0 0 40px var(--hot-pink),
        0 0 80px var(--hot-pink);
    margin-bottom: 15px;
    line-height: 1.4;
    animation: titleGlow 2s ease-in-out infinite;
}

@keyframes titleGlow {

    0%,
    100% {
        text-shadow:
            0 0 10px var(--neon-pink),
            0 0 20px var(--neon-pink),
            0 0 40px var(--hot-pink),
            0 0 80px var(--hot-pink);
    }

    50% {
        text-shadow:
            0 0 15px var(--neon-pink),
            0 0 30px var(--neon-pink),
            0 0 60px var(--hot-pink),
            0 0 100px var(--hot-pink);
    }
}

#menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
    margin: 30px 0;
}

/* --- Retro Buttons --- */
.retro-btn {
    font-family: 'Press Start 2P', monospace;
    font-size: 14px;
    padding: 15px 40px;
    background: transparent;
    color: var(--cyan);
    border: 3px solid var(--cyan);
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 3px;
    transition: all 0.2s;
    text-shadow: 0 0 10px var(--cyan);
    box-shadow:
        0 0 10px rgba(0, 245, 212, 0.3),
        inset 0 0 10px rgba(0, 245, 212, 0.1);
}

.retro-btn:hover {
    background: var(--cyan);
    color: var(--bg-color);
    text-shadow: none;
    box-shadow:
        0 0 20px rgba(0, 245, 212, 0.6),
        inset 0 0 20px rgba(0, 245, 212, 0.2);
}

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

#controls-info {
    margin-top: 30px;
    font-size: 8px;
    line-height: 2.5;
    color: var(--metallic);
    text-shadow: 0 0 5px rgba(138, 138, 154, 0.5);
}

/* --- Touch devices / reduced motion: skip the constantly animated flicker layer --- */
@media (hover: none), (prefers-reduced-motion: reduce) {
    #screen-flicker {
        display: none;
    }
}

/* --- Responsive --- */
@media (max-width: 800px) {
    #game-title {
        font-size: 22px;
    }

    .retro-btn {
        font-size: 10px;
        padding: 10px 25px;
    }
}

@media (max-width: 500px) {
    #game-title {
        font-size: 16px;
    }

    #controls-info {
        font-size: 6px;
    }
}