:root {
  --bg: #14121c; --panel: rgba(26, 22, 38, 0.92); --edge: #5a4a7a; --edge-hi: #8a78b8; --gold: #ffd36b; --green: #9fe870;
  --text: #ece8f6; --muted: #a49cc0;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--text); font: 14px/1.35 system-ui, sans-serif; }
canvas#game { position: fixed; inset: 0; width: 100vw; height: 100vh; image-rendering: pixelated; display: block; }
canvas { image-rendering: pixelated; }
[hidden] { display: none !important; }
.pix { font-family: "Silkscreen", ui-monospace, monospace; letter-spacing: 0.5px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

/* moldura estilo "pixel" */
.frame {
  background: var(--panel);
  border: 3px solid var(--edge);
  border-radius: 4px;
  box-shadow: 0 0 0 2px #0c0a12, inset 0 0 0 1px var(--edge-hi), 0 6px 18px rgba(0, 0, 0, 0.45);
  padding: 10px;
}
.title { color: var(--gold); font-size: 13px; margin-bottom: 6px; }

button { font: inherit; color: #fff; border: 0; cursor: pointer; }
button.big { width: 100%; padding: 11px; margin-top: 6px; font-family: "Silkscreen", monospace; font-size: 16px; background: linear-gradient(#5cb84a, #3d7a32); border: 2px solid #1e3a18; border-radius: 4px; box-shadow: inset 0 2px 0 #8ae070; }
button.big:hover { filter: brightness(1.1); }

/* ===== login ===== */
#login { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(720px, calc(100vw - 24px)); max-height: calc(100vh - 24px); overflow-y: auto; z-index: 5; padding: 16px 18px; }
#login h1 { margin: 0; font-family: "Silkscreen", monospace; font-size: 34px; color: #6fe6ff; text-shadow: 3px 3px 0 #2a1450, 0 0 12px rgba(111, 230, 255, 0.45); text-align: center; }
#login .sub { margin: 0 0 12px; color: var(--muted); text-align: center; }
.login-grid { display: grid; grid-template-columns: 200px 1fr; gap: 18px; }
@media (max-width: 620px) { .login-grid { grid-template-columns: 1fr; } }
.hero-preview { display: flex; flex-direction: column; align-items: center; gap: 8px; background: radial-gradient(#3a2a5c, #160f26); border: 2px solid #0c0a12; border-radius: 4px; padding: 12px 8px; }
#big-preview { width: 144px; height: auto; }
#preview-name { color: var(--gold); font-size: 15px; }
.label { color: var(--muted); margin-bottom: 4px; font-size: 13px; }
#login label { display: block; margin-top: 8px; color: var(--muted); font-size: 13px; }
#login input { display: block; width: 100%; margin-top: 3px; padding: 8px; background: #0e0d15; color: #fff; border: 2px solid #3a3350; border-radius: 4px; font-size: 15px; }
#login input:focus { outline: none; border-color: var(--edge-hi); }
#classes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
#classes .cls { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px 4px; background: #24203a; border: 2px solid #3a3350; border-radius: 4px; cursor: pointer; font-size: 11px; color: #ddd; font-family: "Silkscreen", monospace; }
#classes .cls canvas { width: 64px; height: auto; }
#classes .cls:hover { border-color: var(--edge-hi); }
#classes .cls.on { border-color: var(--green); background: #2e3a2a; }
#class-desc { min-height: 3.4em; margin: 8px 0 0; color: var(--text); font-size: 13px; background: #0e0d15; padding: 8px; border-radius: 4px; }
#class-desc b { color: var(--gold); }
#class-desc img { width: 20px; height: 20px; vertical-align: middle; margin-right: 4px; }
.looks { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.swatches { display: flex; gap: 4px; flex-wrap: wrap; }
.swatches span { width: 20px; height: 20px; border-radius: 3px; border: 2px solid #0c0a12; cursor: pointer; }
.swatches span.on { outline: 2px solid var(--green); outline-offset: 1px; }
#login-err { color: #ff7a7a; min-height: 1.2em; margin: 8px 0 0; }

/* ===== HUD ===== */
#portrait { position: fixed; top: 10px; left: 10px; display: flex; gap: 10px; align-items: flex-start; width: 270px; z-index: 2; padding: 8px 8px 10px; }
#face { width: 56px; height: auto; min-height: 56px; background: radial-gradient(#3a2a5c, #160f26); border: 2px solid #0c0a12; border-radius: 3px; }
#portrait .info { flex: 1; min-width: 0; }
#portrait .row { display: flex; justify-content: space-between; align-items: baseline; }
#s-level { color: var(--gold); font-size: 12px; }
#s-class { font-size: 12px; margin-bottom: 3px; }
.bar { position: relative; height: 13px; background: #0a0910; border: 1px solid #000; border-radius: 2px; margin-top: 3px; overflow: hidden; }
.bar i { position: absolute; inset: 0 auto 0 0; transition: width 0.25s; }
.bar.hp i { background: linear-gradient(#ff7a6a, #c8302a); }
.bar.xp i { background: linear-gradient(#8ac8ff, #3a6ad0); }
.bar.quest i { background: linear-gradient(#ffe27a, #c89020); }
.bar span { position: relative; display: block; font-size: 10px; line-height: 12px; padding-left: 4px; text-shadow: 1px 1px 0 #000; }

#quest { position: fixed; top: 10px; right: 10px; width: 240px; z-index: 2; font-size: 13px; padding: 8px 10px; }
#q-name { font-weight: 600; }
#quest.done { border-color: #8a7a2a; }

#actionbar { position: fixed; left: 50%; bottom: 12px; transform: translateX(-50%); display: flex; gap: 8px; z-index: 3; }
.slot { position: relative; width: 58px; height: 58px; padding: 0; background: linear-gradient(#2e2846, #1a1628); border: 3px solid var(--edge); border-radius: 4px; box-shadow: 0 0 0 2px #0c0a12, inset 0 0 0 1px var(--edge-hi); display: grid; place-items: center; overflow: hidden; }
.slot:hover { border-color: var(--edge-hi); }
.slot canvas, .slot img { width: 40px; height: 40px; image-rendering: pixelated; }
#a-atk canvas { width: 36px; height: 45px; }
#a-ride canvas { width: 50px; height: 40px; }
.slot kbd { position: absolute; right: 2px; bottom: 1px; font: 10px "Silkscreen", monospace; color: #fff; text-shadow: 1px 1px 0 #000; }
.slot .cd { position: absolute; inset: 0; background: conic-gradient(rgba(0, 0, 0, 0.72) var(--p, 0%), transparent 0); }
.slot .cdt { position: absolute; font: 700 18px "Silkscreen", monospace; text-shadow: 2px 2px 0 #000; }
.slot.ready { border-color: #b08aff; box-shadow: 0 0 0 2px #0c0a12, 0 0 12px #a07aff; }
.slot .lock { position: absolute; font-size: 18px; }
.slot.locked canvas { filter: grayscale(1) brightness(0.5); }
.slot.active { border-color: var(--gold); box-shadow: 0 0 0 2px #0c0a12, 0 0 12px #ffc23a; }
.slot .txt { font-size: 13px; color: var(--muted); }
.slot.active .txt { color: var(--gold); }
#skill-name { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); font-size: 12px; color: #e0c8ff; text-shadow: 1px 1px 0 #000; z-index: 3; white-space: nowrap; }

#bag { position: fixed; right: 10px; top: 120px; width: 240px; z-index: 2; }
#equip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 10px; }
.eq { background: #0e0d15; border: 2px solid #3a3350; border-radius: 3px; text-align: center; padding: 4px 2px; font-size: 11px; color: var(--muted); }
.eq canvas { width: 40px; height: 50px; display: block; margin: 0 auto 2px; }
#inv { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin-bottom: 6px; }
.cell { position: relative; aspect-ratio: 1; background: #0e0d15; border: 2px solid #2a2540; border-radius: 3px; display: grid; place-items: center; }
.cell img { width: 28px; height: 28px; image-rendering: pixelated; }
.cell b { position: absolute; right: 2px; bottom: 0; font-size: 11px; text-shadow: 1px 1px 0 #000; }
#gold { float: right; color: var(--text); font-family: system-ui, sans-serif; font-size: 13px; }

#chat { position: fixed; left: 10px; bottom: 10px; width: min(360px, calc(100vw - 20px)); z-index: 2; padding: 8px; }
#chat-log { height: 130px; overflow-y: auto; font-size: 13px; margin-bottom: 6px; word-wrap: break-word; }
#chat-log .sys { color: #e0c060; }
#chat-log b { color: var(--green); }
#chat-input { width: 100%; padding: 6px; background: #0e0d15; color: #fff; border: 2px solid #3a3350; border-radius: 3px; }

@media (max-width: 900px) {
  #chat { width: 260px; }
  #chat-log { height: 90px; }
  #quest { width: 190px; }
  .slot { width: 48px; height: 48px; }
  .slot canvas, .slot img { width: 32px; height: 32px; }
  #actionbar { bottom: 130px; }
}


/* ===================================================================================
   HUD nova (Codex da Interface): peças de pedra/ferro/ouro/runa feitas no PixelLab.
   =================================================================================== */
#hud { --gold: #d8a948; --gold-hi: #f3d488; --rune: #5fe3f0; --ink: #ece4d4; --muted2: #a69cb6;
  font-family: "Pixelify Sans", system-ui, sans-serif; }
#hud .ptitle { font: 400 22px/1 "Jacquard 12", "Pixelify Sans", serif; color: var(--gold); text-shadow: 2px 2px 0 #0b0910; margin: 2px 0 6px; }

/* painel de pedra esticável (9 fatias da moldura) */
#hud .panel { border: 17px solid transparent; border-image: url("assets/ui/painel.png") 34 fill / 17px stretch; padding: 2px 4px; image-rendering: pixelated; filter: drop-shadow(0 4px 6px rgba(0,0,0,.6)); }

/* retrato */
#portrait { position: fixed; top: 8px; left: 8px; width: 320px; height: 156px; background: url("assets/ui/retrato.png") no-repeat; image-rendering: pixelated; z-index: 2; filter: drop-shadow(0 4px 6px rgba(0,0,0,.6)); }
#portrait #face { position: absolute; left: 31px; top: 24px; width: 91px; height: 109px; object-fit: contain; image-rendering: pixelated; background: radial-gradient(ellipse at 50% 70%, #2e2448, #120e1b); border: 0; }
#p-name { position: absolute; left: 164px; top: 30px; width: 137px; text-align: center; }
#p-name b { display: block; font: 600 16px/1 "Pixelify Sans", sans-serif; letter-spacing: .5px; color: var(--ink); text-shadow: 1px 1px 0 #000; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* nível: selo de pedra no canto de cima da janela do retrato */
#s-level { position: absolute; left: 25px; top: 18px; min-width: 30px; padding: 3px 5px 2px; text-align: center; font: 11px/1 "Silkscreen", monospace; color: var(--gold-hi);
  background: linear-gradient(#2c2438, #151119); border: 1px solid #0b0910; box-shadow: inset 0 0 0 1px #7a5418, 0 2px 3px rgba(0,0,0,.6); text-shadow: 1px 1px 0 #000; z-index: 1; }
#s-class { display: none; }
.pbar { position: absolute; left: 162px; width: 139px; overflow: hidden; }
.pbar.hp { top: 60px; height: 18px; }
.pbar.xp { top: 99px; height: 8px; }
.pbar i { position: absolute; inset: 0 auto 0 0; transition: width .3s; }
.pbar.hp i { background: linear-gradient(#ef7a66, #b2352b 60%, #7d1e19); box-shadow: inset 0 1px 0 rgba(255,255,255,.25); }
.pbar.xp i { background: linear-gradient(#8fe6f5, #2b8fb8); }
.pbar span { position: relative; display: block; text-align: center; font: 10px/18px "Silkscreen", monospace; color: #fff; text-shadow: 1px 1px 0 #000; }
.pbar.xp span { display: none; }
#portrait:hover .pbar.xp span { display: block; line-height: 8px; font-size: 7px; }

/* minimapa no anel */
#minimap { position: fixed; top: 6px; right: 8px; width: 192px; height: 192px; z-index: 2; filter: drop-shadow(0 4px 6px rgba(0,0,0,.6)); }
#minimap img { position: absolute; inset: 0; width: 192px; height: 192px; pointer-events: none; }
#minimap canvas { position: absolute; left: 32px; top: 29px; width: 128px; height: 128px; border-radius: 50%; image-rendering: pixelated; background: #120e1b; }
#mm-zone { position: absolute; left: 0; right: 0; bottom: -2px; text-align: center; font: 10px "Silkscreen", monospace; color: var(--gold-hi); text-shadow: 1px 1px 0 #000; letter-spacing: 1px; }

/* missão embaixo do minimapa */
#quest { position: fixed; top: 222px; right: 12px; width: 206px; z-index: 2; font-size: 13px; }
#q-name { font-weight: 600; color: var(--ink); }
#q-text { color: var(--muted2); font-size: 12px; }
.qbar { height: 6px; margin-top: 6px; background: #0b0910; box-shadow: inset 0 0 0 1px #4b4458; }
.qbar i { display: block; height: 100%; background: linear-gradient(90deg, #b8892f, var(--gold-hi)); }

/* barra de ações: laje de pedra em 2x com os 4 slots encaixados */
#actionbar { position: fixed; left: 50%; bottom: 10px; transform: translateX(-50%); width: 334px; height: 108px; z-index: 3; display: block; gap: 0; filter: drop-shadow(0 4px 8px rgba(0,0,0,.7)); }
#actionbar .bg { position: absolute; inset: 0; width: 334px; height: 108px; image-rendering: pixelated; pointer-events: none; }
#actionbar .slot { position: absolute; top: 22px; width: 56px; height: 60px; background: transparent; border: 0; box-shadow: none; border-radius: 0; padding: 0; }
#a-atk { left: 30px; } #a-skill { left: 106px; } #a-ride { left: 182px; } #a-auto { left: 258px; }
#actionbar .slot canvas, #actionbar .slot img { width: 40px; height: 40px; object-fit: contain; image-rendering: pixelated; }
#actionbar .slot kbd { left: 3px; right: auto; top: 1px; bottom: auto; font: 9px "Silkscreen", monospace; color: var(--gold-hi); }
#actionbar .slot.ready { box-shadow: 0 0 0 2px var(--rune), 0 0 12px rgba(95,227,240,.6); border: 0; }
#actionbar .slot.active { box-shadow: 0 0 0 2px var(--gold), 0 0 12px rgba(216,169,72,.6); border: 0; }
#actionbar .slot .txt { font: 11px "Silkscreen", monospace; color: var(--muted2); }
#actionbar .slot.active .txt { color: var(--gold-hi); }
#skill-name { bottom: 122px; font: 400 20px "Jacquard 12", serif; color: #cfe9ff; }

/* menus no canto inferior direito */
#menu { position: fixed; right: 10px; bottom: 12px; display: flex; gap: 6px; z-index: 3; }
.mbtn { position: relative; width: 44px; height: 44px; padding: 0; background: linear-gradient(#2c2438, #17131f); border: 2px solid #0b0910; box-shadow: inset 0 0 0 1px #4b4458, inset 0 0 0 2px #0b0910, 0 0 0 1px #7a5418; display: grid; place-items: center; }
.mbtn:hover { box-shadow: inset 0 0 0 1px var(--gold), 0 0 0 1px var(--gold); }
.mbtn img { width: 26px; height: 26px; image-rendering: pixelated; }
.mbtn kbd { position: absolute; left: 2px; top: 0; font: 9px "Silkscreen", monospace; color: var(--gold-hi); text-shadow: 1px 1px 0 #000; }

/* mochila abre como painel à direita */
#bag { position: fixed; right: 10px; top: 222px; width: 250px; z-index: 4; }

/* chat: faixa translúcida, sem moldura */
#chat { position: fixed; left: 8px; bottom: 10px; width: min(340px, calc(100vw - 360px)); z-index: 2; padding: 6px 8px; background: linear-gradient(90deg, rgba(11,9,16,.72), rgba(11,9,16,.35) 80%, transparent); border: 0; box-shadow: none; }
#chat-log { height: 110px; font-size: 13px; }
#chat-log .sys { color: var(--gold-hi); }
#chat-input { background: rgba(11,9,16,.8); border: 1px solid #4b4458; font-family: "Pixelify Sans", sans-serif; }

@media (max-width: 900px) {
  #portrait { transform: scale(.75); transform-origin: top left; }
  #minimap { transform: scale(.75); transform-origin: top right; }
  #quest { top: 168px; width: 170px; }
  #actionbar { transform: translateX(-50%) scale(.85); transform-origin: bottom center; bottom: 140px; }
  #chat { width: 240px; }
}

/* menu (laje de pedra 1,5x) e painéis */
#menu { position: fixed; right: 10px; bottom: 12px; width: 250px; height: 81px; display: block; gap: 0; z-index: 3; filter: drop-shadow(0 4px 8px rgba(0,0,0,.7)); }
#menu .bg { position: absolute; inset: 0; width: 250px; height: 81px; image-rendering: pixelated; pointer-events: none; }
#menu .mbtn { position: absolute; top: 16px; width: 42px; height: 45px; background: transparent; border: 0; box-shadow: none; padding: 0; display: grid; place-items: center; cursor: pointer; }
#a-bag { left: 22px; } #a-fam { left: 79px; } #a-mnt { left: 136px; } #a-skills { left: 193px; } #a-quest { left: 250px; } #a-opt { left: 307px; }
#menu .mbtn img { width: 32px; height: 32px; image-rendering: pixelated; transition: transform .12s; }
#menu .mbtn:hover img { transform: translateY(-2px); filter: brightness(1.15) drop-shadow(0 0 4px rgba(95,227,240,.6)); }
#menu .mbtn.on { box-shadow: 0 0 0 2px var(--gold), 0 0 10px rgba(216,169,72,.5); }
#menu .mbtn kbd { position: absolute; left: 2px; top: 0; font: 8px "Silkscreen", monospace; color: var(--gold-hi); text-shadow: 1px 1px 0 #000; }
#fam-panel, #opt-panel { position: fixed; right: 10px; bottom: 104px; width: 260px; z-index: 4; }
#bag { top: auto; bottom: 104px; }
#fam-info { color: var(--ink); margin-bottom: 8px; }
#fam-info b { color: var(--gold-hi); }
#fam-list { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
#fam-list button { position: relative; aspect-ratio: 1; padding: 0; cursor: pointer; background: radial-gradient(#2e2640, #17131f); border: 2px solid #0b0910; box-shadow: inset 0 0 0 2px var(--rar, #4b4458); display: grid; place-items: center; }
#fam-list button img { width: 80%; image-rendering: pixelated; }
#fam-list button.on { box-shadow: inset 0 0 0 2px var(--rune), 0 0 8px rgba(95,227,240,.6); }
.fhint { margin-top: 8px; font-size: 11px; color: var(--muted2); }
.keys { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; font-size: 13px; color: var(--ink); margin-bottom: 10px; }
.keys kbd { display: inline-block; min-width: 22px; padding: 1px 4px; margin-right: 4px; font: 9px "Silkscreen", monospace; color: var(--gold-hi); background: #17131f; border: 1px solid #4b4458; text-align: center; }
.obtn { width: 100%; padding: 8px; font: 600 14px "Pixelify Sans", sans-serif; color: var(--ink); background: linear-gradient(#352d45, #241e31); border: 2px solid #0b0910; box-shadow: inset 0 1px 0 #7a7190; cursor: pointer; }
.obtn:hover { background: linear-gradient(#3f3552, #2b2439); }
@media (max-width: 900px) { #menu { transform: scale(.8); transform-origin: bottom right; } }

/* ===================== LOGIN (Codex da Interface) ===================== */
#login { position: fixed; inset: 0; transform: none; top: 0; left: 0; width: auto; max-height: none; overflow-y: auto; z-index: 5; padding: 18px max(16px, env(safe-area-inset-right, 0px)) 24px; display: grid; justify-items: center; align-content: safe center; gap: 6px; background: none; border: 0; box-shadow: none;
  font-family: "Pixelify Sans", system-ui, sans-serif; color: #ece4d4; --gold: #d8a948; --gold-hi: #f3d488; --rune: #5fe3f0; --ink: #ece4d4; --muted2: #a69cb6; }
#login .emblem { position: relative; width: min(560px, 92vw); height: 150px; display: grid; place-items: center; animation: rise .9s ease-out both; }
#login .emblem .ring { position: absolute; width: 150px; height: 150px; left: 50%; top: 0; margin-left: -75px; image-rendering: pixelated; opacity: .9; animation: spin 60s linear infinite; filter: drop-shadow(0 0 10px rgba(95,227,240,.35)); }
#login .emblem .ring-glow { position: absolute; width: 96px; height: 96px; left: 50%; top: 27px; margin-left: -48px; border-radius: 50%; background: radial-gradient(circle, rgba(95,227,240,.35), rgba(95,227,240,0) 70%); animation: pulse 3s ease-in-out infinite; }
#login h1 { position: relative; margin: 52px 0 0; font: 400 clamp(46px, 8vw, 74px)/1 "Jacquard 12", "Pixelify Sans", serif; color: var(--gold); text-align: center; letter-spacing: 1px;
  text-shadow: 3px 3px 0 #0b0910, 0 0 18px rgba(216,169,72,.45), 0 0 40px rgba(95,227,240,.18); animation: glow 4s ease-in-out infinite; }
#login .sub { position: relative; margin: 4px 0 0; font: 11px "Silkscreen", monospace; letter-spacing: 3px; color: var(--rune); text-transform: uppercase; text-shadow: 1px 1px 0 #000; }
#login .lpanel { width: min(760px, 94vw); animation: rise .9s .15s ease-out both; }
#login .panel { border: 17px solid transparent; border-image: url("assets/ui/painel.png") 34 fill / 17px stretch; image-rendering: pixelated; filter: drop-shadow(0 8px 16px rgba(0,0,0,.7)); padding: 4px 6px; }
#login .ptitle { font: 400 24px/1 "Jacquard 12", serif; color: var(--gold); text-shadow: 2px 2px 0 #0b0910; margin: 0 0 8px; }
#login .login-grid { display: grid; grid-template-columns: 230px 1fr; gap: 18px; }
@media (max-width: 640px) { #login .login-grid { grid-template-columns: 1fr; } #login .emblem { height: 120px; } #login h1 { margin-top: 40px; } }
#login .hero-stage { position: relative; display: grid; justify-items: center; align-content: end; padding: 14px 8px 10px; min-height: 250px; background: radial-gradient(ellipse at 50% 80%, rgba(95,227,240,.14), transparent 60%), linear-gradient(#1c1626, #0f0c15); border: 2px solid #0b0910; box-shadow: inset 0 0 0 1px #4b4458; overflow: hidden; }
#login .stage-glow { position: absolute; inset: auto 0 18% 0; height: 60%; background: radial-gradient(ellipse at 50% 100%, rgba(154,92,214,.18), transparent 65%); animation: pulse 4s ease-in-out infinite; }
#big-preview { position: relative; width: 170px; height: auto; image-rendering: pixelated; z-index: 1; margin-bottom: -10px; }
#login .altar { width: 150px; height: 22px; border-radius: 50%; background: radial-gradient(ellipse, rgba(95,227,240,.55), rgba(95,227,240,0) 70%); animation: pulse 2.6s ease-in-out infinite; }
#preview-name { margin-top: 6px; font: 400 26px/1 "Jacquard 12", serif; color: var(--gold-hi); text-shadow: 2px 2px 0 #000; text-align: center; }
#preview-role { font: 10px "Silkscreen", monospace; letter-spacing: 2px; color: var(--muted2); text-transform: uppercase; }
#classes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
#classes .cls { display: grid; justify-items: center; gap: 4px; padding: 6px 2px 5px; cursor: pointer; font: 600 13px "Pixelify Sans", sans-serif; color: var(--ink);
  background: radial-gradient(#2e2640, #17131f); border: 2px solid #0b0910; border-radius: 0; box-shadow: inset 0 0 0 2px #4b4458; transition: transform .12s, box-shadow .12s; }
#classes .cls:hover { transform: translateY(-2px); box-shadow: inset 0 0 0 2px #7a5418; }
#classes .cls.on { background: radial-gradient(#3a2f52, #1b1626); box-shadow: inset 0 0 0 2px var(--rune), 0 0 12px rgba(95,227,240,.45); }
#classes .cls canvas { width: 60px; height: auto; image-rendering: pixelated; }
#class-desc { min-height: 3.2em; margin: 10px 0 2px; padding: 8px 10px; font-size: 13px; color: #2a1f14; background: #d9c9a3; border: 2px solid #8d7650; box-shadow: inset 0 0 18px rgba(120,90,40,.35); }
#class-desc b { color: #6b3d12; }
#class-desc img { width: 18px; height: 18px; vertical-align: middle; margin-right: 4px; image-rendering: pixelated; }
#login label { display: block; margin: 8px 0 3px; font: 10px "Silkscreen", monospace; letter-spacing: 1px; color: var(--muted2); text-transform: uppercase; }
#login input { display: block; width: 100%; padding: 9px 10px; font: 15px "Pixelify Sans", sans-serif; color: var(--ink); background: #0d0b12; border: 2px solid #0b0910; box-shadow: inset 0 0 0 1px #4b4458, inset 0 3px 6px rgba(0,0,0,.6); border-radius: 0; margin: 0; }
#login input:focus { outline: none; box-shadow: inset 0 0 0 1px var(--rune), 0 0 8px rgba(95,227,240,.35); }
#login button.big.gold { width: 100%; margin-top: 14px; padding: 12px; font: 400 26px/1 "Jacquard 12", serif; letter-spacing: 1px; color: #2a1a06; cursor: pointer;
  background: linear-gradient(#f3d488, #d8a948 55%, #7a5418); border: 2px solid #0b0910; border-radius: 0; box-shadow: inset 0 1px 0 #fff3c8, inset 0 -2px 0 rgba(0,0,0,.3), 0 0 0 1px #7a5418, 0 0 16px rgba(216,169,72,.25); transition: filter .12s, transform .08s; }
#login button.big.gold:hover { filter: brightness(1.08); box-shadow: inset 0 1px 0 #fff3c8, 0 0 0 1px #7a5418, 0 0 22px rgba(216,169,72,.45); }
#login button.big.gold:active { transform: translateY(1px); }
#login-err { min-height: 1.2em; margin: 8px 0 0; color: #ff8a7a; font-size: 13px; text-align: center; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: .55; } }
@keyframes glow { 50% { text-shadow: 3px 3px 0 #0b0910, 0 0 26px rgba(216,169,72,.6), 0 0 50px rgba(95,227,240,.25); } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@media (prefers-reduced-motion: reduce) { #login * { animation: none !important; } }

/* ===================== janelas: inventário, evolução, habilidades (Codex da Interface) ===================== */
#hud .win { position: fixed; left: 50%; top: 46%; right: auto; bottom: auto; transform: translate(-50%, -50%); z-index: 6; max-height: calc(100vh - 120px); overflow: auto; color: var(--ink); animation: winIn .16s ease-out; }
@keyframes winIn { from { opacity: 0; transform: translate(-50%, -47%); } }
.whead { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; border-bottom: 2px solid #0b0910; box-shadow: 0 1px 0 #4b4458; padding-bottom: 4px; }
.whead .ptitle { margin: 0 !important; }
.wx { margin-left: auto; width: 26px; height: 26px; padding: 0; font: 14px/1 "Silkscreen", monospace; color: var(--gold-hi); cursor: pointer; background: linear-gradient(#352d45, #1d1828); border: 2px solid #0b0910; box-shadow: inset 0 0 0 1px #7a5418; }
.wx:hover { color: #fff; box-shadow: inset 0 0 0 1px var(--gold); }
#hud .sec { font: 10px "Silkscreen", monospace; letter-spacing: 1px; color: var(--muted2); text-transform: uppercase; margin: 6px 0 4px; }
#hud .small { font-size: 12px; }
#hud .muted { color: var(--muted2); }
.bad { color: #ff8a7a; } .good { color: #8fe08a; }

/* --- inventário --- */
#bag { width: min(660px, 96vw); }
#gold { display: flex; align-items: center; gap: 4px; float: none; font: 13px "Silkscreen", monospace; color: var(--gold-hi); }
#gold img { width: 18px; height: 18px; image-rendering: pixelated; }
#gold + .wx { margin-left: 0; }
.whead #gold { margin-left: auto; }
.inv-grid { display: grid; grid-template-columns: 300px 1fr; gap: 14px; }
.doll { display: grid; grid-template-columns: 52px 1fr 52px; grid-template-rows: auto auto; gap: 6px; padding: 8px; background: radial-gradient(ellipse at 50% 40%, rgba(95,227,240,.10), transparent 60%), linear-gradient(#1c1626, #0f0c15); border: 2px solid #0b0910; box-shadow: inset 0 0 0 1px #4b4458; }
.dcol { display: grid; gap: 6px; align-content: start; }
.dmid { display: grid; justify-items: center; align-content: start; gap: 4px; }
#doll-hero { width: 120px; height: 120px; image-rendering: pixelated; margin-top: 6px; filter: drop-shadow(0 6px 4px rgba(0,0,0,.6)); }
#doll-name { font: 400 20px/1 "Jacquard 12", serif; color: var(--gold-hi); text-shadow: 2px 2px 0 #000; }
#doll-stats { display: grid; grid-template-columns: auto auto; gap: 1px 10px; font-size: 12px; width: 100%; padding: 4px 6px; background: rgba(11,9,16,.6); border: 1px solid #2a2438; }
#doll-stats span { color: var(--muted2); } #doll-stats b { text-align: right; color: var(--ink); font-weight: 600; }
#doll-pets { grid-column: 1 / -1; display: flex; justify-content: center; gap: 26px; padding-top: 6px; border-top: 1px solid #2a2438; }
.petw { display: grid; justify-items: center; gap: 2px; font: 9px "Silkscreen", monospace; color: var(--muted2); text-transform: uppercase; }
.eslot, .cell { position: relative; width: 52px; height: 52px; padding: 0; display: grid; place-items: center; cursor: pointer; background: radial-gradient(#2a2238, #120f19); border: 2px solid #0b0910; box-shadow: inset 0 0 0 2px var(--rar, #3a3350); }
.eslot .ph { font: 8px "Silkscreen", monospace; color: #5d5570; text-transform: uppercase; text-align: center; line-height: 1.1; }
.eslot:not(.has) { cursor: default; background: repeating-linear-gradient(45deg, #15111d 0 4px, #181320 4px 8px); }
.eslot.pet { width: 60px; height: 60px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--rar, #3a3350), 0 0 0 2px #7a5418; }
.eslot.pet.has { background: radial-gradient(rgba(95,227,240,.18), #120f19 70%); }
.eslot img, .cell img { width: 36px; height: 36px; image-rendering: pixelated; }
.eslot.pet img { width: 44px; height: 44px; }
.eslot.has:hover, .cell.item:hover { box-shadow: inset 0 0 0 2px var(--gold), 0 0 8px rgba(216,169,72,.4); }
.plus { position: absolute; right: 2px; top: 1px; font: normal 9px "Silkscreen", monospace; color: var(--rune); text-shadow: 1px 1px 0 #000; }
#inv { display: grid; grid-template-columns: repeat(6, 52px); gap: 5px; margin: 0; max-height: 236px; overflow-y: auto; }
#inv .cell:not(.item) { cursor: default; box-shadow: inset 0 0 0 1px #2a2438; }
.cell.other img { filter: grayscale(.8) brightness(.6); }
#mats { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 6px; }
.cell.mat { width: 44px; height: 44px; cursor: default; }
.cell.mat img { width: 30px; height: 30px; }
.cell b { position: absolute; right: 3px; bottom: 1px; font: 10px "Silkscreen", monospace; color: #fff; text-shadow: 1px 1px 0 #000; }
@media (max-width: 700px) { .inv-grid { grid-template-columns: 1fr; } .doll { justify-self: center; } #inv { grid-template-columns: repeat(auto-fill, 52px); } }

/* --- tooltip --- */
#tip { position: fixed; z-index: 20; max-width: 240px; pointer-events: none; padding: 8px 10px; font: 13px/1.35 "Pixelify Sans", sans-serif; color: var(--ink); background: linear-gradient(#1d1828, #110e18); border: 2px solid #0b0910; box-shadow: inset 0 0 0 1px #7a5418, 0 6px 14px rgba(0,0,0,.7); }
#tip .tn { font: 600 15px "Pixelify Sans", sans-serif; text-shadow: 1px 1px 0 #000; }
#tip .ts { font: 9px "Silkscreen", monospace; color: var(--muted2); text-transform: uppercase; margin-bottom: 4px; }
#tip .th { margin-top: 6px; font: 9px "Silkscreen", monospace; color: var(--gold); }
#tip .up { color: #8fe08a; } #tip .down { color: #ff8a7a; } #tip .muted { color: var(--muted2); }

/* --- evolução --- */
#evo-panel { width: min(720px, 96vw); }
#evo-tabs { display: flex; gap: 4px; }
#evo-tabs button, .obtn { font: 600 13px "Pixelify Sans", sans-serif; }
#evo-tabs button { padding: 5px 12px; color: var(--muted2); cursor: pointer; background: #17131f; border: 2px solid #0b0910; box-shadow: inset 0 0 0 1px #4b4458; }
#evo-tabs button.on { color: var(--gold-hi); background: linear-gradient(#3a2f52, #241d33); box-shadow: inset 0 0 0 1px var(--gold), 0 0 8px rgba(216,169,72,.3); }
.evo-grid { display: grid; grid-template-columns: 200px 1fr 230px; gap: 10px; min-height: 280px; }
#evo-list { display: grid; gap: 4px; align-content: start; max-height: 330px; overflow-y: auto; }
.eunit { display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 6px; padding: 3px 6px 3px 3px; text-align: left; color: var(--ink); cursor: pointer; background: #15111d; border: 2px solid #0b0910; box-shadow: inset 0 0 0 1px #2a2438; font: 13px "Pixelify Sans", sans-serif; }
.eunit .ic { width: 40px; height: 40px; display: grid; place-items: center; background: radial-gradient(#2a2238, #120f19); box-shadow: inset 0 0 0 2px var(--rar); }
.eunit img { width: 34px; height: 34px; image-rendering: pixelated; }
.eunit small { display: block; font: 8px "Silkscreen", monospace; color: var(--muted2); text-transform: uppercase; }
.eunit b { font: 12px "Silkscreen", monospace; color: var(--rune); }
.eunit.on { background: #221b30; box-shadow: inset 0 0 0 1px var(--gold), 0 0 8px rgba(216,169,72,.25); }
#evo-stage { position: relative; display: grid; justify-items: center; align-content: center; gap: 4px; padding: 10px; overflow: hidden; background: radial-gradient(ellipse at 50% 45%, rgba(95,227,240,.12), transparent 60%), linear-gradient(#1c1626, #0f0c15); border: 2px solid #0b0910; box-shadow: inset 0 0 0 1px #4b4458; }
#evo-stage .halo { position: absolute; left: 50%; top: 38%; width: 170px; height: 170px; margin: -85px 0 0 -85px; border-radius: 50%; border: 2px dashed rgba(95,227,240,.35); box-shadow: 0 0 24px rgba(95,227,240,.2), inset 0 0 24px rgba(95,227,240,.15); animation: spin 24s linear infinite; }
#evo-stage .big { position: relative; width: 128px; height: 128px; object-fit: contain; image-rendering: pixelated; animation: bob 2.4s ease-in-out infinite; filter: drop-shadow(0 8px 6px rgba(0,0,0,.6)); }
@keyframes bob { 50% { transform: translateY(-5px); } }
#evo-stage .ename { position: relative; font: 600 17px "Pixelify Sans", sans-serif; text-shadow: 1px 1px 0 #000; }
#evo-stage .elvl { position: relative; font: 400 34px/1 "Jacquard 12", serif; color: var(--gold-hi); text-shadow: 2px 2px 0 #000, 0 0 12px rgba(216,169,72,.5); }
.pips { position: relative; display: flex; gap: 4px; }
.pips i { width: 12px; height: 12px; transform: rotate(45deg); background: #120f19; border: 2px solid #4b4458; }
.pips i.risk { border-color: #7a3a3a; }
.pips i.on { background: var(--rune); border-color: #b8f6fb; box-shadow: 0 0 6px var(--rune); }
#evo-stage.ok .big { animation: okPop .9s ease-out; }
#evo-stage.ok::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle, rgba(95,227,240,.55), transparent 60%); animation: flash .9s ease-out forwards; }
#evo-stage.fail .big { animation: shake .5s; filter: grayscale(.6) drop-shadow(0 0 8px #ff5a4a); }
#evo-stage.fail::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle, rgba(255,80,60,.4), transparent 60%); animation: flash .9s ease-out forwards; }
@keyframes okPop { 30% { transform: scale(1.18); filter: brightness(1.8) drop-shadow(0 0 16px var(--rune)); } }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
@keyframes flash { to { opacity: 0; } }
#evo-info { display: grid; align-content: start; gap: 4px; font-size: 13px; }
#evo-info .row, .chance { display: flex; justify-content: space-between; gap: 6px; }
#evo-info .row span, .chance span { color: var(--muted2); }
#evo-info em { font-style: normal; color: #8fe08a; }
.cost { display: grid; grid-template-columns: 24px 1fr auto; align-items: center; gap: 6px; padding: 2px 4px; background: rgba(11,9,16,.55); border: 1px solid #2a2438; }
.cost img { width: 22px; height: 22px; image-rendering: pixelated; }
.cost b { font: 11px "Silkscreen", monospace; color: #8fe08a; }
.cost.lack b { color: #ff8a7a; }
.chance { flex-wrap: wrap; margin-top: 4px; }
.chance b { font: 13px "Silkscreen", monospace; color: var(--gold-hi); }
.cbar { flex-basis: 100%; height: 6px; background: #0b0910; border: 1px solid #2a2438; }
.cbar i { display: block; height: 100%; background: linear-gradient(90deg, #7a5418, var(--gold-hi)); }
.fail { font-size: 12px; color: var(--muted2); } .fail.risk { color: #ffb09a; }
.prot { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--ink); cursor: pointer; }
.prot img { width: 18px; height: 18px; image-rendering: pixelated; }
.prot.off { opacity: .45; }
.gbtn { margin-top: 6px; padding: 9px; font: 400 24px/1 "Jacquard 12", serif; color: #2a1a06; cursor: pointer; background: linear-gradient(#f3d488, #d8a948 55%, #7a5418); border: 2px solid #0b0910; box-shadow: inset 0 1px 0 #fff3c8, 0 0 0 1px #7a5418, 0 0 14px rgba(216,169,72,.25); }
.gbtn:hover:not(:disabled) { filter: brightness(1.08); }
.gbtn:disabled { filter: grayscale(1) brightness(.6); cursor: not-allowed; }
#evo-msg { min-height: 1.3em; margin-top: 6px; text-align: center; font-size: 14px; }
@media (max-width: 760px) { .evo-grid { grid-template-columns: 1fr; } #evo-list { grid-auto-flow: column; grid-auto-columns: 180px; overflow-x: auto; } }

/* --- habilidades --- */
#skill-panel { width: min(520px, 96vw); }
#sk-list { display: grid; gap: 6px; }
.skrow { display: grid; grid-template-columns: 56px 1fr auto; align-items: center; gap: 10px; padding: 6px; background: #15111d; border: 2px solid #0b0910; box-shadow: inset 0 0 0 1px #2a2438; }
.skrow .ic { position: relative; width: 56px; height: 56px; display: grid; place-items: center; background: radial-gradient(#2e2640, #120f19); box-shadow: inset 0 0 0 2px #7a5418; }
.skrow .ic img { width: 44px; height: 44px; object-fit: contain; image-rendering: pixelated; }
.skrow .lk { position: absolute; font-style: normal; font-size: 18px; }
.skrow .sn { font: 600 15px "Pixelify Sans", sans-serif; color: var(--gold-hi); }
.skrow .sn small { margin-left: 6px; font: 9px "Silkscreen", monospace; color: var(--rune); }
.skrow .sd { font-size: 13px; color: var(--ink); }
.skrow .sm { font: 10px "Silkscreen", monospace; color: var(--muted2); text-align: right; }
.skrow.locked { opacity: .6; } .skrow.locked .ic img { filter: grayscale(1) brightness(.45); } .skrow.locked .sn { color: var(--muted2); }

/* botão AUTO com ícone */
#a-auto .atag { position: absolute; bottom: 2px; font: 8px "Silkscreen", monospace; color: var(--muted2); text-shadow: 1px 1px 0 #000; }
#a-auto.active .atag { color: var(--gold-hi); }
#a-auto.active img { filter: drop-shadow(0 0 5px var(--rune)); animation: spin 3s linear infinite; }
/* ajustes: janelas cabem em telas pequenas, rolagem discreta */
#hud .win { overflow-x: hidden; scrollbar-width: thin; scrollbar-color: #7a5418 #0b0910; }
.inv-grid { grid-template-columns: 300px minmax(0, 1fr); }
#inv { grid-template-columns: repeat(auto-fill, 52px); scrollbar-width: thin; scrollbar-color: #4b4458 transparent; }
.evo-grid { grid-template-columns: 190px minmax(0, 1fr) 220px; }
@media (max-width: 700px) { .inv-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) { .evo-grid { grid-template-columns: minmax(0, 1fr); } }

/* menu com 6 botões (laje barra6.png = barra4 com 2 encaixes a mais) */
#menu, #menu .bg { width: 364px; }
@media (max-width: 1100px) { #menu { transform: scale(.7); transform-origin: bottom right; } }
@media (max-width: 900px) { #menu { transform: scale(.62); } }

/* --- missões --- */
#qlog { width: min(620px, 96vw); }
.qlog-grid { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 12px; min-height: 260px; }
@media (max-width: 640px) { .qlog-grid { grid-template-columns: minmax(0, 1fr); } }
#ql-list { display: grid; gap: 4px; align-content: start; }
.qitem { display: grid; grid-template-columns: 18px 1fr; align-items: center; gap: 6px; padding: 6px 8px; text-align: left; cursor: pointer; color: var(--ink); font: 14px "Pixelify Sans", sans-serif; background: #15111d; border: 2px solid #0b0910; box-shadow: inset 0 0 0 1px #2a2438; }
.qitem small { display: block; font: 8px "Silkscreen", monospace; color: var(--muted2); text-transform: uppercase; }
.qitem .qmark { width: 10px; height: 10px; transform: rotate(45deg); justify-self: center; background: #120f19; border: 2px solid #4b4458; }
.qitem.on .qmark { background: var(--gold); border-color: var(--gold-hi); box-shadow: 0 0 6px var(--gold); }
.qitem.done .qmark { background: #6fd06a; border-color: #b8f0b0; }
.qitem.lock { color: var(--muted2); }
.qitem.sel { background: #221b30; box-shadow: inset 0 0 0 1px var(--gold), 0 0 8px rgba(216,169,72,.25); }
#ql-info { display: grid; align-content: start; gap: 4px; padding: 10px 12px; font-size: 13px; color: #2a1f14; background: #d9c9a3; border: 2px solid #8d7650; box-shadow: inset 0 0 18px rgba(120,90,40,.35); }
#ql-info .qtitle { font: 400 26px/1 "Jacquard 12", serif; color: #6b3d12; }
#ql-info .qstory { font-style: italic; color: #4a3a24; margin-bottom: 4px; }
#ql-info .sec { color: #7a6040 !important; }
#ql-info .muted { color: #6a5a40 !important; }
.qobj { display: flex; justify-content: space-between; font-weight: 600; }
.qobj b { font: 12px "Silkscreen", monospace; }
.qobj.ok { color: #2f6a20; }
.qprog { height: 8px; background: #3a2e1e; border-color: #8d7650; }
.qrew { display: grid; grid-template-columns: 48px 1fr; align-items: center; gap: 8px; font-weight: 600; }
.qrew small { display: block; font: 8px "Silkscreen", monospace; color: #6a5a40; text-transform: uppercase; }
.qrew .ic { width: 48px; height: 48px; display: grid; place-items: center; background: radial-gradient(#2a2238, #120f19); box-shadow: inset 0 0 0 2px #7fc463, 0 0 0 2px #0b0910; }
.qrew img { width: 40px; height: 40px; object-fit: contain; image-rendering: pixelated; }
.qdone { margin-top: 4px; padding: 4px 6px; color: #2f6a20; font-weight: 600; background: rgba(111,208,106,.18); border: 1px solid #6fa060; }
#ql-info .prot { margin-top: 6px; color: #2a1f14; }

/* ===================== NPCs, loja, poções e mana ===================== */
/* mana: canaleta entre a vida e o XP do retrato */
.pbar.mp { top: 82px; height: 11px; background: #0b0910; box-shadow: 0 0 0 1px #0b0910, inset 0 0 0 1px #2a2438; }
.pbar.mp i { background: linear-gradient(#9fb4ff, #4a5ee0 60%, #2a3290); box-shadow: inset 0 1px 0 rgba(255,255,255,.25); }
.pbar.mp span { font: 8px/11px "Silkscreen", monospace; }

/* barra de ações com 6 encaixes (barra6.png em 2x) */
#actionbar, #actionbar .bg { width: 486px; }
#a-atk { left: 30px; } #a-skill { left: 106px; } #a-potv { left: 182px; } #a-potm { left: 258px; } #a-ride { left: 334px; } #a-auto { left: 410px; }
#actionbar .slot.pot .cnt { position: absolute; right: 4px; bottom: 2px; font: 11px "Silkscreen", monospace; color: #fff; text-shadow: 1px 1px 0 #000, -1px 0 0 #000; }
#actionbar .slot.pot.empty img { filter: grayscale(1) brightness(.45); }
#actionbar .slot.pot.empty .cnt { color: #ff8a7a; }
#actionbar .slot.pot:hover img { transform: translateY(-2px); filter: drop-shadow(0 0 4px rgba(255,255,255,.4)); }
@media (max-width: 1200px) { #actionbar { transform: translateX(-50%) scale(.8); transform-origin: bottom center; } }
@media (max-width: 900px) { #actionbar { transform: translateX(-50%) scale(.7); bottom: 140px; } }
#chat { width: min(340px, calc(50vw - 260px)); min-width: 200px; }

/* menu com 5 botões */
#menu, #menu .bg { width: 307px; }
#a-bag { left: 22px; } #a-fam { left: 79px; } #a-skills { left: 136px; } #a-quest { left: 193px; } #a-opt { left: 250px; }

/* dica de conversa perto do NPC */
#npc-hint { position: fixed; left: 50%; bottom: 150px; transform: translateX(-50%); z-index: 3; padding: 4px 12px; font: 600 14px "Pixelify Sans", sans-serif; color: var(--ink); background: rgba(11,9,16,.82); border: 2px solid #0b0910; box-shadow: inset 0 0 0 1px #7a5418; animation: winIn .2s ease-out; white-space: nowrap; }
#npc-hint kbd { display: inline-block; min-width: 18px; margin-right: 6px; padding: 0 4px; font: 10px/16px "Silkscreen", monospace; color: var(--gold-hi); background: #17131f; border: 1px solid #4b4458; text-align: center; }

/* diálogo: retrato | pergaminho */
#npc-dialog { width: min(600px, 96vw); }
#nd-step { margin-left: auto; font: 9px "Silkscreen", monospace !important; }
#nd-step + .wx { margin-left: 8px; }
.nd-grid { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 12px; }
.nd-por { display: grid; place-items: end center; height: 150px; background: radial-gradient(ellipse at 50% 80%, rgba(95,227,240,.16), transparent 65%), linear-gradient(#1c1626, #0f0c15); border: 2px solid #0b0910; box-shadow: inset 0 0 0 1px #4b4458; overflow: hidden; }
#nd-portrait { width: 144px; height: 144px; image-rendering: pixelated; margin-bottom: -8px; animation: bob 3s ease-in-out infinite; }
#nd-text { min-height: 96px; padding: 10px 12px; font: 15px/1.45 "Pixelify Sans", sans-serif; color: #2a1f14; background: #d9c9a3; border: 2px solid #8d7650; box-shadow: inset 0 0 18px rgba(120,90,40,.35); }
.nd-q { margin-top: 8px; padding-top: 6px; border-top: 1px dashed #8d7650; font-size: 13px; }
.nd-q.good { color: #2f6a20; }
.nd-qn { font: 400 22px/1 "Jacquard 12", serif; color: #6b3d12; margin-bottom: 3px; }
.nd-rw { margin-top: 4px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.nd-rw img { width: 22px; height: 22px; image-rendering: pixelated; }
#nd-btns { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }
#nd-btns .gbtn { margin: 0; padding: 7px 16px; font-size: 22px; }
#nd-btns .obtn { width: auto; padding: 8px 16px; }
@media (max-width: 560px) { .nd-grid { grid-template-columns: minmax(0, 1fr); } .nd-por { height: 110px; } }

/* loja */
#shop { width: min(620px, 96vw); }
.sh-por { width: 40px; height: 40px; image-rendering: pixelated; margin: -6px -4px -6px 0; }
#sh-tabs { display: flex; gap: 4px; }
#sh-tabs button { padding: 5px 12px; font: 600 13px "Pixelify Sans", sans-serif; color: var(--muted2); cursor: pointer; background: #17131f; border: 2px solid #0b0910; box-shadow: inset 0 0 0 1px #4b4458; }
#sh-tabs button.on { color: var(--gold-hi); background: linear-gradient(#3a2f52, #241d33); box-shadow: inset 0 0 0 1px var(--gold); }
#sh-gold { margin-left: auto; display: flex; align-items: center; gap: 4px; font: 13px "Silkscreen", monospace; color: var(--gold-hi); }
#sh-gold img, .pr img { width: 16px; height: 16px; image-rendering: pixelated; }
#sh-gold + .wx { margin-left: 4px; }
#sh-list { display: grid; gap: 4px; max-height: min(380px, calc(100vh - 260px)); overflow-y: auto; scrollbar-width: thin; scrollbar-color: #7a5418 #0b0910; padding-right: 2px; }
.srow { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto auto auto; align-items: center; gap: 8px; padding: 3px 6px 3px 3px; background: #15111d; border: 2px solid #0b0910; box-shadow: inset 0 0 0 1px #2a2438; }
.srow:hover { box-shadow: inset 0 0 0 1px #7a5418; }
.srow .ic { position: relative; width: 44px; height: 44px; display: grid; place-items: center; background: radial-gradient(#2a2238, #120f19); box-shadow: inset 0 0 0 2px var(--rar, #3a3350); }
.srow .ic img { width: 34px; height: 34px; image-rendering: pixelated; }
.srow .ic .cnt { position: absolute; right: 2px; bottom: 0; font: 9px "Silkscreen", monospace; color: #fff; text-shadow: 1px 1px 0 #000; }
.srow .nm { font: 600 14px "Pixelify Sans", sans-serif; color: var(--ink); min-width: 0; }
.srow .nm small { display: block; font: 8px "Silkscreen", monospace; color: var(--muted2); text-transform: uppercase; }
.srow .pr { display: flex; align-items: center; gap: 3px; font: 12px "Silkscreen", monospace; color: var(--gold-hi); }
.srow.poor .pr { color: #ff8a7a; }
.srow .qty { width: 48px; padding: 4px; font: 12px "Silkscreen", monospace; color: var(--ink); background: #0d0b12; border: 2px solid #0b0910; box-shadow: inset 0 0 0 1px #4b4458; }
.srow .qty[hidden] { display: none; }
.srow .sb { width: auto; padding: 6px 10px; font-size: 12px; }
.srow .sb:disabled { opacity: .45; cursor: not-allowed; }
#sh-msg { min-height: 1.3em; margin-top: 6px; text-align: center; font-size: 14px; }
@media (max-width: 560px) { .srow { grid-template-columns: 40px minmax(0, 1fr) auto; } .srow .qty { display: none; } }

/* ===================== conta, seleção de heróis e criação ===================== */
#login .apanel { width: min(440px, 94vw); }
.atabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-bottom: 4px; }
.atabs button { padding: 9px 6px; font: 400 22px/1 "Jacquard 12", serif; letter-spacing: 1px; color: var(--muted2); cursor: pointer; background: #17131f; border: 2px solid #0b0910; box-shadow: inset 0 0 0 1px #4b4458; transition: color .12s, box-shadow .12s; }
.atabs button:hover { color: var(--ink); }
.atabs button.on { color: var(--gold-hi); background: linear-gradient(#3a2f52, #241d33); box-shadow: inset 0 0 0 1px var(--gold), 0 0 10px rgba(216,169,72,.25); }
.arune { height: 10px; margin: 6px 0 2px; background: radial-gradient(ellipse at 50% 50%, rgba(95,227,240,.55), transparent 60%); opacity: .7; animation: pulse 3s ease-in-out infinite; }
.lerr { min-height: 1.2em; margin: 8px 0 0; color: #ff8a7a; font-size: 13px; text-align: center; }
.ahint { margin: 6px 0 0; text-align: center; font-size: 13px; color: var(--muted2); }
.ahint a { color: var(--rune); text-decoration: none; border-bottom: 1px dotted var(--rune); }
.ahint a:hover { color: var(--gold-hi); border-color: var(--gold-hi); }
.lhead { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.lhead .ptitle { margin: 0 !important; }
.lacct { margin-left: auto; font: 10px "Silkscreen", monospace; letter-spacing: 1px; color: var(--muted2); text-transform: uppercase; }
.lacct b { color: var(--gold-hi); font-weight: 400; }
#login .label-t { margin: 0 0 6px; font: 10px "Silkscreen", monospace; letter-spacing: 1px; color: var(--muted2); text-transform: uppercase; }

/* 3 vagas de herói */
#slots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.slot-c { position: relative; display: grid; justify-items: center; align-content: start; gap: 2px; min-height: 250px; padding: 10px 6px 10px; cursor: pointer; color: var(--ink); font: 600 13px "Pixelify Sans", sans-serif;
  background: radial-gradient(ellipse at 50% 70%, rgba(95,227,240,.10), transparent 60%), linear-gradient(#1c1626, #0f0c15); border: 2px solid #0b0910; box-shadow: inset 0 0 0 2px #4b4458; transition: transform .12s, box-shadow .15s; animation: rise .5s ease-out both; }
.slot-c:nth-child(2) { animation-delay: .07s; } .slot-c:nth-child(3) { animation-delay: .14s; }
.slot-c:hover { transform: translateY(-3px); box-shadow: inset 0 0 0 2px #7a5418; }
.slot-c:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--rune); }
.slot-c.on { background: radial-gradient(ellipse at 50% 70%, rgba(95,227,240,.22), transparent 60%), linear-gradient(#2a2140, #141020); box-shadow: inset 0 0 0 2px var(--gold), 0 0 18px rgba(216,169,72,.35); }
.sl-num { position: absolute; top: 5px; left: 7px; font: 10px "Silkscreen", monospace; color: var(--muted2); }
.slot-c.on .sl-num { color: var(--gold-hi); }
.sl-stage { position: relative; display: grid; place-items: end center; width: 100%; height: 132px; }
.sl-glow { position: absolute; bottom: 6px; left: 50%; width: 92px; height: 16px; margin-left: -46px; border-radius: 50%; background: radial-gradient(ellipse, rgba(95,227,240,.5), transparent 70%); animation: pulse 2.6s ease-in-out infinite; }
.slot-c.on .sl-glow { background: radial-gradient(ellipse, rgba(243,212,136,.6), transparent 70%); }
.sl-stage canvas { position: relative; width: 120px; height: auto; image-rendering: pixelated; }
.sl-name { margin-top: 4px; font: 400 24px/1 "Jacquard 12", serif; color: var(--gold-hi); text-shadow: 2px 2px 0 #000; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sl-role { font: 9px "Silkscreen", monospace; letter-spacing: 1px; color: var(--muted2); text-transform: uppercase; }
.sl-lv { margin-top: 4px; padding: 2px 8px; font: 11px "Silkscreen", monospace; color: #2a1f14; background: #d9c9a3; border: 1px solid #8d7650; }
.sl-last { margin-top: 3px; font-size: 11px; color: var(--muted2); font-weight: 400; }
.sl-last .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #6fe07a; box-shadow: 0 0 6px #6fe07a; vertical-align: middle; }
.slot-c.empty { align-content: center; background: linear-gradient(#17131f, #0f0c15); box-shadow: inset 0 0 0 2px #2a2438; }
.slot-c.empty::after { content: ""; position: absolute; inset: 8px; border: 2px dashed rgba(95,227,240,.25); pointer-events: none; transition: border-color .15s; }
.slot-c.empty:hover::after { border-color: rgba(95,227,240,.6); }
.slot-c.empty .sl-name { color: var(--muted2); font-size: 22px; }
.sl-plus { width: 54px; height: 54px; display: grid; place-items: center; font: 400 44px/1 "Jacquard 12", serif; color: var(--rune); border-radius: 50%; background: radial-gradient(circle, rgba(95,227,240,.18), transparent 70%); text-shadow: 0 0 10px rgba(95,227,240,.6); transition: transform .15s; }
.slot-c.empty:hover .sl-plus { transform: scale(1.12); }
.sel-bar { display: grid; grid-template-columns: auto auto 1fr; gap: 8px; align-items: end; margin-top: 12px; }
.sel-bar .obtn { width: auto; padding: 10px 14px; }
#login .sel-bar button.big.gold { margin-top: 0; font-size: 24px; padding: 10px; }
#login button.big.gold:disabled { filter: grayscale(.8) brightness(.6); cursor: not-allowed; box-shadow: none; }
.obtn.danger { color: #ffb3a8; }
.obtn.danger:hover:not(:disabled) { background: linear-gradient(#5a2a2e, #3a1a1e); }
.obtn:disabled { opacity: .45; cursor: not-allowed; }
.create-bar { display: grid; grid-template-columns: auto 1fr; gap: 8px; align-items: end; margin-top: 14px; }
.create-bar .obtn { width: auto; padding: 10px 16px; }
#login .create-bar button.big.gold { margin-top: 0; }

/* confirmação de exclusão */
#del-confirm { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(400px, 92vw); z-index: 8; animation: winIn .2s ease-out; }
#del-confirm .ptitle { color: #ff9a8a; }
.del-txt { margin: 0 0 10px; font-size: 14px; color: var(--ink); }
.del-txt b { color: var(--gold-hi); }
#del-confirm .sel-bar { grid-template-columns: 1fr 1fr; }
#opt-panel .opt-btns { display: grid; gap: 6px; margin-top: 8px; }
@media (max-width: 640px) {
  #slots { grid-template-columns: minmax(0, 1fr); }
  .slot-c { min-height: 0; grid-template-columns: 90px 1fr; justify-items: start; align-items: center; text-align: left; column-gap: 10px; }
  .slot-c .sl-stage { grid-row: span 4; height: 96px; }
  .sl-stage canvas { width: 90px; }
  .slot-c.empty { grid-template-columns: 1fr; justify-items: center; }
  .sel-bar { grid-template-columns: 1fr 1fr; }
  .sel-bar .big.gold { grid-column: 1 / -1; }
}
.lerr.ok { color: var(--gold-hi); }
#del-confirm { box-shadow: 0 0 0 100vmax rgba(5,3,10,.62); }
