:root {
    --bg-color: #050505;
    --neon-cyan: #00f3ff;
    --neon-pink: #ff00ff;
    --neon-green: #00ff00;
    --neon-yellow: #f0db4f;
    --grid-color: rgba(0, 243, 255, 0.15);
    --font-display: 'Orbitron', sans-serif;
    --font-mono: 'Share Tech Mono', monospace;
}

h1,
h2,
h3 {
    transition: all 0.3s ease;
}

h1:hover,
h2:hover,
h3:hover {
    color: var(--neon-pink);
    text-shadow:
        2px 0 var(--neon-cyan),
        -2px 0 var(--neon-yellow);
    transform: scale(1.05);
    cursor: help;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    cursor: crosshair;
    /* Visible cursor */
}

#matrixCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.4;
    /* Brighter background */
    pointer-events: none;
}

body {
    background-color: var(--bg-color);
    color: var(--neon-cyan);
    font-family: var(--font-mono);
    overflow-x: hidden;
    min-height: 100vh;
    background-image:
        linear-gradient(var(--grid-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
    background-size: 40px 40px;
    background-position: center center;
}

/* Effects Overlays */
.scanline {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom,
            rgba(255, 255, 255, 0),
            rgba(255, 255, 255, 0) 50%,
            rgba(0, 0, 0, 0.3) 50%,
            rgba(0, 0, 0, 0.3));
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 1000;
    animation: scanline 6s linear infinite;
}

.noise {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999;
    opacity: 0.05;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(0, 0, 0, 0) 0%, rgba(5, 5, 5, 0.9) 90%);
    pointer-events: none;
    z-index: 998;
}

.cyber-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

/* Start Overlay */
.start-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s;
}

.start-content {
    text-align: center;
    border: 2px solid var(--neon-cyan);
    padding: 3rem;
    box-shadow: 0 0 30px var(--neon-cyan);
    background: rgba(0, 0, 0, 0.9);
}

.start-content h2 {
    font-family: var(--font-display);
    color: #fff;
    margin-bottom: 1rem;
    text-shadow: 0 0 10px var(--neon-cyan);
}

.start-content p {
    margin-bottom: 2rem;
    color: var(--neon-cyan);
}

.start-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Hero Section */
.hero-section {
    text-align: center;
    margin-bottom: 5rem;
    padding-top: 4rem;
}

.glitch-name {
    font-family: var(--font-display);
    font-size: 5rem;
    font-weight: 900;
    color: #fff;
    text-transform: uppercase;
    position: relative;
    text-shadow:
        3px 3px var(--neon-pink),
        -3px -3px var(--neon-cyan);
    animation: glitch-skew 3s infinite linear alternate-reverse;
    margin-bottom: 1rem;
    letter-spacing: 5px;
}

.glitch-name::before,
.glitch-name::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color);
}

.glitch-name::before {
    left: 2px;
    text-shadow: -2px 0 var(--neon-pink);
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim 5s infinite linear alternate-reverse;
}

.glitch-name::after {
    left: -2px;
    text-shadow: -2px 0 var(--neon-cyan);
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim2 5s infinite linear alternate-reverse;
}

.cyber-subtitle {
    font-size: 1.2rem;
    color: var(--neon-pink);
    text-shadow: 0 0 5px var(--neon-pink);
    margin-bottom: 0.5rem;
}

/* Status Panel */
.status-panel {
    border: 1px solid var(--neon-green);
    background: rgba(0, 255, 0, 0.05);
    padding: 1rem;
    max-width: 400px;
    margin: 2rem auto;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.2);
    position: relative;
}

.status-panel::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    width: 10px;
    height: 10px;
    border-top: 2px solid var(--neon-green);
    border-left: 2px solid var(--neon-green);
}

.status-panel::after {
    content: '';
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 10px;
    height: 10px;
    border-bottom: 2px solid var(--neon-green);
    border-right: 2px solid var(--neon-green);
}

.status-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.status-row:last-child {
    margin-bottom: 0;
}

.label {
    color: var(--neon-green);
    font-weight: bold;
}

.value {
    color: #fff;
}

.blink-green {
    animation: blink 1s infinite;
    color: var(--neon-green);
    text-shadow: 0 0 5px var(--neon-green);
}

.typing-effect {
    border-right: 2px solid var(--neon-green);
    animation: blink 0.7s infinite;
    padding-right: 5px;
}

/* Games Section */
.section-header {
    font-family: var(--font-display);
    font-size: 2.5rem;
    color: var(--neon-cyan);
    text-align: center;
    margin-bottom: 3rem;
    text-shadow: 0 0 15px var(--neon-cyan);
    position: relative;
}

.game-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 3rem;
}

.game-card {
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid var(--neon-cyan);
    padding: 1rem;
    position: relative;
    transition: all 0.3s;
    width: 100%;
    max-width: 380px;
}

