* {
    box-sizing: border-box;
    font-family: 'Minecraftia', sans-serif; /* A more thematic font */
}

@font-face {
    font-family: 'Minecraftia';
    src: url('https://misuse.org/tmp/minecraftia.ttf') format('truetype');
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #333;
    color: white;
}

/* The canvas is either the one from HTML or injected by JS */
canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: block;
    cursor: crosshair;
}

/* --- UI Overlay --- */
.ui-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Allows clicks to pass through to the canvas */
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.crosshair {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    font-weight: bold;
}

.hotbar {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 4px;
    pointer-events: auto; /* Hotbar is interactive */
}

.hotbar .slot {
    width: 50px;
    height: 50px;
    background-color: rgba(0, 0, 0, 0.5);
    border: 3px solid #555;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
}

.hotbar .slot.active {
    border-color: #FFF;
    transform: scale(1.1);
    transition: transform 0.1s ease-in-out, border-color 0.1s ease-in-out;
}

/* --- Full Screen Menus (Inventory, Pause) --- */
.menu-overlay {
    display: none; /* Use 'flex' to show */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    justify-content: center;
    align-items: center;
    pointer-events: auto; /* Menus are interactive */
    flex-direction: column;
}

.menu-overlay h2 {
    text-align: center;
    font-size: 2em;
    margin-bottom: 20px;
}

.inventory-grid {
    display: grid;
    grid-template-columns: repeat(9, 54px);
    grid-gap: 4px;
    background-color: rgba(20, 20, 20, 0.8);
    padding: 10px;
    border: 3px solid #555;
}

.inventory-slot {
    width: 50px;
    height: 50px;
    background-color: rgba(0, 0, 0, 0.5);
    border: 2px solid #333;
}

.pause-menu-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 200px;
}

.pause-menu-content button {
    padding: 10px;
    font-size: 16px;
    background-color: #777;
    border: 2px solid #333;
    color: white;
    cursor: pointer;
}

.pause-menu-content button:hover {
    background-color: #999;
    border-color: #555;
}

/* Utility class to hide elements */
.hidden {
    display: none !important;
}
