/* --- GLOBAL STYLES & SETUP --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: #1a1a1a;
    background-image: url('images/placeholder-dirty-carpet.png');
    font-family: 'VT323', monospace;
    color: #c5c5c5;
    font-size: 18px;
    cursor: url('images/fly-cursor.png'), auto;
    overflow-x: hidden;
}

/* --- NEW: POOP OVERLAY CANVAS --- */
#poop-overlay-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999; /* Sits on top of everything */
    pointer-events: none; /* Allows clicks to pass through */
}

/* --- TV SCANLINES & OTHER EFFECTS --- */
.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(0deg, rgba(0,0,0,0.3) 0px, rgba(0,0,0,0.3) 1px, transparent 1px, transparent 3px);
    pointer-events: none;
    z-index: 1000;
}

/* --- TYPOGRAPHY & HEADERS --- */
h1, h2, h3 {
    font-family: 'Press Start 2P', cursive;
    text-transform: uppercase;
    color: #00ffff;
    text-shadow: 0 0 5px #00ffff, 0 0 10px #ff00ff;
}

h2 {
    margin: 40px 0 20px 0;
    font-size: 1.5rem;
    text-align: center;
}

/* --- LAYOUT & MAIN CONTAINER --- */
.container {
    max-width: 1000px;
    margin: 20px auto;
    padding: 20px;
    border: 5px solid #333;
    background-color: rgba(10, 10, 10, 0.9);
    box-shadow: 0 0 20px #ff00ff, 0 0 30px #00ffff, inset 0 0 15px #111;
    position: relative;
    z-index: 10;
}

section {
    padding-bottom: 40px;
    border-bottom: 2px dashed #444;
}

/* --- HEADER AND NAVIGATION --- */
header {
    text-align: center;
    border-bottom: 4px solid #555;
    padding-bottom: 20px;
}

.arcade-buttons ul {
    list-style-type: none;
    padding: 0;
    margin-top: 20px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
}

.arcade-buttons a {
    text-decoration: none;
    font-family: 'Press Start 2P', cursive;
    color: #fff;
    background-color: #9d0a0a;
    padding: 10px 20px;
    border-radius: 5px;
    border: 2px solid #5e0606;
    box-shadow: 0 5px 0 #5e0606;
    transition: all 0.07s linear;
    position: relative;
    display: inline-block;
}

.arcade-buttons a:hover {
    box-shadow: 0 3px 0 #5e0606;
    top: 2px;
}

.arcade-buttons a:active {
    box-shadow: 0 0px 0 #5e0606;
    top: 5px;
}

/* --- SECTION-SPECIFIC STYLES --- */
.arcade-cabinet {
    border: 10px solid #3d2b1f;
    padding: 15px;
    background: #2a2a2a;
    width: 90%;
    margin: auto;
}

.screen {
    background: #000;
    border: 5px inset #444;
    padding: 20px;
    aspect-ratio: 16 / 9;
    width: 100%;
}

.main-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.loud-button {
    font-family: 'Press Start 2P', cursive;
    font-size: 1rem;
    color: #000;
    background-color: #e5d85c;
    border: 2px solid #333;
    padding: 15px;
    width: 100%;
    margin-top: 15px;
    cursor: url('images/fly-cursor.png'), auto;
}

.high-scores pre {
    background: #0a0a0a;
    padding: 20px;
    border: 2px solid #8a9a5b;
    color: #0f0;
    font-size: 1.2rem;
    white-space: pre-wrap;
    text-shadow: 0 0 5px #0f0;
    overflow-x: auto;
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.grid-item {
    background: #111;
    border: 2px solid #444;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

.grid-item img,
.grid-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* --- SNAKE GAME STYLES --- */
.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

#snake-game-canvas {
    background-color: #000;
    border: 5px inset #444;
}

#game-ui {
    font-family: 'Press Start 2P', cursive;
    color: #0f0;
    text-shadow: 0 0 5px #0f0;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 20px;
}

#start-game-btn {
    font-size: 1rem;
    padding: 10px 20px;
    width: auto;
    margin-top: 0;
}

/* --- FOOTER --- */
footer {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 2px dashed #444;
}

footer a {
    color: #8a9a5b;
}

/* --- ANIMATIONS & EFFECTS --- */
#image-zapper-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 999;
    overflow: hidden;
}

.zapper-image {
    position: absolute;
    display: block;
    width: 250px;
    height: auto;
    border: 4px solid #fff;
    box-shadow: 0 0 20px #ff00ff, 0 0 30px #00ffff;
    animation: zoomAcross 2s linear forwards;
}

@keyframes zoomAcross {
    0% { transform: translateX(-100%) scale(0.5); opacity: 1; }
    10% { transform: translateX(0) scale(1); }
    90% { transform: translateX(calc(100vw - 100%)) scale(1); }
    100% { transform: translateX(100vw) scale(0.5); opacity: 1; }
}

.flicker-text {
    font-size: 2rem;
    animation: flicker 4s linear infinite;
}

.glitch {
    position: relative;
}

.glitch::before, .glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 10, 0.9);
    overflow: hidden;
}

.glitch::before {
    left: 2px;
    text-shadow: -2px 0 #ff00ff;
    animation: glitch-anim-1 2.5s infinite linear alternate-reverse;
}

.glitch::after {
    left: -2px;
    text-shadow: 2px 0 #00ffff;
    animation: glitch-anim-2 3s infinite linear alternate-reverse;
}

.is-glitching::before {
    animation: glitch-anim-1 0.5s infinite linear alternate-reverse;
}

.is-glitching::after {
    animation: glitch-anim-2 0.5s infinite linear alternate-reverse;
}

@keyframes flicker {
    0%, 18%, 22%, 25%, 53%, 57%, 100% { text-shadow: 0 0 4px #00ffff, 0 0 11px #00ffff, 0 0 19px #00ffff, 0 0 40px #ff00ff, 0 0 80px #ff00ff; color: #eafcff; }
    20%, 24%, 55% { text-shadow: none; color: #333; }
}

@keyframes glitch-anim-1 {
    0% { clip-path: inset(10% 0 89% 0); }
    20% { clip-path: inset(48% 0 4% 0); }
    40% { clip-path: inset(54% 0 6% 0); }
    60% { clip-path: inset(1% 0 94% 0); }
    80% { clip-path: inset(82% 0 10% 0); }
    100% { clip-path: inset(57% 0 35% 0); }
}

@keyframes glitch-anim-2 {
    0% { clip-path: inset(79% 0 12% 0); }
    20% { clip-path: inset(1% 0 97% 0); }
    40% { clip-path: inset(80% 0 14% 0); }
    60% { clip-path: inset(23% 0 46% 0); }
    80% { clip-path: inset(2% 0 88% 0); }
    100% { clip-path: inset(71% 0 21% 0); }
}