@font-face { font-family: 'Pixelify Sans'; src: url('/fonts/pixelify-sans-latin-400-normal.woff2') format('woff2'); font-weight: 400; }
@font-face { font-family: 'Pixelify Sans'; src: url('/fonts/pixelify-sans-latin-700-normal.woff2') format('woff2'); font-weight: 700; }
:root { --slot: 40px; --ui-font: 'Pixelify Sans', ui-monospace, monospace; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #000; font-family: var(--ui-font); color: #fff; user-select: none; -webkit-user-select: none; }
#c { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; image-rendering: pixelated; }
#ui { position: fixed; inset: 0; pointer-events: none; }
#ui > * { pointer-events: auto; }
#ui > .hud, #ui > .overlay, #ui > .chat:not(.open), #ui > .cursorstack, #ui > .tooltip { pointer-events: none; }
.hidden { display: none !important; }
img { image-rendering: pixelated; }
.btn { font-family: var(--ui-font); font-size: 18px; color: #fff; background: #6b6b6b; border: 2px solid #1a1a1a; box-shadow: inset -2px -3px 0 #4a4a4a, inset 2px 2px 0 #9a9a9a; padding: 9px 20px; cursor: pointer; text-shadow: 2px 2px 0 #333; min-width: 200px; }
.btn:hover { background: #7a8ac8; box-shadow: inset -2px -3px 0 #4a5a98, inset 2px 2px 0 #a8b8f0; }
.btn.small { font-size: 14px; padding: 6px 12px; min-width: 0; }
input { font-family: var(--ui-font); }

/* ---------- login ---------- */
.screen { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; }
.login { background: radial-gradient(ellipse at 50% 30%, #3b5a2a 0%, #1d2c15 45%, #0b0f08 100%); }
.login::before { content: ''; position: absolute; inset: 0; background-image: linear-gradient(rgba(0,0,0,.18) 2px, transparent 2px), linear-gradient(90deg, rgba(0,0,0,.18) 2px, transparent 2px); background-size: 48px 48px; pointer-events: none; }
.logo { font-size: 72px; font-weight: 700; letter-spacing: 4px; color: #f2c23a; text-shadow: 4px 4px 0 #8a5a10, 8px 8px 0 #2a1a05; position: relative; }
.logo span { color: #e8e8e8; text-shadow: 4px 4px 0 #555, 8px 8px 0 #111; }
.sub { color: #c8d8b0; font-size: 18px; margin-bottom: 18px; position: relative; text-shadow: 2px 2px 0 #000; }
.lform { position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.stage { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.lform input { width: 320px; font-size: 20px; padding: 10px 12px; background: #000; color: #fff; border: 2px solid #a0a0a0; outline: none; }
.lform input:focus { border-color: #fff; }
.who { color: #e0e0e0; font-size: 17px; text-shadow: 2px 2px 0 #000; }
.back { color: #b0c8ff; font-size: 14px; text-decoration: none; }
.lerr { color: #ff6b6b; min-height: 22px; font-size: 16px; position: relative; text-shadow: 2px 2px 0 #000; }
.login.busy .btn { opacity: .5; pointer-events: none; }
.ltex { position: absolute; bottom: 24px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.ltexnote, .texnote { color: #c8c8c8; font-size: 13px; max-width: 520px; text-align: center; }

/* ---------- HUD ---------- */
.hud { position: fixed; inset: 0; }
body.nohud .hud, body.nohud .chat { display: none; }
.crosshair { position: absolute; left: 50%; top: 50%; width: 18px; height: 18px; transform: translate(-50%, -50%); mix-blend-mode: difference; }
.crosshair::before, .crosshair::after { content: ''; position: absolute; background: #fff; }
.crosshair::before { left: 8px; top: 0; width: 2px; height: 18px; }
.crosshair::after { top: 8px; left: 0; height: 2px; width: 18px; }
.hotbar-wrap { position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; }
.hotbar { display: flex; background: rgba(0,0,0,.45); border: 2px solid #1a1a1a; padding: 2px; }
.slot { width: var(--slot); height: var(--slot); position: relative; background: #8b8b8b; border: 2px solid; border-color: #373737 #fff #fff #373737; display: flex; align-items: center; justify-content: center; }
.hotbar .slot { background: rgba(80,80,80,.55); border-color: rgba(30,30,30,.8) rgba(160,160,160,.6) rgba(160,160,160,.6) rgba(30,30,30,.8); margin: 0 1px; }
.hotbar .slot.sel { outline: 3px solid #fff; outline-offset: -1px; z-index: 1; box-shadow: 0 0 0 1px #000; }
.slot img { width: 32px; height: 32px; pointer-events: none; }
.slot .cnt, .cursorstack .cnt { position: absolute; right: 1px; bottom: -1px; font-size: 16px; font-weight: 700; text-shadow: 2px 2px 0 #3f3f3f; pointer-events: none; }
.slot .dur { position: absolute; left: 4px; right: 4px; bottom: 3px; height: 3px; background: #000; }
.slot .dur div { height: 100%; }
.stats, .stats2 { width: 362px; display: flex; justify-content: space-between; height: 20px; margin-bottom: 1px; }
.hearts, .food, .armor, .air { display: flex; gap: 0; flex-wrap: wrap; width: 180px; }
.food, .air { flex-direction: row-reverse; }
.hearts img, .food img, .armor img, .air img { width: 18px; height: 18px; }
.hearts img.shake { animation: shake .3s infinite; }
@keyframes shake { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-2px); } }
.xpbar { width: 362px; height: 10px; background: #1a1a1a; border: 2px solid #000; position: relative; margin-bottom: 4px; }
.xpfill { height: 100%; background: linear-gradient(#a8f04a, #6ab81a); width: 0; }
.xplevel { position: absolute; left: 50%; top: -18px; transform: translateX(-50%); color: #80ff20; font-size: 20px; font-weight: 700; text-shadow: 2px 0 0 #000, -2px 0 0 #000, 0 2px 0 #000, 0 -2px 0 #000; }
.heldname { font-size: 18px; text-shadow: 2px 2px 0 #3f3f3f; margin-bottom: 8px; opacity: 0; transition: opacity .4s; height: 22px; }
.actionbar { position: absolute; bottom: 140px; left: 50%; transform: translateX(-50%); font-size: 18px; text-shadow: 2px 2px 0 #333; opacity: 0; transition: opacity .5s; }
.debug { position: absolute; left: 6px; top: 6px; white-space: pre; font-size: 15px; line-height: 19px; background: rgba(0,0,0,.4); padding: 4px 8px; text-shadow: 1px 1px 0 #000; }
.bossbar { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); text-align: center; }
.bossname { font-size: 16px; text-shadow: 2px 2px 0 #333; margin-bottom: 4px; }
.bossouter { width: 364px; height: 10px; background: #2a0a2a; border: 2px solid #000; }
.bossinner { height: 100%; background: linear-gradient(#e070ff, #a020c0); width: 100%; }

/* ---------- overlays ---------- */
.overlay { position: fixed; inset: 0; opacity: 0; display: none; pointer-events: none; transition: opacity .3s; }
.ov-hurt { background: radial-gradient(ellipse at center, transparent 40%, rgba(255,0,0,.8) 100%); display: block; }
.ov-portal { background: radial-gradient(ellipse at center, rgba(120,30,200,.5), rgba(80,10,160,.95)); }
.ov-water { background: rgba(20,60,160,.6); }
.ov-lava { background: rgba(220,80,10,.9); }
.ov-fire { background: linear-gradient(to top, rgba(255,120,0,.9), transparent 45%); }
.ov-sleep { background: #000; transition: opacity 1s; }
.ov-loading { background: #2a1e14; display: flex; align-items: center; justify-content: center; transition: opacity .6s; }
.ov-loading::before { content: ''; position: absolute; inset: 0; background-image: linear-gradient(rgba(0,0,0,.25) 2px, transparent 2px), linear-gradient(90deg, rgba(0,0,0,.25) 2px, transparent 2px); background-size: 64px 64px; }
.loadtext { font-size: 26px; text-shadow: 3px 3px 0 #000; position: relative; }

/* ---------- chat ---------- */
.chat { position: fixed; left: 6px; bottom: 120px; width: min(560px, 60vw); }
.chatlog { max-height: 300px; overflow: hidden; display: flex; flex-direction: column; }
.chatline { background: rgba(0,0,0,.45); padding: 2px 6px; font-size: 16px; text-shadow: 2px 2px 0 #222; transition: opacity 1s; word-wrap: break-word; }
.chatline.fade { opacity: 0; }
.chat.open .chatline.fade { opacity: 1; }
.chat.open .chatlog { overflow-y: auto; }
.chatinput { width: 100%; margin-top: 4px; font-size: 17px; padding: 6px 8px; background: rgba(0,0,0,.6); color: #fff; border: none; outline: none; }

/* ---------- windows ---------- */
.window { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); background: #c6c6c6; border: 3px solid; border-color: #fff #555 #555 #fff; box-shadow: 0 0 0 3px #000, 0 0 0 9999px rgba(0,0,0,.55); padding: 12px 14px 14px; color: #3f3f3f; display: flex; flex-direction: column; gap: 6px; }
.wtitle, .clabel { font-size: 17px; color: #404040; display: flex; align-items: center; gap: 10px; }
.wtop { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 6px; }
.grid { display: grid; gap: 0; }
.grid .slot { margin: 1px; }
.hotrow { margin-top: 8px; }
.col { display: flex; flex-direction: column; align-items: flex-start; }
.col > .slot, .wtop .slot { flex: none; width: var(--slot); }
.wtop .slot.result, .wtop .slot.big { width: 52px; }
.preview { width: 104px; height: 168px; background: #000; border: 2px solid; border-color: #373737 #fff #fff #373737; display: flex; align-items: flex-end; justify-content: center; color: #ddd; font-size: 13px; padding-bottom: 6px; }
.offcol { justify-content: flex-end; height: 168px; }
.craft { display: flex; flex-direction: column; gap: 4px; }
.crow { display: flex; align-items: center; gap: 12px; }
.crow.big { margin: 6px 0 0 30px; }
.arrow { font-size: 28px; color: #8b8b8b; }
.slot.result { width: 52px; height: 52px; }
.slot.big { width: 56px; height: 56px; }
.slot.armor::after, .slot.offhand::after { position: absolute; font-size: 20px; color: #6b6b6b; pointer-events: none; }
.slot.armor:empty.a0::after { content: '⛑'; } .slot.armor:empty.a1::after { content: '▣'; } .slot.armor:empty.a2::after { content: '‖'; } .slot.armor:empty.a3::after { content: '▞'; } .slot.offhand:empty::after { content: '◫'; }
.slot:hover { background: #a8a8a8; }
.furnace { display: flex; align-items: center; gap: 22px; margin: 6px 0 0 50px; }
.fcol { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.flame { width: 22px; height: 22px; background: #8b8b8b; display: flex; align-items: flex-end; }
.flame div { width: 100%; background: linear-gradient(#ffd04a, #ff6a10); }
.farrow { width: 44px; height: 18px; background: #8b8b8b; clip-path: polygon(0 30%, 65% 30%, 65% 0, 100% 50%, 65% 100%, 65% 70%, 0 70%); }
.farrow div { height: 100%; background: #fff; }
.win-creative .cgrid { max-height: 260px; overflow-y: auto; padding-right: 4px; }
.csearch { font-size: 15px; padding: 3px 6px; border: 2px solid #555; background: #fff; color: #222; width: 200px; }
.slot.trash { font-size: 22px; color: #a02020; cursor: pointer; }
.cursorstack { position: fixed; width: 32px; height: 32px; transform: translate(-50%, -50%); pointer-events: none; z-index: 50; }
.cursorstack img { width: 32px; height: 32px; }
.tooltip { position: fixed; background: rgba(16,0,16,.94); border: 2px solid #2a0a5a; padding: 4px 8px; color: #fff; font-size: 15px; z-index: 60; pointer-events: none; white-space: nowrap; text-shadow: 1px 1px 0 #333; }
.tdur { color: #aaa; font-size: 13px; }

/* ---------- menus ---------- */
.death { background: rgba(120,0,0,.55); }
.death h1, .pause h1 { font-size: 48px; text-shadow: 4px 4px 0 #3a0000; margin: 0 0 8px; }
.death p { font-size: 18px; margin: 0 0 16px; text-shadow: 2px 2px 0 #000; }
.pause { background: rgba(0,0,0,.6); overflow-y: auto; padding: 30px 0; justify-content: flex-start; }
.pause h1 { text-shadow: 3px 3px 0 #333; margin-top: 4vh; }
.settings { display: grid; grid-template-columns: repeat(2, 260px); gap: 10px 24px; background: rgba(0,0,0,.4); padding: 14px 18px; border: 2px solid #333; }
.settings label { display: flex; flex-direction: column; font-size: 15px; gap: 4px; }
.settings label.chk { flex-direction: row; align-items: center; gap: 8px; }
.settings input[type=range] { width: 100%; accent-color: #7a8ac8; }
.texrow { display: flex; flex-direction: column; align-items: center; gap: 6px; max-width: 560px; }
.controls { max-width: 620px; font-size: 14px; color: #ddd; background: rgba(0,0,0,.4); padding: 8px 12px; border: 2px solid #333; }
.controls summary { cursor: pointer; font-size: 16px; }
.plist { position: fixed; top: 40px; left: 50%; transform: translateX(-50%); background: rgba(0,0,0,.6); padding: 8px 14px; min-width: 280px; pointer-events: none; }
.ptitle { font-size: 16px; color: #ffd84a; margin-bottom: 6px; text-align: center; }
.pentry { font-size: 16px; padding: 2px 0; }
.opstar { color: #ffd84a; margin-right: 4px; }
@media (max-height: 760px) { :root { --slot: 34px; } .slot img { width: 26px; height: 26px; } .stats, .stats2, .xpbar { width: 308px; } .hearts, .food, .armor, .air { width: 153px; } .hearts img, .food img, .armor img, .air img { width: 15px; height: 15px; } }
