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

body {
    margin: 0;
    padding: 0;
    font-family: 'Arial', sans-serif;
    overflow: hidden;
}

body.pointer-locked {
    cursor: none;
}

.game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    background: #000;
    overflow: hidden;
}

#gameCanvas {
    width: 100%;
    height: 100%;
    display: block;
}

.hud {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    padding: 15px 20px;
    color: white;
    z-index: 10;
    backdrop-filter: blur(10px);
}

.stat-container {
    display: flex;
    gap: 30px;
    align-items: center;
    flex-wrap: wrap;
}

.stat {
    display: flex;
    align-items: center;
    gap: 10px;
}

.stat-label {
    font-weight: bold;
    font-size: 16px;
}

.bar-container {
    width: 200px;
    height: 25px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.bar {
    height: 100%;
    transition: width 0.3s ease, background-color 0.3s ease;
    border-radius: 10px;
}

.hunger-bar {
    background: linear-gradient(90deg, #f093fb 0%, #f5576c 100%);
}

.stat-value {
    font-weight: bold;
    font-size: 16px;
    min-width: 40px;
}

.resources {
    display: flex;
    gap: 20px;
    font-size: 16px;
    font-weight: bold;
}

.resources span {
    background: rgba(255, 255, 255, 0.1);
    padding: 5px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.controls {
    margin-top: 10px;
}

.control-hint {
    font-size: 14px;
    color: #aaa;
    font-style: italic;
}

.build-mode {
    margin-top: 10px;
    padding: 10px;
    background: rgba(255, 215, 0, 0.2);
    border-radius: 8px;
    border: 2px solid rgba(255, 215, 0, 0.5);
}

.build-mode span {
    display: block;
    font-weight: bold;
    color: #ffd700;
    margin-bottom: 10px;
}

.build-mode button {
    margin-right: 10px;
    padding: 8px 15px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
    transition: all 0.2s;
}

.build-mode button:hover {
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.build-mode button:active {
    transform: translateY(0);
}

.game-over {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.95);
    padding: 40px 60px;
    border-radius: 15px;
    text-align: center;
    color: white;
    z-index: 100;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
}

.game-over h1 {
    font-size: 48px;
    color: #f5576c;
    margin-bottom: 20px;
    text-shadow: 0 0 20px rgba(245, 87, 108, 0.5);
}

.game-over p {
    font-size: 24px;
    margin-bottom: 30px;
    color: #ccc;
}

.game-over button {
    padding: 15px 40px;
    font-size: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
}

.game-over button:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.5);
}

.game-over button:active {
    transform: scale(0.98);
}

.crosshair {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    z-index: 5;
    pointer-events: none;
}

.crosshair::before,
.crosshair::after {
    content: '';
    position: absolute;
    background: rgba(255, 255, 255, 0.8);
}

.crosshair::before {
    top: 50%;
    left: 0;
    width: 100%;
    height: 2px;
    transform: translateY(-50%);
}

.crosshair::after {
    left: 50%;
    top: 0;
    width: 2px;
    height: 100%;
    transform: translateX(-50%);
}

.click-prompt {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.65);
    color: white;
    padding: 12px 20px;
    border-radius: 15px;
    font-size: 16px;
    font-weight: bold;
    z-index: 50;
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.2);
    animation: pulse 2s infinite;
    backdrop-filter: blur(6px);
}

@keyframes pulse {
    0%, 100% {
        transform: translateX(-50%) scale(1);
        opacity: 1;
    }
    50% {
        transform: translateX(-50%) scale(1.05);
        opacity: 0.9;
    }
}

.selected-block {
    background: rgba(255, 255, 255, 0.1);
    padding: 5px 12px;
    border-radius: 8px;
    border: 2px solid rgba(255, 215, 0, 0.5);
    font-weight: bold;
}
