* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    overflow: hidden;
    background: #0a0e1a;
    font-family: 'Silkscreen', cursive;
    cursor: default;
}

#title-screen {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    background: linear-gradient(180deg, #060b18 0%, #0d1a2a 30%, #112233 60%, #0a3030 100%);
}

#title-bg-canvas {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: 
        radial-gradient(ellipse at 20% 80%, rgba(30, 80, 80, 0.3) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(60, 40, 100, 0.3) 0%, transparent 50%);
}

#title-content {
    position: relative;
    text-align: center;
    z-index: 1;
}

#title-text {
    font-family: 'Press Start 2P', cursive;
    font-size: clamp(24px, 5vw, 56px);
    color: #5cc4b8;
    text-shadow: 
        4px 4px 0px #1a3a4a,
        0 0 40px rgba(92, 196, 184, 0.4),
        0 0 80px rgba(92, 196, 184, 0.15);
    letter-spacing: 2px;
    line-height: 1.4;
    margin-bottom: 16px;
    animation: titlePulse 4s ease-in-out infinite;
}

@keyframes titlePulse {
    0%, 100% { text-shadow: 4px 4px 0px #1a3a4a, 0 0 40px rgba(92,196,184,0.4); }
    50% { text-shadow: 4px 4px 0px #1a3a4a, 0 0 60px rgba(92,196,184,0.6), 0 0 100px rgba(92,196,184,0.2); }
}

#subtitle {
    font-family: 'Silkscreen', cursive;
    font-size: clamp(10px, 1.8vw, 16px);
    color: #7a8a9a;
    margin-bottom: 40px;
    font-style: italic;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

#rotating-head-container {
    width: 200px;
    height: 200px;
    margin: 0 auto 30px;
}

#enter-btn {
    font-family: 'Press Start 2P', cursive;
    font-size: clamp(12px, 2vw, 18px);
    padding: 16px 40px;
    background: linear-gradient(180deg, #4a4a4a 0%, #3a3a3a 50%, #2a2a2a 100%);
    color: #e0e0e0;
    border: 3px solid #5a5a5a;
    border-bottom-color: #1a1a1a;
    border-right-color: #1a1a1a;
    cursor: pointer;
    transition: all 0.1s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#enter-btn:hover {
    background: linear-gradient(180deg, #5a5a5a 0%, #4a4a4a 50%, #3a3a3a 100%);
    color: #5cc4b8;
    border-color: #6a6a6a;
    border-bottom-color: #2a2a2a;
    border-right-color: #2a2a2a;
}

#enter-btn:active {
    border: 3px solid #5a5a5a;
    border-top-color: #1a1a1a;
    border-left-color: #1a1a1a;
    transform: translate(2px, 2px);
}

#footer-link {
    margin-top: 30px;
}

/* HUD */
#hud {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 100;
}

#biome-name {
    position: absolute;
    top: 16px; left: 16px;
    font-family: 'Press Start 2P', cursive;
    font-size: clamp(10px, 1.5vw, 14px);
    color: #e0e0e0;
    background: rgba(0,0,0,0.6);
    padding: 10px 16px;
    border: 2px solid rgba(255,255,255,0.15);
    text-shadow: 2px 2px 0 #000;
    transition: color 0.5s;
}

#misery-container {
    position: absolute;
    top: 16px; right: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0,0,0,0.6);
    padding: 10px 16px;
    border: 2px solid rgba(255,255,255,0.15);
}

#misery-label {
    font-family: 'Press Start 2P', cursive;
    font-size: 10px;
    color: #cc4444;
    text-shadow: 1px 1px 0 #000;
}

#misery-bar-bg {
    width: 100px;
    height: 12px;
    background: #1a1a1a;
    border: 1px solid #444;
}

#misery-bar {
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, #44aa44, #cccc44, #cc4444);
    transition: width 0.5s ease;
}

#misery-value {
    font-family: 'Press Start 2P', cursive;
    font-size: 10px;
    color: #e0e0e0;
    min-width: 36px;
    text-align: right;
}

#crosshair {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    color: rgba(255,255,255,0.7);
    font-family: monospace;
    text-shadow: 0 0 4px rgba(0,0,0,0.8);
    pointer-events: none;
}

#tooltip {
    position: absolute;
    top: 60%;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Silkscreen', cursive;
    font-size: clamp(12px, 1.5vw, 16px);
    color: #c0d8d0;
    background: rgba(0,0,0,0.75);
    padding: 10px 20px;
    border: 1px solid rgba(92,196,184,0.4);
    border-radius: 2px;
    text-align: center;
    max-width: 400px;
    opacity: 0;
    transition: opacity 0.3s;
    font-style: italic;
    pointer-events: none;
}

#tooltip.visible {
    opacity: 1;
}

#controls-hint {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Silkscreen', cursive;
    font-size: 11px;
    color: rgba(255,255,255,0.5);
    background: rgba(0,0,0,0.5);
    padding: 8px 20px;
    text-align: center;
    white-space: nowrap;
}

/* Mobile Controls */
#mobile-controls {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 99;
    pointer-events: none;
}

#joystick-zone {
    position: absolute;
    bottom: 20px;
    left: 20px;
    width: 140px;
    height: 140px;
    pointer-events: auto;
}

#joystick-base {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    border: 2px solid rgba(255,255,255,0.25);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

#joystick-thumb {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(92,196,184,0.5);
    border: 2px solid rgba(92,196,184,0.7);
    position: absolute;
}

#touch-look-zone {
    position: absolute;
    top: 0; right: 0;
    width: 50%;
    height: 100%;
    pointer-events: auto;
}

/* Scene container */
#scene-container {
    width: 100vw;
    height: 100vh;
}

#scene-container canvas {
    display: block;
}