* { margin: 0; padding: 0; box-sizing: border-box; }
:root { --bg: rgba(12,14,12,.92); --panel: rgba(20,24,20,.95); --line: #3a4438; --tx: #cfd8c8; --acc: #cd412b; --ok: #7da05f; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #000; font-family: 'Segoe UI', Roboto, sans-serif; color: var(--tx); user-select: none; }
#gl { position: fixed; inset: 0; }
.hidden { display: none !important; }
.screen { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 40; }
.screen.dark { background: rgba(0,0,0,.6); }
button { background: #2a332a; color: var(--tx); border: 1px solid var(--line); padding: 8px 16px; cursor: pointer; font-size: 14px; letter-spacing: .06em; }
button:hover { background: #3a453a; border-color: #6a7a60; }
button.big { font-size: 18px; padding: 12px 34px; background: var(--acc); border: 0; color: #fff; font-weight: 700; }
button.big:hover { background: #e05238; }
input, select { background: #161a16; border: 1px solid var(--line); color: var(--tx); padding: 8px 10px; font-size: 14px; }
h1 { font-size: 56px; letter-spacing: .12em; color: #e8e4d8; font-weight: 900; }
h1 span { color: var(--acc); }
h1.red { color: var(--acc); }
h2 { font-size: 18px; letter-spacing: .1em; margin-bottom: 12px; display: flex; justify-content: space-between; }
h3 { font-size: 12px; letter-spacing: .15em; color: #8a967f; margin: 10px 0 4px; }

/* menu */
#menu { background: radial-gradient(ellipse at 50% 110%, #24301e 0%, #0a0d09 70%); }
.menu-box { display: flex; flex-direction: column; gap: 12px; align-items: center; }
.menu-sub { color: #78846d; letter-spacing: .4em; margin-top: -8px; }
.menu-box input { width: 320px; text-align: center; font-size: 16px; }
.menu-row { display: flex; gap: 10px; }
.server-info { font-size: 12px; color: #8a967f; text-align: center; white-space: pre-line; }

.panel { background: var(--panel); border: 1px solid var(--line); padding: 18px 22px; min-width: 420px; max-height: 86vh; overflow: auto; }
.panel.wide { min-width: 700px; }
.panel.small { min-width: 260px; text-align: center; }
.panel label { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin: 8px 0; font-size: 14px; }
.close { padding: 2px 8px; }
.keys { margin-top: 14px; font-size: 11px; color: #78846d; line-height: 1.7; }
table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 13px; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid #242c22; }
.row { display: flex; gap: 8px; }
.row input { flex: 1; }

/* HUD */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
#crosshair { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); color: #fff9; font-size: 18px; }
#hitmark { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); color: #ff5030; font-size: 22px; font-weight: 900; }
#compass { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); background: var(--bg); padding: 3px 18px; font-size: 12px; letter-spacing: .3em; border: 1px solid var(--line); }
#vitals { position: absolute; right: 16px; bottom: 86px; width: 190px; display: flex; flex-direction: column; gap: 4px; }
.bar { position: relative; height: 20px; background: #111511cc; border: 1px solid var(--line); }
.bar i { position: absolute; inset: 0; transform-origin: left; background: #b33; }
.bar.hp i { background: linear-gradient(#c74, #a33); }
.bar.cal i { background: linear-gradient(#b7893c, #96662a); }
.bar.hyd i { background: linear-gradient(#3c7ab7, #2a5a96); }
.bar b { position: absolute; right: 6px; top: 2px; font-size: 11px; color: #fffc; }
#statusIcons { display: flex; gap: 4px; flex-wrap: wrap; }
.sticon { background: #111511dd; border: 1px solid var(--line); font-size: 11px; padding: 2px 6px; color: #e0b040; }
.sticon.bad { color: #e05238; }
#hotbar { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); display: flex; gap: 5px; pointer-events: auto; }
.slot { width: 58px; height: 58px; background: #12160fcc; border: 1px solid var(--line); position: relative; cursor: pointer; }
.slot.active { border-color: var(--acc); box-shadow: 0 0 8px #cd412b66; }
.slot img { width: 100%; height: 100%; image-rendering: pixelated; }
.slot .n { position: absolute; right: 3px; bottom: 1px; font-size: 11px; color: #fff; text-shadow: 0 1px 2px #000; }
.slot .dur { position: absolute; left: 0; bottom: 0; height: 3px; background: #7da05f; }
.slot .key { position: absolute; left: 3px; top: 1px; font-size: 9px; color: #ffffff55; }
#prompt { position: absolute; left: 50%; top: 58%; transform: translateX(-50%); background: var(--bg); border: 1px solid var(--line); padding: 6px 14px; font-size: 13px; }
#buildHint, #ammoHud { position: absolute; right: 16px; bottom: 180px; background: var(--bg); border: 1px solid var(--line); padding: 6px 10px; font-size: 12px; text-align: right; }
#ammoHud { bottom: 40px; font-size: 20px; font-weight: 700; }
#vehHud { position: absolute; left: 16px; bottom: 40px; background: var(--bg); border: 1px solid var(--line); padding: 6px 12px; font-size: 13px; }
#toasts { position: absolute; top: 70px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 4px; align-items: center; }
.toast { background: var(--bg); border: 1px solid var(--line); padding: 5px 14px; font-size: 13px; animation: fade 4s forwards; }
@keyframes fade { 0%,80% { opacity: 1; } 100% { opacity: 0; } }
#eventBanner { position: absolute; top: 40px; left: 50%; transform: translateX(-50%); color: #e0b040; font-size: 15px; letter-spacing: .2em; text-shadow: 0 2px 4px #000; }
#dmgVignette { position: fixed; inset: 0; pointer-events: none; box-shadow: inset 0 0 120px #a0000000; transition: box-shadow .3s; }

/* chat */
#chat { position: fixed; left: 12px; bottom: 12px; width: 380px; z-index: 20; }
#chatLog { max-height: 180px; overflow-y: auto; font-size: 13px; display: flex; flex-direction: column; gap: 2px; }
#chatLog div { background: #0009; padding: 2px 8px; }
#chatLog .sys { color: #e0b040; } #chatLog .team { color: #7da0ff; } #chatLog .local { color: #a0e07f; } #chatLog .kill { color: #e05238; }
#chatInputRow { display: flex; gap: 4px; margin-top: 4px; }
#chatInput { flex: 1; }

/* inventory */
#invScreen { flex-direction: row; gap: 18px; align-items: flex-start; padding-top: 6vh; }
#invLeft, #invRight { background: var(--panel); border: 1px solid var(--line); padding: 14px; width: 400px; max-height: 84vh; overflow-y: auto; }
#invMid { width: 400px; display: flex; flex-direction: column; gap: 12px; }
#containerPanel, #itemInfo { background: var(--panel); border: 1px solid var(--line); padding: 14px; }
.grid6 { display: grid; grid-template-columns: repeat(6, 58px); gap: 5px; }
#wearSlots { display: flex; gap: 5px; flex-wrap: wrap; }
.slot .wl { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 9px; color: #ffffff33; letter-spacing: .1em; }
#itemInfo { font-size: 13px; min-height: 90px; }
#itemInfo h4 { color: #e8e4d8; margin-bottom: 4px; }
#itemInfo .desc { color: #8a967f; font-size: 12px; margin-bottom: 6px; }
#itemInfo .props { font-size: 11px; color: #a8b49b; line-height: 1.6; }
#itemInfo .actions { margin-top: 8px; display: flex; gap: 6px; flex-wrap: wrap; }
#itemInfo .actions button { font-size: 11px; padding: 4px 10px; }
#craftCats { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
#craftCats button { font-size: 10px; padding: 3px 8px; }
#craftCats button.on { background: var(--acc); color: #fff; }
#craftSearch { width: 100%; margin-bottom: 6px; }
#craftList { display: grid; grid-template-columns: repeat(6, 58px); gap: 5px; max-height: 300px; overflow-y: auto; }
.slot.craftable { border-color: #5a7a4a; }
.slot.uncraftable img { opacity: .35; }
.slot.locked { outline: 1px dashed #666; }
#craftDetail { background: #161a16; border: 1px solid var(--line); padding: 10px; font-size: 12px; margin-top: 8px; }
#craftQueue { display: flex; gap: 5px; }
#craftQueue .slot .prog { position: absolute; left: 0; bottom: 0; height: 100%; background: #7da05f33; }
#containerActions button { margin-top: 8px; font-size: 12px; }
#containerExtra { font-size: 12px; color: #e0b040; margin-bottom: 6px; }

/* map */
#mapCanvas { border: 2px solid var(--line); background: #05070a; max-height: 84vh; }
#mapLegend { font-size: 11px; color: #8a967f; margin-top: 6px; }

/* death */
#deathScreen { background: radial-gradient(ellipse at center, #30060699 0%, #000000ee 80%); gap: 16px; }
#bagList { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
#bagList button { min-width: 130px; }

/* shop */
#shopList { display: flex; flex-direction: column; gap: 6px; max-height: 60vh; overflow-y: auto; }
.shopRow { display: flex; align-items: center; gap: 10px; background: #161a16; padding: 6px 10px; font-size: 13px; }
.shopRow img { width: 36px; height: 36px; }
.shopRow .price { margin-left: auto; color: #e0b040; }

/* team */
#teamPanel { position: fixed; left: 12px; top: 60px; background: var(--bg); border: 1px solid var(--line); padding: 8px 12px; font-size: 12px; z-index: 15; min-width: 150px; }
#teamPanel .mate { display: flex; gap: 6px; align-items: center; }
#teamPanel .dot { width: 8px; height: 8px; border-radius: 50%; background: #555; } #teamPanel .dot.on { background: var(--ok); }
#teamInviteBox { position: fixed; top: 110px; left: 50%; transform: translateX(-50%); background: var(--bg); border: 1px solid var(--acc); padding: 10px 16px; z-index: 30; }

/* gestures */
#gestureWheel { position: fixed; left: 50%; top: 50%; transform: translate(-50%,-50%); z-index: 30; width: 320px; height: 320px; }
#gestureWheel button { position: absolute; width: 90px; transform: translate(-50%,-50%); }

/* build picker / hammer menu */
#buildPicker, #hammerMenu { position: fixed; left: 50%; top: 50%; transform: translate(-50%,-50%); z-index: 30; display: grid; grid-template-columns: repeat(4, 110px); gap: 6px; background: var(--panel); border: 1px solid var(--line); padding: 12px; }
#buildPicker button, #hammerMenu button { font-size: 11px; padding: 10px 4px; }

/* loading */
#loading { background: #0a0d09; z-index: 60; }
#loadingBar { width: 340px; height: 6px; background: #1a201a; margin-top: 24px; }
#loadingBar i { display: block; height: 100%; width: 0; background: var(--acc); transition: width .2s; }
#loadingText { margin-top: 10px; color: #78846d; font-size: 13px; }

::-webkit-scrollbar { width: 8px; } ::-webkit-scrollbar-thumb { background: #333d30; }
