body { margin: 0; overflow: hidden; font-family: 'Courier New', monospace; background: #222; user-select: none; }

#hud { position: absolute; width: 100%; height: 100%; pointer-events: none; display: none; }
#fps-display { position: absolute; top: 10px; left: 10px; color: #fff; font-weight: bold; text-shadow: 1px 1px 0 #000; display: none; z-index: 1000; }

#chat-ui { position: absolute; bottom: 100px; left: 10px; width: 500px; display: flex; flex-direction: column; justify-content: flex-end; pointer-events: none; z-index: 20; }
#chat-history { max-height: 200px; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; margin-bottom: 5px; text-shadow: 1px 1px 0 #000; color: white; font-size: 14px; }
.chat-msg { background: rgba(0,0,0,0.5); padding: 2px 4px; width: fit-content; margin-top: 2px; border-radius: 2px; transition: opacity 0.5s; opacity: 1; }
#chat-input-line { display: none; width: 100%; background: rgba(0,0,0,0.7); pointer-events: auto; padding: 5px; border: 1px solid #555; }
#chat-input { width: 100%; background: transparent; border: none; color: white; font-family: inherit; font-size: 14px; outline: none; }

#crosshair { position: absolute; top: 50%; left: 50%; width: 20px; height: 20px; transform: translate(-50%, -50%); z-index: 10; }
#crosshair::before, #crosshair::after { content: ''; position: absolute; background: rgba(255, 255, 255, 0.8); }
#crosshair::before { top: 9px; left: 0; width: 20px; height: 2px; }
#crosshair::after { top: 0; left: 9px; width: 2px; height: 20px; }

#bottom-ui { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); width: 400px; height: 90px; display: flex; flex-direction: column; align-items: center; }
#status-bars { display: flex; justify-content: space-between; width: 364px; margin-bottom: 2px; }
.bar-container { display: flex; gap: 0px; }
.stat-icon { width: 18px; height: 18px; background-size: contain; background-repeat: no-repeat; background-position: center; image-rendering: pixelated; margin-right: 0px;}
#food-container { flex-direction: row-reverse; }

#xp-bar-bg { width: 364px; height: 8px; background: #333; border: 1px solid #000; margin-bottom: 4px; position: relative; }
#xp-bar-fill { width: 30%; height: 100%; background: #81c784; }

#hud-hotbar { display: flex; background: rgba(0,0,0,0.5); padding: 3px; border-radius: 2px; pointer-events: auto; position: relative; }

#offhand-slot-ui { position: absolute; left: -50px; bottom: 0; width: 40px; height: 40px; background-color: rgba(0,0,0,0.2); border: 2px solid #555; display: none; justify-content: center; align-items: center; }
#offhand-slot-ui .item-icon { width: 80%; height: 80%; }

.mc-button { background: #777; border: 2px solid; border-color: #fff #333 #333 #fff; color: #fff; text-shadow: 2px 2px 0 #333; font-family: inherit; font-size: 16px; padding: 8px 12px; cursor: pointer; text-align: center; width: 300px; margin: 5px; image-rendering: pixelated; }
.mc-button:hover { background: #888; border-color: #ffffaa #3a3a2a #3a3a2a #ffffaa; color: #ffffaa; }
.mc-button.small { width: 145px; display: inline-block; }
.mc-button.listening { background: #a6a62e; color: #ffff55; border-color: #ffffaa #606010 #606010 #ffffaa; }

.menu-screen { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); display: none; flex-direction: column; align-items: center; justify-content: center; z-index: 500; }

#loading-screen { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: #444; color: white; display: none; align-items: center; justify-content: center; z-index: 2000; flex-direction: column; }
#loading-bar-bg { width: 300px; height: 20px; border: 2px solid white; margin-top: 20px; }
#loading-bar-fill { width: 0%; height: 100%; background: #81c784; transition: width 0.1s; }

#title-screen { background: url('./assets/textures/block/dirt.png'); background-size: 64px; }
#title-overlay { background: rgba(0,0,0,0.75); padding: 20px; border: 2px solid #555; display: flex; flex-direction: column; align-items: center; }
.input-field { background: #000; border: 2px solid #555; color: #fff; padding: 10px; font-family: inherit; font-size: 16px; width: 280px; margin-bottom: 20px; }
.label { color: #aaa; margin-bottom: 5px; align-self: flex-start; margin-left: 5px; }

#skin-upload-container { display: flex; flex-direction: column; width: 300px; margin-bottom: 10px; }
#skin-preview { width: 64px; height: 64px; border: 2px solid #555; display: none; background-color: #000; background-size: contain; background-repeat: no-repeat; image-rendering: pixelated; margin: 5px auto 15px auto; }

#pause-menu h2 { color: #fff; margin-bottom: 20px; font-weight: normal; }

#inventory-screen, #creative-screen, #chest-screen, #options-screen, #furnace-screen { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.75); display: none; z-index: 200; justify-content: center; align-items: center; }

.window { background: #c6c6c6; border: 2px solid #000; box-shadow: inset 4px 4px #fff, inset -4px -4px #555; padding: 10px; width: 352px; position: relative; image-rendering: pixelated; }
.large-window { width: 352px; }
.furnace-window { width: 352px; padding-top: 10px; padding-bottom: 10px; background: #c6c6c6; border: 2px solid #000; box-shadow: inset 4px 4px #fff, inset -4px -4px #555; position: relative; image-rendering: pixelated; display: flex; flex-direction: column; align-items: center; }

.furnace-top { width: 100%; height: 160px; position: relative; margin-bottom: 5px; }
.f-slot { position: absolute; width: 32px; height: 32px; background: #8b8b8b; border: 2px solid #373737; border-bottom-color: #fff; border-right-color: #fff; display: flex; justify-content: center; align-items: center; cursor: pointer; }
.f-slot:hover { background: #a0a0a0; }

#f-input { left: 112px; top: 30px; }
#f-fuel { left: 112px; top: 100px; }
#f-output { left: 220px; top: 64px; width: 48px; height: 48px; }

#f-flame-bg { position: absolute; left: 113px; top: 70px; width: 28px; height: 28px; background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAA1+1dtAAAAKElEQVQokWNgwA3+48HsY8SogzgNMDZmHCE1o2E4Gobj0TRC/qO7kQAAW08QA7x4+aQAAAAASUVORK5CYII=') center/contain no-repeat; opacity: 0.1; }
#f-flame-fill { position: absolute; bottom: 0; left: 0; width: 100%; height: 0%; background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAA1+1dtAAAAKElEQVQokWNgwA3+48HsY8SogzgNMDZmHCE1o2E4Gobj0TRC/qO7kQAAW08QA7x4+aQAAAAASUVORK5CYII=') center/contain no-repeat; filter: sepia(1) saturate(5) hue-rotate(-50deg); transition: height 0.1s linear; }

#f-arrow-bg { position: absolute; left: 158px; top: 68px; width: 44px; height: 30px; background: #8b8b8b; clip-path: polygon(0 35%, 65% 35%, 65% 0%, 100% 50%, 65% 100%, 65% 65%, 0 65%); opacity: 0.3; }
#f-arrow-fill { position: absolute; left: 158px; top: 68px; width: 0px; height: 30px; background: #fff; clip-path: polygon(0 35%, 65% 35%, 65% 0%, 100% 50%, 65% 100%, 65% 65%, 0 65%); transition: width 0.1s linear; }

.creative-window { background: #c6c6c6; border: 2px solid #000; width: 420px; height: 520px; position: relative; image-rendering: pixelated; display: flex; flex-direction: column; padding: 10px; box-shadow: inset 4px 4px #fff, inset -4px -4px #555; }
#creative-search { width: 100%; padding: 5px; margin-bottom: 10px; background: #555; color: white; border: 2px solid #333; }
#creative-list { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(9, 36px); gap: 2px; padding: 5px; background: #8b8b8b; border: 2px solid #373737; }

.window-title { font-weight: bold; color: #404040; margin-bottom: 5px; font-size: 14px; align-self: flex-start; }
.slot { width: 32px; height: 32px; border: 2px solid #373737; border-bottom-color: #fff; border-right-color: #fff; background: #8b8b8b; position: relative; display: flex; justify-content: center; align-items: center; }
.slot:hover { background: #a0a0a0; cursor: pointer; }

.hud-slot { width: 40px; height: 40px; border: 2px solid #555; margin: 0 1px; background-color: rgba(0,0,0,0.1); position: relative; display: flex; justify-content: center; align-items: center; }
.hud-slot.active { border: 3px solid white; z-index: 2; margin: -1px 0; }

.item-icon { width: 80%; height: 80%; background-size: contain; image-rendering: pixelated; background-repeat: no-repeat; background-position: center; pointer-events: none; }
.item-count { position: absolute; bottom: 0; right: 2px; color: white; font-size: 12px; font-weight: bold; text-shadow: 2px 2px 0 #3f3f3f; pointer-events: none; }

.crafting-container { display: flex; justify-content: flex-end; align-items: center; margin-bottom: 20px; margin-right: 30px; }
.crafting-grid { display: grid; gap: 2px; margin-right: 15px; }
.grid-2x2 { grid-template-columns: repeat(2, 36px); }
.grid-3x3 { grid-template-columns: repeat(3, 36px); }
.inv-grid { display: grid; grid-template-columns: repeat(9, 36px); gap: 2px; margin-top: 5px; }
.spacer { height: 10px; }
.crafting-arrow { width: 30px; height: 20px; background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAALUlEQVRYR+3QQREAAAgCMNifM4nBcyJg72zbAqc49wQIECBAgAABAgQIECBA4AIj/gAx2y8rkwAAAABJRU5ErkJggg==') no-repeat center/contain; image-rendering: pixelated; margin-right: 15px; opacity: 0.6; filter: invert(1); }

#tooltip { position: absolute; pointer-events: none; z-index: 1000; background: rgba(16, 0, 16, 0.95); border: 2px solid; border-color: #2a002a #2a002a #180018 #180018; padding: 4px 6px; color: white; font-size: 14px; text-shadow: 2px 2px 0 #2a002a; display: none; }
#drag-icon { position: absolute; width: 32px; height: 32px; pointer-events: none; z-index: 500; background-size: contain; image-rendering: pixelated; display: none; }

#death-screen { background: rgba(100, 0, 0, 0.6); display: none; z-index: 300; flex-direction: column; align-items: center; justify-content: center; color: white; }
#death-screen h1 { font-size: 50px; text-shadow: 4px 4px 0 #000; margin-bottom: 20px; }
