body {
    margin: 0;
    padding: 0;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #000033; /* Dark retro blue */
    font-family: 'Courier New', Courier, monospace;
    overflow: hidden;
    position: relative;
    touch-action: none; /* Prevent default touch scrolling */
}

/* Pixel grid */
body::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(0, 255, 255, 0.3) 2px, transparent 2px);
    background-size: 20px 20px;
    opacity: 0.5;
    z-index: 0;
    animation: pulse 3s ease-in-out infinite;
}

/* VHS scanline and glitch effect */
body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
            transparent 50%,
            rgba(255, 255, 255, 0.1) 50%
    );
    background-size: 100% 5px;
    pointer-events: none;
    opacity: 0.6;
    animation: scanline 6s linear infinite, vhs-jitter 0.3s infinite;
    z-index: 0;
}

/* SVG Pixel Art Button */
.pixel-art-button {
    position: absolute;
    bottom: 20px;
    left: 20px;
    width: 100px;
    height: 100px;
    cursor: pointer;
    z-index: 1;
    transition: transform 0.2s;
}

.pixel-art-button:hover {
    transform: scale(1.1);
}

/* Windows 95-style Start Menu */
.retro-menu {
    display: none;
    position: absolute;
    width: 300px;
    background: #c0c0c0; /* Windows 95 grey */
    border: 2px solid #000; /* Base black border */
    box-shadow:
            inset -1px -1px 0 #fff, /* Top-left highlight */
            inset 1px 1px 0 #808080, /* Bottom-right shadow */
            -1px -1px 0 #fff, /* Outer top-left highlight */
            1px 1px 0 #808080; /* Outer bottom-right shadow */
    bottom: 130px; /* Above floppy disk */
    left: 20px;
    z-index: 1001;
}

.retro-menu-titlebar {
    background: #000080; /* Windows 95 blue */
    color: #fff;
    padding: 3px;
    cursor: move;
    user-select: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'MS Sans Serif', sans-serif;
    font-size: 12px;
}

.retro-menu-close {
    cursor: pointer;
    padding: 0 8px;
    font-weight: bold;
}

.retro-menu-content {
    padding: 8px;
    font-family: 'MS Sans Serif', sans-serif;
    font-size: 12px;
    color: #000;
}

.menu-option {
    display: flex;
    align-items: center;
    padding: 4px;
    margin-bottom: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.menu-option:hover {
    background: #000080;
    color: #fff;
}

.menu-option svg {
    width: 24px;
    height: 24px;
    margin-right: 8px;
}

.menu-option-text {
    flex-grow: 1;
}

.menu-option-text strong {
    display: inline-block;
    margin-right: 5px;
}

.container {
    text-align: center;
    color: #0ff;
    text-shadow: 0 0 10px #0ff, 0 0 20px #0ff, 0 0 30px #0ff;
    position: relative;
    z-index: 1;
}

h1 {
    font-size: 4rem;
    margin: 0;
    animation: glitch 2s linear infinite;
}

p {
    font-size: 1.5rem;
    margin: 20px 0;
}

.cursor {
    display: inline-block;
    width: 10px;
    height: 1.5rem;
    background: #0ff;
    vertical-align: middle;
    animation: blink 1s step-end infinite;
}

/* CMD Prompt Window */
.cmd-window {
    display: none;
    position: absolute;
    width: 600px;
    height: 400px;
    background: #000;
    border: 2px solid #0ff;
    box-shadow: 0 0 20px #0ff;
    color: #0ff;
    top: 20%;
    left: 50%;
    transform: translateX(-50%); /* Center horizontally */
    z-index: 1000;
}

.cmd-titlebar {
    background: #0ff;
    color: #000;
    padding: 5px;
    cursor: move;
    user-select: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cmd-titlebar span {
    font-size: 1rem;
}

.cmd-close {
    cursor: pointer;
    padding: 0 10px;
}

.cmd-content {
    padding: 10px;
    height: calc(100% - 40px);
    overflow-y: auto;
    font-size: 1rem;
    user-select: none;
    pointer-events: none;
}

.cmd-input-container {
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.cmd-input-prompt {
    margin-right: 10px;
}

.cmd-input {
    background: transparent;
    border: none;
    color: #0ff;
    font-family: 'Courier New', Courier, monospace;
    outline: none;
    width: auto;
    flex-grow: 1;
    pointer-events: auto;
}

/* Glitch animation */
@keyframes glitch {
    2%, 64% {
        transform: translate(2px, 0) skew(5deg);
    }
    4%, 60% {
        transform: translate(-2px, 0) skew(-5deg);
    }
    62% {
        transform: translate(0, 0) skew(0deg);
    }
}

/* Blink cursor animation */
@keyframes blink {
    50% {
        opacity: 0;
    }
}

/* Scanline animation */
@keyframes scanline {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 0 100%;
    }
}

/* VHS jitter effect */
@keyframes vhs-jitter {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30% {
        transform: translateX(2px);
    }
    20% {
        transform: translateX(-2px);
    }
}

/* Pulse animation for grid */
@keyframes pulse {
    0%, 100% {
        opacity: 0.5;
    }
    50% {
        opacity: 0.7;
    }
}

/* Button styling */
.btn {
    display: inline-block;
    padding: 10px 20px;
    font-size: 1.2rem;
    color: #0ff;
    border: 2px solid #0ff;
    text-decoration: none;
    margin-top: 20px;
    transition: all 0.3s;
    background: transparent;
    cursor: pointer;
    z-index: 1; /* Ensure button is clickable */
}

.btn:hover {
    background: #0ff;
    color: #000;
    text-shadow: none;
}

/* Responsive design */
@media (max-width: 600px) {
    h1 {
        font-size: 2rem;
    }
    p {
        font-size: 0.9rem;
    }
    .btn {
        padding: 8px 16px;
        font-size: 1rem;
    }
    .cmd-window {
        width: 90%;
        height: 300px;
        left: 5%;
        top: 5%; /* Adjusted for mobile */
        transform: none; /* Remove desktop centering */
        margin-left: 0;
    }
    .retro-menu {
        width: 80%;
        max-width: 250px;
        bottom: 100px;
        left: 10px;
    }
    .pixel-art-button {
        width: 60px;
        height: 60px;
        bottom: 10px;
        left: 10px;
    }
    .menu-option svg {
        width: 20px;
        height: 20px;
    }
    .menu-option-text {
        font-size: 10px;
    }
}