:root {
  --bg: #07090b;
  --panel: rgba(14, 13, 11, 0.92);
  --panel-2: rgba(28, 25, 20, 0.95);
  --line: #3a3226;
  --line-hi: #6b5a3c;
  --text: #d9d1bf;
  --dim: #8f8672;
  --gold: #c9a45a;
  --red: #b3261e;
  --green: #5fbf6a;
  --blue: #7393ff;
  --font-title: 'Cinzel', Georgia, serif;
  --font-ui: 'Inter', 'Segoe UI', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--font-ui); overflow: hidden; user-select: none; }
#app, #view { position: fixed; inset: 0; }
#view canvas { display: block; }
.hidden { display: none !important; }
button { font-family: var(--font-ui); cursor: pointer; }
kbd { font-family: var(--font-ui); font-size: 10px; opacity: 0.6; border: 1px solid currentColor; border-radius: 3px; padding: 0 4px; margin-left: 4px; }

/* ---------- pós-processamento barato */
#vignette { position: fixed; inset: 0; pointer-events: none; background: radial-gradient(ellipse at center, transparent 45%, rgba(0,0,0,0.75) 100%); }
#grain { position: fixed; inset: -50%; pointer-events: none; opacity: 0.07; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"); animation: grain 0.5s steps(4) infinite; }
@keyframes grain { 0% { transform: translate(0,0); } 25% { transform: translate(-3%,2%); } 50% { transform: translate(2%,-3%); } 75% { transform: translate(-2%,-1%); } }
#hurt { position: fixed; inset: 0; pointer-events: none; opacity: 0; background: radial-gradient(ellipse at center, transparent 40%, rgba(150,0,0,0.65) 100%); transition: opacity 0.4s; }
#hurt.flash { opacity: 1; transition: none; }
#hurt.low { animation: pulse 1.1s infinite; }
@keyframes pulse { 0%,100% { opacity: 0.25; } 50% { opacity: 0.7; } }

/* ---------- HUD */
#hud { position: fixed; inset: 0; pointer-events: none; }
#hud > * { pointer-events: auto; }
#topbar { position: absolute; top: 14px; left: 18px; text-shadow: 0 2px 6px #000; pointer-events: none !important; }
#zone { font-family: var(--font-title); font-size: 22px; font-weight: 700; letter-spacing: 1px; color: #e8dcc0; }
#clock { font-size: 13px; color: var(--dim); margin-top: 2px; }
#clock b { color: var(--text); font-size: 15px; }
#minimap { position: absolute; top: 14px; right: 14px; width: 220px; height: 220px; border: 1px solid var(--line-hi); background: #000; box-shadow: 0 4px 20px #000; border-radius: 4px; image-rendering: pixelated; }
#log { position: absolute; left: 16px; bottom: 150px; width: min(520px, 40vw); font-size: 13px; line-height: 1.45; pointer-events: none !important; text-shadow: 0 1px 3px #000, 0 0 8px #000; }
#log div { opacity: 0.9; transition: opacity 0.5s; }
#log div.old { opacity: 0.45; }
#log .warn { color: #d9a35a; } #log .alert { color: #ff6a4a; font-weight: 600; } #log .good { color: #8fd08a; }
#log .dim { color: #9a927e; } #log .crit { color: #ffd04a; font-weight: 700; } #log .hurt { color: #ff7a6a; } #log .level { color: #c9a0ff; font-weight: 700; }
#hint { position: absolute; bottom: 6px; left: 50%; transform: translateX(-50%); font-size: 11px; color: #6d6656; pointer-events: none !important; white-space: nowrap; }

