:root {
    --primary-color: #000000;
    --accent-color: #ff0000;
    --text-color: #ffffff;
    --glitch-color: #0ff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    cursor: none;
}

body {
    font-family: 'Courier New', monospace;
    background-color: var(--primary-color);
    color: var(--text-color);
    overflow: hidden;
    height: 100vh;
    position: relative;
}

/* Custom Cursor */
.cursor {
    width: 20px;
    height: 20px;
    border: 2px solid var(--text-color);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    mix-blend-mode: difference;
}

.cursor-dot {
    width: 4px;
    height: 4px;
    background-color: var(--text-color);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 9999;
}

/* Grain Effect */
.grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAgAElEQVR4nHXdy44kSXIA0LM...') repeat;
    opacity: 0.1;
    pointer-events: none;
    z-index: 1000;
}

/* TV Effect */
.tv-effect {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%);
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 1001;
    animation: tvScan 0.5s linear infinite;
}

/* Static Effect */
.static-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-radial-gradient(circle at 50% 50%, rgba(0,0,0,0) 0, rgba(0,0,0,0.1) 1px, transparent 2px);
    pointer-events: none;
    z-index: 999;
    opacity: 0.1;
    animation: static 0.5s steps(10) infinite;
}

/* Main Container */
.main-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 1;
}

/* Game Title */
.glitch-container {
    position: relative;
    margin-bottom: 2rem;
}

.game-title {
    font-size: 4rem;
    font-weight: bold;
    text-align: center;
    position: relative;
    animation: glitch 1s infinite;
}

.game-title::before,
.game-title::after {
    content: attr(data-text);
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
}

.game-title::before {
    left: 2px;
    text-shadow: -2px 0 #ff0000;
    clip: rect(24px, 550px, 90px, 0);
    animation: glitch-anim 2s infinite linear alternate-reverse;
}

.game-title::after {
    left: -2px;
    text-shadow: -2px 0 #00ff00;
    clip: rect(85px, 550px, 140px, 0);
    animation: glitch-anim2 2s infinite linear alternate-reverse;
}

/* Key Prompt */
.key-prompt {
    margin-top: 2rem;
    text-align: center;
    animation: pulse 2s infinite;
}

.key {
    padding: 0.5rem 1rem;
    border: 2px solid var(--text-color);
    margin-right: 1rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 1002;
}

.modal-content {
    position: relative;
    width: 80%;
    max-width: 800px;
    margin: 5% auto;
    background-color: rgba(0, 0, 0, 0.95);
    border: 1px solid var(--accent-color);
    padding: 2rem;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.close-btn {
    font-size: 2rem;
    cursor: pointer;
    color: var(--accent-color);
}

/* Gallery */
.gallery {
    display: flex;
    overflow: hidden;
}

.gallery-item {
    flex: 0 0 100%;
    transition: transform 0.5s ease;
}

.gallery-item img {
    width: 100%;
    height: auto;
}

.gallery-controls {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
}

.gallery-controls button {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.5rem;
    cursor: pointer;
}

/* Context Menu */
.context-menu {
    display: none;
    position: fixed;
    background-color: rgba(0, 0, 0, 0.95);
    border: 1px solid var(--accent-color);
    padding: 0.5rem 0;
    z-index: 1003;
}

.menu-item {
    padding: 0.5rem 1rem;
    cursor: pointer;
}

.menu-item:hover {
    background-color: var(--accent-color);
}

/* Animations */
@keyframes glitch {
    0% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); }
    40% { transform: translate(-2px, -2px); }
    60% { transform: translate(2px, 2px); }
    80% { transform: translate(2px, -2px); }
    100% { transform: translate(0); }
}

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

@keyframes tvScan {
    0% { transform: translateY(0); }
    100% { transform: translateY(4px); }
}

@keyframes static {
    0% { transform: translate(0,0); }
    100% { transform: translate(1px, 1px); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .game-title {
        font-size: 2rem;
    }

    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
}