@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    overflow: hidden;
    background: #000;
    font-family: 'Press Start 2P', monospace;
    cursor: default;
    user-select: none;
    -webkit-user-select: none;
}

#game-canvas {
    display: block;
    width: 100vw;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
}

/* ===== Loading Screen ===== */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #e22;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    background: linear-gradient(180deg, #2d1a0e 0%, #1a0a00 100%);
}

.loading-content {
    text-align: center;
}

.minecraft-title {
    font-size: 48px;
    color: #fff;
    text-shadow:
        3px 3px 0 #3f3f3f,
        -1px -1px 0 #000,
        4px 4px 8px rgba(0, 0, 0, 0.6);
    letter-spacing: 4px;
    margin-bottom: 40px;
}

.loading-bar-container {
    width: 300px;
    height: 20px;
    background: #222;
    border: 2px solid #555;
    margin: 20px auto;
    position: relative;
}

.loading-bar {
    width: 0%;
    height: 100%;
    background: #5a5;
    transition: width 0.3s;
}

#loading-text {
    color: #aaa;
    font-size: 10px;
    margin-top: 10px;
}

/* ===== Menu Screen ===== */
#menu-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 900;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64"><rect fill="%23555" width="64" height="64"/><rect fill="%23666" x="0" y="0" width="32" height="32"/><rect fill="%23666" x="32" y="32" width="32" height="32"/></svg>');
    background-size: 64px 64px;
    image-rendering: pixelated;
}

#menu-screen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.menu-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.menu-buttons {
    margin-top: 30px;
}

.mc-btn {
    display: block;
    width: 300px;
    margin: 8px auto;
    padding: 12px 20px;
    font-family: 'Press Start 2P', monospace;
    font-size: 12px;
    color: #fff;
    background: #555;
    border: 3px solid #000;
    border-bottom-color: #333;
    border-right-color: #333;
    border-top-color: #888;
    border-left-color: #888;
    cursor: pointer;
    text-shadow: 2px 2px 0 #2a2a2a;
    image-rendering: pixelated;
    transition: background 0.05s;
}

.mc-btn:hover {
    background: #6c6ca0;
    border-top-color: #aac;
    border-left-color: #aac;
    border-bottom-color: #448;
    border-right-color: #448;
}

.mc-btn:active {
    background: #484860;
}

.menu-footer {
    position: absolute;
    bottom: 20px;
    left: 0;
    width: 100%;
    text-align: center;
    z-index: 1;
}

.menu-version {
    color: #aaa;
    font-size: 8px;
}

/* ===== Pause Menu ===== */
#pause-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 800;
    background: rgba(0, 0, 0, 0.6);
}

.pause-content {
    text-align: center;
}

.pause-content h2 {
    color: #fff;
    font-size: 20px;
    margin-bottom: 30px;
    text-shadow: 2px 2px 0 #2a2a2a;
}

/* ===== HUD ===== */
#hud {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
}

/* Crosshair */
#crosshair {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 24px;
}

.ch-h,
.ch-v {
    position: absolute;
    background: #fff;
    mix-blend-mode: difference;
}

.ch-h {
    width: 24px;
    height: 2px;
    top: 50%;
    transform: translateY(-50%);
}

.ch-v {
    width: 2px;
    height: 24px;
    left: 50%;
    transform: translateX(-50%);
}

/* Hotbar */
#hotbar {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0;
    background: rgba(0, 0, 0, 0.6);
    padding: 2px;
    border: 2px solid #1a1a1a;
    image-rendering: pixelated;
}

.hotbar-slot {
    width: 48px;
    height: 48px;
    border: 2px solid #555;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(80, 80, 80, 0.5);
}

.hotbar-slot.selected {
    border: 3px solid #fff;
    background: rgba(130, 130, 130, 0.6);
}

.hotbar-slot canvas {
    width: 32px;
    height: 32px;
    image-rendering: pixelated;
}

.hotbar-slot .slot-number {
    position: absolute;
    bottom: 1px;
    right: 3px;
    color: #ccc;
    font-size: 6px;
    text-shadow: 1px 1px 0 #000;
}

/* Block name tooltip */
#block-name {
    position: absolute;
    bottom: 74px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 10px;
    text-shadow: 1px 1px 0 #3e3e3e;
    opacity: 0;
    transition: opacity 0.3s;
    white-space: nowrap;
}

#block-name.visible {
    opacity: 1;
}

/* Debug Info */
#debug-info {
    position: absolute;
    top: 5px;
    left: 5px;
    color: #fff;
    font-size: 8px;
    line-height: 1.8;
    text-shadow: 1px 1px 0 #000;
}

#debug-info p {
    margin: 0;
}

/* Block break overlay */
#break-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}