#bottom { position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%); display: flex; align-items: flex-end; gap: 18px; }
.orb { position: relative; width: 112px; height: 112px; border-radius: 50%; overflow: hidden; background: #120a08; border: 3px solid #4a3d28; box-shadow: 0 0 0 2px #1a140c, 0 6px 24px #000, inset 0 0 20px #000; }
.orb .fill { position: absolute; left: 0; right: 0; bottom: 0; height: 100%; transition: height 0.35s ease-out; }
.orb.hp .fill { background: radial-gradient(circle at 40% 30%, #ff5a4a, #8a0f0a 60%, #3a0402); }
.orb.inf .fill { background: radial-gradient(circle at 40% 30%, #b8ff6a, #3d7a1a 60%, #11260a); }
.orb .gloss { position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle at 35% 25%, rgba(255,255,255,0.35), transparent 35%); }
.orb span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 18px; text-shadow: 0 2px 4px #000; }
.orb label { position: absolute; bottom: 14px; width: 100%; text-align: center; font-size: 9px; letter-spacing: 2px; color: rgba(255,255,255,0.6); text-shadow: 0 1px 2px #000; }
#center { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 10px 16px 8px; background: linear-gradient(180deg, rgba(20,17,13,0.85), rgba(10,9,7,0.95)); border: 1px solid var(--line); border-radius: 6px; min-width: 420px; box-shadow: 0 6px 30px #000; }
#xpbar { position: relative; width: 100%; height: 8px; background: #1a1610; border: 1px solid #3a3020; border-radius: 4px; overflow: hidden; }
#xpbar .fill { height: 100%; background: linear-gradient(90deg, #6a4ab0, #a080ff); transition: width 0.4s; }
#xpbar span { position: absolute; inset: -3px 0 0; font-size: 9px; text-align: center; color: #ddd; text-shadow: 0 1px 2px #000; }
#ap { display: flex; gap: 4px; align-items: center; }
#ap .pip { width: 18px; height: 22px; border-radius: 3px; background: #2a2418; border: 1px solid #4a3d28; transform: skewX(-12deg); transition: background 0.2s; }
#ap .pip.on { background: linear-gradient(180deg, #ffe08a, #c99a2a); border-color: #ffe9b0; box-shadow: 0 0 8px rgba(255,200,80,0.6); }
#ap .pip.bonus { background: linear-gradient(180deg, #9affd0, #2ab08a); border-color: #c0ffe8; }
#ap .pip.preview { background: linear-gradient(180deg, #ff9a6a, #a0401a); }
#ap .lbl { margin-left: 8px; font-size: 13px; color: var(--gold); font-weight: 700; }
#needs { display: flex; gap: 14px; }
.need { display: flex; align-items: center; gap: 5px; font-size: 12px; }
.need i { font-style: normal; }
.need .bar { width: 110px; height: 7px; background: #1a1610; border: 1px solid #3a3020; border-radius: 4px; overflow: hidden; }
.need .fill { height: 100%; transition: width 0.4s; }
#need-food .fill { background: #c98a3a; } #need-water .fill { background: #3a8ac9; }
.need.low .bar { border-color: #ff5a3a; animation: pulse 1s infinite; }
#status { display: flex; gap: 6px; min-height: 18px; }
#status span { font-size: 11px; padding: 1px 7px; border-radius: 9px; background: #3a1010; border: 1px solid #8a2020; color: #ffb0a0; }
#status span.info { background: #102a3a; border-color: #20608a; color: #a0d8ff; }
#buttons { display: flex; gap: 8px; }
#buttons button, .panel button, .end-buttons button, .hub-card button { background: linear-gradient(180deg, #2a241a, #17130e); color: var(--text); border: 1px solid var(--line-hi); padding: 7px 14px; border-radius: 4px; font-size: 13px; font-weight: 600; }
#buttons button:hover, .panel button:hover, .end-buttons button:hover, .hub-card button:hover { border-color: var(--gold); color: #fff; }
button.primary { background: linear-gradient(180deg, #7a2a1a, #3e120a) !important; border-color: #c0603a !important; }
button.good { background: linear-gradient(180deg, #2a6a3a, #123a1a) !important; border-color: #5fbf6a !important; animation: pulse-btn 1.2s infinite; }
@keyframes pulse-btn { 50% { box-shadow: 0 0 16px rgba(95,191,106,0.7); } }
button:disabled { opacity: 0.4; cursor: default; }
#turnbanner { position: absolute; top: 28%; left: 50%; transform: translateX(-50%); font-family: var(--font-title); font-size: 28px; letter-spacing: 6px; color: #ff6a4a; text-shadow: 0 0 20px #000, 0 2px 4px #000; pointer-events: none !important; animation: fadeio 1.4s forwards; }
@keyframes fadeio { 0% { opacity: 0; } 20% { opacity: 1; } 80% { opacity: 1; } 100% { opacity: 0; } }

/* ---------- painéis */
.panel { position: fixed; background: var(--panel); border: 1px solid var(--line-hi); border-radius: 6px; padding: 12px 14px; box-shadow: 0 10px 40px #000; z-index: 10; }
.panel h3 { margin: 0; font-family: var(--font-title); color: var(--gold); font-size: 17px; letter-spacing: 1px; }
.panel h4 { margin: 12px 0 6px; font-size: 12px; color: var(--dim); text-transform: uppercase; letter-spacing: 1px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.panel .x { background: none !important; border: none !important; color: var(--dim); font-size: 16px; padding: 2px 6px !important; }
#panel-inv { right: 14px; top: 220px; width: 380px; }
#panel-loot { left: 50%; top: 50%; transform: translate(-50%, -60%); width: 360px; }
.tip { font-size: 11px; color: var(--dim); margin: 8px 0 0; }
.inv-body { display: flex; gap: 12px; }
.equip { display: grid; grid-template-columns: repeat(3, 58px); gap: 6px; }
.slot { position: relative; width: 58px; height: 58px; background: #0d0b09; border: 1px solid #3a3226; border-radius: 4px; display: flex; align-items: center; justify-content: center; font-size: 28px; cursor: pointer; }
.slot:hover { border-color: var(--gold); }
.slot .lbl { position: absolute; top: 2px; left: 4px; font-size: 8px; color: #6d6656; text-transform: uppercase; }
.slot .q { position: absolute; bottom: 1px; right: 4px; font-size: 11px; font-weight: 700; text-shadow: 0 1px 2px #000; }
.slot.r1 { border-color: #3a4f9a; box-shadow: inset 0 0 12px rgba(115,147,255,0.25); }
.slot.r2 { border-color: #9a8a2a; box-shadow: inset 0 0 12px rgba(242,210,75,0.25); }
.slot.r3 { border-color: #c06a1a; box-shadow: inset 0 0 14px rgba(255,138,42,0.4); }
.slot.empty { opacity: 0.55; font-size: 20px; color: #3a3226; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, 46px); gap: 4px; }
.grid .slot { width: 46px; height: 46px; font-size: 22px; }
.stats { font-size: 12px; line-height: 1.6; color: var(--dim); flex: 1; }
.stats b { color: var(--text); }
#loot-list { display: flex; flex-direction: column; gap: 4px; max-height: 50vh; overflow-y: auto; margin-bottom: 10px; }
.loot-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border: 1px solid #2a241a; border-radius: 4px; cursor: pointer; background: #0e0c0a; }
.loot-row:hover { border-color: var(--gold); background: #1a160f; }
.loot-row .ic { font-size: 22px; width: 28px; text-align: center; }
.loot-row .nm { flex: 1; font-size: 13px; font-weight: 600; }
.loot-row .sub { font-size: 11px; color: var(--dim); font-weight: 400; }
.empty-msg { color: var(--dim); font-size: 13px; padding: 10px 0; font-style: italic; }

#ctx { position: fixed; z-index: 20; background: var(--panel-2); border: 1px solid var(--line-hi); border-radius: 4px; padding: 4px; min-width: 190px; box-shadow: 0 8px 24px #000; }
#ctx div { padding: 6px 10px; font-size: 13px; cursor: pointer; border-radius: 3px; display: flex; justify-content: space-between; gap: 14px; }
#ctx div:hover { background: #3a2a1a; }
#ctx div.off { opacity: 0.4; pointer-events: none; }
#ctx small { color: var(--gold); }

#tooltip { position: fixed; z-index: 30; pointer-events: none; background: rgba(8,7,6,0.96); border: 1px solid #4a3d28; padding: 8px 11px; border-radius: 4px; font-size: 12px; max-width: 300px; box-shadow: 0 6px 20px #000; }
.tt-name { font-weight: 700; font-size: 14px; margin-bottom: 2px; }
.tt-qty { color: var(--dim); font-weight: 500; }
.tt-type { color: var(--dim); font-size: 11px; margin-bottom: 6px; }
.tt-base { color: #cfc6b0; }
.tt-affix { color: #8fa8ff; }
.tt-desc { color: #cfc6b0; }
.tt-hint { color: var(--gold); font-size: 11px; margin-top: 6px; }
.tt-bar { height: 6px; background: #2a0a08; border-radius: 3px; overflow: hidden; margin: 4px 0; }
.tt-bar div { height: 100%; background: #c0301a; }

#floats { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
.float { position: absolute; font-weight: 800; font-size: 18px; transform: translate(-50%, -50%); text-shadow: 0 2px 3px #000, 0 0 6px #000; animation: floatup 1s ease-out forwards; white-space: nowrap; }
.float.dmg { color: #fff; } .float.crit { color: #ffd04a; font-size: 26px; } .float.hurt { color: #ff4a3a; font-size: 22px; }
.float.miss { color: #aaa; font-size: 14px; font-style: italic; } .float.dot { color: #c04040; font-size: 13px; }
.float.info { color: #a0d8ff; font-size: 14px; } .float.level { color: #c9a0ff; font-size: 28px; }
@keyframes floatup { 0% { opacity: 0; margin-top: 0; } 15% { opacity: 1; } 100% { opacity: 0; margin-top: -50px; } }

/* ---------- telas */
.screen { position: fixed; inset: 0; z-index: 40; overflow-y: auto; background: radial-gradient(ellipse at 50% 0%, rgba(60,30,15,0.5), transparent 60%), linear-gradient(180deg, rgba(5,6,8,0.92), rgba(5,4,3,0.98)); }
.hub-wrap { max-width: 1240px; margin: 0 auto; padding: 28px 20px 40px; }
.hub-title { text-align: center; margin-bottom: 22px; }
.hub-title h1 { font-family: var(--font-title); font-weight: 900; font-size: clamp(38px, 6vw, 72px); letter-spacing: 10px; margin: 0; color: #e6d6b0; text-shadow: 0 0 30px rgba(180,40,20,0.5), 0 4px 0 #3a0a04; }
.hub-title p { color: var(--dim); margin: 4px 0 0; letter-spacing: 2px; font-size: 13px; }
.hub-cols { display: grid; grid-template-columns: 300px 1fr 330px; gap: 16px; }
@media (max-width: 1000px) { .hub-cols { grid-template-columns: 1fr; } }
.hub-card { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 16px; }
.hub-card h3 { margin: 0 0 10px; font-family: var(--font-title); color: var(--gold); font-size: 16px; letter-spacing: 1px; }
.hub-card h3 small { color: var(--dim); font-family: var(--font-ui); font-size: 11px; }
.hub-card .grid { margin-bottom: 4px; }
.hub-card .stats { margin-top: 12px; }
#hub-level { margin-bottom: 12px; font-size: 13px; }
#hub-level .xp { height: 6px; background: #1a1610; border-radius: 3px; overflow: hidden; margin-top: 4px; }
#hub-level .xp div { height: 100%; background: linear-gradient(90deg, #6a4ab0, #a080ff); }
.story #hub-brief { font-size: 13px; line-height: 1.6; color: #b8ae98; }
.story #hub-brief p { margin: 0 0 10px; }
#hub-record { font-size: 12px; color: var(--dim); margin: 14px 0; line-height: 1.7; border-top: 1px solid var(--line); padding-top: 10px; }
button.big { width: 100%; padding: 14px !important; font-size: 16px !important; font-family: var(--font-title) !important; letter-spacing: 2px; }
button.link { background: none !important; border: none !important; color: #6d6656 !important; font-size: 11px !important; margin-top: 10px; text-decoration: underline; }
.end-wrap { max-width: 900px; margin: 0 auto; padding: 40px 20px; text-align: center; }
.end-wrap h1 { font-family: var(--font-title); font-size: 48px; margin: 0; letter-spacing: 6px; }
.end-wrap p { color: var(--dim); }
#end-card { width: 100%; max-width: 840px; border: 1px solid var(--line-hi); border-radius: 6px; box-shadow: 0 10px 40px #000; margin: 10px 0 18px; }
.end-buttons { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ======================= v0.2: tempo real, contas e servidores ======================= */
#srv-badge { margin-top: 6px; display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: 1px; padding: 2px 8px; border-radius: 3px; }
.badge-pve { background: #143a1c; border: 1px solid #3a8a4a; color: #9ef0a8; }
.badge-pvp { background: #3a1010; border: 1px solid #b03a2a; color: #ffb0a0; }
#team { position: absolute; top: 242px; right: 14px; width: 220px; display: flex; flex-direction: column; gap: 4px; }
.mate { background: rgba(10,9,7,0.8); border: 1px solid var(--line); border-radius: 3px; padding: 3px 7px; font-size: 12px; }
.mate.dead { opacity: 0.4; text-decoration: line-through; }
.mbar { height: 4px; background: #2a0a08; margin-top: 2px; border-radius: 2px; overflow: hidden; }
.mbar div { height: 100%; background: #c0301a; }
#log { bottom: 175px; }
#log .who { color: #c9a45a; }
#chat { position: absolute; left: 16px; bottom: 148px; width: min(520px, 40vw); background: rgba(8,7,6,0.92); border: 1px solid var(--line-hi); color: var(--text); padding: 7px 10px; border-radius: 4px; font: 13px var(--font-ui); outline: none; }
#actionbar { position: absolute; bottom: 205px; left: 50%; transform: translateX(-50%); width: 260px; height: 18px; background: rgba(10,9,7,0.9); border: 1px solid var(--line-hi); border-radius: 3px; overflow: hidden; pointer-events: none !important; }
#actionbar .fill { height: 100%; background: linear-gradient(90deg, #8a6a2a, #e0b04a); }
#actionbar span { position: absolute; inset: 0; font-size: 11px; font-weight: 700; text-align: center; line-height: 18px; text-shadow: 0 1px 2px #000; }
.sbar { position: relative; width: 100%; height: 10px; background: #1a1610; border: 1px solid #3a3020; border-radius: 4px; overflow: hidden; }
.sbar .fill { height: 100%; background: linear-gradient(90deg, #2a8a6a, #6ae0b0); transition: width 0.15s; }
.sbar label { position: absolute; inset: -2px 0 0; font-size: 8px; letter-spacing: 2px; text-align: center; color: rgba(255,255,255,0.55); }
.sbar.low .fill { background: #8a3a2a; }
#hotrow { display: flex; align-items: center; gap: 10px; }
#hotbar { display: flex; gap: 4px; }
#hotbar .slot { width: 46px; height: 46px; font-size: 22px; }
#hotbar .slot.armed { border-color: #ff9a40; box-shadow: 0 0 12px rgba(255,150,60,0.7); }
.slot .key { position: absolute; top: 1px; left: 4px; font-size: 10px; color: #8f8672; font-weight: 700; }
.slot .ic { pointer-events: none; }
#ammo { font-size: 12px; color: var(--gold); min-width: 70px; }
#cdwrap { width: 100%; height: 3px; background: transparent; }
#cooldown { height: 100%; background: #c9a45a; width: 0; }
#status span.buff { background: #2a1a3a; border-color: #7a4ab0; color: #d8b8ff; }
#netmsg { position: absolute; top: 40%; left: 50%; transform: translate(-50%, -50%); background: rgba(10,8,6,0.95); border: 1px solid #b03a2a; padding: 18px 26px; border-radius: 6px; font-size: 15px; text-align: center; }
.float.fire { color: #ff9a30; font-size: 14px; }

/* conta */
.login-wrap { max-width: 1000px; margin: 0 auto; padding: 8vh 20px 40px; }
.login-card { max-width: 440px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.login-card label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--dim); text-transform: uppercase; letter-spacing: 1px; }
.login-card input { background: #0b0a08; border: 1px solid var(--line-hi); color: var(--text); padding: 10px 12px; border-radius: 4px; font: 15px var(--font-ui); outline: none; }
.login-card input:focus { border-color: var(--gold); }
.tabs { display: flex; gap: 6px; }
.tab { flex: 1; background: none !important; border: none !important; border-bottom: 2px solid var(--line) !important; border-radius: 0 !important; color: var(--dim) !important; font-size: 14px !important; }
.tab.on { border-bottom-color: var(--gold) !important; color: var(--gold) !important; }
.error { color: #ff7a6a; font-size: 13px; min-height: 18px; }

/* abrigo */
.hub-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.logo-sm { font-family: var(--font-title); font-weight: 900; font-size: 30px; letter-spacing: 5px; margin: 0; color: #e6d6b0; text-shadow: 0 0 20px rgba(180,40,20,0.5); }
.user { font-size: 13px; color: var(--dim); display: flex; gap: 12px; align-items: center; }
.user b { color: var(--gold); }
.server { border: 1px solid var(--line); border-radius: 5px; padding: 10px 12px; margin-bottom: 8px; background: rgba(0,0,0,0.25); }
.server .row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.server .nm { font-weight: 700; font-size: 14px; }
.server .meta { font-size: 11px; color: var(--dim); margin: 4px 0 6px; line-height: 1.5; }
.server .meta b { color: var(--text); }
.server button { padding: 5px 12px !important; font-size: 12px !important; }
.server.pvp { border-color: #5a2a20; }
.server.full { opacity: 0.5; }
.tag { font-size: 10px; font-weight: 800; padding: 1px 6px; border-radius: 3px; margin-left: 6px; }
.tag.hard { background: #3a2a10; border: 1px solid #8a6a2a; color: #f0c870; }
#hub-last { font-size: 12px; color: var(--dim); margin: 12px 0; border-top: 1px solid var(--line); padding-top: 10px; line-height: 1.6; }
#hub-brief { font-size: 12px; line-height: 1.6; color: #a8a090; }

/* percepção de ruído e mira */
#noise-layer { position: fixed; inset: 0; pointer-events: none; z-index: 4; }
.noise-ind { position: absolute; width: 90px; height: 26px; margin: -13px 0 0 -45px; border-top: 4px solid rgba(255,235,200,0.85); border-radius: 50% 50% 0 0 / 100% 100% 0 0; transform: rotate(var(--rot)); animation: tremor 0.9s ease-out forwards; filter: drop-shadow(0 0 6px rgba(255,200,150,0.6)); }
.noise-ind.behind { border-top-color: rgba(255,90,60,0.95); width: 120px; margin-left: -60px; filter: drop-shadow(0 0 10px rgba(255,60,40,0.8)); }
@keyframes tremor {
  0% { opacity: 0; transform: rotate(var(--rot)) translateY(6px); }
  10% { opacity: 1; transform: rotate(var(--rot)) translate(-3px, 0); }
  20% { transform: rotate(var(--rot)) translate(3px, -1px); }
  30% { transform: rotate(var(--rot)) translate(-2px, 1px); }
  40% { transform: rotate(var(--rot)) translate(2px, 0); }
  100% { opacity: 0; transform: rotate(var(--rot)) translateY(-4px); }
}
#crosshair { position: fixed; z-index: 6; pointer-events: none; border: 2px solid rgba(255,230,190,0.75); border-radius: 50%; transform: translate(-50%, -50%); box-shadow: 0 0 4px #000; transition: width 0.08s, height 0.08s; }
#crosshair::after { content: ''; position: absolute; left: 50%; top: 50%; width: 3px; height: 3px; margin: -1.5px; background: #ffe0b0; border-radius: 50%; }
.tag.perm { background: #3a0a2a; border: 1px solid #a0307a; color: #ff9ad8; }
.tag.cone { background: #1a2a3a; border: 1px solid #3a6a9a; color: #a0d0ff; }

/* profissões */
#prof-modal { z-index: 60; }
.prof-wrap { max-width: 1280px; margin: 0 auto; padding: 30px 20px 50px; text-align: center; }
.prof-wrap h1 { font-family: var(--font-title); letter-spacing: 4px; color: #e6d6b0; margin: 0 0 6px; }
.prof-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-top: 18px; text-align: left; }
.prof-card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 14px; cursor: pointer; transition: border-color 0.15s, transform 0.15s; display: flex; flex-direction: column; gap: 6px; }
.prof-card:hover { border-color: var(--gold); transform: translateY(-2px); }
.prof-card.cur { border-color: #5fbf6a; box-shadow: 0 0 0 1px #5fbf6a inset; }
.prof-card .pic { height: 170px; border-radius: 6px; background: radial-gradient(ellipse at 50% 70%, #2a3038, #101216); display: flex; align-items: flex-end; justify-content: center; overflow: hidden; font-size: 64px; }
.prof-card .pic img { height: 170px; }
.prof-card h3 { margin: 4px 0 0; font-family: var(--font-title); color: var(--gold); font-size: 17px; }
.prof-card .d { font-size: 12px; color: var(--dim); font-style: italic; }
.prof-card ul { margin: 0; padding-left: 16px; font-size: 12px; line-height: 1.5; }
.prof-card .pro li { color: #9ee0a0; } .prof-card .con li { color: #ff9a8a; }
.prof-card .kit { font-size: 18px; letter-spacing: 3px; }
#hub-prof { display: flex; gap: 10px; align-items: center; background: rgba(0,0,0,0.25); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; margin-bottom: 12px; }
#hub-prof .ic { font-size: 30px; }
#hub-prof b { color: var(--gold); }
#hub-prof small { color: var(--dim); display: block; }
#hub-prof button { margin-left: auto; padding: 4px 10px !important; font-size: 11px !important; }
#ammo b.empty { color: #ff6a4a; }
#ammo b.rl { color: #ffd27a; }
#ammo .batt { margin-left: 8px; color: #b8c8d8; }
#ammo .batt.low { color: #ff8a5a; }
#crosshair.aimed { border-color: rgba(255,120,90,0.9); }

#ammo .dur { margin-left: 8px; color: #c8b890; } #ammo .dur.low { color: #ff7a5a; } #ammo .sil { margin-left: 6px; color: #9ac8ff; }
#btn-ability { position: relative; overflow: hidden; border-color: #6a8a5a; min-width: 150px; }
#btn-ability .cdfill { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(0,0,0,0.6); pointer-events: none; }
#btn-ability span { position: relative; }
#btn-ability.ready { box-shadow: 0 0 8px rgba(140,220,120,0.55); }
#down-banner { position: fixed; top: 22%; left: 50%; transform: translateX(-50%); z-index: 8; padding: 12px 26px; background: rgba(60,6,6,0.82); border: 1px solid #a02020; border-radius: 6px; color: #ffd0c0; font-family: var(--font-title); letter-spacing: 1px; text-align: center; pointer-events: none; }
#pings { position: fixed; inset: 0; pointer-events: none; z-index: 5; overflow: hidden; }
.ping { position: absolute; transform: translate(-50%, -100%); color: #8fd0ff; font-size: 12px; font-weight: 700; text-align: center; text-shadow: 0 0 4px #000, 0 0 2px #000; }
.ping::before { content: '\25BC'; display: block; font-size: 22px; line-height: 1; animation: pingb 0.9s ease-in-out infinite; }
@keyframes pingb { 50% { transform: translateY(6px); } }
.mate.down span { color: #ff9a6a; } .mate.npc span { color: #ffd23a; }
.mate.down .mbar div { background: #c8641e; } .mate.npc .mbar div { background: #e0b020; }
#skill-modal { z-index: 60; }
.skill-wrap { max-width: 980px; margin: 0 auto; padding: 24px 16px; }
#skill-head { display: flex; gap: 16px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 12px 16px; margin-bottom: 14px; }
#skill-head .ab { font-size: 38px; } #skill-head h2 { margin: 0; font-family: var(--font-title); color: var(--gold); font-size: 20px; }
#skill-head p { margin: 4px 0 0; font-size: 12.5px; color: var(--dim); }
#skill-head .pts { margin-left: auto; text-align: right; font-size: 13px; } #skill-head .pts b { color: #9ee0a0; font-size: 22px; }
#skill-tree { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.sk-branch { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.sk-branch h3 { margin: 0 0 4px; font-family: var(--font-title); color: var(--gold); font-size: 15px; }
.sk-node { border: 1px solid var(--line-hi); border-radius: 6px; padding: 8px 10px; cursor: pointer; background: rgba(0,0,0,0.25); }
.sk-node b { display: block; font-size: 13px; } .sk-node small { color: var(--dim); font-size: 11.5px; line-height: 1.4; display: block; margin-top: 2px; }
.sk-node.own { border-color: #5fbf6a; background: rgba(60,120,70,0.25); cursor: default; }
.sk-node.can:hover { border-color: var(--gold); }
.sk-node.lock { opacity: 0.45; cursor: default; }
.skill-actions { text-align: center; margin-top: 12px; }
@media (max-width: 760px) { #skill-tree { grid-template-columns: 1fr; } }

#shelter-modal { z-index: 60; }
#shelter-head { display: flex; align-items: center; gap: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 12px 16px; margin-bottom: 10px; }
#shelter-head h2 { margin: 0; font-family: var(--font-title); color: var(--gold); font-size: 20px; }
#shelter-head .coins { margin-left: auto; font-size: 20px; color: #f0d070; font-weight: 700; }
#shelter-tabs { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
#shelter-tabs button.on { border-color: var(--gold); color: #fff; box-shadow: 0 0 0 1px var(--gold) inset; }
#shelter-body { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.sh-card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.sh-card h3 { margin: 0; font-family: var(--font-title); color: var(--gold); font-size: 15px; }
.sh-card p { margin: 0; font-size: 12.5px; color: var(--dim); }
.sh-card .chips { display: flex; flex-wrap: wrap; gap: 5px; }
.sh-card .chip { font-size: 12px; padding: 2px 7px; border: 1px solid var(--line-hi); border-radius: 10px; background: rgba(0,0,0,0.3); }
.sh-card .chip.ok { border-color: #5fbf6a; color: #bfeec4; } .sh-card .chip.no { border-color: #8a4a3a; color: #ffb09a; }
.sh-card .lvl { font-size: 12px; color: #9ee0a0; }
.sh-card .bar { height: 6px; border-radius: 3px; background: #222; overflow: hidden; } .sh-card .bar div { height: 100%; background: #6fbf6a; }
.sh-card.locked { opacity: 0.5; } .sh-card.wide { grid-column: 1 / -1; }
.sh-card .row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; } .sh-card .row .nm { flex: 1; min-width: 140px; font-size: 13px; }
.sh-card button.small { padding: 3px 10px; font-size: 12px; }
#shelter-modal, #skill-modal { background: rgba(8,7,6,0.96); overflow-y: auto; }
#shelter-tabs button, .sh-card button, .skill-actions button { background: linear-gradient(180deg, #2a241a, #17130e); color: var(--text); border: 1px solid var(--line-hi); padding: 7px 14px; border-radius: 4px; font-size: 13px; font-weight: 600; cursor: pointer; }
#shelter-tabs button:hover, .sh-card button:hover:not(:disabled) { border-color: var(--gold); color: #fff; }
.sh-card button:disabled { opacity: 0.4; cursor: default; }
.sh-card button.primary { border-color: #8a7440; } .sh-card button.good { border-color: #5fbf6a; }
.skill-actions button.link { background: none; border: none; text-decoration: underline; color: var(--dim); }

#rank-modal { z-index: 60; background: rgba(8,7,6,0.96); overflow-y: auto; }
#rank-head { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 12px 16px; margin-bottom: 12px; }
#rank-head h2 { margin: 0 0 4px; font-family: var(--font-title); color: var(--gold); font-size: 20px; } #rank-head p { margin: 2px 0; font-size: 12.5px; color: var(--dim); }
#rank-body table { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
#rank-body th, #rank-body td { padding: 7px 12px; text-align: left; font-size: 13px; border-bottom: 1px solid #221d15; }
#rank-body th { color: var(--dim); font-size: 11px; text-transform: uppercase; letter-spacing: 1px; } #rank-body tr.me td { background: rgba(120,170,100,0.16); color: #cfe8c0; }
#rank-body td.t { color: #e0c070; font-size: 12px; }
#rank-titles { margin-top: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 12px 16px; }
#rank-titles h3 { margin: 0 0 8px; font-family: var(--font-title); color: var(--gold); font-size: 15px; }
#rank-titles button { margin: 0 6px 6px 0; background: linear-gradient(180deg, #2a241a, #17130e); color: var(--text); border: 1px solid var(--line-hi); padding: 5px 12px; border-radius: 12px; font-size: 12px; cursor: pointer; } #rank-titles button.on { border-color: var(--gold); color: #fff; }
/* #btn-rank fica na fileira de botões do abrigo */

/* ---------- Fase 6: Kombi amarela, chefe e carro */
#world-banner { position: fixed; top: 74px; left: 50%; transform: translateX(-50%); z-index: 7; padding: 7px 18px; background: rgba(50,40,6,0.85); border: 1px solid #c8a020; border-radius: 6px; color: #ffe8a0; font-size: 13px; text-align: center; pointer-events: none; }
#boss-bar { position: fixed; top: 46px; left: 50%; transform: translateX(-50%); width: min(520px, 70vw); z-index: 7; pointer-events: none; text-align: center; font-family: var(--font-title); color: #ffd0a0; letter-spacing: 2px; font-size: 14px; text-shadow: 0 0 6px #000; }
#boss-bar .bb { height: 10px; margin-top: 3px; background: #200606; border: 1px solid #a03020; border-radius: 3px; overflow: hidden; }
#boss-bar .bb div { height: 100%; background: linear-gradient(90deg, #8a1010, #e04020); transition: width 0.2s; }
#status .car { color: #ffd890; } #status .roof { color: #a0d8ff; }

/* ---------- login com Google */
#google-wrap { display: flex; flex-direction: column; align-items: center; gap: 10px; }
#google-wrap.hidden { display: none; }
#google-wrap .or { width: 100%; display: flex; align-items: center; gap: 10px; color: var(--dim); font-size: 12px; text-transform: uppercase; letter-spacing: 1px; }
#google-wrap .or::before, #google-wrap .or::after { content: ''; flex: 1; border-top: 1px solid var(--line-hi); }

/* ====================================================================== Abrigo redesenhado (Fase 8) */
.hub-cols { grid-template-columns: 340px minmax(0, 1fr) 360px; align-items: start; }
.hub-card h4 { margin: 14px 0 6px; font-size: 11px; color: var(--dim); text-transform: uppercase; letter-spacing: 1.5px; font-weight: 600; }
.hub-card .btn-row { display: grid; gap: 6px; margin-top: 8px; }
.hub-card .btn-row.two { grid-template-columns: 1fr 1fr; }
.hub-card .btn-row.three { grid-template-columns: 1fr 1fr 1fr; }
.hub-card .btn-row button { width: 100%; padding: 8px 6px; font-size: 12px; white-space: nowrap; }
.hub-card button.wide { width: 100%; padding: 10px 12px; font-size: 15px; display: flex; flex-direction: column; align-items: center; gap: 2px; font-family: var(--font-title); letter-spacing: 1px; }
.hub-card button.wide small { font-family: var(--font-ui); font-size: 10px; letter-spacing: 0.5px; opacity: 0.75; font-weight: 500; }
.hub-actions { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.char-card #btn-reset { display: block; margin: 12px auto 0; }

/* boneco: equipamento em volta do retrato */
.doll { display: grid; grid-template-columns: 58px 1fr 58px; gap: 8px; align-items: stretch; margin-bottom: 12px; }
.doll-col { display: flex; flex-direction: column; gap: 6px; }
.doll-col .slot { width: 58px; height: 58px; }
.doll-pic { min-height: 250px; border-radius: 8px; background: radial-gradient(ellipse at 50% 75%, #2c2620 0%, #14110d 60%, #0b0a08 100%); border: 1px solid var(--line); display: flex; align-items: flex-end; justify-content: center; overflow: hidden; position: relative; }
.doll-pic::after { content: ''; position: absolute; left: 15%; right: 15%; bottom: 8px; height: 10px; border-radius: 50%; background: rgba(0,0,0,0.6); filter: blur(4px); }
.doll-pic img { height: 250px; position: relative; z-index: 1; }
.slot .lbl { top: 3px; left: 5px; font-size: 8px; letter-spacing: 0.5px; }
.slot.empty .lbl { color: #5d5444; }

/* nome, nível e fichas */
#hub-level { margin-bottom: 12px; }
#hub-level .lvl-row { display: flex; align-items: baseline; gap: 12px; font-size: 13px; }
#hub-level .lvl-row > b { font-family: var(--font-title); font-size: 18px; color: #e6d6b0; margin-right: auto; }
#hub-level .coins { color: #e8c86a; }
#hub-level .xp { height: 6px; margin-top: 6px; }
#hub-level .xp-t { font-size: 10px; color: var(--dim); }

/* profissão */
#hub-prof { display: block; padding: 10px; margin-bottom: 4px; }
#hub-prof .prof-line { display: flex; gap: 10px; align-items: center; }
#hub-prof .ic { font-size: 30px; line-height: 1; }
#hub-prof .prof-line small { display: block; font-size: 11px; color: var(--dim); line-height: 1.35; margin-top: 2px; }
#hub-prof button { margin: 0; padding: 7px 6px !important; font-size: 12px !important; }

/* atributos em grade */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 2px 14px; font-size: 12px; line-height: 1.7; }
.hub-card .stats { margin-top: 0; }
.stats > div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* histórico em blocos */
#hub-record { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 0; padding: 0; border: none; }
#hub-record div { background: rgba(0,0,0,0.3); border: 1px solid var(--line); border-radius: 5px; padding: 6px 4px; text-align: center; }
#hub-record b { display: block; font-size: 16px; color: var(--text); }
#hub-record span { font-size: 10px; color: var(--dim); text-transform: uppercase; letter-spacing: 0.5px; }

/* mochila e depósito ocupam a largura toda, sem sobra torta à direita */
.hub-card .grid { grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 5px; }
.hub-card .grid .slot { width: auto; height: auto; aspect-ratio: 1; }
.hub-card h3 + .grid { margin-top: 2px; }
.hub-card .tip { margin: 6px 0 16px; }

/* servidores */
.server .row { gap: 10px; }
.server .nm { flex: 1; font-size: 15px; }
.server .cnt { font-size: 12px; color: var(--dim); }
.server .row button { min-width: 92px; }
.server .tags { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 4px; }
.server .tags .tag { margin: 0; white-space: nowrap; }
.server .where { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 11px; color: var(--dim); }
.hub-top .user { display: flex; align-items: center; gap: 12px; }
.hub-top .user .link { margin: 0; }

/* opções */
.opt-wrap { max-width: 760px; }
.opt-wrap h2 { font-family: var(--font-title); color: var(--gold); margin: 0 0 10px; }
#options-body section { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 12px 16px; margin-bottom: 12px; }
#options-body h3 { margin: 0 0 8px; font-size: 14px; color: var(--gold); display: flex; align-items: center; justify-content: space-between; }
.opt-row { display: grid; grid-template-columns: 190px 1fr 50px; align-items: center; gap: 12px; padding: 5px 0; font-size: 13px; }
.opt-row input[type=range] { width: 100%; accent-color: var(--gold); }
.opt-row select { background: #0b0a08; color: var(--text); border: 1px solid var(--line-hi); border-radius: 4px; padding: 5px 8px; grid-column: 2 / 4; justify-self: start; }
.opt-row.chk { grid-template-columns: 24px 1fr; cursor: pointer; }
.opt-row.chk input { width: 18px; height: 18px; accent-color: var(--gold); }
.opt-row small { display: block; color: var(--dim); font-size: 11px; }
.keygrid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 18px; }
.keyrow { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; padding: 3px 0; border-bottom: 1px solid rgba(255,255,255,0.04); }
.keyrow button, #options-body h3 button { min-width: 84px; background: #0b0a08; color: var(--text); border: 1px solid var(--line-hi); border-radius: 4px; padding: 4px 8px; font-size: 12px; font-weight: 700; cursor: pointer; }
.keyrow button:hover { border-color: var(--gold); }
.keyrow button.wait { border-color: #ffd23a; color: #ffd23a; animation: pulse-btn 1s infinite; }
@media (max-width: 640px) { .keygrid { grid-template-columns: 1fr; } .opt-row { grid-template-columns: 1fr; } }

/* legendas de som */
#captions { position: fixed; left: 50%; bottom: 200px; transform: translateX(-50%); z-index: 7; display: flex; flex-direction: column; align-items: center; gap: 3px; pointer-events: none; }
#captions div { background: rgba(0,0,0,0.72); color: #f0e8d4; font-size: 14px; padding: 3px 12px; border-radius: 4px; text-shadow: 0 1px 2px #000; }
#captions b { color: #ffd890; margin-right: 6px; font-size: 16px; }
.stats .st { display: flex; justify-content: space-between; gap: 8px; border-bottom: 1px solid rgba(255,255,255,0.04); }
.stats .st span { color: var(--dim); }
.stats .st b small { color: #9ee0a0; font-weight: 600; }
.char-card .stats { grid-template-columns: 1fr 1fr; gap: 0 16px; }
.hub-card .grid.stash { grid-template-columns: repeat(8, 1fr); }
#hub-pack { grid-template-columns: repeat(6, 1fr); max-width: 360px; }
/* HUD: fileira de botões numa linha só, todos da mesma altura */
#buttons { flex-wrap: nowrap; align-items: stretch; }
#buttons button { white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
#captions { bottom: 250px; }
/* mochila em jogo: equipamento em 2 colunas compactas ao lado dos atributos */
#inv-equip { grid-template-columns: repeat(2, 56px); align-content: start; }
#inv-equip .slot { width: 56px; height: 56px; }

/* ---------- criar servidor com mapa real */
.srv-head { display: flex; align-items: center; justify-content: space-between; }
.srv-head button { font-family: var(--font-ui) !important; font-size: 12px !important; padding: 5px 10px !important; letter-spacing: 0; }
.create-wrap { max-width: 1100px; }
.create-wrap h2 { font-family: var(--font-title); color: var(--gold); margin: 0 0 6px; }
.create-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; margin-top: 10px; }
@media (max-width: 860px) { .create-grid { grid-template-columns: 1fr; } }
.search-row { display: flex; gap: 6px; }
.search-row input, .create-form input[type=text], .create-form input:not([type]) { flex: 1; background: #0b0a08; border: 1px solid var(--line-hi); color: var(--text); padding: 8px 10px; border-radius: 4px; font: 13px var(--font-ui); }
.create-wrap button { background: linear-gradient(180deg, #2a241a, #17130e); color: var(--text); border: 1px solid var(--line-hi); padding: 7px 14px; border-radius: 4px; font-size: 13px; font-weight: 600; cursor: pointer; }
.create-wrap button:hover { border-color: var(--gold); }
#cr-map { height: 420px; border-radius: 6px; border: 1px solid var(--line-hi); margin-top: 8px; background: #111; }
#cr-results { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; max-height: 120px; overflow: auto; }
#cr-results div { font-size: 12px; padding: 4px 8px; background: rgba(0,0,0,0.35); border-radius: 3px; cursor: pointer; color: var(--dim); }
#cr-results div:hover { color: #fff; background: rgba(201,164,90,0.15); }
.presets { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; font-size: 12px; color: var(--dim); }
.presets button { padding: 4px 9px !important; font-size: 11px !important; }
.create-form { display: flex; flex-direction: column; gap: 10px; }
.create-form label { display: flex; flex-direction: column; gap: 4px; font-size: 11px; color: var(--dim); text-transform: uppercase; letter-spacing: 1px; }
.create-form label.chk { flex-direction: row; align-items: flex-start; gap: 8px; text-transform: none; letter-spacing: 0; font-size: 12px; color: var(--text); cursor: pointer; }
.create-form label.chk input { margin-top: 2px; accent-color: var(--gold); }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.seg button { font-size: 12px !important; padding: 7px 4px !important; }
.seg button.on { border-color: var(--gold) !important; color: #fff; box-shadow: 0 0 0 1px var(--gold) inset; }
#cr-status { min-height: 18px; font-size: 12px; color: #d9a35a; }
#cr-status.err { color: #ff8a7a; }
.leaflet-container { font: 12px var(--font-ui); }
.tag.real { background: #12301e; border: 1px solid #3a8a5a; color: #9ef0b8; }
.server .owner { font-size: 11px; color: var(--dim); }
#create-modal, #options-modal { background: rgba(6, 6, 7, 0.95); z-index: 60; }
