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

body {
    background: #1a1a2e;
    overflow: hidden;
    font-family: 'Courier New', monospace;
    touch-action: none;
}

#game-container {
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

#gameCanvas {
    background: #87CEEB;
    image-rendering: pixelated;
    cursor: crosshair;
}

#hotbar {
    position: absolute;
    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;
}

.hotbar-slot {
    width: 50px;
    height: 50px;
    background: #8b8b8b;
    border: 2px solid #373737;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    cursor: pointer;
}

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

.hotbar-slot .count {
    position: absolute;
    bottom: 2px;
    right: 4px;
    color: white;
    font-size: 12px;
    text-shadow: 1px 1px #000;
}

.hotbar-slot .key {
    position: absolute;
    top: 2px;
    left: 4px;
    color: #aaa;
    font-size: 10px;
}

.block-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

#crosshair {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 24px;
    text-shadow: 1px 1px 2px black;
    pointer-events: none;
    display: none;
}

#debug {
    position: absolute;
    top: 10px;
    left: 10px;
    color: white;
    font-size: 12px;
    text-shadow: 1px 1px #000;
    pointer-events: none;
}

#start-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    z-index: 100;
}

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

#start-screen p {
    margin: 8px 0;
    color: #aaa;
}

#start-btn {
    margin-top: 30px;
    padding: 15px 40px;
    font-size: 20px;
    background: #5c8a3e;
    color: white;
    border: 3px solid #3d5c29;
    cursor: pointer;
    font-family: inherit;
}

#start-btn:hover {
    background: #6b9f48;
}

.hidden {
    display: none !important;
}

/* Mobile controls */
#mobile-controls {
    position: absolute;
    bottom: 100px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    pointer-events: none;
}

#dpad {
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: auto;
}

#dpad-mid {
    display: flex;
    gap: 40px;
}

#dpad button, #action-btns button {
    width: 50px;
    height: 50px;
    font-size: 20px;
    background: rgba(255, 255, 255, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    color: white;
}

#action-btns {
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: auto;
}

#action-btns button {
    width: 60px;
    height: 60px;
    font-size: 28px;
}

/* Mining progress */
.mine-progress {
    position: absolute;
    pointer-events: none;
}

@media (max-width: 768px) {
    .hotbar-slot {
        width: 40px;
        height: 40px;
    }
    
    .block-icon {
        width: 24px;
        height: 24px;
    }
    
    #mobile-controls {
        display: flex !important;
    }
}
