:root {
    --bg-color: #050505;
    --text-color: #e0e0e0;
    --accent-color: #d00000;
    /* Blood red for horror */
    --ui-bg: rgba(20, 0, 0, 0.7);
    --font-main: 'Rajdhani', sans-serif;
    --font-horror: 'Nosifer', cursive;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
    -webkit-user-select: none;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-main);
    overflow: hidden;
    width: 100vw;
    height: 100vh;
}

#game-container {
    position: relative;
    width: 100%;
    height: 100%;
}

#game-canvas {
    display: block;
    width: 100%;
    height: 100%;
}

#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

#score-display {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 2rem;
    font-weight: bold;
    color: var(--text-color);
    text-shadow: 0 0 10px var(--accent-color);
}

#message-display {
    font-size: 3rem;
    font-family: var(--font-horror);
    color: var(--accent-color);
    text-shadow: 0 0 20px #000;
    margin-bottom: 20px;
    text-align: center;
}

#start-button {
    pointer-events: auto;
    background: transparent;
    border: 2px solid var(--accent-color);
    color: var(--accent-color);
    font-family: var(--font-horror);
    font-size: 2rem;
    padding: 15px 40px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

#start-button:hover {
    background: var(--accent-color);
    color: #000;
    box-shadow: 0 0 30px var(--accent-color);
}

#tweet-button {
    pointer-events: auto;
    background: transparent;
    border: 2px solid #1da1f2;
    color: #1da1f2;
    font-family: var(--font-horror);
    font-size: 1.5rem;
    padding: 10px 30px;
    margin-bottom: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

#tweet-button:hover {
    background: #1da1f2;
    color: #fff;
    box-shadow: 0 0 30px #1da1f2;
}

.back-link {
    position: absolute;
    top: 20px;
    left: 20px;
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    font-size: 1rem;
    pointer-events: auto;
    z-index: 100;
    transition: color 0.3s;
}

.back-link:hover {
    color: #fff;
}

/* Mobile Controls */
#mobile-controls {
    display: none;
    /* Hidden by default, shown via JS if touch device */
    position: absolute;
    bottom: 40px;
    left: 0;
    width: 100%;
    height: 150px;
    pointer-events: none;
    justify-content: space-between;
    padding: 0;
}

/* Joysticks */
.joystick-zone {
    position: absolute;
    bottom: 20px;
    width: 120px;
    height: 120px;
    border: 2px solid rgba(255, 0, 0, 0.3);
    border-radius: 50%;
    background: rgba(20, 0, 0, 0.5);
    pointer-events: auto;
    touch-action: none;
    z-index: 2000;
}

#joystick-left {
    left: 40px;
}

#joystick-right {
    right: 40px;
}

.joystick-knob {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 50px;
    height: 50px;
    margin-top: -25px;
    margin-left: -25px;
    background: rgba(200, 0, 0, 0.8);
    border-radius: 50%;
    box-shadow: 0 0 10px #d00000;
    transform: translate(0, 0);
    pointer-events: none;
}

#action-buttons {
    display: flex;
    gap: 20px;
    pointer-events: auto;
    align-items: flex-end;
    position: absolute;
    bottom: 150px;
    right: 40px;
}

.control-btn {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255, 0, 0, 0.2);
    border: 2px solid rgba(255, 0, 0, 0.5);
    color: #fff;
    font-size: 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.control-btn:active {
    background: rgba(255, 0, 0, 0.5);
}

@media (max-width: 768px) {
    #mobile-controls {
        display: flex;
    }
}

/* Stamina Bar */
#stamina-container {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    height: 15px;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid #444;
    border-radius: 8px;
    overflow: hidden;
    z-index: 1000;
}

#stamina-bar {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #00ff00, #ffff00);
    transition: width 0.1s linear;
}

#stamina-text {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 0.9rem;
    pointer-events: none;
    text-shadow: 0 0 4px #000;
    opacity: 0.8;
    z-index: 1000;
}

@media (max-width: 768px) {
    #stamina-text {
        display: none;
    }
}

/* Overlays */
#noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
    opacity: 0;
    /* Noise will be generated via JS or simple heavy grain */
    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)" opacity="0.4"/%3E%3C/svg%3E');
    mix-blend-mode: overlay;
}

#vignette-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 4;
    background: radial-gradient(circle, transparent 50%, rgba(0, 0, 0, 0.8) 100%);
    opacity: 0.5;
    transition: opacity 0.5s;
}