/* styles.css */
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: 110px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; }

#status-bars {
    display: flex;
    justify-content: space-between;
    width: 364px;
    margin-bottom: 4px;
}

.bar-container {
    display: flex;
}

#hearts-container {
    display: flex;
    gap: -1px; /* Slight overlap for pixelated heart rows */
}

#food-container {
    display: flex;
    flex-direction: row-reverse; /* Drumsticks empty from left-to-right */
    gap: -1px;
}

.status-slot {
    position: relative;
    width: 18px;
    height: 18px;
    image-rendering: pixelated;
    display: inline-block;
}

.status-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    image-rendering: pixelated;
}

.status-fg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    image-rendering: pixelated;
    z-index: 1;
}

/* Base HUD silhouettes if separate _empty files are missing */
.heart-empty {
    background-image: url('./assets/textures/gui/heart.png');
    filter: brightness(0) opacity(0.35);
}

.heart-fill {
    background-image: url('./assets/textures/gui/heart.png');
}

.heart-fill.half {
    clip-path: polygon(0 0, 50% 0, 50% 100%, 0 100%);
}

.food-empty {
    background-image: url('./assets/textures/gui/food.png');
    filter: brightness(0) opacity(0.35);
}

.food-fill {
    background-image: url('./assets/textures/gui/food.png');
}

.food-fill.half {
    clip-path: polygon(50% 0, 100% 0, 100% 100%, 50% 100%);
}

#xp-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 364px;
    margin-bottom: 6px;
}

#xp-level {
    color: #80FF20;
    font-family: inherit;
    font-size: 14px;
    font-weight: bold;
    text-shadow: 
        -1px -1px 0 #000,  
         1px -1px 0 #000,
        -1px  1px 0 #000,
         1px  1px 0 #000,
         0px  2px 0 #000;
    z-index: 10;
    pointer-events: none;
    margin-bottom: 2px;
}

#xp-bar-bg { 
    width: 100%; 
    height: 10px; 
    background: #1b1b1b; 
    border: 2px solid #000; 
    position: relative; 
    image-rendering: pixelated;
    box-shadow: inset 0px 2px 0px rgba(0,0,0,0.4); 
}

#xp-bar-fill { 
    height: 100%; 
    background: linear-gradient(to bottom, #80FF20 0%, #55AA00 100%); 
    box-shadow: inset 0px 1px 0px rgba(255,255,255,0.4); 
    width: 30%; 
}

#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; }
.mc-button.disabled { background: #555 !important; color: #888 !important; border-color: #777 #222 #222 #777 !important; cursor: not-allowed; text-shadow: 2px 2px 0 #111 !important; }

.badge { font-size: 10px; color: #ff5555; vertical-align: super; margin-left: 5px; }

.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; }

/* RETRO ROTATING MENU WALLPAPER PAN */
#title-screen { background: url('./assets/textures/block/dirt.png'); background-size: 64px; animation: panDirt 15s linear infinite; }
@keyframes panDirt { from { background-position: 0 0; } to { background-position: 256px 256px; } }

.menu-overlay { background: rgba(0,0,0,0.7); padding: 15px 30px; border: 2px solid #555; display: flex; flex-direction: column; align-items: center; border-radius: 4px; box-shadow: 0 0 20px rgba(0,0,0,0.9); position: relative; width: 400px; }

/* MINECRAFT BLOCK LOGO MOCK */
#minecraft-logo {
    font-size: 64px;
    font-weight: 900;
    color: #c6c6c6;
    text-shadow: 
        -4px -4px 0 #000,  
         4px -4px 0 #000,
        -4px  4px 0 #000,
         4px  4px 0 #000,
         4px  8px 0 #3c3c3c,
        -4px  8px 0 #3c3c3c,
         0px  8px 0 #3c3c3c;
    letter-spacing: 4px;
    font-family: Arial, sans-serif;
    margin-bottom: 50px;
    position: relative;
    transform: scaleX(0.85) rotate(-3deg);
}

/* BOBBING SPLASH GRAPHICS */
#splash-text {
    color: #ff0;
    font-size: 16px;
    font-weight: bold;
    position: absolute;
    right: -45px;
    bottom: -20px;
    transform: rotate(-15deg);
    text-shadow: 2px 2px 0 #3f3f00;
    animation: splashBob 0.4s infinite alternate ease-in-out;
    pointer-events: none;
    letter-spacing: 1px;
}
@keyframes splashBob { 0% { transform: scale(1) rotate(-15deg); } 100% { transform: scale(1.1) rotate(-15deg); } }

.menu-buttons { display: flex; flex-direction: column; align-items: center; }

.footer-left { position: absolute; bottom: 10px; left: 15px; color: #888; font-size: 11px; pointer-events: none; }
.footer-right { position: absolute; bottom: 10px; right: 15px; color: #888; font-size: 11px; pointer-events: none; }

.input-field { background: #000; border: 2px solid #555; color: #fff; padding: 6px; font-family: inherit; font-size: 14px; width: 280px; margin-bottom: 12px; }
.label { color: #aaa; margin-bottom: 3px; align-self: flex-start; margin-left: 5px; font-size: 12px; }

#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); }

/* PIXEL STYLE MINECRAFT PURPLE GRADIENT TOOLTIP */
#tooltip {
    position: absolute;
    pointer-events: none;
    z-index: 1000;
    background: #100010;
    border: 2px solid #2e006c;
    outline: 2px solid #100010;
    padding: 6px 12px;
    display: none;
    box-shadow: 0 0 10px rgba(0,0,0,0.9);
    border-radius: 2px;
}
.tooltip-title {
    color: #ffffff;
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 4px;
    text-shadow: 1px 1px 0 #3f3f3f;
}
.tooltip-desc {
    color: #55ffff;
    font-size: 12px;
    margin-bottom: 2px;
    text-shadow: 1px 1px 0 #153f15;
}
.tooltip-sub {
    color: #55ff55;
    font-size: 11px;
    text-shadow: 1px 1px 0 #153f15;
}

#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; }