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

body {
    background: #87CEEB;
    overflow: hidden;
    font-family: 'Courier New', monospace;
}

canvas {
    display: block;
}

#blocker {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    cursor: pointer;
}

#blocker.hidden {
    display: none;
}

#instructions {
    text-align: center;
    color: white;
    padding: 40px;
}

#instructions h1 {
    font-size: 48px;
    margin-bottom: 20px;
    color: #5c8a3e;
    text-shadow: 3px 3px #2d4a1f;
}

#instructions p {
    margin: 10px 0;
    font-size: 18px;
}

#instructions .controls {
    margin: 20px 0;
    line-height: 1.8;
    color: #aaa;
}

#instructions .hint {
    color: #888;
    font-size: 14px;
    margin-top: 30px;
}

#crosshair {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 30px;
    font-weight: bold;
    text-shadow: 1px 1px 2px black, -1px -1px 2px black;
    pointer-events: none;
    z-index: 50;
}

#hotbar {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 4px;
    background: rgba(0, 0, 0, 0.7);
    padding: 8px;
    border-radius: 4px;
    border: 2px solid #555;
    z-index: 50;
}

.slot {
    width: 50px;
    height: 50px;
    background: #8b8b8b;
    border: 3px solid #373737;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 28px;
    cursor: pointer;
    transition: border-color 0.1s;
}

.slot.selected {
    border-color: #fff;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.slot:hover {
    border-color: #aaa;
}

#debug {
    position: fixed;
    top: 10px;
    left: 10px;
    color: white;
    font-size: 14px;
    text-shadow: 1px 1px 2px black;
    pointer-events: none;
    z-index: 50;
    line-height: 1.6;
}

#hud {
    position: fixed;
    top: 10px;
    right: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 50;
}

#hud > div {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.5);
    padding: 6px 10px;
    border-radius: 4px;
}

#hud .label {
    font-size: 18px;
}

#hud .bar-bg {
    width: 120px;
    height: 16px;
    background: #333;
    border-radius: 3px;
    overflow: hidden;
    border: 2px solid #555;
}

#hud .bar-bg.xp {
    height: 10px;
}

#hud .bar-fill {
    height: 100%;
    transition: width 0.3s;
}

#hud .bar-fill.health {
    background: linear-gradient(to bottom, #ff6b6b, #c92a2a);
    width: 100%;
}

#hud .bar-fill.hunger {
    background: linear-gradient(to bottom, #ffd43b, #fab005);
    width: 100%;
}

#hud .bar-fill.xp {
    background: linear-gradient(to bottom, #69db7c, #2f9e44);
    width: 0%;
}

#hud .value {
    color: white;
    font-size: 12px;
    min-width: 45px;
    text-shadow: 1px 1px 1px black;
}

/* Mobile warning */
@media (max-width: 768px) {
    #instructions .controls::after {
        content: "\A\A⚠️ Best played on desktop with mouse";
        white-space: pre;
        color: #ff9800;
    }
}
