:root {
  --bg: #0f1420;
  --panel: #182033;
  --panel2: #202a42;
  --text: #e8ecf5;
  --muted: #94a0bb;
  --accent: #e6b450;
  --danger: #e05d5d;
  --ok: #5dc28a;
  --radius: 10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 system-ui, "Segoe UI", sans-serif; }
a { color: var(--accent); }
h1, h2, h3 { margin: 0 0 .5em; font-weight: 650; }
h1 { font-family: Georgia, serif; letter-spacing: .5px; }
button, input, select {
  font: inherit; color: var(--text); background: var(--panel2);
  border: 1px solid #33405f; border-radius: 8px; padding: .55em .8em;
}
button { cursor: pointer; background: var(--accent); color: #1a1408; border: 0; font-weight: 600; }
button.secondary { background: var(--panel2); color: var(--text); border: 1px solid #33405f; }
button.danger { background: transparent; color: var(--danger); border: 1px solid var(--danger); }
button:disabled { opacity: .5; cursor: default; }
input:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.error { color: var(--danger); min-height: 1.4em; }

/* ---------- lobby ---------- */
.wrap { max-width: 980px; margin: 0 auto; padding: 32px 16px; }
.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 24px; flex-wrap: wrap; }
.card { background: var(--panel); border-radius: var(--radius); padding: 20px; }
.auth { max-width: 380px; margin: 8vh auto; }
.auth form { display: grid; gap: 10px; }
.tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.tabs button { flex: 1; }
.tabs button:not(.active) { background: var(--panel2); color: var(--muted); }
.chars { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-bottom: 28px; }
.char { background: var(--panel); border-radius: var(--radius); padding: 16px; border-left: 5px solid var(--c, var(--accent)); display: grid; gap: 8px; }
.char .name { font-size: 1.2em; font-weight: 700; }
.char .actions { display: flex; gap: 8px; margin-top: 6px; }
.char .actions button:first-child { flex: 1; }
.heroes { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin: 12px 0; }
.hero {
  background: var(--panel2); border: 2px solid transparent; border-radius: var(--radius); padding: 12px;
  color: var(--text); text-align: left; font-weight: 400;
}
.hero b { display: block; font-size: 1.05em; color: var(--c); }
.hero[aria-pressed="true"] { border-color: var(--c); background: #26304b; }
.create { display: flex; gap: 10px; flex-wrap: wrap; }
.create input { flex: 1; min-width: 180px; }

/* ---------- jogo ---------- */
.play { display: grid; grid-template-columns: 1fr 320px; height: 100vh; }
.stage { position: relative; background: #000; display: flex; flex-direction: column; min-width: 0; }
.stagebar { display: flex; gap: 8px; align-items: center; padding: 8px 12px; background: var(--panel); flex-wrap: wrap; }
.stagebar .who { font-weight: 700; margin-right: auto; }
.gamebox { position: relative; flex: 1; min-height: 0; }
#game { position: absolute; inset: 0; }
#overlay { position: absolute; pointer-events: none; z-index: 5; }
.side { background: var(--panel); display: flex; flex-direction: column; min-height: 0; border-left: 1px solid #26304b; }
.side section { padding: 12px 14px; border-bottom: 1px solid #26304b; }
.side h3 { font-size: .8em; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); margin-bottom: 6px; }
.plist { list-style: none; margin: 0; padding: 0; max-height: 28vh; overflow: auto; }
.plist li { display: flex; align-items: center; gap: 8px; padding: 3px 0; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; }
.plist .here { margin-left: auto; font-size: .75em; color: var(--ok); }
.chat { flex: 1; display: flex; flex-direction: column; min-height: 0; padding: 12px 14px; }
.log { flex: 1; overflow: auto; font-size: .92em; display: flex; flex-direction: column; gap: 3px; }
.log .sys { color: var(--muted); font-style: italic; }
.log .area { color: #9fd3ff; }
.chatform { display: flex; gap: 6px; margin-top: 8px; }
.chatform input { flex: 1; min-width: 0; }
.chatform select { padding: .55em .3em; }
.toast { position: fixed; bottom: 16px; left: 16px; background: var(--panel2); padding: 10px 14px; border-radius: 8px; z-index: 50; box-shadow: 0 4px 20px #0008; }
.hint { position: absolute; top: 12px; left: 12px; right: 12px; z-index: 6; background: #182033ee; padding: 12px 14px; border-radius: 8px; border-left: 4px solid var(--accent); }

/* scanner de RAM */
.scanner { position: fixed; right: 336px; top: 56px; width: 380px; max-height: 80vh; overflow: auto; z-index: 40; background: var(--panel); border: 1px solid #33405f; border-radius: var(--radius); padding: 14px; font-size: .9em; }
.scanner .row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.scanner table { width: 100%; border-collapse: collapse; font-family: ui-monospace, Consolas, monospace; }
.scanner td { padding: 2px 4px; border-bottom: 1px solid #26304b; }

@media (max-width: 860px) {
  .play { grid-template-columns: 1fr; grid-template-rows: 60vh 1fr; height: auto; min-height: 100vh; }
  .side { border-left: 0; }
  .scanner { right: 16px; left: 16px; width: auto; }
}

.portal { display: flex; gap: 6px; }
.portal select { flex: 1; min-width: 0; }
.small { font-size: .85em; margin-top: 6px; }
.booting { position: absolute; inset: 0; z-index: 20; background: #0f1420f2; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; font-size: 1.1em; }
.spinner { width: 36px; height: 36px; border: 4px solid #33405f; border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

#screen { image-rendering: pixelated; image-rendering: crisp-edges; display: block; margin: auto; background: #000; }
.gamebox { display: flex; align-items: center; justify-content: center; background: #000; }

.hud { display: grid; gap: 6px; }
.hudrow { display: flex; justify-content: space-between; }
.bar { position: relative; height: 16px; background: #0d1220; border-radius: 4px; overflow: hidden; font-size: .78em; }
.bar i { position: absolute; inset: 0 auto 0 0; display: block; }
.bar.hp i { background: linear-gradient(#4fd17a, #2f9e55); }
.bar.xp i { background: linear-gradient(#e6c55a, #b8902c); }
.bar span { position: relative; padding-left: 6px; line-height: 16px; text-shadow: 0 1px 2px #000; }

/* janela de diálogo no estilo do SD3 (azul com borda clara) */
.dialog { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); width: min(92%, 640px); z-index: 7;
  background: linear-gradient(#2a3f8fee, #182a66ee); border: 3px solid #d8e2ff; border-radius: 8px; box-shadow: 0 0 0 2px #0a1030, 0 8px 24px #0008;
  padding: 12px 16px 18px; font: 15px/1.45 system-ui, sans-serif; color: #fff; cursor: pointer; }
.dialog .speaker { font-weight: 700; color: #ffe28a; margin-bottom: 4px; }
.dialog .dtext { white-space: pre-line; text-shadow: 0 1px 0 #000; }
.dialog .dnext { position: absolute; right: 12px; bottom: 4px; font-size: 11px; animation: blink 1s steps(2) infinite; }
.dialog .dbtns { display: flex; gap: 8px; justify-content: flex-end; margin-top: 10px; }
.dialog button { cursor: pointer; }
.dialog table.shop { width: 100%; border-collapse: collapse; cursor: default; }
.dialog table.shop td { padding: 4px 6px; border-bottom: 1px solid #ffffff22; vertical-align: middle; }
.dialog table.shop td.num { text-align: right; white-space: nowrap; }
.dialog .muted { color: #c6d0f0; }
@keyframes blink { 50% { opacity: 0; } }
.inv { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
.inv li { display: flex; align-items: center; gap: 6px; }
.inv li button { margin-left: auto; padding: 1px 8px; font-size: .8em; }
.inv .key { display: inline-block; min-width: 16px; text-align: center; font-size: .75em; background: #0d1220; border-radius: 3px; }

/* painéis: missões, itens, grupo, guilda, ranking */
.pbtns { display: inline-flex; gap: 4px; margin-left: auto; margin-right: 8px; flex-wrap: wrap; }
.pbtns button { padding: 4px 8px; font-size: .85em; }
.panel { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); width: min(94%, 680px); max-height: calc(100% - 20px); z-index: 8;
  display: flex; flex-direction: column; background: #141c2ff5; border: 2px solid #3a4a7a; border-radius: 10px; box-shadow: 0 10px 30px #000a; }
.panel .ptabs { display: flex; gap: 4px; padding: 8px; border-bottom: 1px solid #ffffff1a; flex-wrap: wrap; }
.panel .ptabs button { padding: 4px 10px; font-size: .85em; background: #22304f; color: #cdd6f4; }
.panel .ptabs button.on { background: var(--accent, #e6b450); color: #111; }
.panel .ptabs .pclose { margin-left: auto; }
.panel kbd { font-size: .7em; opacity: .7; }
.panel .pbody { padding: 10px 14px; overflow: auto; }
.panel h4 { margin: 10px 0 4px; color: #ffe28a; }
.panel .row, .dialog .row { display: flex; gap: 6px; margin: 8px 0; flex-wrap: wrap; }
.panel input { flex: 1; min-width: 80px; }
.quest { border: 1px solid #ffffff1f; border-radius: 6px; padding: 8px 10px; margin: 6px 0; background: #0d1220aa; }
.quest.ready { border-color: #5adc7a; }
.quest.locked { opacity: .6; }
.quest .qhead { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.quest .qdesc { margin: 4px 0; white-space: normal; }
.quest .qgoal, .quest .qrew { font-size: .9em; margin: 2px 0; }
.quest button { margin-top: 4px; }
.tag { font-size: .72em; padding: 1px 6px; border-radius: 8px; background: #2c3a63; color: #cdd6f4; }
.rw { font-size: .85em; padding: 1px 6px; border-radius: 6px; background: #3b3416; color: #ffe28a; }
.rw.item { background: #16343b; color: #9be7ff; }
.ok { color: #7cf2a0; }
.mark { color: #ffd34a; }
.eq { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.eq li { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 4px 0; border-bottom: 1px solid #ffffff12; }
.eq li > div { flex-basis: 100%; }
.eq .slot { min-width: 72px; color: #9fb0d8; font-size: .85em; }
.eq button { margin-left: auto; }
.statline { font-size: .9em; padding: 6px 8px; background: #0d1220; border-radius: 6px; }
.members { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.members li { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.members li .bar { flex-basis: 100%; }
.members .dot, .partybox .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); display: inline-block; }
.ranks { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ranks ol { padding-left: 20px; margin: 0; }
.ghead { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; font-size: 1.1em; }
.invite { position: absolute; top: 12px; right: 12px; z-index: 9; background: #1d2a52f5; border: 2px solid #e6b450; border-radius: 8px; padding: 10px 12px; max-width: 280px; }
.partybox .pm { display: grid; gap: 2px; margin: 4px 0; }
.dialog .qlist { max-height: 45vh; overflow: auto; cursor: default; }
.dialog .shopwrap { max-height: 45vh; overflow: auto; }
.zone { font-size: .75em; padding: 1px 6px; border-radius: 8px; margin-left: 4px; }
.zone.safe { background: #1d4d2c; color: #7cf2a0; }
.zone.hunt { background: #4d3d1d; color: #ffe28a; }
.zone.pvp { background: #5a1d1d; color: #ff8a8a; }
#log .party { color: #9be7a8; }
#log .guild { color: #9bc8ff; }
@media (max-width: 700px) { .ranks { grid-template-columns: 1fr; } }
.bar.gauge i { background: linear-gradient(#6ab4ff, #3a72c8); }
.bar.gauge.full i { background: linear-gradient(#ffe14a, #ff9a3c); animation: gaugepulse .5s ease-in-out infinite alternate; }
@keyframes gaugepulse { from { filter: brightness(1); } to { filter: brightness(1.35); } }

/* ===== 1.5: menus no estilo das janelas do SD3 ===== */
.panel, .dialog, .invite { background: linear-gradient(180deg, #2b3f9aee 0%, #1a2766f2 60%, #121b4cf5 100%); border: 3px solid #e4ecff; border-radius: 10px;
  box-shadow: 0 0 0 2px #0a1030, inset 0 0 0 2px #5b74c9, 0 12px 32px #000b; color: #f2f5ff; }
.panel { width: min(96%, 760px); }
.panel .ptabs { border-bottom: 2px solid #ffffff22; background: #0d1540aa; border-radius: 7px 7px 0 0; }
.panel .ptabs button { background: #22336f; color: #dfe6ff; border: 1px solid #4d64b8; border-radius: 6px; }
.panel .ptabs button.on { background: linear-gradient(#ffe28a, #e6b450); color: #1a1420; border-color: #fff3c4; }
.panel .pbody { padding: 12px 14px; }
.panel h4 { color: #ffe28a; text-shadow: 0 1px 0 #000; }
.panel button, .dialog button, .invite button { background: linear-gradient(#ffe28a, #e6b450); color: #1a1420; border: 1px solid #fff3c4; border-radius: 6px; padding: 4px 12px; font-weight: 600; cursor: pointer; }
.panel button:disabled, .dialog button:disabled { opacity: .45; cursor: default; }
.panel button.ghost, .dialog button.ghost, .invite button.ghost { background: #22336f; color: #dfe6ff; border-color: #4d64b8; }
.panel button.danger { background: #6b1f2a; color: #ffd7d7; border-color: #b84d5d; }
.panel input { background: #0d1540; color: #fff; border: 1px solid #4d64b8; border-radius: 6px; padding: 5px 8px; }
.spacer { flex: 1; }
.icon { image-rendering: pixelated; vertical-align: middle; }
.icon.tiny { width: 16px; height: 16px; }

/* herói e itens */
.herogrid { display: grid; grid-template-columns: 300px 1fr; gap: 14px; }
.herocard { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.heroimg { width: 80px; height: 80px; image-rendering: pixelated; background: radial-gradient(#3a55b8, #16235e); border: 2px solid #8fa5ef; border-radius: 8px; }
.hname { font-size: 1.15em; font-weight: 700; color: #ffe28a; }
.lvl { font-weight: 700; }
.herocol .bar { margin: 4px 0; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin: 8px 0; }
.stats div { background: #0d1540; border: 1px solid #34488f; border-radius: 6px; padding: 3px 6px; display: flex; justify-content: space-between; font-size: .85em; }
.stats span { color: #9fb0e8; }
.slots { display: grid; gap: 5px; }
.eslot { display: flex; gap: 8px; align-items: center; background: #0d1540; border: 1px solid #34488f; border-radius: 6px; padding: 4px 6px; }
.eslot.filled { cursor: pointer; }
.eslot.filled:hover { border-color: #ffe28a; }
.eicon { width: 32px; height: 32px; background: #070c2a; border-radius: 4px; display: grid; place-items: center; }
.ename { font-size: .72em; color: #9fb0e8; text-transform: uppercase; letter-spacing: .05em; }
.eitem { font-size: .9em; }
.filters { display: flex; gap: 6px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.filters button { padding: 2px 10px; font-size: .85em; }
.filters button:not(.on) { background: #22336f; color: #dfe6ff; border-color: #4d64b8; }
.grid { display: grid; grid-template-columns: repeat(6, 44px); gap: 5px; }
.cell { position: relative; width: 44px; height: 44px; background: #0b1238; border: 2px solid #34488f; border-radius: 7px; display: grid; place-items: center; cursor: pointer; }
.cell:hover { border-color: #8fa5ef; }
.cell.sel { border-color: #ffe28a; box-shadow: 0 0 0 2px #ffe28a55, inset 0 0 10px #ffe28a44; }
.cell.empty { cursor: default; opacity: .5; }
.cell.other img { opacity: .45; }
.cell .cnt { position: absolute; right: 2px; bottom: 0; font-size: .72em; text-shadow: 0 1px 0 #000, 1px 0 0 #000; }
.detail { margin-top: 10px; background: #0d1540; border: 1px solid #34488f; border-radius: 8px; padding: 8px 10px; min-height: 86px; }
.dhead { display: flex; gap: 10px; align-items: center; }
.cmp { margin-top: 6px; font-size: .88em; }
.cmp .up { color: #7cf2a0; margin-right: 6px; }
.cmp .down { color: #ff8a8a; margin-right: 6px; }
.dact { margin-top: 8px; }
.keys { margin-top: 6px; }

/* missões */
.qgrid { display: grid; grid-template-columns: 240px 1fr; gap: 12px; }
.story { border: 1px solid #c9a227; border-radius: 6px; padding: 8px 10px; margin-bottom: 12px; background: linear-gradient(180deg, rgba(201,162,39,.16), rgba(201,162,39,.04)); }
.story .qhead b { color: #ffe28a; }
.story .qdesc { margin: 6px 0; white-space: normal; }
.story .qgoal { font-weight: 600; margin: 4px 0; }
.story button { margin-top: 6px; }
.qlist2 { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; align-content: start; max-height: 52vh; overflow: auto; }
.qlist2 li { background: #0d1540; border: 1px solid #34488f; border-radius: 6px; padding: 6px 8px; cursor: pointer; }
.qlist2 li.sel { border-color: #ffe28a; }
.qlist2 li.ready { border-left: 4px solid #5adc7a; }
.qdetail { background: #0d1540; border: 1px solid #34488f; border-radius: 8px; padding: 10px 12px; display: grid; gap: 6px; align-content: start; }
.qrew { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.rw.luc { background: #3b2f10; }
.empty-state { text-align: center; padding: 10px 6px; }
.empty-state .big { font-size: 2.2em; }
.empty-state .row { justify-content: center; }

/* grupo, guilda e ranking */
.members li { background: #0d1540; border: 1px solid #34488f; border-radius: 6px; padding: 6px 8px; }
.gtag { display: inline-block; background: #e6b450; color: #1a1420; font-weight: 800; border-radius: 4px; padding: 0 6px; margin-right: 6px; font-size: .85em; }
ol.rank { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
ol.rank li { display: flex; gap: 6px; align-items: center; background: #0d1540; border: 1px solid #34488f; border-radius: 6px; padding: 4px 8px; }
ol.rank .pos { width: 26px; text-align: center; }

/* loja */
.dialog table.shop td.sicon { width: 36px; }
.dialog .cmp { font-size: .8em; }

@media (max-width: 760px) {
  .herogrid, .qgrid { grid-template-columns: 1fr; }
  .grid { grid-template-columns: repeat(6, 1fr); }
  .cell { width: auto; aspect-ratio: 1; }
}

/* seletor de idioma (tela de entrada e menu de controles do jogo) */
#langbox { position: fixed; bottom: 12px; right: 14px; z-index: 5; }
.langpick { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.langpick span { font-size: 12px; opacity: .8; }
.langpick button { padding: 4px 10px; font-size: 12px; border-radius: 6px; cursor: pointer; opacity: .65; }
.langpick button.on { opacity: 1; outline: 2px solid #ffd76a; }

/* menu do mapa (M) */
.mapgrid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.mapmain #mapcanvas { margin: 0 auto; }
.mapmain { min-width: 0; }
.maphead { margin-bottom: 6px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.maphead .tag.safe { background: #1d6b3a; } .maphead .tag.hunt { background: #8a3a1a; }
#mapcanvas { display: block; max-width: 100%; border: 2px solid #4d64b8; border-radius: 6px; image-rendering: pixelated; background: #05060f; }
.maplegend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; font-size: .78em; color: #c6d0f0; }
.maplegend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 4px; vertical-align: -1px; }
.mapside { min-width: 0; }
.arealist { list-style: none; margin: 4px 0 0; padding: 0; max-height: 470px; overflow: auto; display: grid; gap: 3px; }
.arealist li { display: flex; justify-content: space-between; gap: 6px; padding: 4px 7px; border-radius: 5px; background: rgba(13, 21, 64, .6); font-size: .82em; }
.arealist li span { color: #a9b6e0; white-space: nowrap; }
.arealist li.town b { color: #7cf2a0; }
.arealist li.here { background: linear-gradient(90deg, #6b5a12, #2a2a60); outline: 1px solid #ffe28a; }
.arealist li.here b::before { content: '▶ '; color: #ffe28a; }
.arealist li { align-items: center; }
.arealist li b { flex: 1; }
.travelbtn { font: inherit; font-size: .9em; padding: 1px 8px; border-radius: 4px; border: 1px solid #ffe28a; background: #3a3170; color: #ffe28a; cursor: pointer; }
.travelbtn:hover { background: #5a4ab0; }
.travelbtns { display: flex; gap: 3px; }
.travelbtn.small { padding: 1px 6px; }
@media (max-width: 760px) { .mapgrid { grid-template-columns: 1fr; } .arealist { max-height: 200px; } }

/* janela de troca */
.trade { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(0, 0, 10, .55); }
.trade.hidden { display: none; }
.tradewin { width: min(860px, 94vw); background: linear-gradient(180deg, #16215a, #0d1540); border: 2px solid #8fa5ef; border-radius: 10px; box-shadow: 0 10px 40px #000a; padding: 10px 14px 12px; color: #e8ecff; }
.thead { display: flex; justify-content: space-between; align-items: center; font-size: 1.05em; margin-bottom: 8px; }
.tcols { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.tcol { background: rgba(0, 0, 0, .25); border: 1px solid #33438a; border-radius: 8px; padding: 8px; min-height: 220px; display: flex; flex-direction: column; }
.tcol.ready { border-color: #7cf2a0; box-shadow: 0 0 0 1px #7cf2a066 inset; }
.ttitle { font-weight: 700; margin-bottom: 6px; }
.tlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; max-height: 260px; overflow: auto; flex: 1; align-content: start; }
.tlist li { display: flex; align-items: center; gap: 6px; padding: 3px 6px; border-radius: 5px; background: rgba(26, 38, 110, .7); font-size: .85em; }
.tlist li[data-add], .tlist li[data-rem] { cursor: pointer; }
.tlist li[data-add]:hover { background: #2a3a9a; } .tlist li[data-rem]:hover { background: #6a2a3a; }
.tlist li span { flex: 1; }
.tluc { margin-top: 8px; display: flex; gap: 6px; align-items: center; }
.tluc input { width: 110px; }
.tbtns { margin-top: 10px; align-items: center; gap: 10px; }
@media (max-width: 760px) { .tcols { grid-template-columns: 1fr; } .tcol { min-height: 0; } }
.tradewin button { background: linear-gradient(#ffe28a, #e6b450); color: #1a1420; border: 1px solid #fff3c4; border-radius: 6px; padding: 5px 14px; font-weight: 600; cursor: pointer; }
.tradewin button.ghost { background: #22336f; color: #dfe6ff; border-color: #4d64b8; }
.tradewin button:disabled { opacity: .6; cursor: default; }
.tradewin .pclose { background: transparent; color: #fff; border: 0; font-size: 18px; padding: 0 6px; }

/* durabilidade, abas da loja */
.dur { display: inline-block; width: 46px; height: 4px; background: #00000066; border-radius: 2px; overflow: hidden; vertical-align: middle; }
.dur i { display: block; height: 100%; background: #6fd27a; }
.dur.low i { background: #f0b03c; }
.dur.broken { background: #b84d5d; }
.bad { color: #ff8a8a; }
.dialog .shoptabs { display: flex; gap: 6px; margin: 4px 0 6px; }
.dialog .shoptabs button { background: #0d1540; border: 1px solid #34488f; color: #c9d4ff; padding: 3px 12px; }
.dialog .shoptabs button.on { background: #34488f; color: #fff; border-color: #ffe28a; }
.dialog .shopwrap.short { max-height: 22vh; }

/* grupo: lista compacta no canto de cima (só aparece em grupo) */
.partybox { position: absolute; top: 46px; left: 8px; z-index: 6; display: grid; gap: 4px; pointer-events: auto; }
.partybox .pm { display: flex; gap: 6px; align-items: center; width: 150px; margin: 0; padding: 3px 6px 3px 3px; background: #0b123acc; border: 1px solid #34488f99; border-radius: 6px; }
.partybox .pm.down { opacity: .55; }
.partybox .pface { width: 22px; height: 22px; image-rendering: pixelated; background: #1d2a52; border-radius: 4px; flex: none; }
.partybox .pinfo { flex: 1; min-width: 0; display: grid; gap: 2px; }
.partybox .pname { display: flex; align-items: baseline; gap: 4px; font-size: 11px; font-weight: 600; color: #eef2ff; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.partybox .pname span { margin-left: auto; font-size: 10px; font-weight: 500; color: #ffe28a; }
.partybox .crown { font-style: normal; color: #ffd45a; font-size: 10px; }
.partybox .pbar { height: 3px; background: #00000080; border-radius: 2px; overflow: hidden; }
.partybox .pbar i { display: block; height: 100%; background: linear-gradient(90deg, #3fbf62, #7ee08f); }
.partybox .pbar.mp i { background: linear-gradient(90deg, #3a7ad9, #7fb3ff); }
.phead { display: flex; gap: 8px; align-items: baseline; margin-bottom: 6px; }
.members .pbtns { margin-left: auto; display: flex; gap: 4px; }
.lootmode { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 10px 0; padding: 8px; background: #0d1540; border: 1px solid #34488f; border-radius: 6px; }
.lootmode .tag.off { opacity: .45; }
.lootmode .muted { flex-basis: 100%; }

/* Livro de Marcação */
.dialog .bpages { display: grid; gap: 6px; margin-top: 6px; }
.dialog .bpage { display: flex; align-items: center; gap: 10px; padding: 6px 8px; background: #f3e8c80f; border: 1px solid #e8d8a855; border-radius: 6px; }
.dialog .bpage.empty { border-style: dashed; }
.dialog .bnum { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: #e8d8a8; color: #3a2a10; font-weight: 800; font-size: 12px; flex: none; }
.dialog .bplace { flex: 1; min-width: 0; }
.dialog .bbtns { display: flex; gap: 4px; }

/* raridade dos itens: normal, mágico (azul), raro (amarelo), super raro (laranja), set (verde) */
img.icon.rar1 { filter: drop-shadow(0 0 2px #6aa8ff); }
img.icon.rar2 { filter: drop-shadow(0 0 2px #ffd34a); }
img.icon.rar3 { filter: drop-shadow(0 0 3px #ff7a3c); }
img.icon.rar4 { filter: drop-shadow(0 0 3px #4cf08a); }
.cell.rc1 { border-color: #6aa8ff !important; }
.cell.rc2 { border-color: #ffd34a !important; }
.cell.rc3 { border-color: #ff7a3c !important; box-shadow: inset 0 0 8px #ff7a3c55; }
.cell.rc4 { border-color: #4cf08a !important; box-shadow: inset 0 0 8px #4cf08a55; }
.rtag { font-size: 10.5px; font-weight: 800; padding: 0 6px; border-radius: 8px; color: #10142a; background: var(--rc); vertical-align: middle; }
.ibonus { display: flex; flex-wrap: wrap; gap: 3px 8px; margin-top: 3px; font-size: 11.5px; color: #8af0b0; }
.setbox { margin-top: 6px; padding: 6px 8px; border: 1px solid #4cf08a66; border-radius: 6px; background: #0a2a1a66; font-size: 11.5px; }
.setbox .sethead b { color: #4cf08a; }
.setpieces { display: flex; flex-wrap: wrap; gap: 2px 8px; margin: 3px 0; color: #8a93b8; }
.setpieces .on { color: #4cf08a; }
.setb { color: #8a93b8; }
.setb.on { color: #c8ffd8; }
.filters { flex-wrap: wrap; }
/* 8 espaços do herói em duas colunas, compactos */
.slots { grid-template-columns: 1fr 1fr; gap: 4px; }
.slots .eslot { padding: 3px 5px; gap: 6px; min-width: 0; }
.slots .eslot .eicon img { width: 26px; height: 26px; }
.slots .eslot .eitem { font-size: 11px; line-height: 1.2; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.slots .eslot > div:last-child { min-width: 0; }
.langpick .flag { width: 18px; height: 13px; vertical-align: -2px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,.35); margin-right: 3px; }
