@font-face { font-family: 'Silkscreen'; src: url('fonts/silkscreen-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Silkscreen'; src: url('fonts/silkscreen-700.woff2') format('woff2'); font-weight: 700; font-display: swap; }

:root {
  --bg: #0b0e1a;
  --surface: #121729;
  --surface-2: #1a2038;
  --line: #2a3152;
  --text: #e7e9f3;
  --muted: #8b93b5;
  --gold: #facc15;
  --accent: #7c5cff;
  --good: #4ade80;
  --bad: #f87171;
  --xp: #38bdf8;
  --strip-h: 140px;
  --pixel: 'Silkscreen', ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: radial-gradient(1200px 500px at 50% 0%, #1b2140 0%, var(--bg) 60%) fixed, var(--bg);
  color: var(--text);
  font: 13px/1.4 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  min-height: 100vh; padding: 24px 16px 32px; gap: 28px; justify-content: center;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; cursor: pointer; }
img { image-rendering: pixelated; }

/* ---------- Web ---------- */
#web-header { text-align: center; max-width: 640px; }
#web-header h1 { font-family: var(--pixel); font-weight: 700; font-size: clamp(28px, 6vw, 44px); margin: 0 0 8px; letter-spacing: 1px; color: #fff; text-shadow: 3px 3px 0 #000; }
#web-header p { color: var(--muted); margin: 0 0 18px; font-size: 15px; }
.web-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.web-actions button, .web-actions .dl {
  background: var(--surface-2); border: 2px solid var(--line); border-radius: 10px; padding: 9px 14px;
  color: var(--text); text-decoration: none; font-weight: 600;
}
.web-actions button:hover, .web-actions .dl:hover { border-color: var(--accent); }
.desktop-only { display: none !important; }

#app { width: min(760px, 100%); display: flex; flex-direction: column; gap: 8px; }

/* ---------- Desktop (janela transparente) ---------- */
html.desktop body { background: transparent; padding: 0; min-height: 0; height: 100vh; overflow: hidden; justify-content: flex-end; gap: 0; }
html.desktop .web-only { display: none !important; }
html.desktop .desktop-only { display: inline-flex !important; }
html.desktop #app { width: 100%; height: 100%; gap: 6px; padding: 0 2px 4px; justify-content: flex-end; }
html.desktop #strip, html.desktop #strip * { -webkit-app-region: drag; }
html.desktop #strip button, html.desktop #strip button * { -webkit-app-region: no-drag; }

/* ---------- Faixa do jogo ---------- */
#strip {
  position: relative; flex: 0 0 var(--strip-h); height: var(--strip-h);
  background: rgba(12, 15, 28, 0.94); border: 2px solid var(--line); border-radius: 14px;
  overflow: hidden; display: flex; flex-direction: column;
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
  user-select: none; -webkit-user-select: none;
}
#hud {
  flex: 0 0 34px; display: flex; align-items: center; gap: 10px; padding: 0 6px 0 12px;
  font-family: var(--pixel); font-size: 11px; white-space: nowrap;
  border-bottom: 2px solid rgba(42, 49, 82, .7);
}
.hud-stage { display: flex; flex-direction: column; line-height: 1.05; min-width: 0; overflow: hidden; }
#hud-act { color: var(--muted); font: 10px/1.2 system-ui, -apple-system, 'Segoe UI', sans-serif; overflow: hidden; text-overflow: ellipsis; }
#hud-wave { color: #fff; }
.farm-badge { background: #3f2d00; color: var(--gold); border: 1px solid #a16207; border-radius: 6px; font-family: var(--pixel); font-size: 9px; padding: 1px 5px; }
.hud-lvl { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.xpbar { width: 70px; height: 6px; background: #0a0d18; border: 1px solid var(--line); border-radius: 3px; overflow: hidden; }
.xpbar i { display: block; height: 100%; width: 0; background: var(--xp); transition: width .2s; }
.hud-gold { display: flex; align-items: center; gap: 4px; color: var(--gold); min-width: 64px; }
.hud-gold img { width: 12px; height: 12px; }
.hud-btns { display: flex; gap: 2px; }
.hud-btns button {
  position: relative; width: 28px; height: 26px; display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid transparent; border-radius: 7px; font-size: 14px; line-height: 1; padding: 0;
}
.hud-btns button:hover, .hud-btns button.on { background: var(--surface-2); border-color: var(--line); }
.hud-btns img { width: 18px; height: 18px; }
#bag-badge, .hud-badge { position: absolute; top: -2px; right: -2px; min-width: 14px; height: 14px; padding: 0 3px; border-radius: 7px; background: #e11d48; color: #fff; font: 700 9px/14px system-ui, sans-serif; }
#scene { flex: 1; width: 100%; min-height: 0; display: block; }

#toast { position: absolute; left: 50%; top: 64px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 4px; pointer-events: none; z-index: 5; }
#toast div {
  background: rgba(10, 12, 24, .92); border: 1px solid var(--line); border-radius: 8px; padding: 3px 9px;
  font-size: 11px; max-width: min(520px, 90vw); text-align: center; animation: toast 3.2s forwards;
}
@keyframes toast { 0% { opacity: 0; transform: translateY(-4px); } 8%, 80% { opacity: 1; transform: none; } 100% { opacity: 0; } }

/* ---------- Painel ---------- */
#panel {
  height: 420px; background: var(--surface); border: 2px solid var(--line); border-radius: 14px;
  display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 8px 24px rgba(0,0,0,.35);
}
#panel[hidden] { display: none; }
html.desktop #panel { flex: 1 1 auto; height: auto; min-height: 0; }
.panel-head { display: flex; align-items: center; gap: 6px; padding: 6px 6px 0 8px; border-bottom: 2px solid var(--line); }
html.desktop .panel-head { -webkit-app-region: drag; }
html.desktop .panel-head button { -webkit-app-region: no-drag; }
.tabs { display: flex; gap: 2px; flex: 1; overflow-x: auto; }
.tabs button {
  background: transparent; border: 0; border-bottom: 3px solid transparent; padding: 7px 10px 6px;
  font-family: var(--pixel); font-size: 11px; color: var(--muted);
}
.tabs button.on { color: #fff; border-bottom-color: var(--accent); }
.icon-btn { background: transparent; border: 1px solid var(--line); border-radius: 7px; width: 28px; height: 26px; margin-bottom: 4px; }
#panel-body { flex: 1; overflow: auto; padding: 12px; }
#panel-body h3 { font-family: var(--pixel); font-size: 11px; font-weight: 400; color: var(--muted); margin: 0 0 8px; text-transform: uppercase; letter-spacing: .5px; }
.row { display: flex; gap: 8px; align-items: center; }
.between { justify-content: space-between; }
.muted { color: var(--muted); }
.gold { color: var(--gold); }
.good { color: var(--good); }
.bad { color: var(--bad); }
.px { font-family: var(--pixel); }
.btn {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 5px 10px; font-size: 12px;
  display: inline-flex; align-items: center; gap: 5px;
}
.btn:hover:not(:disabled) { border-color: var(--accent); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn.danger { border-color: #7f1d1d; color: #fca5a5; }
.btn img { width: 12px; height: 12px; }

/* Mochila */
.bag-layout { display: grid; grid-template-columns: 1fr 210px; gap: 12px; }
.eq-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin-bottom: 12px; }
.slot {
  background: var(--surface-2); border: 2px solid var(--rc, var(--line)); border-radius: 9px; padding: 5px 2px 4px;
  display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0;
}
.slot img { width: 26px; height: 26px; }
.slot span { font-size: 9px; color: var(--muted); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot.empty img { opacity: .25; }
.bag-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(34px, 1fr)); gap: 4px; }
.cell {
  position: relative; aspect-ratio: 1; background: var(--surface-2); border: 2px solid var(--rc, var(--line)); border-radius: 7px;
  display: flex; align-items: center; justify-content: center; padding: 0;
}
.cell img { width: 22px; height: 22px; }
.cell.void { border-style: dashed; border-color: #20263f; background: transparent; cursor: default; }
.cell .up { position: absolute; right: 1px; bottom: 0; font-size: 9px; color: var(--good); font-style: normal; }
.cell.new::after { content: ''; position: absolute; top: 2px; left: 2px; width: 5px; height: 5px; border-radius: 50%; background: #e11d48; }
.slot.sel, .cell.sel { outline: 2px solid #fff; outline-offset: 1px; }
.detail { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px; position: sticky; top: 0; }
.detail .nm { font-weight: 700; color: var(--rc); font-size: 13px; }
.detail .sub { color: var(--muted); font-size: 11px; margin-bottom: 6px; }
.detail ul { margin: 0 0 8px; padding: 0; list-style: none; font-size: 12px; }
.detail li { padding: 1px 0; }
.detail li.base { color: #fff; }
.detail li.aff { color: #a5b4fc; }
.detail .cmp { font-size: 12px; margin-bottom: 8px; }
.detail .acts { display: flex; flex-wrap: wrap; gap: 5px; }
.power-chip { font-family: var(--pixel); font-size: 11px; background: #1f1840; border: 1px solid #3b2f7a; border-radius: 8px; padding: 3px 8px; }

/* Herói */
.class-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.class-card { background: var(--surface-2); border: 2px solid var(--line); border-radius: 10px; padding: 8px; text-align: left; display: flex; flex-direction: column; gap: 4px; }
.class-card.on { border-color: var(--accent); background: #1d1940; }
.class-card img { height: 48px; width: auto; max-width: 100%; object-fit: contain; align-self: flex-start; image-rendering: pixelated; }
.class-card b { font-size: 12px; }
.class-card small { color: var(--muted); font-size: 11px; line-height: 1.3; }
.two-col { display: grid; grid-template-columns: 1.2fr 1fr; gap: 14px; }
.skill { display: flex; gap: 8px; align-items: flex-start; padding: 7px 8px; border: 1px solid var(--line); border-radius: 9px; margin-bottom: 6px; background: var(--surface-2); }
.skill.locked { opacity: .5; }
.skill .info { flex: 1; }
.skill b { font-size: 12px; }
.skill small { display: block; color: var(--muted); font-size: 11px; }
.stats { width: 100%; border-collapse: collapse; font-size: 12px; }
.stats td { padding: 3px 0; border-bottom: 1px dashed #232a47; }
.stats td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.toggle { appearance: none; width: 30px; height: 17px; border-radius: 9px; background: #2a3152; position: relative; cursor: pointer; flex: 0 0 auto; margin: 0; }
.toggle::after { content: ''; position: absolute; top: 2px; left: 2px; width: 13px; height: 13px; border-radius: 50%; background: #8b93b5; transition: .15s; }
.toggle:checked { background: var(--accent); }
.toggle:checked::after { left: 15px; background: #fff; }

/* Mapa */
.diff-tabs { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.diff-tabs .btn.on { border-color: var(--dc); color: var(--dc); }
.act { margin-bottom: 12px; }
.act-title { font-size: 12px; margin-bottom: 5px; }
.stages { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; }
.stage { aspect-ratio: 1.3; border-radius: 7px; border: 2px solid var(--line); background: var(--surface-2); font-family: var(--pixel); font-size: 11px; padding: 0; }
.stage.done { border-color: #3b4a7a; }
.stage.cur { border-color: #fff; background: #2a2360; }
.stage.lock { opacity: .45; cursor: default; }
.stage.boss { color: var(--gold); }

/* Forja / Ajustes */
.up-row { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); margin-bottom: 7px; }
.up-row .info { flex: 1; }
.up-row b { font-size: 13px; }
.up-row small { display: block; color: var(--muted); font-size: 11px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px dashed #232a47; }
.set-row small { display: block; color: var(--muted); font-size: 11px; }
select { background: var(--surface-2); color: var(--text); border: 1px solid var(--line); border-radius: 7px; padding: 4px 6px; font: inherit; }
textarea { width: 100%; height: 60px; background: #0a0d18; color: var(--text); border: 1px solid var(--line); border-radius: 8px; font: 11px ui-monospace, monospace; padding: 6px; resize: vertical; }
.report { text-align: center; padding: 10px 0; }
.report h2 { font-family: var(--pixel); font-size: 18px; margin: 0 0 4px; }
.report .big { display: flex; justify-content: center; gap: 24px; margin: 16px 0; flex-wrap: wrap; }
.report .big div { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 16px; min-width: 120px; }
.report .big b { display: block; font-family: var(--pixel); font-size: 18px; }
.report .loot { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; max-width: 480px; margin: 0 auto 14px; }
.report .loot .cell { width: 34px; }

@media (max-width: 560px) {
  :root { --strip-h: 132px; }
  .hud-lvl .xpbar { width: 40px; }
  #hud-act { display: none; }
  #hud { gap: 6px; padding-left: 8px; }
  #hud-wave { font-size: 9px; }
  .hud-gold { min-width: 0; }
  .bag-layout, .two-col { grid-template-columns: 1fr; }
  .class-grid { grid-template-columns: 1fr; }
  .eq-row { grid-template-columns: repeat(3, 1fr); }
  .stages { grid-template-columns: repeat(5, 1fr); }
}

/* barras de rolagem discretas */
#panel-body::-webkit-scrollbar { width: 8px; }
#panel-body::-webkit-scrollbar-thumb { background: #2a3152; border-radius: 4px; }
#panel-body::-webkit-scrollbar-track { background: transparent; }

/* ---------- Menu: conta, vagas e criação ---------- */
#panel.menu .panel-head { display: none; }
html.desktop #panel.menu #panel-body { -webkit-app-region: no-drag; }
#strip.menu .hud-lvl, #strip.menu .hud-gold, #strip.menu #hud-farm,
#strip.menu .hud-btns button:not(#btn-hide) { visibility: hidden; }
.menu-wrap { max-width: 380px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 0 0 8px; }
.menu-wrap.wide { max-width: 100%; align-items: stretch; }
.menu-title { font-size: 18px; font-weight: 700; color: #fff; text-shadow: 2px 2px 0 #000; margin: 0 0 2px; text-align: center; }
.center { text-align: center; }
.auth-box { width: 100%; display: flex; flex-direction: column; gap: 8px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: #0d1122; border-radius: 9px; padding: 3px; gap: 3px; }
.seg button { background: transparent; border: 0; border-radius: 7px; padding: 7px; font-weight: 600; color: var(--muted); }
.seg button.on { background: var(--accent); color: #fff; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.field input, input.inp {
  background: #0d1122; color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; font: 14px system-ui, sans-serif;
}
.field input:focus { outline: none; border-color: var(--accent); }
.btn.big { padding: 10px 14px; font-size: 14px; justify-content: center; }
.link { background: none; border: 0; color: #a5b4fc; font-size: 12px; padding: 2px; text-decoration: underline; text-underline-offset: 2px; }
.link.danger { color: #fca5a5; }
.form-err { background: #3b0d14; border: 1px solid #7f1d1d; color: #fecaca; border-radius: 8px; padding: 7px 9px; font-size: 12px; }
.form-info { background: #0c2b1c; border: 1px solid #166534; color: #bbf7d0; border-radius: 8px; padding: 7px 9px; font-size: 12px; }
.or { width: 100%; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.acct-mini { font-size: 11px; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.notice { background: #1d1940; border: 1px solid #3b2f7a; border-radius: 10px; padding: 8px 10px; font-size: 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.slot-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 6px; }
.slot-card {
  background: var(--surface-2); border: 2px solid var(--line); border-radius: 12px; padding: 12px 10px; min-height: 230px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center;
}
.slot-card img { height: 64px; width: auto; max-width: 100%; object-fit: contain; image-rendering: pixelated; }
.slot-card b { font-size: 13px; color: #fff; word-break: break-word; }
.slot-card small { font-size: 11px; line-height: 1.4; }
.slot-card .btn { margin-top: 4px; width: 100%; justify-content: center; }
.slot-card.empty { border-style: dashed; color: var(--muted); }
.slot-card.empty:hover { border-color: var(--accent); color: #fff; }
.slot-card .plus { font: 700 30px/1 var(--pixel); }
.create-grid { display: grid; grid-template-columns: 170px 1fr; gap: 14px; margin-top: 6px; }
.preview { background: #0d1122; border: 1px solid var(--line); border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 14px 8px; align-self: start; position: sticky; top: 0; }
.preview img { height: 128px; width: auto; max-width: 100%; object-fit: contain; image-rendering: pixelated; }
.preview b { color: #fff; text-align: center; word-break: break-word; }
.create-form { display: flex; flex-direction: column; gap: 8px; }
.create-form .class-grid { margin-bottom: 4px; }
.create-form .class-card img { height: 40px; width: auto; }
.create-form .class-card small { display: none; }
.create-form .class-card { align-items: center; text-align: center; padding: 6px; }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.swatch { width: 24px; height: 24px; border-radius: 6px; background: var(--c); border: 2px solid rgba(255,255,255,.15); padding: 0; }
.swatch.on { border-color: #fff; box-shadow: 0 0 0 2px var(--accent); }
.hero-card { display: flex; gap: 12px; align-items: center; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 14px; }
.hero-card img { height: 80px; width: auto; max-width: 120px; object-fit: contain; flex: none; image-rendering: pixelated; }
.hero-card > div { flex: 1; display: flex; flex-direction: column; gap: 2px; font-size: 12px; }
.hero-card b { font-size: 14px; color: #fff; }
.account-box { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 6px; }
.account-box small { display: block; color: var(--muted); font-size: 11px; max-width: 330px; }
@media (max-width: 560px) {
  .slot-grid { grid-template-columns: 1fr; }
  .slot-card { min-height: 0; }
  .create-grid { grid-template-columns: 1fr; }
  .preview { position: static; }
}
.bag-seg { max-width: 360px; margin-bottom: 12px; }

/* ---------- Itens: fundo pela raridade ---------- */
.cell:not(.void), .slot:not(.empty), .detail[style*="--rc"] .nm { --glow: color-mix(in srgb, var(--rc) 40%, transparent); }
.cell:not(.void), .slot:not(.empty) {
  background: radial-gradient(circle at 50% 38%, color-mix(in srgb, var(--rc) 38%, #161c33) 0%, color-mix(in srgb, var(--rc) 12%, #11162a) 70%);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.35), inset 0 -6px 10px rgba(0,0,0,.25), 0 0 6px var(--glow);
}
.cell img, .slot img { filter: drop-shadow(0 1px 0 rgba(0,0,0,.55)); }
.slot img.ghost, .cell img.ghost { opacity: .22; filter: grayscale(1); }
.cell img { width: 26px; height: 26px; }
.slot img { width: 30px; height: 30px; }
.cell.sm { width: 34px; height: 34px; aspect-ratio: auto; }
.cell.sm img { width: 24px; height: 24px; }
/* ---------- Joias e fusão ---------- */
.gem-bar { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px; font-family: var(--pixel); font-size: 11px; }
.gem-bar span { display: inline-flex; align-items: center; gap: 4px; }
.gem-bar img { width: 18px; height: 18px; }
.gem-bar .gold img { width: 13px; height: 13px; }
.center-bar { justify-content: center; margin: 0 auto 12px; max-width: 480px; }
.fuse-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); margin-bottom: 6px; }
.fuse-row.dim { opacity: .55; }
.fuse-in { display: flex; gap: 3px; }
.fuse-arrow { color: var(--muted); font-family: var(--pixel); }
.fuse-row .info { flex: 1; min-width: 0; font-size: 12px; }
.fuse-row .info small { display: block; color: var(--muted); font-size: 11px; }
.fuse-cost { display: flex; flex-direction: column; gap: 2px; font-family: var(--pixel); font-size: 10px; align-items: flex-end; }
.fuse-cost span { display: inline-flex; align-items: center; gap: 3px; }
.fuse-cost img { width: 14px; height: 14px; }
@media (max-width: 560px) { .fuse-row { flex-wrap: wrap; } .fuse-row .info { flex: 1 1 100%; order: 9; } }

/* ---------- Janela flutuante do navegador (Document Picture-in-Picture) ---------- */
html.pip, html.pip body { height: 100%; }
html.pip body { margin: 0; padding: 0; min-height: 0; overflow: hidden; background: #0b0e1a; display: flex; flex-direction: column; justify-content: flex-end; }
html.pip #app { width: 100%; height: 100%; gap: 6px; padding: 4px; box-sizing: border-box; justify-content: flex-end; }
html.pip #panel { flex: 1 1 auto; height: auto; min-height: 0; }

/* ---------- Evolução de classe / nível dos atos ---------- */
.evo-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.evo-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-left: 3px solid var(--ec); border-radius: 10px; background: var(--surface-2); }
.evo-row.done { background: color-mix(in srgb, var(--ec) 10%, var(--surface-2)); }
.evo-row .info { display: flex; flex-direction: column; min-width: 0; }
.evo-row .info b { color: var(--ec); }
.evo-row .info small { color: var(--muted); font-size: 11px; }
.evo-cost { display: flex; gap: 8px; align-items: center; font-size: 12px; white-space: nowrap; }
.evo-cost span { display: inline-flex; align-items: center; gap: 3px; }
.evo-cost img { width: 12px; height: 12px; }
.evo-cost .bad, .lvl-chip.bad { color: #f87171; }
.lvl-chip { display: inline-block; font-family: var(--pixel); font-size: 9px; padding: 1px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); color: #a5f3fc; margin-left: 4px; }
.lvl-chip.bad { border-color: #7f1d1d; background: #2a0f14; }
.map-note { margin: 0 0 10px; padding: 8px 10px; border: 1px solid #a16207; background: #2a1d00; color: #fde68a; border-radius: 10px; font-size: 12px; }
.btn.tiny { padding: 2px 7px; font-size: 11px; }
.rename { gap: 6px; margin-bottom: 2px; }
.rename input { flex: 1; min-width: 0; background: #0a0d18; border: 1px solid var(--line); color: var(--text); border-radius: 8px; padding: 5px 8px; font: inherit; }

/* ---------- Segurança da conta / convites ---------- */
.sec-line { font-size: 11px; color: #86efac; margin: -6px 0 12px; }
.invite-box { border: 1px solid #a16207; background: color-mix(in srgb, #facc15 6%, var(--surface-2)); border-radius: 12px; padding: 10px 12px; margin-bottom: 14px; }
.invite-box input { flex: 1; min-width: 0; background: #0a0d18; border: 1px solid var(--line); color: var(--text); border-radius: 8px; padding: 6px 8px; font: inherit; }
.invites td { vertical-align: middle; padding: 5px 4px; }
.invites td.code { letter-spacing: 1px; color: #fde68a; white-space: nowrap; font-size: 11px; }
.invites td.right { text-align: right; white-space: nowrap; }
.mfa-qr { display: block; width: 180px; height: 180px; margin: 6px auto; background: #fff; border-radius: 10px; padding: 8px; image-rendering: auto; }
.mfa-secret { display: inline-block; margin-top: 4px; font-size: 12px; color: var(--text); letter-spacing: 1px; word-break: break-all; }
.notice.name-ask { flex-wrap: wrap; justify-content: flex-start; width: 100%; }
.notice.name-ask .row { flex: 1 1 260px; gap: 8px; }
.notice.name-ask input, .account-box ~ .rename input { flex: 1; min-width: 0; background: #0a0d18; border: 1px solid var(--line); color: var(--text); border-radius: 8px; padding: 6px 8px; font: inherit; }
.pv { display: inline-block; margin-top: 4px; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 6px; }
.pv.good { color: #86efac; background: #052e16; border: 1px solid #166534; }
.pv.bad { color: #fca5a5; background: #2a0f14; border: 1px solid #7f1d1d; }
.pv.mid { color: #fde68a; background: #2a1d00; border: 1px solid #a16207; }

/* ---------- Perigo das fases (mapa) ---------- */
.stage { box-shadow: inset 0 -4px 0 var(--th, transparent); }
.stage.done, .stage.lock { border-color: color-mix(in srgb, var(--th, var(--line)) 45%, var(--line)); }
.threat-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 0 0 10px; font-size: 12px; }
.threat-legend span { display: inline-flex; align-items: center; gap: 5px; }
.threat-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.threat-legend small { margin-left: auto; font-size: 11px; }
.map-note.threat-note { border-color: var(--th); background: color-mix(in srgb, var(--th) 10%, var(--surface-2)); color: var(--text); display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.stage .lock-ic { font-size: 13px; filter: grayscale(1); opacity: .8; }
.evo-av { width: 58px; height: auto; flex: 0 0 auto; margin: -6px 0; image-rendering: pixelated; filter: drop-shadow(0 0 6px color-mix(in srgb, var(--ec) 55%, transparent)); }
.evo-row:not(.done) .evo-av { opacity: .92; }
.evo-row .info { flex: 1; }
.dye-line { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); margin: -2px 0 8px; }
.dye-line i { width: 12px; height: 12px; border-radius: 3px; border: 1px solid var(--line); display: inline-block; }

/* ---- joias: encaixes nos itens e bolsa de joias ---- */
.slot { position: relative; }
.cell .so, .slot .so { position: absolute; left: 2px; bottom: 2px; display: flex; gap: 1px; font-style: normal; }
.slot .so { left: 4px; top: 4px; bottom: auto; }
.so b { width: 4px; height: 4px; border: 1px solid #8b93b0; background: #0b0e1a; transform: rotate(45deg); }
.socks { margin: 0 0 8px; border-top: 1px dashed var(--line); padding-top: 6px; }
.socks-h { font-size: 11px; font-weight: 700; margin-bottom: 4px; }
.sock { display: flex; align-items: center; gap: 6px; padding: 4px 5px; border: 1px solid var(--jc, var(--line)); border-radius: 7px; margin-bottom: 4px; font-size: 11px; background: rgba(0,0,0,.18); }
.sock img { width: 22px; height: 22px; flex: none; }
.sock > span { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sock b { color: var(--jc, var(--text)); }
.sock small { color: #a5b4fc; }
.sock.empty { border-style: dashed; }
.sock .hole { width: 10px; height: 10px; margin: 0 6px; border: 2px solid #5b6488; transform: rotate(45deg); background: #0b0e1a; flex: none; }
.sock .btn.tiny img { width: 10px; height: 10px; vertical-align: -1px; }
.gem-pick { display: flex; flex-direction: column; gap: 3px; margin: -1px 0 6px 10px; max-height: 150px; overflow: auto; }
.gp { display: flex; align-items: center; gap: 6px; text-align: left; background: var(--surface); border: 1px solid var(--jc, var(--line)); border-radius: 7px; padding: 3px 6px; color: var(--text); font: inherit; font-size: 11px; cursor: pointer; }
.gp:hover { background: var(--surface-2); }
.gp img { width: 20px; height: 20px; }
.gp span { display: flex; flex-direction: column; }
.gp b { color: var(--jc); }
.gp small { color: #a5b4fc; }
.jtable { border-collapse: separate; border-spacing: 3px; margin-top: 6px; width: 100%; }
.jtable th { font-size: 9px; font-weight: 700; text-align: center; letter-spacing: .3px; }
.jtable td.jf { font-size: 11px; font-weight: 700; white-space: nowrap; padding-right: 2px; }
.jcell { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 1px; background: var(--surface-2); border: 2px solid var(--jc, var(--line)); border-radius: 7px; padding: 3px 0 2px; color: var(--text); cursor: pointer; font: inherit; }
.jcell img { width: 22px; height: 22px; }
.jcell span { font-size: 10px; font-weight: 700; }
.jcell.zero { opacity: .35; border-color: var(--line); }
.jcell.sel { outline: 2px solid #fff; outline-offset: 1px; opacity: 1; }
.bag-seg { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 1fr; max-width: 480px; }

/* ---- atributos com origem: base, melhorias, itens, joias ---- */
.src-legend { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 10px; color: var(--muted); padding: 2px 0 4px; }
.src-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }
.stats tr.srow td { padding-bottom: 0; border-bottom: 0; }
.stats tr.sparts td { padding-top: 2px; }
.sbar { display: flex; height: 3px; border-radius: 2px; overflow: hidden; background: #0b0e1a; margin: 1px 0 3px; }
.sbar i { display: block; height: 100%; }
.schips { font-size: 10px; display: flex; flex-wrap: wrap; gap: 0 4px; justify-content: flex-end; }
.schips b { color: var(--muted); font-weight: 400; }
.qhelp { display: inline-flex; align-items: center; justify-content: center; width: 15px; height: 15px; margin-left: 5px; padding: 0; border-radius: 50%; border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); font-family: inherit; font-size: 10px; font-weight: 700; line-height: 1; cursor: pointer; vertical-align: 1px; }
.qhelp:hover, .qhelp.on { color: #0b0e1a; background: #a5b4fc; border-color: #a5b4fc; }
.stats tr.shelp td { padding: 2px 0 4px; border-bottom: 0; }
.shelp div { text-align: left; font-size: 11px; line-height: 1.4; color: #c7d2fe; background: rgba(99, 102, 241, .12); border: 1px solid rgba(165, 180, 252, .3); border-radius: 7px; padding: 6px 8px; }

/* ---- confirmação com senha e código (recomeçar / apagar herói) ---- */
.danger-box { margin-top: 10px; padding: 10px 12px; border: 1px solid #7f1d1d; background: rgba(127, 29, 29, .18); border-radius: 10px; font-size: 12px; }
.danger-box.slim { margin-top: 4px; padding: 8px; text-align: left; display: flex; flex-direction: column; gap: 6px; }
.danger-box.slim p { margin: 0 !important; }
.id-fields { display: flex; gap: 6px; flex-wrap: wrap; }
.id-fields input { flex: 1 1 140px; min-width: 0; background: #0a0d18; border: 1px solid var(--line); color: var(--text); border-radius: 8px; padding: 6px 8px; font: inherit; }
.id-fields input:focus { outline: none; border-color: var(--accent); }
.danger-box.slim .id-fields { flex-direction: column; }

/* ---- itens Lendários e Celestiais brilham na mochila ---- */
@keyframes legGlow { 0%, 100% { box-shadow: 0 0 4px 0 color-mix(in srgb, var(--rc) 55%, transparent), inset 0 0 6px color-mix(in srgb, var(--rc) 25%, transparent); } 50% { box-shadow: 0 0 10px 2px color-mix(in srgb, var(--rc) 75%, transparent), inset 0 0 10px color-mix(in srgb, var(--rc) 40%, transparent); } }
.cell.leg, .slot.leg { animation: legGlow 2.2s ease-in-out infinite; }
.cell.leg img, .slot.leg img { filter: drop-shadow(0 0 3px color-mix(in srgb, var(--rc) 80%, transparent)); }
@media (prefers-reduced-motion: reduce) { .cell.leg, .slot.leg { animation: none; box-shadow: 0 0 8px 1px color-mix(in srgb, var(--rc) 65%, transparent); } }

/* ---- itens que pedem nível maior que o do herói ---- */
.cell.locked img { filter: grayscale(.6) brightness(.7); }
.cell .lv { position: absolute; right: 1px; top: 0; font-style: normal; font-size: 9px; font-weight: 700; color: #fca5a5; background: rgba(10, 12, 24, .85); border-radius: 4px; padding: 0 2px; line-height: 12px; }
.cell .lv::before { content: '🔒'; font-size: 7px; margin-right: 1px; }

/* ---- loja do mercador ---- */
.shop-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.shop-head .btn img { width: 12px; height: 12px; vertical-align: -1px; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.shop-card { position: relative; display: flex; flex-direction: column; gap: 6px; background: var(--surface-2); border: 1px solid var(--line); border-top: 3px solid var(--rc); border-radius: 10px; padding: 8px 9px 9px; }
.shop-card.done { opacity: .5; }
.shop-card.leg { animation: legGlow 2.2s ease-in-out infinite; }
.shop-tier { font-size: 9px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--muted); }
.shop-tier span { font-weight: 400; text-transform: none; letter-spacing: 0; }
.shop-tier.t-b { color: #93c5fd; }
.shop-tier.t-c { color: #facc15; }
.shop-top { display: flex; gap: 8px; align-items: center; }
.shop-top .cell.sm { width: 34px; flex: none; }
.shop-top b { display: block; font-size: 12px; line-height: 15px; }
.shop-top small { color: var(--muted); font-size: 10px; }
.shop-card ul { margin: 0; padding: 0; list-style: none; font-size: 11px; color: #a5b4fc; flex: 1; }
.shop-card ul li.base { color: #fff; }
.shop-card ul li.good { color: var(--good); }
.shop-card .btn img { width: 12px; height: 12px; vertical-align: -1px; }

/* ---- reciclar e criar ---- */
.forge-seg { max-width: 520px; }
.mtable td.jf small { display: block; font-size: 9px; font-weight: 400; color: var(--muted); white-space: normal; max-width: 90px; }
.mcell { position: relative; display: flex; flex-direction: column; align-items: center; gap: 1px; background: var(--surface-2); border: 2px solid var(--jc, var(--line)); border-radius: 7px; padding: 3px 0 2px; }
.mcell img { width: 22px; height: 22px; }
.mcell span { font-size: 10px; font-weight: 700; }
.mcell.zero { opacity: .45; border-color: var(--line); }
.mref { position: absolute; top: -6px; right: -6px; width: 16px; height: 16px; padding: 0; border-radius: 50%; border: 1px solid var(--line); background: var(--accent); color: #fff; font-size: 8px; line-height: 14px; cursor: pointer; }
.mref:disabled { background: var(--surface); color: var(--muted); cursor: default; opacity: .6; }
.craft-slots { margin-bottom: 8px; }
.craft-slots .slot.sel { outline: 2px solid #fff; outline-offset: 1px; }
.craft-types { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 10px; }
.craft-types .btn.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.fuse-cost span img { width: 14px; height: 14px; vertical-align: -2px; }

/* ---- pets: chocadeira, coleção e detalhes ---- */
.egg-box { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--rc, var(--line)); border-radius: 10px; background: var(--surface-2); }
.egg-box.empty { border-style: dashed; border-color: var(--line); }
.egg-box.ready { box-shadow: 0 0 0 1px var(--rc), 0 0 14px -2px var(--rc); }
.egg-box.ready .egg-img { animation: eggWobble .7s ease-in-out infinite; }
.egg-img { width: 40px; height: 40px; image-rendering: pixelated; object-fit: contain; flex: none; }
.egg-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 12px; }
.egg-info small { color: var(--muted); }
.egg-acts { flex: none; }
.egg-bar { height: 5px; border-radius: 3px; background: #0b0e1a; overflow: hidden; margin-top: 3px; }
.egg-bar i { display: block; height: 100%; background: linear-gradient(90deg, #34d399, #a7f3d0); }
.egg-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.egg-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px 3px 4px; border-radius: 999px; border: 1px solid var(--rc); background: var(--surface); color: var(--text); font: inherit; font-size: 11px; cursor: pointer; }
.egg-chip:disabled { cursor: default; opacity: .8; }
.egg-chip img { width: 18px; height: 18px; image-rendering: pixelated; }
@keyframes eggWobble { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-9deg); } 75% { transform: rotate(9deg); } }
.pcell { position: relative; }
.pcell img { object-fit: contain; }
.pcell .plv { position: absolute; right: 2px; bottom: 1px; font-size: 9px; font-weight: 700; color: #e2e8f0; text-shadow: 0 1px 0 #000; font-style: normal; }
.pcell .pact { position: absolute; left: 2px; top: 0; font-size: 10px; color: #fde047; font-style: normal; text-shadow: 0 1px 0 #000; }
.pcell .prole { position: absolute; left: 3px; bottom: 3px; width: 6px; height: 6px; border-radius: 50%; box-shadow: 0 0 0 1px #000; }
.pet-top { display: flex; gap: 10px; align-items: center; }
.pet-portrait { flex: none; width: 64px; height: 64px; display: grid; place-items: center; border-radius: 10px; border: 2px solid var(--rc); background: radial-gradient(circle at 50% 60%, color-mix(in srgb, var(--rc) 25%, transparent), transparent 70%), #0b0e1a; }
.pet-portrait.leg { animation: legGlow 2.4s ease-in-out infinite; }
.pet-portrait img { max-width: 58px; max-height: 58px; image-rendering: pixelated; object-fit: contain; }
.pet-id { flex: 1; min-width: 0; }
.pet-lvl { font-size: 11px; margin-top: 4px; }
.pet-eq-h { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin: 8px 0 4px; }
.pet-eq { grid-template-columns: repeat(3, 1fr); }

/* ---- habilidades e armas da classe ---- */
.sk-ic { width: 28px; height: 28px; flex: none; image-rendering: pixelated; object-fit: contain; margin-top: 1px; }
.skill.locked .sk-ic { filter: grayscale(1); opacity: .5; }
.detail li.cls { font-size: 11px; }
.btn.cls-w { border-color: #34d399; }
.sdiff { list-style: none; margin: 4px 0 2px; padding: 6px 8px; border-radius: 8px; background: rgba(0, 0, 0, .22); font-size: 11px; display: grid; gap: 2px; }
.sdiff li { display: flex; justify-content: space-between; gap: 8px; }
.sdiff li span { color: var(--muted); }
.sdiff li.good b { color: #4ade80; }
.sdiff li.bad b { color: #f87171; }
.egg-q { font-size: 11px; color: var(--muted); align-self: center; margin-right: 2px; }