.game-card:hover {
    box-shadow: 0 0 25px rgba(0, 243, 255, 0.4);
    transform: scale(1.02);
    border-color: #fff;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--neon-cyan);
    padding-bottom: 0.5rem;
}

.game-header h3 {
    color: #fff;
    font-family: var(--font-display);
    letter-spacing: 1px;
}

.game-controls-info {
    font-size: 0.8rem;
    color: var(--neon-pink);
}

.canvas-wrapper {
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.8);
}

canvas {
    background: #080808;
    display: block;
    width: 100%;
    height: auto;
}

.game-ui {
    display: flex;
    flex-wrap: wrap;
    /* Allow wrapping */
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    gap: 10px;
    /* Add gap for wrapping */
}

.game-actions {
    display: flex;
    gap: 5px;
    /* Reduce gap */
}

.icon-btn {
    padding: 0.5rem;
    min-width: 35px;
    /* Slightly smaller */
}

.cyber-btn {
    background: transparent;
    border: 1px solid var(--neon-cyan);
    color: var(--neon-cyan);
    padding: 0.6rem 1.5rem;
    font-family: var(--font-display);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    position: relative;
    overflow: hidden;
}

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

.cyber-btn:hover::before {
    left: 100%;
}

.cyber-btn:hover {
    background: rgba(0, 243, 255, 0.1);
    box-shadow: 0 0 15px var(--neon-cyan);
    text-shadow: 0 0 5px var(--neon-cyan);
    color: #fff;
}

.big-btn {
    font-size: 1.2rem;
    padding: 1rem 3rem;
    border-width: 2px;
}

.score-display {
    font-size: 1.1rem;
    color: #fff;
    font-family: var(--font-display);
}

.cyber-footer {
    text-align: center;
    margin-top: 4rem;
    padding: 2rem;
    border-top: 1px solid rgba(0, 243, 255, 0.2);
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
}

/* Animations */
@keyframes glitch-skew {
    0% {
        transform: skew(0deg);
    }

    20% {
        transform: skew(-2deg);
    }

    40% {
        transform: skew(2deg);
    }

    60% {
        transform: skew(-1deg);
    }

    80% {
        transform: skew(1deg);
    }

    100% {
        transform: skew(0deg);
    }
}

@keyframes glitch-anim {
    0% {
        clip: rect(24px, 9999px, 92px, 0);
    }

    20% {
        clip: rect(65px, 9999px, 12px, 0);
    }

    40% {
        clip: rect(12px, 9999px, 54px, 0);
    }

    60% {
        clip: rect(87px, 9999px, 32px, 0);
    }

    80% {
        clip: rect(43px, 9999px, 76px, 0);
    }

    100% {
        clip: rect(15px, 9999px, 64px, 0);
    }
}

@keyframes glitch-anim2 {
    0% {
        clip: rect(12px, 9999px, 54px, 0);
    }

    20% {
        clip: rect(87px, 9999px, 32px, 0);
    }

    40% {
        clip: rect(43px, 9999px, 76px, 0);
    }

    60% {
        clip: rect(15px, 9999px, 64px, 0);
    }

    80% {
        clip: rect(24px, 9999px, 92px, 0);
    }

    100% {
        clip: rect(65px, 9999px, 12px, 0);
    }
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

@keyframes scanline {
    0% {
        background-position: 0 0;
    }

    100% {
        background-position: 0 100%;
    }
}

/* Mobile Controls */
.mobile-controls {
    display: none;
    /* Hidden by default */
    margin-top: 1rem;
    justify-content: center;
}

.d-pad {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.d-pad-row {
    display: flex;
    gap: 40px;
    /* Space for center */
}

.shooter-pad {
    display: flex;
    gap: 20px;
    align-items: center;
}

.control-btn {
    width: 50px;
    height: 50px;
    background: rgba(0, 243, 255, 0.1);
    border: 1px solid var(--neon-cyan);
    color: var(--neon-cyan);
    border-radius: 50%;
    font-size: 1.2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    touch-action: manipulation;
    /* Prevent zoom */
    user-select: none;
    cursor: pointer;
}

.control-btn:active {
    background: var(--neon-cyan);
    color: #000;
}

.fire-btn {
    width: 70px;
    height: 70px;
    border-color: var(--neon-pink);
    color: var(--neon-pink);
    font-size: 2rem;
}

.fire-btn:active {
    background: var(--neon-pink);
}

/* Responsive */
@media (max-width: 768px) {
    .glitch-name {
        font-size: 2.5rem;
        /* Smaller title */
        letter-spacing: 2px;
    }

    .game-container {
        flex-direction: column;
        align-items: center;
    }

    .mobile-controls {
        display: flex;
        /* Show on mobile */
    }

    .game-header h3 {
        font-size: 1rem;
    }

    .game-controls-info {
        display: none;
        /* Hide keyboard instructions on mobile */
    }

    .game-card {
        padding: 0.5rem;
    }
}