:root {
  --bg: #0b0f16;
  --panel: #141b26;
  --panel2: #0f151e;
  --line: #243044;
  --line2: #33425c;
  --text: #e6ebf2;
  --muted: #8794a8;
  --accent: #ffcf4a;
  --bronze: #b88a4a;
  --bronze-dark: #604727;
  --good: #7cf29a;
  --bad: #ff7070;
  --font-ui: system-ui, 'Segoe UI', sans-serif;
  --font-display: 'Pixelify Sans', 'Trebuchet MS', system-ui;
  --r: 6px;
  --r-lg: 10px;
  --sp1: 4px;
  --sp2: 8px;
  --sp3: 12px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 13px/1.4 var(--font-ui); }
.hidden { display: none !important; }
/* o [hidden] do navegador só vale para HTML: o sprite <svg hidden> precisa desta regra */
svg[hidden] { display: none; }
.muted { color: var(--muted); }
img.px { image-rendering: pixelated; width: 32px; height: 32px; object-fit: contain; }
img.mi { image-rendering: pixelated; width: 60px; height: 45px; margin: -7px -14px; object-fit: contain; }

/* ---------- botões e campos ---------- */
button {
  font: inherit; color: var(--text); cursor: pointer;
  background: linear-gradient(#243046, #1a2332);
  border: 1px solid var(--line); border-radius: var(--r); padding: 4px 8px;
  box-shadow: inset 0 1px 0 #ffffff12, 0 1px 0 #0008;
  transition: border-color .12s, background .12s, box-shadow .12s, transform .05s;
}
button:hover:not(:disabled) { background: linear-gradient(#2c3a56, #1f2a3d); border-color: var(--accent); }
button:active:not(:disabled) { transform: translateY(1px); box-shadow: inset 0 2px 4px #0009; }
button:disabled { opacity: .45; cursor: default; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* variantes (as classes antigas .tabs .on e .aacts .gold/.danger usam as mesmas regras) */
.btn-primary, .tabs button.on, .aacts button.gold { background: linear-gradient(#ffe07a, #ffcf4a 50%, #e0a800); color: #1a1200; font-weight: 700; border-color: #a87a00; text-shadow: 0 1px 0 #fff5; }
.btn-primary:hover:not(:disabled), .tabs button.on:hover:not(:disabled), .aacts button.gold:hover:not(:disabled) { background: linear-gradient(#ffeaa0, #ffd65e 50%, #ebb400); border-color: #fff3b0; }
.btn-danger, .aacts button.danger { color: var(--bad); border-color: #7a2a2a; }
.btn-danger:hover:not(:disabled), .aacts button.danger:hover:not(:disabled) { background: linear-gradient(#4a2026, #2e161b); border-color: var(--bad); }
.btn-ghost { background: transparent; box-shadow: none; border-color: transparent; color: var(--muted); }
.btn-ghost:hover:not(:disabled) { background: #ffffff10; border-color: var(--line2); color: var(--text); }
/* confirmação em dois toques: 1º clique arma, 2º executa */
.confirming, .confirming:hover:not(:disabled) { color: #fff; background: linear-gradient(#b23a42, #7a1f26); border-color: var(--bad); animation: armed .8s ease-in-out infinite; }
@keyframes armed { 50% { box-shadow: 0 0 0 2px #ff707055; } }

input:not([type=checkbox]):not([type=radio]):not([type=range]), select, textarea {
  font: inherit; color: var(--text); background: #0b1018;
  border: 1px solid var(--line); border-radius: var(--r); padding: 6px 8px;
  transition: border-color .12s, box-shadow .12s;
}
input:not([type=checkbox]):not([type=radio]):not([type=range]):focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--accent); box-shadow: 0 0 0 2px #ffcf4a33; outline: none; }
input[type=checkbox], input[type=radio], input[type=range] { accent-color: var(--accent); }

.ico { position: relative; width: 32px; height: 32px; padding: 0; display: grid; place-items: center; }
.ico svg { width: 18px; height: 18px; fill: currentColor; }
.ico kbd { position: absolute; right: 2px; bottom: 1px; font: 700 9px/1 var(--font-ui); color: var(--accent); text-shadow: 0 1px 0 #000, 0 0 2px #000; }

/* ---------- layout e palco ---------- */
#app { height: 100vh; height: 100dvh; }
#stage { position: relative; width: 100%; height: 100%; overflow: hidden; container: stage / inline-size; }
#stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
#ov { cursor: crosshair; touch-action: none; }
/* vinheta fixa e pulso de HP baixo: acima do canvas, abaixo da HUD (z 2+), sem pegar clique */
#stage::before, #stage.lowhp::after { content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 1; }
#stage::before { box-shadow: inset 0 0 90px #0007; }
#stage.lowhp::after { box-shadow: inset 0 0 140px rgba(200, 0, 0, .55); animation: beat 1s ease-in-out infinite; }
@keyframes beat { 0%, 100% { opacity: .4; } 50% { opacity: 1; } }
@keyframes pop { from { transform: translateY(-6px); opacity: 0; } }
#usemode { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); background: rgba(20, 27, 38, .92); border: 1px solid var(--accent); padding: 6px 12px; border-radius: var(--r); z-index: 3; }

/* alvo e tutorial: canto superior esquerdo no celular, centro do topo no desktop; por cima dos painéis */
.corner { position: absolute; top: 14px; left: max(12px, env(safe-area-inset-left)); z-index: 5; display: grid; gap: 14px; width: min(280px, calc(100% - 24px)); pointer-events: none; }
.corner > * { pointer-events: auto; }
/* desktop: o painel do treinador ocupa o canto esquerdo; alvo e tutorial vão para o centro, abaixo do dock */
@media (min-width: 821px) {
  .corner { top: 54px; left: 50%; transform: translateX(-50%); }
  body.has-duel .corner { top: 104px; }
}
#targetframe, #tut { position: relative; background: rgba(20, 27, 38, .94); border: 1px solid #c9505a; border-radius: 8px; padding: 12px 10px 8px; box-shadow: 0 6px 24px rgba(0, 0, 0, .5); animation: pop .15s ease-out; }
#targetframe::before { content: 'Alvo'; position: absolute; top: -9px; left: 10px; padding: 0 8px; border-radius: 5px; background: linear-gradient(#ff9a9a, #c93a3a); color: #2a0606; font: 600 11px/16px var(--font-display); text-transform: uppercase; letter-spacing: .05em; }
#targetframe .mon { padding: 0 0 0 6px; border: 0; border-left: 4px solid var(--c); border-radius: 0; background: none; }
#targetframe small { color: var(--muted); }
#targetframe .bar { height: 7px; margin: 3px 0 2px; }
.effs { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 2px; }
#tut { border-color: var(--accent); }
#tut h4 { margin: 0 0 6px; font: 600 15px/1.2 var(--font-display); color: var(--accent); }
#tut h4 small { margin-left: 4px; font: 600 11px var(--font-ui); color: var(--muted); }
#tut ol { margin: 0 0 8px; padding-left: 20px; display: grid; gap: 3px; }
#tut li { color: var(--muted); }
#tut li.done { text-decoration: line-through; opacity: .6; }
#tut li.done::marker { content: '✔  '; color: var(--good); }
#tut li.cur { color: var(--text); font-weight: 700; }
#tut li.cur::marker { color: var(--accent); }
#tut li small { display: block; margin: 2px 0 3px; font-weight: 400; font-size: 12px; line-height: 1.4; color: #c3cddb; }
#tut li small b { color: var(--accent); }
.tut-bar { height: 5px; margin: 0 0 8px; background: #0b1017; border-radius: 3px; overflow: hidden; }
.tut-bar i { display: block; height: 100%; background: linear-gradient(90deg, #e08a00, var(--accent)); transition: width .3s; }
#tutskip { font-size: 11px; padding: 2px 8px; }

#zoombox { position: absolute; top: 12px; right: 12px; z-index: 5; display: grid; gap: 6px; }
#zoombox .ico { background: rgba(20, 27, 38, .88); border-color: var(--line2); box-shadow: 0 2px 8px #0008; }

/* ---------- diálogo com NPC ---------- */
#npcbox { position: absolute; right: 56px; top: 16px; width: min(380px, calc(100% - 80px)); z-index: 7; background: rgba(20, 27, 38, .96); border: 1px solid var(--accent); border-radius: 8px; padding: 16px 12px 10px; box-shadow: 0 6px 24px rgba(0, 0, 0, .5); animation: pop .15s ease-out; }
#npcbox.closing { opacity: 0; transition: opacity .4s; }
#npcname { position: absolute; top: -11px; left: 12px; padding: 2px 10px; border-radius: var(--r); background: linear-gradient(#ffe07a, #e0a800); color: #1a1200; font: 600 14px/18px var(--font-display); box-shadow: 0 2px 6px #0008; }
#npcname:empty { display: none; }
#npcx { position: absolute; top: 4px; right: 4px; padding: 2px 8px; }
#npcbox p { margin: 0 22px 10px 0; line-height: 1.45; }
#npcbox p em { color: #ffd75e; font-style: normal; font-weight: 700; }
#npcopts { display: flex; flex-wrap: wrap; gap: 6px; }
#npcopts button { text-transform: capitalize; }
#npcopts button:not(.bye)::before { content: '▸ '; color: var(--accent); }
#npcopts .bye { margin-left: auto; background: transparent; box-shadow: none; color: var(--muted); }

/* ---------- toast ---------- */
#toast { position: absolute; left: 50%; top: 18%; transform: translateX(-50%); z-index: 5; display: grid; gap: 8px; justify-items: center; width: max-content; max-width: calc(100% - 24px); pointer-events: none; }
.toast { display: grid; justify-items: center; gap: 2px; padding: 10px 22px; text-align: center; background: linear-gradient(#22304aee, #141c2bee); border: 1px solid var(--accent); border-radius: var(--r-lg); box-shadow: 0 0 0 1px #000, 0 10px 30px #000a, 0 0 24px #ffcf4a33; animation: toast 2.5s ease-out forwards; }
.toast b { font: 700 22px/1.1 var(--font-display); color: var(--accent); text-shadow: 0 2px 0 #2a1600; }
/* automático pausado: fica na tela (sem sumir) até voltar; clicável mesmo com a fila de avisos sem clique */
.toast.nag { font: inherit; color: inherit; pointer-events: auto; cursor: pointer; border-color: #ffe07a; animation: nag 1.6s ease-in-out infinite alternate; }
.toast.nag b { color: #ffe07a; }
.toast.nag kbd { padding: 0 6px; border: 1px solid #ffe07a; border-radius: 4px; color: #ffe07a; font-weight: 700; }
.toast.nag:hover { border-color: #fff3c0; }
@keyframes nag { from { box-shadow: 0 0 0 1px #000, 0 10px 30px #000a, 0 0 10px #ffe07a33; } to { box-shadow: 0 0 0 1px #000, 0 10px 30px #000a, 0 0 26px #ffe07a88; } }
/* recompensas na lateral, ao lado dos botões de zoom */
#feed { position: absolute; top: 12px; right: 60px; z-index: 4; display: grid; gap: 5px; justify-items: end; max-width: min(260px, 50%); pointer-events: none; }
/* PC: abaixo da barra de botões do topo (por cima dela o feed some atrás) */
@media (min-width: 821px) { #feed { top: 56px; } }
.feed { display: flex; align-items: center; gap: 6px; min-height: 28px; padding: 3px 10px 3px 6px; color: #eef2ff; font: 600 13px/1.2 var(--font-ui); background: linear-gradient(90deg, #141c2bcc, #22304af0); border: 1px solid var(--line2); border-right: 3px solid var(--c); border-radius: 8px; box-shadow: 0 4px 12px #0008; animation: feed 3.6s ease-out forwards; }
.feed b { color: var(--c); }
.feed small { color: var(--muted); }
.feed img { width: 24px; height: 24px; object-fit: contain; image-rendering: pixelated; }
/* PvP aberto: quem derrubou ⚔ quem perdeu, com os dois bichos */
.feed img.mi { width: 30px; height: 26px; margin: -2px 0; }
.feed.pvp { gap: 4px; }
.feed.pvp span { white-space: nowrap; }
.feed-x { width: 14px; height: 14px; flex: none; fill: var(--c); }
@keyframes feed {
  0% { opacity: 0; transform: translateX(28px); }
  8% { opacity: 1; transform: none; }
  85% { opacity: 1; }
  100% { opacity: 0; transform: translateX(14px); }
}
/* ---------- anúncios globais: faixa rolando no topo + cartões, acima de janelas e modais ---------- */
#announce { position: fixed; inset: 0 0 auto 0; z-index: 25; display: grid; justify-items: center; gap: 10px; pointer-events: none; }
/* Com faixa no ar, o jogo inteiro desce --tk (a faixa ganha uma tira própria, não cobre nada). */
:root { --tk: 0px; --tk-ease: .4s cubic-bezier(.2, .8, .2, 1); }
body.has-ticker { --tk: 34px; }
#app { box-sizing: border-box; padding-top: var(--tk); transition: padding-top var(--tk-ease); }
#ticker { display: flex; align-items: center; width: 100%; height: 32px; background: linear-gradient(#5a1414f2, #2c0a0af2); border-bottom: 2px solid var(--accent); box-shadow: 0 4px 18px #000b; overflow: hidden; transform: translateY(-110%); transition: transform var(--tk-ease); }
#ticker.on { transform: none; }
#ticker > div { flex: 1; overflow: hidden; white-space: nowrap; }
#ticker span { display: inline-block; padding-left: 100%; color: #fff4c9; font: 700 16px/32px var(--font-ui); text-shadow: 0 1px 2px #000; animation: ticker var(--d, 18s) linear infinite; }
@keyframes ticker { to { transform: translateX(-100%); } }
#anncards { display: grid; gap: 8px; justify-items: center; margin-top: 12vh; max-width: calc(100% - 24px); }
#anncards .toast { border-color: #ff7a4a; }
@keyframes toast {
  0% { opacity: 0; transform: scale(.8); }
  10% { opacity: 1; transform: scale(1.04); }
  16% { transform: scale(1); }
  80% { opacity: 1; transform: none; }
  100% { opacity: 0; transform: translateY(-8px); }
}

/* ---------- chat (só pega clique quando está digitando) ---------- */
#chat { position: absolute; left: max(8px, env(safe-area-inset-left)); bottom: 8px; z-index: 2; width: min(420px, 34%); pointer-events: none; padding-bottom: env(safe-area-inset-bottom); }
/* #logbox é o scroller; column-reverse deixa a rolagem presa à última linha */
#logbox { display: flex; flex-direction: column-reverse; max-height: 190px; overflow-y: auto; border-radius: var(--r) var(--r) 0 0; pointer-events: none; font-size: 12px; scrollbar-width: thin; }
#logbox:focus { outline: none; }
#log { padding: 6px 8px; background: rgba(8, 12, 18, .62); pointer-events: none; transition: background .2s; }
#log:empty { display: none; }
#chat:focus-within #logbox { pointer-events: auto; max-height: 260px; }
#chat:focus-within #log { pointer-events: auto; background: rgba(8, 12, 18, .88); }
/* fora do modo digitação mostra só as 8 últimas linhas */
#chat:not(:focus-within) #log p:nth-last-child(n+9) { display: none; }
#log p { margin: 1px 0; text-shadow: 0 1px 0 #000; overflow-wrap: break-word; }
#log .g { color: #9ad0ff; }
#log .i { color: var(--good); }
#log .s { color: var(--accent); }
#log b { color: var(--accent); }
#say { width: 100%; pointer-events: auto; background: rgba(8, 12, 18, .85); padding: 7px 9px; border-radius: 0 0 var(--r) var(--r); }
#chat:has(#log:empty) #say { border-radius: var(--r); }
#say:not(:focus) { opacity: .75; }
#say:focus { border-color: var(--accent); }

/* ---------- HUD: hotbar de golpes + barra de modo (o pet em campo aparece na Equipe) ---------- */
#hud { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); z-index: 2; display: grid; grid-template-columns: auto; justify-items: center; align-items: stretch; gap: 8px; max-width: calc(100% - 24px); pointer-events: none; padding-bottom: env(safe-area-inset-bottom); }
.hotbar:empty { display: none; }
/* barra de modo: Explorar/Batalha + atalhos da cidade */
#modebar { grid-column: 1 / -1; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; pointer-events: auto; }
#modebar button { display: flex; align-items: center; gap: 6px; padding: 0 14px; min-height: 40px; font: 800 12px/1 var(--font-ui); letter-spacing: .06em; text-transform: uppercase; color: #9fb4d6; background: linear-gradient(#22324c, #182437); border: 1px solid #2c4366; border-radius: 4px; box-shadow: 0 4px 14px #0009; }
#modebar button:hover { border-color: #5a86c4; color: #dbe8ff; }
#modebar button i { font-style: normal; }
#modebar #modeBtn { min-width: 170px; color: #fff; background: linear-gradient(#2f6fd6, #1d4fa6); border: 2px solid #f5c84a; }
#modebar #modeBtn i { display: grid; place-items: center; width: 34px; height: 30px; border-radius: 3px; background: #ffffff22; font-size: 20px; }
#modebar #modeBtn span { display: grid; gap: 2px; text-align: left; }
#modebar #modeBtn small { font-size: 9px; opacity: .8; }
#modebar #modeBtn b { font-size: 16px; letter-spacing: .08em; }
#modebar #modeBtn.hunting { background: linear-gradient(#e0703a, #b0441c); }
#modebar #autoQuick.on { color: #fff; background: linear-gradient(#2f9a52, #1d6e38); border-color: #7cf29a; }
#townbar { display: flex; flex-wrap: wrap; gap: 6px; }
#townbar.hidden { display: none; }
/* ---------- Explorar (rotas de caça) ---------- */
.ex { display: grid; gap: 10px; }
.ex-sub { color: var(--muted); }
.ex-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
#exq { flex: 1 1 260px; min-width: 0; padding: 10px 12px; background: #0b111a; border: 1px solid #2a3a52; border-radius: 6px; color: var(--text); font-size: 14px; }
#exq:focus { border-color: #4a8fe0; outline: none; }
.ex-tools { display: flex; gap: 6px; }
.ex-tools button { padding: 8px 14px; border-radius: 999px; background: #101a28; border: 1px solid #2a3a52; color: #b8c6dc; font-weight: 700; white-space: nowrap; }
.ex-tools button[aria-pressed=true] { border-color: var(--accent); color: var(--accent); }
.ex-tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; border: 1px solid #22324a; border-radius: 6px; background: #0b111a; }
.ex-tabs button { display: flex; flex: none; align-items: center; gap: 6px; padding: 6px 10px; background: transparent; border: 1px solid transparent; border-radius: 4px; font-weight: 700; color: #cdd7e6; }
.ex-tabs button i { width: 8px; height: 8px; border-radius: 50%; background: var(--rc); box-shadow: 0 0 6px var(--rc); }
.ex-tabs button em { font-style: normal; font-size: 10px; padding: 1px 6px; border-radius: 999px; background: #1c2a3e; color: #9fb0c8; }
.ex-tabs button.on { border-color: var(--rc); background: color-mix(in srgb, var(--rc) 14%, #0b111a); color: #fff; }
#exbody { display: grid; gap: 14px; }
/* destaque: mapa da rota (desenho do minimapa) + informações */
.ex-hero { display: grid; grid-template-columns: minmax(0, 400px) minmax(0, 1fr); grid-template-rows: 1fr auto; column-gap: 16px; row-gap: 10px; padding: 12px; border: 1px solid color-mix(in srgb, var(--rc) 45%, #22324a); border-radius: 8px; background: radial-gradient(120% 140% at 100% 0, color-mix(in srgb, var(--rc) 16%, transparent), transparent 60%), linear-gradient(#111c2c, #0c1522); }
.ex-map { grid-row: 1 / 3; position: relative; margin: 0; align-self: start; border: 1px solid var(--bronze-dark); border-top-color: var(--bronze); border-radius: 4px; overflow: hidden; background: #22548f; box-shadow: 0 4px 14px #0008, inset 0 0 0 1px #000a; }
.ex-map img { display: block; width: 100%; height: auto; aspect-ratio: 5 / 3; image-rendering: pixelated; }
.ex-map figcaption { position: absolute; left: 6px; bottom: 6px; display: flex; align-items: center; gap: 6px; padding: 3px 8px; border-radius: 3px; background: #0b1018d9; border: 1px solid var(--bronze-dark); font: 700 11px/1.2 var(--font-ui); color: #f4e3b8; }
.ex-map figcaption i { width: 7px; height: 7px; border-radius: 50%; background: var(--rc); }
.ex-hero-info { display: grid; gap: 8px; align-content: start; min-width: 0; }
.ex-hero-info > small { font: 800 10px/1 var(--font-ui); letter-spacing: .14em; text-transform: uppercase; color: var(--rc); }
.ex-hero-info .ex-title b { font-size: 20px; }
.ex-hero-info p { color: #c6d2e4; }
.ex-hero .ex-mon { width: 52px; height: 40px; }
.ex-hero .ex-mon img.mi { width: 50px; height: 38px; }
.ex-hero-act { display: flex; flex-wrap: wrap; gap: 8px; align-self: end; }
.ex-go { flex: 1 1 160px; padding: 11px 18px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #fff; background: linear-gradient(#2f7fe0, #1c5fb8); border: 1px solid #7fb8ff; border-radius: 4px; box-shadow: 0 3px 10px #1c5fb855; }
.ex-go:hover:not(:disabled) { filter: brightness(1.12); }
.ex-go:disabled { opacity: .6; cursor: default; }
.ex-more { padding: 10px 18px; font-weight: 700; background: #0b111a; border: 1px solid #2a3a52; border-radius: 4px; color: #dbe5f3; }
.ex-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.ex-title b { font-size: 15px; color: #fff; }
.ex-lv { font: 800 11px/1 var(--font-ui); padding: 3px 7px; border: 1px solid #3a4c66; border-radius: 3px; color: #dfe7f3; white-space: nowrap; }
.ex-ch { font: 800 10px/1 var(--font-ui); letter-spacing: .06em; text-transform: uppercase; color: var(--good); }
.ex-warn { color: #ff7a6a; }
.ex-xp small { font-size: 9px; font-weight: 800; letter-spacing: .08em; color: #8e9bb0; }
.ex-xp b { color: #ffcf4a; }
.ex-xp b.lo { color: #8e9bb0; }
.ex-mons { display: flex; align-items: center; gap: 4px; min-width: 0; }
.ex-mon { display: grid; place-items: center; flex: none; width: 42px; height: 32px; border: 1px solid #2c3b52; border-radius: 4px; background: #0b111a; overflow: hidden; }
.ex-mon img.mi { width: 40px; height: 30px; margin: 0; }
.ex-names { margin-left: 4px; min-width: 0; color: #b8c6da; font-weight: 700; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ex-det { display: grid; gap: 6px; margin-top: 4px; padding-top: 8px; border-top: 1px solid #22324a; }
.ex-det p { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.ex-det p > b { min-width: 64px; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #8e9bb0; }
.ex-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px 2px 2px; border: 1px solid #2c3b52; border-radius: 999px; background: #0b111a; font-size: 12px; }
.ex-chip img.mi { width: 32px; height: 24px; margin: 0; }
.ex-chip img.px { width: 20px; height: 20px; }
.ex-grp > header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin-bottom: 8px; padding: 8px 12px; border: 1px solid #22324a; border-left: 3px solid #4aa3ff; border-radius: 6px; background: #0d1626; }
.ex-grp > header b { font: 800 13px/1 var(--font-ui); letter-spacing: .08em; text-transform: uppercase; }
.ex-grp > header em { padding: 2px 6px; border-radius: 3px; background: #1c2a3e; font: 700 10px/1 var(--font-ui); font-style: normal; }
.ex-grp > header p { flex-basis: 100%; color: var(--muted); font-size: 12px; }
.ex-up > header { border-left-color: #ff6a3d; }
.ex-easy > header { border-left-color: #6fd38a; }
/* cards: mapa em cima, como o minimapa; nome, bichos e nível embaixo */
.ex-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 228px), 1fr)); gap: 10px; }
.ex-card { display: grid; grid-template-rows: auto 1fr; overflow: hidden; background: linear-gradient(#111c2c, #0c1522); border: 1px solid #22324a; border-radius: 6px; cursor: pointer; transition: transform .12s, border-color .12s, box-shadow .12s; }
.ex-card:hover, .ex-card:focus-visible { border-color: var(--rc); outline: none; transform: translateY(-2px); box-shadow: 0 6px 16px #0009; }
.ex-card.on { border-color: #4aa3ff; box-shadow: inset 0 0 0 1px #4aa3ff; }
.ex-card.here { border-color: var(--good); }
.ex-pic { position: relative; border-bottom: 1px solid var(--bronze-dark); background: #22548f; }
.ex-thumb { display: block; width: 100%; height: auto; aspect-ratio: 5 / 3; background: #0b111a; image-rendering: pixelated; }
.ex-pic .ex-lv { position: absolute; left: 6px; top: 6px; background: #0b1018d9; border-color: color-mix(in srgb, var(--rc) 60%, #3a4c66); }
.ex-here { position: absolute; left: 6px; bottom: 6px; padding: 3px 7px; border-radius: 3px; background: #1d6e38e6; font: 800 10px/1 var(--font-ui); font-style: normal; letter-spacing: .06em; text-transform: uppercase; color: #fff; }
.ex-fav { position: absolute; right: 6px; top: 6px; width: 30px; height: 30px; padding: 0; display: grid; place-items: center; background: #0b1018d9; border: 1px solid #2a3a52; border-radius: 50%; font-size: 17px; line-height: 1; color: #9aa8bd; }
.ex-fav.on { color: #ffcf4a; border-color: #ffcf4a88; }
.ex-main { display: grid; gap: 7px; align-content: start; min-width: 0; padding: 9px 10px 10px; }
.ex-name { overflow: hidden; font-size: 14px; color: #fff; white-space: nowrap; text-overflow: ellipsis; }
.ex-card .ex-mons { flex-wrap: wrap; }
.ex-card .ex-names { flex-basis: 100%; margin: 0; font-size: 11px; font-weight: 600; }
.ex-rec { display: flex; justify-content: space-between; align-items: center; gap: 6px; padding-top: 7px; border-top: 1px solid #1c2a3e; font-weight: 800; font-size: 12px; white-space: nowrap; }
.ex-rec small { font-size: 9px; letter-spacing: .08em; color: #8e9bb0; }
.ex-foot { padding-top: 8px; border-top: 1px solid #22324a; color: #c6d2e4; font-weight: 700; }
@media (max-width: 700px) {
  .ex { gap: 8px; }
  .ex-sub { display: none; }
  .ex-tools { flex: 1; }
  .ex-tools button { flex: 1; }
  /* regiões numa faixa só, arrastando de lado */
  .ex-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain; }
  .ex-tabs::-webkit-scrollbar { display: none; }
  .ex-hero { grid-template-columns: 1fr; grid-template-rows: auto; padding: 10px; }
  .ex-map { grid-row: auto; }
  .ex-hero-info .ex-title b { font-size: 17px; }
  .ex-hero .ex-names { display: none; }
  .ex-go, .ex-more { min-height: 44px; }
  .ex-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .ex-main { gap: 5px; padding: 7px 8px 8px; }
  .ex-name { font-size: 13px; }
  .ex-card .ex-mon { width: 34px; height: 26px; }
  .ex-card .ex-mon img.mi { width: 32px; height: 24px; }
  .ex-card .ex-names { display: none; }
  .ex-rec { flex-wrap: wrap; font-size: 11px; }
  .ex-pic .ex-lv { font-size: 10px; padding: 2px 5px; }
  .ex-fav { width: 34px; height: 34px; }
  .ex-card:hover { transform: none; }
}
.hotbar { display: grid; grid-template-columns: repeat(8, 64px); align-items: stretch; gap: 4px; padding: 6px; pointer-events: auto; background: linear-gradient(135deg, #1b2029f5, #0b1017f5); border: 1px solid var(--bronze-dark); border-top-color: var(--bronze); border-radius: 4px; box-shadow: 0 5px 22px #000b, inset 0 0 0 1px #000a, inset 0 1px 0 #e4bd7650; }
.hotbar > p { margin: 0; padding: 4px 10px; font-size: 12px; }
.hotbar button {
  position: relative; width: 64px; min-height: 64px; padding: 12px 4px 12px; overflow: hidden;
  display: grid; align-content: center; justify-items: center; gap: 2px;
  border: 1px solid #33425c; border-top: 3px solid var(--c);
  background: #121a26;
  background: radial-gradient(circle at 50% 25%, color-mix(in srgb, var(--c) 30%, #121a26), #0c121a);
  text-align: center; font-weight: 700; font-size: 11px; line-height: 1.1;
}
.hotbar button:hover:not(:disabled) { background: radial-gradient(circle at 50% 25%, color-mix(in srgb, var(--c) 45%, #121a26), #101824); border-color: var(--accent); border-top-color: var(--c); }
.hotbar button b { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; max-width: 100%; overflow-wrap: anywhere; text-shadow: 0 1px 0 #000; }
.hotbar button small { font-size: 9.5px; font-weight: 400; color: #aab5c6; white-space: nowrap; }
.hotbar button kbd { position: absolute; top: 2px; left: 4px; font: 700 10px/1 var(--font-ui); color: #cfd8e6; opacity: .85; }
/* recarga radial + segundos restantes */
.hotbar button::after { content: ''; position: absolute; inset: 0; background: conic-gradient(#000b calc(var(--cd, 0) * 360deg), transparent 0); pointer-events: none; }
.hotbar button[data-s]:not([data-s=''])::before { content: attr(data-s); position: absolute; inset: 0; z-index: 1; display: grid; place-items: center; font-size: 16px; font-weight: 800; text-shadow: 0 1px 2px #000, 0 0 4px #000; pointer-events: none; }
.hotbar button[data-s]:not([data-s='']) :is(b, small) { opacity: .35; }
.hotbar button.lock { filter: grayscale(1); opacity: .6; cursor: not-allowed; }
.hotbar button.lock:hover { border-color: #33425c; border-top-color: var(--c); }
.hotbar button.deny { animation: deny .18s linear; border-color: var(--bad); border-top-color: var(--bad); }
.hotbar button.ready { animation: ready .3s ease-out; border-color: var(--c); }
.hotbar .eff { position: absolute; top: 2px; right: 2px; }
.move-rank { position: absolute; left: 4px; bottom: 3px; color: #d8c39d; font: 700 8px/1 var(--font-display); font-style: normal; }
.move-up { position: absolute; right: 3px; bottom: 2px; z-index: 2; display: grid; place-items: center; width: 15px; height: 15px; border: 1px solid #ffe097; border-radius: 3px; background: #8a5b1f; color: #fff4c9; font: 900 13px/1 var(--font-ui); font-style: normal; box-shadow: 0 0 7px #ffc95a88; }
.move-up:hover { background: #c48830; }
.eff { display: inline-block; font-style: normal; font-size: 9px; font-weight: 800; line-height: 13px; padding: 0 3px; border-radius: 4px; }
.eff.up { background: var(--good); color: #0d2a10; }
.eff.down { background: #4a5262; color: #c9d0db; }
@keyframes deny { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
@keyframes ready { 40% { box-shadow: 0 0 0 2px var(--c), 0 0 16px var(--c); } }

/* ---------- janelas móveis ---------- */
#side { position: fixed; inset: var(--tk) 0 0 0; transition: top var(--tk-ease); z-index: 4; pointer-events: none; }
#side > section { position: absolute; width: 320px; max-height: calc(100dvh - 24px); padding: 9px 12px; overflow: auto; pointer-events: auto; background: repeating-linear-gradient(90deg, #ffffff03 0 1px, transparent 1px 5px), linear-gradient(180deg, #1a2029f5, #0c1118f5); border: 1px solid var(--bronze-dark); border-top-color: var(--bronze); border-radius: 4px; box-shadow: 0 7px 24px #000a, inset 0 1px 0 #d0a15d45; scrollbar-width: thin; scrollbar-color: var(--bronze-dark) transparent; }
#side > section.panel-hidden { display: none; }
#side [data-panel='player'] { width: 340px; }
#side [data-panel='map'] { width: 320px; }
#side [data-panel='party'] { width: 300px; }
#side [data-panel='battle'] { width: 300px; }
#side [data-panel='profession'] { width: min(470px, calc(100vw - 24px)); }
#side .me { background: linear-gradient(180deg, #202733, #141a23); }
#side h2 { margin: 0; font-size: 16px; }
#side h3 { display: flex; align-items: center; margin: 0 0 6px; font: 600 14px/1.2 var(--font-display); text-transform: uppercase; letter-spacing: .08em; color: #d8c39d; }
#side h3::before { content: ''; flex: none; width: 6px; height: 6px; margin-right: 7px; background: var(--bronze); transform: rotate(45deg); box-shadow: 0 0 6px #b88a4a88; }
#side h3[data-tip]::after { content: '?'; display: grid; place-items: center; width: 13px; height: 13px; margin-left: 6px; border: 1px solid var(--line2); border-radius: 50%; font: 700 9px/1 var(--font-ui); color: var(--muted); cursor: help; }
.drag-handle { cursor: grab; user-select: none; touch-action: none; }
.drag-handle:active { cursor: grabbing; }
.drag-handle::after { content: '⠿'; margin-left: auto; padding-left: 8px; color: #9c8055; font: 700 15px/1 var(--font-ui); }
.me > .drag-handle::after { margin-left: 0; }
#paneldock { position: fixed; top: calc(10px + var(--tk)); transition: top var(--tk-ease); left: 50%; z-index: 6; display: flex; align-items: center; gap: 3px; transform: translateX(-50%); padding: 4px; background: linear-gradient(#202733ee, #0e131bee); border: 1px solid var(--bronze-dark); border-top-color: var(--bronze); border-radius: 4px; box-shadow: 0 4px 16px #0009; }
#paneldock > b { padding: 0 7px; color: #d8c39d; font: 700 10px/1 var(--font-display); text-transform: uppercase; letter-spacing: .08em; }
#paneldock button { min-height: 25px; padding: 3px 7px; border-radius: 2px; font-size: 10px; }
#paneldock button[aria-pressed='true'] { color: #1a1200; background: linear-gradient(#e6c57e, #ad7e3d); border-color: #e6c57e; font-weight: 700; }
#resetPanels { color: var(--muted); }
.row { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.me .bar { margin: 6px 0; }
.btns { display: flex; gap: 4px; }
.field { margin-top: 6px; }
.field button { flex: 1; }
.me .field { display: flex; gap: 4px; margin: 0; }
.me .field button { flex: none; }
.tools { margin-top: 6px; }
.tools .btns { flex: 1; display: grid; grid-template-columns: repeat(6, 1fr); }
.tools .ico { width: auto; }
.opt { margin-top: 6px; font-size: 11px; }
.tip { font-size: 11px; color: var(--muted); }
.rename { justify-content: flex-start; flex-wrap: wrap; }
.rename input { flex: 1 1 140px; min-width: 0; }
#oNameMsg { min-height: 1.2em; margin: 4px 0 10px; }
#oNameMsg.ok { color: var(--good); }
#oNameMsg.err { color: var(--bad); }
h3 img.px { width: 20px; height: 20px; vertical-align: middle; }
#ctxmenu { position: fixed; z-index: 1000; display: flex; flex-direction: column; min-width: 170px; padding: 4px; background: var(--panel); border: 1px solid var(--line2); border-radius: var(--r); box-shadow: 0 6px 18px #0009; }
#ctxmenu button { text-align: left; border: 0; background: none; padding: 6px 10px; border-radius: 4px; }
#ctxmenu button:hover, #ctxmenu button:focus-visible { background: var(--line); }
#ctxmenu header { padding: 4px 10px 6px; margin-bottom: 2px; border-bottom: 1px solid var(--line); font: 600 13px/1.2 var(--font-display); color: var(--accent); }
.mini { display: block; background: linear-gradient(180deg, #141a22, #0d1219); }
.panel-title { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; width: 100%; }
.panel-title h3 { margin-bottom: 7px; }
.panel-title span { color: #7f8b9b; font-size: 9px; text-transform: uppercase; letter-spacing: .1em; }
.map-frame { position: relative; padding: 6px; border: 1px solid var(--bronze-dark); background: #070a0e; box-shadow: inset 0 0 0 1px #b88a4a35, 0 3px 10px #0008; }
.map-frame::before, .map-frame::after { content: ''; position: absolute; width: 10px; height: 10px; z-index: 1; pointer-events: none; border-color: var(--bronze); }
.map-frame::before { top: 2px; left: 2px; border-top: 2px solid; border-left: 2px solid; }
.map-frame::after { right: 2px; bottom: 2px; border-right: 2px solid; border-bottom: 2px solid; }
#minimap { display: block; width: 100%; height: auto; image-rendering: pixelated; border: 1px solid #273348; background: #22548f; cursor: zoom-in; }
#miniregion { color: #e2c98f; font-weight: 700; }
.mini-zoom { position: absolute; left: 10px; bottom: 10px; z-index: 2; display: flex; gap: 3px; opacity: .55; transition: opacity .15s; }
.map-frame:hover .mini-zoom, .mini-zoom:focus-within { opacity: 1; }
.mini-zoom button { width: 18px; height: 18px; padding: 0; display: grid; place-items: center; font: 700 13px/1 var(--font-ui); color: #f4e3b8; background: #0b1018d9; border: 1px solid var(--bronze-dark); border-radius: 3px; box-shadow: none; }
.mini-zoom button:hover { border-color: var(--bronze); background: #1b2433; }
#bigmap { display: block; margin: 0 auto; height: auto; border: 1px solid #273348; border-radius: 6px; background: #22548f; }
.map-tabs { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 10px; }
.map-tabs button { padding: 5px 8px; border: 1px solid var(--line); border-radius: 4px; background: #111b28; color: #d8e2ed; cursor: pointer; }
.map-tabs button[aria-pressed="true"] { border-color: var(--bronze); background: #3b2e1d; color: #fff; }
.map-tabs button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.map-caption { margin: 0 0 7px; color: #d8e2ed; font-weight: 700; }
.mapkeys .mk { display: inline-block; width: 9px; height: 9px; margin: 0 3px 0 2px; border-radius: 50%; vertical-align: -1px; border: 1px solid #fff8; }
.mk.h { background: #d9435a; } .mk.s { background: #e3ad35; } .mk.a { background: #3a7fc4; } .mk.d { background: #2b2233; }

/* rastreador da pesquisa do Professor */
#quest { margin-top: 8px; padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--r); background: #0b101899; font-size: 12px; }
#quest .bar { margin: 4px 0 0; height: 6px; }
#quest.ready { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 10px #ffcf4a40, inset 0 0 12px #ffcf4a1a; }
#quest.ready .bar i { background: linear-gradient(90deg, #e0a800, #ffcf4a, #fff3b0); }

/* automático: estado na janela de configuração; AUTO + engrenagem na barra de modo */
.autostate { padding: 1px 8px; border-radius: 99px; background: #ffffff0d; font-size: 11px; white-space: nowrap; }
.autostate.on { background: #1f4a2a; color: var(--good); }
.autostate.on::before { content: '●'; margin-right: 4px; animation: blink 1.2s infinite; }
.autostate.paused { background: #4a3a14; color: var(--accent); }
.autostate-row { align-items: center; }
.autogroup { display: flex; }
#modebar .autogroup > button:first-child { border-radius: 4px 0 0 4px; }
#modebar #autoCfg { min-width: 34px; padding: 0 8px; border-left: 0; border-radius: 0 4px 4px 0; }
#modebar #autoCfg svg { width: 14px; height: 14px; }
#modebar #autoQuick.paused { color: #1a1200; background: linear-gradient(#ffe07a, #e0a800); border-color: #a87a00; }
/* ligado, mas esperando: na cidade/cais ou sem selvagem no raio */
#modebar #autoQuick.on.wait { background: linear-gradient(#3d6f8e, #24506b); border-color: #8fd0f2; }
@keyframes blink { 50% { opacity: .2; } }

.form { display: grid; gap: 10px; }
.form fieldset { display: grid; gap: 6px; }
.form label { display: flex; gap: 8px; align-items: center; }
.form label.locked { opacity: .5; }
.form input[type=number] { width: 64px; }
.keys { display: grid; grid-template-columns: 1fr auto auto; gap: 6px 10px; align-items: center; }
.keys kbd { min-width: 70px; text-align: center; padding: 3px 8px; border: 1px solid var(--line); border-radius: var(--r); background: #0b1018; }
.keys kbd.wait { border-color: var(--accent); color: var(--accent); }

/* ---------- barras ---------- */
.bar { position: relative; height: 15px; background: linear-gradient(#05080c, #0e141c); box-shadow: inset 0 1px 3px #000a, 0 1px 0 #ffffff0d; border-radius: 4px; overflow: hidden; }
.bar i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(#72f272, #2fb52f 55%, #219421); box-shadow: inset 0 1px 0 #ffffff59; transition: width .25s ease-out; }
.bar.mid i { background: linear-gradient(#ffe36a, #e0b420 55%, #b98f0c); }
.bar.low i { background: linear-gradient(#ff7a7a, #d93030 55%, #a81c1c); }
.bar.hp.low { animation: hpPulse 1s ease-in-out infinite; }
@keyframes hpPulse { 50% { box-shadow: inset 0 1px 3px #000a, 0 0 8px #ff3b3b99; } }
.bar.xp { height: 5px; margin-top: 3px; }
.bar.xp i { background: linear-gradient(90deg, #4f8dff, #9cc8ff); box-shadow: none; }
.bar.xp.tr { height: 12px; }
.bar.xp.tr i { background: linear-gradient(90deg, #8a55ff, #c9a2ff); }
.bar.en { height: 6px; margin-top: 3px; }
.bar.en i { background: linear-gradient(90deg, #2f8fff, #7fd0ff); box-shadow: none; }
.bar span { position: relative; display: block; text-align: center; font-size: 10px; line-height: 15px; text-shadow: 0 1px 0 #000, 0 0 2px #000; }
.bar.xp.tr span { line-height: 12px; }
.bar span, #money, #online { font-variant-numeric: tabular-nums; font-weight: 700; }

/* ---------- cards de monstro e listas ---------- */
.mon { display: grid; grid-template-columns: 34px 1fr; gap: 6px; align-items: center; padding: 4px 6px; border: 1px solid var(--line); border-left: 4px solid var(--c); border-radius: var(--r); background: var(--panel2); }
.mon .top { display: flex; justify-content: space-between; margin-bottom: 2px; gap: 4px; }
.tag { font-size: 10px; padding: 0 5px; border-radius: 8px; background: var(--c); color: #111; font-weight: 700; white-space: nowrap; }
.shiny { color: #ffd84a; }
#party { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
#party li { position: relative; min-width: 0; }
#party li > button { display: grid; grid-template-columns: 42px minmax(0, 1fr); align-items: center; gap: 5px; width: 100%; height: 48px; padding: 2px 5px 2px 2px; overflow: hidden; text-align: left; border: 1px solid var(--line); border-radius: 4px; background: linear-gradient(135deg, #171e28, #0b1017); cursor: pointer; }
#party li > button:hover, #party li > button:focus-visible { border-color: var(--accent); }
#party li.out > button { border-color: #59d66f; background: #15271b; box-shadow: inset 0 0 0 1px #59d66f66, 0 0 8px #59d66f44; }
#party li.mounted > button { border-color: var(--bronze); background: #302618; box-shadow: inset 0 0 0 1px #b88a4a66, 0 0 8px #b88a4a44; }
#party li.ko > button { opacity: .55; filter: grayscale(.65); }
#party img.mi { width: 42px; height: 42px; object-fit: contain; image-rendering: pixelated; filter: drop-shadow(0 2px 1px #000b); }
#party li > button { border-left: 3px solid var(--c, var(--line)); }
#party .pic { position: relative; display: grid; place-items: center; }
#party .pn { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 4px; row-gap: 2px; min-width: 0; align-items: center; }
#party .pn b { grid-column: 1 / -1; overflow: hidden; font-size: 12px; white-space: nowrap; text-overflow: ellipsis; }
#party .pn small { overflow: hidden; color: var(--muted); font-size: 10px; white-space: nowrap; text-overflow: ellipsis; }
#party .pn small em { color: #e8dcc2; font-style: normal; font-weight: 600; }
#party .pn .hpn { color: #cfe8d2; font-variant-numeric: tabular-nums; }
#party li.ko .pn .hpn { color: #ff8a8a; }
#party .pn .bar { grid-column: 1 / -1; height: 5px; }
#party .pn .xpb { grid-column: 1 / -1; display: block; height: 2px; background: #211a35; border-radius: 1px; }
#party .pn .xpb i { display: block; height: 100%; background: #9a6aff; border-radius: 1px; }
#side h3 .cnt, #bagpart h4 .cnt { margin-left: 6px; color: var(--muted); font: 600 11px/1 var(--font-ui); letter-spacing: 0; text-transform: none; }
/* item escolhido: quem pode receber brilha, quem não pode apaga */
#party li.can > button { border-color: #7ee08a; box-shadow: 0 0 0 1px #7ee08a inset, 0 0 10px #7ee08a66; animation: canuse 1s ease-in-out infinite alternate; }
#party li.cant > button { opacity: .4; }
#party li.drop > button { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent) inset, 0 0 14px #ffcf4a88; }
@keyframes canuse { to { box-shadow: 0 0 0 1px #7ee08a inset, 0 0 16px #7ee08aaa; } }
/* atalho de cura/reviver no canto do cartão */
#party .qa { position: absolute; top: -5px; right: -4px; display: grid; place-items: center; width: 20px; height: 20px; padding: 0; color: #fff; font: 700 13px/1 var(--font-ui); background: #2f9a4a; border: 1px solid #9ff0ad; border-radius: 50%; box-shadow: 0 2px 6px #000a; cursor: pointer; }
#party .qa.revive { background: #c9852e; border-color: #ffd28a; }
#party .qa:hover { filter: brightness(1.2); }
/* mochila dentro da Equipe */
#bagpart { display: none; margin-top: 8px; padding-top: 7px; border-top: 1px solid var(--line); }
[data-panel='party'].bag-on #bagpart { display: block; }
#bagpart h4 { margin: 0 0 5px; font: 600 12px/1.2 var(--font-display); text-transform: uppercase; letter-spacing: .08em; color: #d8c39d; }
#bag button.using { border-color: #7ee08a; box-shadow: 0 0 0 1px #7ee08a inset, 0 0 8px #7ee08a77; }
#bag button[draggable='true'] { cursor: grab; }

/* mochila: sempre 12 células (item ou .slot vazia) */
#bag { display: grid; grid-template-columns: repeat(6, 1fr); grid-auto-rows: max-content; gap: 4px; }
#bag button, #bag .slot { position: relative; aspect-ratio: 1; border-radius: var(--r); }
#bag button { padding: 2px; display: grid; place-items: center; background: var(--panel2); }
#bag button.sel { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset, 0 0 8px #ffcf4a55; }
#bag button b { position: absolute; right: 2px; bottom: 0; font-size: 10px; text-shadow: 0 1px 0 #000, 0 0 2px #000; font-variant-numeric: tabular-nums; }
#bag .empty { grid-column: 1 / -1; }
.slot { display: block; border: 1px dashed var(--line); background: #0b101866; }

/* ---------- modais, login e janelas ---------- */
.modal { position: fixed; inset: var(--tk) 0 0 0; transition: top var(--tk-ease); display: grid; place-items: center; background: rgba(4, 6, 10, .72); z-index: 10; padding: 16px; }
#login { background: radial-gradient(circle at 50% 30%, #1d2b40, #070a10 70%); overflow: hidden; }
/* telas de carregamento: abrir o jogo (#boot) e entrar no mundo (#enter) */
#boot, #enter { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 16px; background: radial-gradient(circle at 50% 35%, #1d2b40, #070a10 72%); transition: opacity .5s ease; }
#enter { z-index: 30; }
#boot.done { opacity: 0; pointer-events: none; }
.boot-card { display: grid; justify-items: center; gap: 12px; width: min(380px, 100%); text-align: center; }
.boot-card h1 { margin: 0; font: 700 44px/1 var(--font-display); letter-spacing: .04em; background: linear-gradient(#fff3b0, #ffcf4a 45%, #e08a00); -webkit-background-clip: text; background-clip: text; color: transparent; }
.boot-card h2 { margin: 0; font: 600 22px/1.1 var(--font-display); color: var(--accent); }
.boot-ball { position: relative; width: 64px; height: 64px; border-radius: 50%; border: 4px solid #0b0f16; background: linear-gradient(#e2423f 0 46%, #0b0f16 46% 54%, #f2f2f2 54%); box-shadow: 0 8px 24px #000a, inset -6px -6px 0 #0002; animation: boot-roll 1.1s cubic-bezier(.6, 0, .4, 1) infinite; }
.boot-ball i { position: absolute; left: 50%; top: 50%; width: 18px; height: 18px; margin: -9px; border-radius: 50%; background: #f2f2f2; border: 4px solid #0b0f16; box-shadow: 0 0 0 2px #f2f2f2 inset; animation: boot-glow 1.1s ease-in-out infinite; }
@keyframes boot-roll { 0% { transform: rotate(0); } 30% { transform: rotate(-24deg); } 60% { transform: rotate(18deg); } 100% { transform: rotate(0); } }
@keyframes boot-glow { 50% { background: #ffe07a; box-shadow: 0 0 12px #ffcf4a; } }
.boot-bar { width: 100%; height: 10px; border-radius: 99px; background: #0b111a; border: 1px solid #2a3a52; overflow: hidden; }
.boot-bar i { display: block; width: 0; height: 100%; background: linear-gradient(90deg, #e0a800, #ffcf4a, #fff3b0); box-shadow: 0 0 10px #ffcf4a88; transition: width .25s ease-out; }
#boottxt { margin: 0; color: #dfe7f3; font-weight: 700; font-variant-numeric: tabular-nums; }
.boot-tip { min-height: 2.6em; margin: 0; color: var(--muted); font-size: 12px; }
#entersteps { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; text-align: left; }
#entersteps li { position: relative; padding-left: 26px; color: #6f7c90; }
#entersteps li::before { content: ''; position: absolute; left: 4px; top: 50%; width: 10px; height: 10px; margin-top: -6px; border-radius: 50%; border: 2px solid #3a4c66; }
#entersteps li.on { color: #fff; font-weight: 700; }
#entersteps li.on::before { border-color: var(--accent); border-right-color: transparent; animation: spin .7s linear infinite; }
#entersteps li.ok { color: var(--good); }
#entersteps li.ok::before { content: '✓'; border: 0; width: auto; height: auto; margin-top: -.6em; left: 3px; font-weight: 800; color: var(--good); }
@media (prefers-reduced-motion: reduce) { .boot-ball, .boot-ball i, #entersteps li.on::before { animation: none; } }
#parade { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
#parade i { position: absolute; top: var(--y, 50%); left: -120px; width: 96px; height: 96px; background-position: center; background-size: contain; background-repeat: no-repeat; image-rendering: pixelated; opacity: .34; filter: drop-shadow(0 6px 4px #0008); scale: var(--s, 1); animation: walk 34s linear var(--d, 0s) infinite, hop .44s ease-in-out infinite; }
@keyframes hop { 50% { margin-top: -3px; } }
#hero { position: absolute; right: max(2vw, 8px); bottom: -3vh; width: min(36vw, 504px); aspect-ratio: 504 / 552; opacity: .76; filter: drop-shadow(0 22px 30px #000d); pointer-events: none; transform-origin: 50% 100%; animation: hero-breathe 3.2s ease-in-out infinite; }
#hero img { display: block; width: 100%; height: 100%; object-fit: contain; }
#hero::before, #hero::after { content: ''; position: absolute; top: 23.2%; width: 4%; height: 7.4%; border-bottom: 2px solid #21191a; border-radius: 45%; background: #f3c7b8; opacity: 0; animation: hero-blink 4.6s steps(1) infinite; }
#hero::before { left: 31.5%; transform: rotate(4deg); }
#hero::after { left: 45.5%; transform: rotate(-4deg); }
@keyframes hero-breathe { 50% { transform: translateY(-10px) scale(1.012); } }
@keyframes hero-blink { 0%, 45%, 48%, 100% { opacity: 0; } 46%, 47% { opacity: 1; } }
@media (max-width: 900px) { #hero { display: none; } }
@keyframes walk { to { transform: translateX(calc(100vw + 160px)); } }
.card { position: relative; z-index: 1; width: min(420px, 100%); max-height: 92vh; max-height: 92dvh; overflow-y: auto; background: linear-gradient(#172031, #111824); border-radius: var(--r-lg); padding: 20px; display: grid; gap: 10px; box-shadow: 0 0 0 1px #000, 0 0 0 3px #2b3850, 0 0 0 4px #000, 0 24px 60px #000b; scrollbar-width: thin; scrollbar-color: #33425c transparent; }
.card.wide { width: min(760px, 100%); }
.card h1 { margin: 0; font: 700 46px/1.05 var(--font-display); text-align: center; letter-spacing: .04em; background: linear-gradient(#fff3b0, #ffcf4a 45%, #e08a00); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-stroke: 1px #4a2a00; filter: drop-shadow(0 3px 0 #2a1600); }
.card h2 { margin: 0; font-family: var(--font-display); font-weight: 600; }
.card p { margin: 0; }
.tagline { text-align: center; }
/* barra de título fixa da janela (título e ✕ não somem ao rolar) */
#win .card > .row:first-child { margin: -20px -20px 4px; padding: 10px 14px; background: linear-gradient(#22304a, #18223a); border-bottom: 1px solid var(--accent); position: sticky; top: -20px; z-index: 1; }
#wtitle { font-size: 19px; color: var(--accent); }
#wbody h3 { margin: 6px 0 2px; font: 600 15px/1.2 var(--font-display); color: #b9c4d6; letter-spacing: .03em; }
.x { padding: 2px 8px; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
#lf { display: grid; gap: 8px; }
#lf:not(.reg) .up { display: none; }
#lf .up { display: grid; gap: 8px; }
.hint { font-size: 11px; color: var(--muted); }
#lf input:not([type=checkbox]) { padding: 9px 10px; }
.pw { position: relative; display: grid; }
#lf .pw input { padding-right: 42px; }
#eye { position: absolute; right: 4px; top: 50%; margin-top: -16px; }
#eye[aria-pressed=true], #lp[type=text] + #eye { color: var(--accent); }
fieldset { border: 1px solid var(--line); border-radius: var(--r); padding: 8px; margin: 0; }
legend { color: var(--muted); font-size: 12px; padding: 0 4px; }
/* cadastro: duas colunas (dados | inicial), destaque laranja */
#login { --reg: #ff6a3d; }
#login .card:has(#lf.reg) { width: min(1000px, 100%); }
.reg-main { display: grid; gap: 8px; }
.reg-col { display: grid; gap: 8px; align-content: start; }
#lf.reg .reg-main { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 28px; }
#lf.reg .reg-pick { border-left: 1px solid var(--line); padding-left: 28px; }
.reg-head { gap: 2px; margin-bottom: 4px; }
.reg-head h2 { font: 800 16px/1.2 var(--font-ui); text-transform: uppercase; letter-spacing: .04em; color: #fff; }
.reg-pick .reg-head h2 { color: #ffb648; }
.lbl { color: #c5cedb; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; margin-top: 4px; }
#gender { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
#gender button { height: 46px; font-weight: 700; background: #0d1118; border: 1px solid #1d2430; }
#gender button i { font-style: normal; margin-right: 4px; color: #5aa7ff; }
#gender button[data-g="1"] i { color: #ff7ab6; }
#gender button.on, #gender button[aria-pressed=true] { border: 2px solid var(--reg); background: linear-gradient(#3b2626, #251b1d); }
#colors { display: flex; gap: 6px; flex-wrap: wrap; }
#colors button { width: 28px; height: 28px; border-radius: 50%; background: var(--c); border: 2px solid transparent; padding: 0; }
#colors button.on, #colors button[aria-pressed=true] { border-color: #fff; box-shadow: 0 0 0 2px #000, 0 0 10px var(--c); }
#starters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
#starters h3 { grid-column: 1 / -1; margin: 6px 0 -2px; color: #8d97a6; font: 700 11px/1 var(--font-ui); letter-spacing: .12em; text-transform: uppercase; }
#starters button { position: relative; display: grid; justify-items: center; align-content: start; gap: 5px; padding: 10px 6px 9px; background: #0d1118; border: 1px solid #1d2430; border-radius: 8px; }
#starters button:hover { border-color: #3a4558; }
#starters button.on, #starters button[aria-pressed=true] { border: 2px solid var(--reg); padding: 9px 5px 8px; background: linear-gradient(#3b2626, #221a1c); box-shadow: 0 0 14px #ff6a3d33; }
#starters button.on::after { content: '✓'; position: absolute; top: -2px; right: -2px; width: 20px; height: 20px; border-radius: 0 8px 0 6px; background: var(--reg); color: #fff; font: 800 12px/20px var(--font-ui); }
#starters img { width: 80px; height: 60px; margin: -6px 0 -4px; object-fit: contain; image-rendering: pixelated; filter: drop-shadow(0 3px 2px #0009); }
#starters button.on img { animation: hop .5s ease-in-out infinite; }
#starters b { color: #fff; font-size: 13px; }
#starters .tys { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; }
#starters .tys em { font: 800 9px/1 var(--font-ui); font-style: normal; text-transform: uppercase; letter-spacing: .04em; padding: 3px 7px; border-radius: 3px; background: var(--t); color: #fff; text-shadow: 0 1px 0 #0008; }
#starters .st { display: flex; gap: 5px; }
#starters .st i { font: 800 9px/1 var(--font-ui); font-style: normal; padding: 3px 6px; border-radius: 3px; border: 1px solid #ff6a3d99; color: #ff9b73; }
#starters .st i + i { border-color: #ffb64899; color: #ffc46b; }
#lf.reg #go { margin-top: 6px; padding: 13px; background: linear-gradient(#ff7a4d, #ff5a32); border-color: #c23e1c; color: #fff; text-shadow: 0 1px 0 #0005; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
#lf.reg #go:hover:not(:disabled) { background: linear-gradient(#ff8c63, #ff6a40); }
.switch { text-align: center; color: var(--muted); }
.linkbtn { background: none; border: 0; padding: 0; color: #ffb648; font-weight: 700; cursor: pointer; }
.linkbtn:hover { text-decoration: underline; }
@media (max-width: 760px) {
  #lf.reg .reg-main { grid-template-columns: 1fr; gap: 14px; }
  #lf.reg .reg-pick { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 12px; }
}
.chk { display: flex; gap: 6px; align-items: center; color: var(--muted); }
#go { padding: 10px; font-size: 14px; }
#go.busy { cursor: progress; }
#go.busy:disabled { opacity: 1; }
#go.busy::before { content: ''; display: inline-block; width: 13px; height: 13px; margin-right: 8px; vertical-align: -2px; border: 2px solid #1a120055; border-top-color: #1a1200; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
#lerr { color: var(--bad); min-height: 1em; }
#dc .card { justify-items: center; text-align: center; }
#dctxt:empty { display: none; }

/* tooltip próprio (main.js posiciona) */
#tip { position: fixed; left: 0; top: 0; z-index: 30; max-width: 260px; padding: 6px 9px; background: #0d131c; border: 1px solid #3a4a66; border-radius: var(--r); box-shadow: 0 6px 18px #000a; font-size: 12px; line-height: 1.35; pointer-events: none; }
#tip b { color: var(--accent); }
/* passo atual do tutorial */
.hint-pulse { outline: 2px solid var(--accent); outline-offset: 3px; animation: hintPulse 1.1s ease-in-out infinite; }
@keyframes hintPulse { 50% { outline-color: #ffcf4a22; outline-offset: 6px; } }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.list { display: grid; gap: 5px; align-content: start; }
.item { display: grid; grid-template-columns: 34px 1fr auto; gap: 8px; align-items: center; padding: 4px 6px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel2); }
.item small { display: block; color: var(--muted); font-size: 11px; }
.item .acts { display: flex; gap: 4px; align-items: center; }
.item input { width: 60px; }
.item.bt { text-align: left; border-left: 4px solid var(--c); width: 100%; }
.item.bt.sel { border-color: #ff3b3b; border-left-color: var(--c); }
.monrow { display: grid; grid-template-columns: 1fr auto; gap: 6px; align-items: center; }
#dexgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.dex { display: grid; grid-template-columns: 34px 1fr; gap: 6px; align-items: center; padding: 5px; border: 1px solid var(--line); border-left: 4px solid var(--c); border-radius: var(--r); background: var(--panel2); }
.dex.unseen img { filter: brightness(0) opacity(.5); }
.dex small { display: block; color: var(--muted); font-size: 10px; }
.dexbar { display: grid; gap: 6px; margin-bottom: 4px; }
.dexbar .bar, .bar.dexbar { height: 10px; margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chips button { border-radius: 99px; padding: 3px 12px; font-size: 12px; }
.chips button.on { background: var(--accent); color: #1a1200; border-color: var(--accent); font-weight: 700; }
.saldo { padding: 6px 10px; border: 1px solid var(--line); border-radius: var(--r); background: #0b101899; }
.saldo b { color: var(--accent); font-variant-numeric: tabular-nums; }
small.tot { color: var(--muted); font-size: 11px; min-width: 6ch; font-variant-numeric: tabular-nums; }
.help { display: grid; }
.help details { border-bottom: 1px solid var(--line); }
.help summary { cursor: pointer; font-weight: 700; color: var(--accent); padding: 6px 0; }
.help summary::marker { color: var(--muted); }
.help p { margin: 4px 0; }
.help details p:last-child { margin-bottom: 10px; }
.help b { color: var(--accent); }

/* nível máximo (treinador 200 / pet 100) */
.lvmax { color: #ffd84a; text-shadow: 0 0 6px rgba(255, 216, 74, .55); }
.maxb { font-size: 9px; padding: 0 4px; border-radius: 6px; background: linear-gradient(#ffe680, #e0a800); color: #2a1d00; font-weight: 800; vertical-align: middle; }

/* ---------- central do admin: faixa ao vivo, menu lateral, seção à direita ---------- */
/* tamanho fixo: trocar de seção não faz a janela pular */
#win .card:has(.admin) { width: min(1100px, 100%); height: min(88dvh, 820px); align-content: start; }
.admin { display: grid; grid-template-columns: 172px minmax(0, 1fr); grid-template-areas: 'pulse pulse' 'nav main'; gap: 12px 16px; align-items: start; }
.apulse { grid-area: pulse; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid #24452f; border-left: 3px solid var(--good); border-radius: var(--r); background: linear-gradient(90deg, #11251a, var(--panel2) 75%); }
.apulse-txt { flex: 1; min-width: 0; font-size: 14px; color: #c9d3e1; }
.apulse-txt b { color: #fff; font-variant-numeric: tabular-nums; }
.apulse small { color: var(--muted); white-space: nowrap; }
.apulse-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--good); animation: alive 2s ease-out infinite; }
@keyframes alive { 0% { box-shadow: 0 0 0 0 #7cf29a99; } 70%, 100% { box-shadow: 0 0 0 8px #7cf29a00; } }
.anav { grid-area: nav; position: sticky; top: 36px; display: grid; gap: 14px; }
.anav-g { display: grid; gap: 2px; }
.anav-g > span { padding: 0 10px 2px; color: var(--muted); font-size: 11px; font-weight: 600; }
.anav button { display: flex; justify-content: space-between; align-items: center; min-height: 36px; padding: 6px 10px; text-align: left; color: #c5cedb; background: transparent; box-shadow: none; border-color: transparent; }
.anav button:hover:not(:disabled) { background: #ffffff0d; border-color: var(--line2); }
.anav button.on { color: var(--accent); font-weight: 700; background: #ffcf4a14; border-color: transparent; box-shadow: inset 3px 0 0 var(--accent); }
.anav button i { min-width: 22px; padding: 0 6px; border-radius: 99px; font: 600 11px/18px var(--font-ui); text-align: center; color: var(--text); background: #ffffff14; }
.amain { grid-area: main; display: grid; gap: 10px; min-width: 0; }
.adminmsg { margin: 0; padding: 6px 10px; border-radius: var(--r); color: var(--good); background: #7cf29a14; }
.adminmsg:empty { display: none; }
.aempty { margin: 0; padding: 22px 16px; text-align: center; color: var(--muted); border: 1px dashed var(--line2); border-radius: var(--r); }
.aform { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.aform input, .aform select { flex: 1 1 120px; min-width: 0; }
.aform input[type=number] { flex: 0 1 80px; }
.afield { display: grid; gap: 3px; font-size: 12px; color: var(--muted); }
.afield.grow { flex: 1 1 200px; }
.aform .afield input[type=number] { width: 84px; }
.aunit { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.aunit input { width: 84px; }
.acheck { display: flex; align-items: center; gap: 6px; min-height: 32px; }

/* visão geral */
.afacts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1px; margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--r); background: var(--line); }
.afacts div { padding: 8px 12px; background: var(--panel2); }
.afacts dt { color: var(--muted); font-size: 11px; }
.afacts dd { margin: 0; font-weight: 600; }
.atools { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 10px; }
.atool { display: grid; gap: 6px; align-content: start; padding: 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel2); }
.atool h4, .aregras legend { margin: 0; font: 600 15px/1.2 var(--font-display); color: #ead9b2; }
.atool .aform { align-items: end; }

/* avisos: prévia no mesmo formato que o jogador vê */
.aviso { display: grid; gap: 10px; max-width: 660px; }
.aviso textarea { min-height: 70px; resize: vertical; font-size: 14px; color: var(--text); }
#aAvCount { justify-self: end; }
.aviso:not([data-tipo=faixa]) .avseg { display: none; }
.aprev { display: grid; gap: 8px; padding: 10px; border: 1px dashed var(--line2); border-radius: var(--r); background: #070a10; }
.aprev-msg { overflow-wrap: anywhere; }
.aviso[data-tipo=faixa] .aprev-msg { overflow: hidden; padding: 0 12px; color: #fff4c9; font: 700 15px/32px var(--font-ui); white-space: nowrap; text-overflow: ellipsis; background: linear-gradient(#5a1414f2, #2c0a0af2); border-bottom: 2px solid var(--accent); }
.aviso[data-tipo=toast] .aprev-msg { justify-self: center; max-width: 85%; padding: 10px 22px; text-align: center; font-weight: 600; background: linear-gradient(#22304aee, #141c2bee); border: 1px solid var(--accent); border-radius: var(--r-lg); }
.aviso[data-tipo=chat] .aprev-msg { color: #ffd75e; font-size: 12px; }
.aviso[data-tipo=chat] .aprev-msg::before { content: 'Aviso: '; font-weight: 700; }

/* regras do jogo */
.aregras { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 10px; }
.aregras fieldset { display: grid; gap: 8px; align-content: start; min-width: 0; margin: 0; padding: 8px 12px 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel2); }
.aregras legend { padding: 0 4px; }
.aregras .afield { grid-template-columns: minmax(0, 1fr) auto; align-items: center; color: #c5cedb; font-size: 13px; }
.aregras .bands { grid-column: 1 / -1; }
.aballs { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 2px 18px; }
.aballs .aball-n { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.aballs img.px { width: 24px; height: 24px; flex: none; }
.abands { width: 100%; max-width: 440px; border-collapse: collapse; }
.abands th, .abands td { padding: 3px 8px 3px 0; text-align: left; }
.abands thead th { color: var(--muted); font-size: 11px; font-weight: 600; }
.abands tbody th { font-weight: 600; }
.abands input { width: 80px; }
.asave { grid-column: 1 / -1; position: sticky; bottom: -20px; z-index: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r); background: #111824f5; }
.asave-txt { flex: 1 1 180px; color: var(--muted); }
.asave.dirty { border-color: var(--accent); }
.asave.dirty .asave-txt { color: var(--accent); font-weight: 600; }
.asave:not(.dirty) [data-a=regrasdesc] { visibility: hidden; }

/* jogador (online e contas) */
.arow { display: grid; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel2); }
.ahead { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ahead b { font-size: 15px; }
.ameta { margin: 0; color: var(--muted); }
.pets { display: flex; flex-wrap: wrap; gap: 4px; }
.pets .chip { display: flex; align-items: center; gap: 2px; padding: 2px 6px 2px 2px; font-size: 11px; }
.pets .chip img.mi { width: 40px; height: 30px; margin: -4px -2px -4px -4px; }
.pets .chip.max { border-color: #ffd84a; box-shadow: 0 0 6px rgba(255, 216, 74, .45) inset; }
.aacts { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.agroup { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding-left: 10px; border-left: 2px solid var(--line2); }
.agroup > span { margin-right: 2px; color: var(--muted); font-size: 11px; }
.agroup:last-child:not(:first-child) { margin-left: auto; }

@media (max-width: 820px) {
  #win .card:has(.admin) { height: auto; }
  .admin { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'pulse' 'nav' 'main'; }
  .apulse { flex-wrap: wrap; }
  .apulse-txt { flex-basis: calc(100% - 20px); }
  .apulse small { flex: 1; }
  .anav { position: static; display: flex; flex-wrap: wrap; gap: 4px; }
  .anav-g { display: contents; }
  .anav-g > span { display: none; }
  .anav button { flex: 1 1 auto; justify-content: center; gap: 6px; min-height: 40px; border-color: var(--line); }
  .anav button.on { border-color: var(--accent); box-shadow: none; }
  .agroup:last-child:not(:first-child) { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) { .apulse-dot { animation: none; } }
/* ---------- duelo: menu, convite, barra de estado, contagem e resultado ---------- */
#paneldock .duel-dock { display: inline-flex; align-items: center; gap: 5px; margin-right: 4px; color: #ffe6b0; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; background: linear-gradient(#6a2c1c, #3a1710); border-color: #a8653a; }
#paneldock .duel-dock svg { width: 13px; height: 13px; }
#paneldock .duel-dock:hover:not(:disabled) { background: linear-gradient(#8a3a24, #4a1d14); border-color: var(--accent); }
#paneldock .duel-dock.live { border-color: var(--accent); animation: duelLive 1.6s ease-in-out infinite; }
@keyframes duelLive { 50% { box-shadow: 0 0 0 2px #ffcf4a44, 0 0 14px #ff7a4a99; } }
.duel-emblem { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: #fff2c9; background: radial-gradient(circle at 50% 35%, #d0663a, #5a1d10 72%); border: 1px solid #ffcf4a99; box-shadow: 0 0 16px #ff7a4a66, inset 0 2px 0 #ffffff40, inset 0 -3px 6px #0006; }
.duel-emblem svg { width: 24px; height: 24px; filter: drop-shadow(0 1px 0 #0009); }
.duel-spin { display: inline-block; flex: none; width: 14px; height: 14px; border: 2px solid #ffcf4a44; border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
/* "avatar" com a inicial do treinador, cor fixa por nome */
.duel-av { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: #fff; font: 700 16px/1 var(--font-display); font-style: normal; text-shadow: 0 1px 1px #0009; background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--c) 55%, #fff), var(--c) 48%, color-mix(in srgb, var(--c) 45%, #000)); border: 2px solid #0009; box-shadow: 0 0 0 1px color-mix(in srgb, var(--c) 70%, #fff3), 0 2px 6px #0008; }

/* janela Duelos */
.duel { display: grid; gap: 10px; }
.duel-hero { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--bronze-dark); border-top-color: var(--bronze); border-radius: 4px; background: radial-gradient(120% 140% at 0 50%, #6a2c1c99, transparent 55%), linear-gradient(135deg, #1b2029, #0b1017); box-shadow: inset 0 1px 0 #e4bd7650, 0 4px 14px #0007; }
.duel-hero .duel-emblem { animation: emblemGlow 2.6s ease-in-out infinite; }
@keyframes emblemGlow { 50% { box-shadow: 0 0 26px #ff7a4aaa, inset 0 2px 0 #ffffff40, inset 0 -3px 6px #0006; } }
.duel-hero b { display: block; color: var(--accent); font: 700 18px/1.15 var(--font-display); letter-spacing: .04em; text-shadow: 0 2px 0 #2a1600; }
.duel-hero small { display: block; color: #aeb8c8; font-size: 12px; line-height: 1.4; }
.duel-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 12px; align-items: start; }
.duel-search { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.duel-search input { flex: 1; min-width: 0; }
.duel-search small { font-size: 11px; white-space: nowrap; }
.duel-list { display: grid; gap: 5px; align-content: start; min-height: 120px; max-height: min(50vh, 420px); padding: 2px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--bronze-dark) transparent; }
.duel-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto auto; gap: 8px; align-items: center; width: 100%; padding: 6px 8px; text-align: left; background: var(--panel2); border-left: 3px solid var(--line); }
.duel-row:hover:not(:disabled) { background: linear-gradient(90deg, #ffcf4a14, #141c28 70%); }
.duel-row.sel, .duel-row.sel:hover:not(:disabled) { border-color: var(--accent); background: linear-gradient(90deg, #ffcf4a26, #121a26 70%); box-shadow: inset 0 0 0 1px #ffcf4a55, 0 0 14px #ffcf4a22; }
.duel-row.busy:not(.sel) { opacity: .62; }
.duel-who { display: grid; min-width: 0; }
.duel-who b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.duel-who small, .duel-foe small { color: var(--muted); font-size: 11px; }
.duel-rec { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.duel-rec b { color: var(--text); }
.duel-rec b.w { color: var(--good); }
.duel-rec b.l { color: var(--bad); }
.duel-pill { padding: 0 8px; border-radius: 99px; font: 700 9px/16px var(--font-ui); letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.duel-pill.free { background: #1f4a2a; color: var(--good); }
.duel-pill.free::before { content: '●'; margin-right: 4px; animation: blink 1.6s infinite; }
.duel-pill.busy { background: #4a2a14; color: #ffb37a; }
.duel-none { display: grid; justify-items: center; gap: 6px; margin: 0; padding: 24px 10px; color: var(--muted); text-align: center; }
.duel-none small { font-size: 11px; }
.duel-cfg { display: grid; padding: 12px; border: 1px solid var(--bronze-dark); border-top-color: var(--bronze); border-radius: 4px; background: repeating-linear-gradient(90deg, #ffffff03 0 1px, transparent 1px 5px), linear-gradient(180deg, #1a2029, #0c1118); box-shadow: inset 0 1px 0 #d0a15d45, 0 4px 14px #0007; }
.duel-cfg.empty .duel-form, .duel-cfg:not(.empty) .duel-empty { display: none; }
.duel-form { display: grid; gap: 8px; animation: pop .18s ease-out; }
.duel-empty { display: grid; justify-items: center; align-content: center; gap: 6px; min-height: 260px; color: var(--muted); text-align: center; }
.duel-empty .duel-emblem { margin-bottom: 4px; opacity: .55; filter: grayscale(.7); }
.duel-empty b { color: var(--text); font: 600 15px/1.2 var(--font-display); }
.duel-cfg h4 { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin: 4px 0 0; color: #d8c39d; font: 600 12px/1.2 var(--font-display); letter-spacing: .08em; text-transform: uppercase; }
.duel-cfg h4 small { color: var(--muted); font: 400 11px var(--font-ui); letter-spacing: 0; text-transform: none; }
.duel-cfg h4 small b { color: var(--accent); font-variant-numeric: tabular-nums; }
.duel-foe { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 10px; align-items: center; padding-bottom: 8px; border-bottom: 1px solid #ffffff12; }
.duel-foe .duel-av { width: 48px; height: 48px; font-size: 22px; }
.duel-foe > div { display: grid; min-width: 0; }
.duel-foe b { overflow: hidden; font: 700 18px/1.15 var(--font-display); text-overflow: ellipsis; white-space: nowrap; }
.duel-rate { height: 5px; margin: 5px 0 3px; border-radius: 3px; box-shadow: inset 0 1px 2px #0008; }
.duel-sizes { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.duel-sizes button { display: grid; justify-items: center; gap: 2px; padding: 6px 0 5px; }
.duel-sizes b { font: 700 17px/1 var(--font-display); }
.duel-sizes small { color: var(--muted); font-size: 9px; }
.duel-sizes .btn-primary small { color: #3a2a00; }
.duel-team { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; padding: 4px 8px; border: 1px dashed var(--line2); border-radius: var(--r); background: #0b101899; }
.duel-team:empty { display: none; }
.duel-team > small { color: var(--muted); font-size: 10px; }
.duel-team > small:first-child { letter-spacing: .06em; text-transform: uppercase; }
.duel-team > small:last-child:not(:first-child) { flex-basis: 100%; }
.duel-team span { display: flex; }
.duel-team img.mi { width: 36px; height: 32px; margin: -2px -3px; filter: drop-shadow(0 2px 1px #000b); animation: pop .2s ease-out both; }
.duel-bet { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.duel-bet input { width: 112px; font-variant-numeric: tabular-nums; }
.duel-bet .chips button { padding: 3px 10px; }
.duel-pot { color: var(--muted); font-size: 12px; line-height: 1.35; }
.duel-pot b { color: var(--accent); }
.duel-action { display: grid; gap: 6px; margin-top: 2px; }
.duel-go { position: relative; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 11px; overflow: hidden; font: 700 16px/1 var(--font-display); letter-spacing: .05em; }
.duel-go svg { width: 18px; height: 18px; }
.duel-go::after { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, #ffffff80 50%, transparent 70%); transform: translateX(-100%); animation: shine 2.8s ease-in-out 1s infinite; pointer-events: none; }
@keyframes shine { 0%, 60% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
.duel-note { margin: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r); background: #0b101899; color: var(--muted); font-size: 12px; text-align: center; }
.duel-wait { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0; padding: 8px 10px; border: 1px solid #ffcf4a66; border-radius: var(--r); background: #ffcf4a12; font-size: 12px; }
.duel-wait b { color: var(--accent); font-variant-numeric: tabular-nums; }
.duel-msg { color: #ffb37a; font-size: 12px; text-align: center; }
.duel-msg:empty { display: none; }

/* barra de estado (convite enviado / fila / ringue): fixa no topo, acima das janelas */
#duelbar { position: fixed; top: calc(52px + var(--tk)); left: 50%; z-index: 24; display: flex; align-items: center; gap: 10px; max-width: calc(100% - 24px); padding: 6px 8px 8px; overflow: hidden; transform: translateX(-50%); background: linear-gradient(135deg, #2b1a14f5, #110c0bf5); border: 1px solid #8a5b1f; border-top-color: var(--accent); border-radius: 4px; box-shadow: 0 6px 22px #000b, inset 0 1px 0 #ffd99a40; font-size: 12px; animation: duelBarIn .35s cubic-bezier(.2, .9, .3, 1.3); transition: top var(--tk-ease); }
#duelbar[data-phase='fight'], #duelbar[data-phase='countdown'] { border-color: #8a2a2a; border-top-color: #ff7070; background: linear-gradient(135deg, #3a1416f5, #140a0bf5); }
#duelbar .duel-ic { flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; color: #fff2c9; background: radial-gradient(circle at 50% 35%, #d0663a, #5a1d10 72%); border: 1px solid #ffcf4a88; }
#duelbar .duel-ic svg { width: 14px; height: 14px; }
#duelbar .duel-ic .duel-spin { width: 12px; height: 12px; border-color: #fff3; border-top-color: #fff2c9; }
#duelbar .msg { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#duelbar .msg b { color: var(--accent); }
#duelbar .msg small { margin-left: 6px; color: #c9b28a; font-size: 11px; }
#duelbar .t { min-width: 4ch; color: var(--accent); font: 700 17px/1 var(--font-display); font-variant-numeric: tabular-nums; text-align: right; }
#duelbar.low .t { color: var(--bad); animation: blink .8s infinite; }
#duelbar button { flex: none; padding: 3px 10px; font-size: 12px; }
#duelbar .prog { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: linear-gradient(90deg, #ff7a4a, var(--accent)); transform-origin: left; animation: drain var(--dur) linear var(--el) both; }
#duelbar[data-phase='queue'] .prog { right: auto; width: 30%; animation: scan 1.6s ease-in-out infinite; }
#duelbar.bump { animation: bump .7s ease-out; }
@keyframes duelBarIn { from { opacity: 0; transform: translate(-50%, -14px) scale(.95); } }
@keyframes drain { to { transform: scaleX(0); } }
@keyframes scan { from { transform: translateX(-100%); } to { transform: translateX(340%); } }
@keyframes bump { 30% { transform: translateX(-50%) scale(1.06); box-shadow: 0 0 0 2px var(--accent), 0 0 22px #ffcf4a88; } }

/* convite recebido: cartão próprio por cima de tudo (não bloqueia o jogo) */
#duelinvite { position: fixed; top: calc(96px + var(--tk)); left: 50%; z-index: 27; width: min(360px, calc(100% - 24px)); transform: translateX(-50%); transition: top var(--tk-ease); }
.duel-inv { position: relative; display: grid; justify-items: center; gap: 9px; padding: 16px 16px 14px; overflow: hidden; isolation: isolate; text-align: center; background: radial-gradient(120% 70% at 50% 0, #6a2c1caa, transparent 70%), linear-gradient(#1c2230, #0e131b); border: 1px solid var(--bronze); border-top: 2px solid var(--accent); border-radius: var(--r-lg); box-shadow: 0 0 0 1px #000, 0 18px 50px #000c, 0 0 34px #ff7a4a44; }
.duel-inv.enter { animation: invIn .5s cubic-bezier(.2, .9, .3, 1.25) both; }
.duel-inv::before { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(110deg, transparent 35%, #ffcf4a1c 50%, transparent 65%) 0 0 / 250% 100%; animation: sweep 3s linear infinite; }
@keyframes sweep { from { background-position: 150% 0; } to { background-position: -100% 0; } }
@keyframes invIn { 0% { opacity: 0; transform: translateY(-24px) scale(.85); } 60% { opacity: 1; transform: translateY(3px) scale(1.02); } }
.duel-inv .duel-emblem { width: 50px; height: 50px; animation: emblemClash 1.6s ease-in-out infinite; }
@keyframes emblemClash { 0%, 70%, 100% { transform: none; } 78% { transform: scale(1.14) rotate(-6deg); } 86% { transform: scale(1.04) rotate(4deg); } }
.duel-kicker { color: #ffb37a; font: 700 11px/1 var(--font-display); letter-spacing: .22em; text-transform: uppercase; }
.duel-inv-who { display: flex; align-items: center; gap: 10px; max-width: 100%; }
.duel-inv-who b { overflow: hidden; color: var(--accent); font: 700 26px/1.1 var(--font-display); text-overflow: ellipsis; white-space: nowrap; text-shadow: 0 2px 0 #2a1600; }
.duel-terms { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; width: 100%; }
.duel-terms span { display: grid; gap: 2px; padding: 7px 4px; border: 1px solid var(--line); border-radius: var(--r); background: #0b101899; }
.duel-terms b { font: 700 20px/1.1 var(--font-display); font-variant-numeric: tabular-nums; }
.duel-terms small { color: var(--muted); font-size: 10px; }
.duel-warn { margin: 0; color: var(--bad); font-size: 12px; }
.duel-time-row { display: flex; align-items: center; gap: 8px; width: 100%; }
.duel-time { position: relative; flex: 1; height: 8px; overflow: hidden; border-radius: 4px; background: #05080c; box-shadow: inset 0 1px 3px #000a; }
.duel-time i { position: absolute; inset: 0; background-color: #72f272; transform-origin: left; animation: drain var(--dur) linear var(--el) both, timeColor var(--dur) linear var(--el) both; }
@keyframes timeColor { 0%, 50% { background-color: #72f272; } 75% { background-color: #ffcf4a; } 100% { background-color: #ff4f4f; } }
.duel-time-row b { min-width: 4ch; color: var(--accent); font: 700 14px/1 var(--font-display); font-variant-numeric: tabular-nums; text-align: right; }
.duel-inv-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; }
.duel-inv-acts button { padding: 9px; font: 700 15px/1 var(--font-display); letter-spacing: .04em; }
.duel-inv .duel-wait { width: 100%; }

/* contagem no ringue, "LUTEM!" e cartão de fim: centro da tela, acima das janelas e dos anúncios */
#duelfx { position: fixed; inset: var(--tk) 0 0 0; z-index: 26; display: grid; place-items: center; padding: 16px; pointer-events: none; }
#duelfx:empty { display: none; }
#duelfx.cd { background: radial-gradient(circle, transparent 25%, #0009 100%); animation: fadeIn .3s ease-out; }
@keyframes fadeIn { from { opacity: 0; } }
.duel-cd { display: grid; justify-items: center; gap: 4px; text-align: center; }
.duel-vs { display: flex; align-items: center; gap: 14px; max-width: calc(100vw - 32px); font: 700 clamp(18px, 3.2vw, 30px)/1 var(--font-display); }
.duel-vs b { overflow: hidden; max-width: 38vw; padding: 7px 14px; border: 1px solid var(--bronze); border-radius: 4px; background: linear-gradient(#1c2230ee, #0e131bee); box-shadow: 0 6px 20px #000a; text-overflow: ellipsis; white-space: nowrap; text-shadow: 0 2px 0 #000; }
.duel-vs .me { color: #9ad0ff; border-left: 4px solid #4280eb; animation: vsL .55s cubic-bezier(.2, .9, .3, 1.2) both; }
.duel-vs .foe { color: #ff9a8a; border-right: 4px solid #db4242; animation: vsR .55s cubic-bezier(.2, .9, .3, 1.2) both; }
.duel-vs i { color: var(--accent); font-size: 1.4em; font-style: normal; text-shadow: 0 0 14px #ff7a4a, 0 3px 0 #2a1600; animation: vsPop .45s .3s cubic-bezier(.2, .9, .3, 1.4) both; }
@keyframes vsL { from { opacity: 0; transform: translateX(-50vw); } }
@keyframes vsR { from { opacity: 0; transform: translateX(50vw); } }
@keyframes vsPop { from { opacity: 0; transform: scale(3) rotate(-12deg); } }
/* número só aparece durante o pulso (entre um número e outro fica invisível) */
.duel-num { position: relative; min-height: 1em; opacity: 0; font: 700 clamp(110px, 20vw, 210px)/1 var(--font-display); background: linear-gradient(#fff3b0, #ffcf4a 45%, #e08a00); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-stroke: 2px #4a2a00; filter: drop-shadow(0 6px 0 #2a1600) drop-shadow(0 0 28px #ff7a4a99); }
.duel-num.pulse { animation: cdNum 1s cubic-bezier(.2, .8, .3, 1) both; }
.duel-num.pulse::after { content: ''; position: absolute; left: 50%; top: 50%; width: .9em; height: .9em; margin: -.45em; border: 6px solid #ffcf4a; border-radius: 50%; animation: cdRing .8s ease-out both; }
@keyframes cdNum { 0% { opacity: 0; transform: scale(2.4); } 16% { opacity: 1; transform: scale(.9); } 28% { transform: scale(1.05); } 40%, 72% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(.65); } }
@keyframes cdRing { from { opacity: .9; transform: scale(.4); } to { opacity: 0; transform: scale(2.4); } }
.duel-num.go { opacity: 1; font-size: clamp(72px, 13vw, 150px); background-image: linear-gradient(#fff, #ff9a5a 40%, #e0302a); -webkit-text-stroke-color: #3a0a00; animation: cdGo 1.4s ease-out both; }
@keyframes cdGo { 0% { opacity: 0; transform: scale(3) rotate(-8deg); } 14% { opacity: 1; transform: scale(1) rotate(0); } 20% { transform: translateX(-8px) rotate(-2deg); } 26% { transform: translateX(8px) rotate(2deg); } 32% { transform: none; } 75% { opacity: 1; transform: scale(1.04); } 100% { opacity: 0; transform: scale(1.4); } }
.duel-ringtag { color: #d8c39d; font: 600 13px/1 var(--font-display); letter-spacing: .16em; text-transform: uppercase; text-shadow: 0 1px 0 #000, 0 0 8px #000; animation: fadeIn .6s .4s both; }
.duel-end { --c: #8794a8; position: relative; display: grid; justify-items: center; gap: 4px; min-width: min(340px, calc(100vw - 32px)); padding: 22px 30px 18px; overflow: hidden; isolation: isolate; text-align: center; pointer-events: auto; cursor: pointer; background: radial-gradient(120% 80% at 50% 0, color-mix(in srgb, var(--c) 22%, transparent), transparent 70%), linear-gradient(#1c2230f5, #0e131bf5); border: 1px solid var(--bronze); border-top: 2px solid var(--c); border-radius: var(--r-lg); box-shadow: 0 0 0 1px #000, 0 20px 60px #000c, 0 0 44px color-mix(in srgb, var(--c) 35%, transparent); animation: endIn .6s cubic-bezier(.2, .9, .3, 1.3) both, endOut .5s ease-in var(--out, 5.5s) forwards; }
.duel-end.win { --c: #ffcf4a; }
.duel-end.lose { --c: #ff6b6b; }
.duel-end.draw { --c: #9ad0ff; }
.duel-end.canceled { --out: 3.5s; padding: 14px 22px; }
.duel-end.win::before { content: ''; position: absolute; left: 50%; top: 50%; z-index: -1; width: 600px; height: 600px; margin: -300px; background: repeating-conic-gradient(#ffcf4a1f 0 10deg, transparent 10deg 20deg); animation: spin 14s linear infinite; }
.duel-end small { color: #c9b28a; font: 600 12px/1 var(--font-display); letter-spacing: .16em; text-transform: uppercase; }
.duel-end b { font: 700 clamp(40px, 8vw, 66px)/1.05 var(--font-display); letter-spacing: .06em; text-transform: uppercase; background: linear-gradient(#fff, var(--c) 55%, color-mix(in srgb, var(--c) 55%, #000)); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 3px 0 #000a); }
.duel-end.canceled b { font-size: 26px; }
.duel-end.lose b { animation: loseDrop .8s .15s cubic-bezier(.3, 1.4, .5, 1) both; }
.duel-end .pot { color: var(--accent); font: 700 22px/1.2 var(--font-display); font-variant-numeric: tabular-nums; text-shadow: 0 2px 0 #2a1600; animation: potIn .5s .45s cubic-bezier(.2, .9, .3, 1.4) both; }
.duel-end.lose .pot { color: var(--bad); }
.duel-end.draw .pot { color: #9ad0ff; }
.duel-end p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
@keyframes endIn { 0% { opacity: 0; transform: scale(.6) translateY(20px); } 60% { opacity: 1; transform: scale(1.05); } }
@keyframes endOut { to { opacity: 0; transform: translateY(-14px) scale(.96); } }
@keyframes loseDrop { 0% { opacity: 0; transform: translateY(-30px); } 60% { opacity: 1; transform: translateY(4px) rotate(-2deg); } }
@keyframes potIn { from { opacity: 0; transform: scale(.4); } }
/* barra no ar: o canto (alvo/tutorial) e o diálogo do NPC descem para baixo dela (a barra fica por cima
   de tudo; até ~1400px ela alcança o canto esquerdo ou o diálogo à direita) */
@media (max-width: 1400px) {
  body.has-duel .corner, body.has-duel #npcbox { top: 100px; }
}
@media (max-width: 820px) {
  .duel-grid { grid-template-columns: 1fr; }
  .duel-list { max-height: 34vh; }
  .duel-hero small { display: none; }
  .duel-empty { min-height: 120px; }
  /* sem o dock no topo: a barra sobe, sem cobrir o zoom (direita) */
  #duelbar { top: calc(8px + var(--tk)); max-width: calc(100% - 104px); }
  #duelinvite { top: calc(52px + var(--tk)); }
  body.has-duel .corner, body.has-duel #npcbox { top: 56px; }
}
@media (prefers-reduced-motion: reduce) {
  #duelbar, #duelbar.bump, #duelbar.low .t, #paneldock .duel-dock.live, .duel-hero .duel-emblem, .duel-form, .duel-team img.mi, .duel-go::after, .duel-pill.free::before,
  .duel-inv.enter, .duel-inv::before, .duel-inv .duel-emblem, #duelfx.cd, .duel-vs .me, .duel-vs .foe, .duel-vs i, .duel-ringtag,
  .duel-num.pulse, .duel-num.go, .duel-end, .duel-end.win::before, .duel-end.lose b, .duel-end .pot { animation: none; }
  .duel-num { opacity: 1; }
  .duel-num.pulse::after { display: none; }
  #duelbar, #duelinvite { transition: none; }
}

/* ---------- celular (barra, gavetas, joystick): escondidos no desktop ---------- */
#mnav, #mstat, #joy, .mobile-only { display: none; }
/* mochila: filtros + linha de detalhe */
#bagf { margin-bottom: 6px; }
#bagf small { opacity: .7; font-size: 10px; }
#bagd { min-height: 2.6em; margin: 6px 0 0; font-size: 11px; line-height: 1.3; }
#bagd:empty::before { content: "Passe o mouse ou toque num item para ver o que ele faz."; }
/* desktop: painel compacto; itens rolam sem esconder filtros e descrição */
@media (min-width: 821px) and (min-height: 521px) {
  #side [data-panel='party'] #bagf button { padding-inline: 9px; }
  #side [data-panel='party'] #bag { max-height: 160px; padding-right: 3px; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; scrollbar-width: thin; scrollbar-color: var(--bronze-dark) transparent; }
  #side [data-panel='party'] #bagd { max-height: 3.9em; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--bronze-dark) transparent; }
}
/* janelas: título fixo, só o conteúdo rola */
#win .card { grid-template-rows: auto minmax(0, 1fr); overflow: hidden; }
/* todas as janelas no mesmo tamanho fixo: trocar de aba ou de conteúdo não faz o card crescer ou encolher.
   .sm = formulário curto (ex.: Cartão de Renomear) */
#win .card, #win .card.wide { width: min(1040px, 100%); height: min(680px, 88dvh); }
#win .card.sm { width: min(460px, 100%); height: auto; }
#wbody { min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--bronze-dark) transparent; }

/* ---------- telas menores ---------- */
/* palco estreito: HUD vai para o canto inferior direito */
@container stage (max-width: 900px) {
  .hotbar { grid-template-columns: repeat(4, 64px); justify-content: center; }
  /* chat não encosta na HUD centralizada */
  #chat { width: min(34%, calc(50% - 160px)); }
}
/* palco largo: o chat nunca encosta na HUD centralizada */
@container stage (min-width: 901px) {
  #chat { width: min(420px, 34%, calc(50% - 330px)); }
}
@media (max-width: 820px), (pointer: coarse) and (max-height: 520px) {
  /* gaveta da Equipe já traz a mochila (não há botão Mochila na barra) */
  #bagpart { display: block; }
  /* jogo ocupa a tela toda acima da barra de navegação */
  :root { --nav: calc(56px + env(safe-area-inset-bottom)); }
  #app { display: block; padding-bottom: var(--nav); }
  #paneldock { display: none; }
  .mobile-only { display: flex; }
  .drag-handle { cursor: default; touch-action: auto; }
  .drag-handle::after { display: none; }

  /* barra de baixo: o "cinto" de bronze */
  #mnav { display: grid; grid-template-columns: repeat(7, 1fr); position: fixed; inset: auto 0 0 0; z-index: 7; height: var(--nav); padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); background: repeating-linear-gradient(90deg, #ffffff05 0 1px, transparent 1px 6px), linear-gradient(#232a35, #0c1118); border-top: 1px solid var(--bronze); box-shadow: 0 -6px 18px #0009, inset 0 1px 0 #ffd99a33; }
  #mnav button { display: grid; place-items: center; align-content: center; gap: 3px; min-height: 48px; padding: 0; border: 0; border-radius: 0; background: none; color: #a99878; font: 600 10px/1 var(--font-ui); }
  #mnav svg { width: 21px; height: 21px; fill: currentColor; }
  #mnav button[aria-pressed='true'] { color: var(--accent); background: radial-gradient(ellipse at 50% 0, #ffcf4a2e, transparent 70%); box-shadow: inset 0 2px 0 var(--accent); }
  #mnav button:active { background: #ffffff0d; }

  /* painéis viram gaveta acima da barra; só a escolhida aparece */
  #side { position: fixed; inset: auto 0 var(--nav) 0; z-index: 6; pointer-events: none; }
  #side section[data-panel], #side section.panel-hidden[data-panel] { position: static; display: none; width: auto; max-height: min(62dvh, 560px); overflow-y: auto; overscroll-behavior: contain; padding: 14px 14px 12px; border-width: 1px 0 0; border-radius: 14px 14px 0 0; box-shadow: 0 -10px 30px #000b, inset 0 1px 0 #d0a15d45; }
  #side > section.sheet-on, #side > section.sheet-on[data-panel] { display: block; pointer-events: auto; animation: sheetIn .18s ease-out; }
  #side > section.sheet-on::before { content: ''; display: block; width: 38px; height: 4px; margin: -6px auto 8px; border-radius: 4px; background: #ffffff2e; }
  #side [data-panel='map'] .map-frame canvas { width: 100%; height: auto; image-rendering: pixelated; }
  #side .tools .btns { flex-wrap: wrap; }
  #side .tools.mobile-only button { flex: 1; }

  /* status no topo: toque abre o Menu */
  #mstat { display: grid; grid-template-columns: minmax(0, auto) auto; column-gap: 6px; align-items: baseline; position: absolute; top: 8px; left: max(8px, env(safe-area-inset-left)); z-index: 3; min-width: 132px; max-width: 48%; padding: 6px 10px 7px; background: #0d1219e0; border: 1px solid var(--bronze-dark); border-top-color: var(--bronze); border-radius: 8px; color: var(--text); text-align: left; box-shadow: 0 4px 14px #0008; }
  #mstat b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 700 13px/1.1 var(--font-display); }
  #mstat small { color: var(--muted); font-size: 11px; }
  #mstat .bar { display: block; grid-column: 1 / -1; height: 6px; margin-top: 5px; }
  .corner { top: 58px; width: min(260px, calc(100% - 70px)); }
  #npcbox { top: 58px; }
  #zoombox { top: 8px; right: max(8px, env(safe-area-inset-right)); gap: 5px; }

  /* joystick no canto esquerdo */
  #joy { display: block; position: absolute; left: max(16px, env(safe-area-inset-left)); bottom: 16px; z-index: 3; width: 118px; height: 118px; border-radius: 50%; background: radial-gradient(circle, #0d121930 35%, #0d1219a6 72%); border: 2px solid #b88a4a80; box-shadow: inset 0 0 18px #000a; touch-action: none; }
  #joy i { position: absolute; left: 50%; top: 50%; width: 50px; height: 50px; margin: -25px 0 0 -25px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #f0cf8e, #9b6c34 70%); box-shadow: 0 3px 8px #000b, inset 0 -3px 0 #0004; pointer-events: none; }
  #joy.on { border-color: var(--accent); }

  /* golpes e companheiro no canto direito, compactos */
  #hud { left: auto; right: max(8px, env(safe-area-inset-right)); bottom: 10px; width: min(236px, calc(100% - 158px)); grid-template-columns: 1fr; gap: 6px; transform: none; justify-items: stretch; }
  /* barra de modo compacta: Explorar numa linha; Auto, engrenagem, Curar e Depósito na de baixo */
  #modebar { gap: 4px; }
  #modebar button { min-height: 32px; padding: 0 8px; font-size: 10px; letter-spacing: .03em; }
  #modebar #modeBtn { flex: 1 1 100%; min-width: 0; min-height: 40px; }
  #modebar #modeBtn b { font-size: 14px; }
  #modebar #autoCfg { min-width: 30px; padding: 0 6px; }
  #townbar { display: contents; }
  #townbar.hidden { display: none; }
  #modebar .long { display: none; }
  #hud:has(.hotbar:empty) { grid-template-columns: 1fr; }
  .hotbar { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 3px; padding: 4px; }
  .hotbar button { width: 100%; min-height: 50px; padding: 8px 2px; font-size: 10px; }
  .hotbar button kbd, .hotbar button small { display: none; }
  /* toque: sem zoom de duplo toque nem seleção; espaço vazio some; melhorar fica no painel Golpes */
  .hotbar { touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
  .hotbar button:not([data-slot]), .hotbar .move-up { display: none; }
  .hotbar button b { font-size: 9.5px; letter-spacing: -.02em; }
  /* Soltar/Recolher (R) e Próximo alvo (Tab); Alvo só com pet em campo, Soltar some na cidade */
  #mfight { display: flex; gap: 4px; }
  #mfight button { flex: 1; color: #fff; background: linear-gradient(#2f6fd6, #1d4fa6); border-color: #5a86c4; }
  body:not(.petout) #mfight [data-key='Tab'] { display: none; }
  body:not(.petout) #modebar:has(#townbar:not(.hidden)) #mfight { display: none; }
  /* pet em campo: linha de luta grande em cima; Explorar vira botão pequeno ao lado do Auto */
  body.petout #mfight { order: -1; flex: 1 1 100%; }
  body.petout #mfight button { min-height: 40px; font-size: 12px; }
  body.petout #modebar #modeBtn { flex: 0 1 auto; min-height: 32px; }
  body.petout #modebar #modeBtn :is(i, small) { display: none; }
  body.petout #modebar #modeBtn b { font-size: 10px; }
  /* chat não fica embaixo dos golpes */
  body.petout #chat { width: min(62%, 320px, calc(100% - min(236px, 100% - 158px) - 24px)); }
  #chatch { overflow-x: auto; scrollbar-width: none; }
  #chatch button { flex: none; }

  /* chat: só as últimas linhas; o campo aparece pelo botão Chat */
  #chat { left: max(8px, env(safe-area-inset-left)); bottom: 146px; width: min(62%, 320px); padding-bottom: 0; }
  #logbox { max-height: 4.6em; }
  #say { display: none; }
  body.chatting #chat { inset: auto 8px 8px 8px; width: auto; z-index: 8; }
  body.chatting #say { display: block; }
  body.chatting #logbox { max-height: 40dvh; }
  body.chatting :is(#joy, #hud), body.has-sheet :is(#joy, #hud, #chat) { visibility: hidden; }
  #tut li:not(.cur) { display: none; }

  /* janelas: gaveta de tela cheia com título fixo */
  #win { place-items: end stretch; padding: 0; }
  #win .card, #win .card.wide { width: 100%; height: calc(100dvh - var(--tk) - 8px); max-height: none; padding: 14px 12px calc(12px + env(safe-area-inset-bottom)); border-radius: 14px 14px 0 0; }
  #win .card.sm { height: auto; max-height: calc(100dvh - var(--tk) - 8px); }
  #dexgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
  .dex { grid-template-columns: 1fr; justify-items: center; gap: 2px; padding: 6px 3px; text-align: center; border-left-width: 1px; border-top: 3px solid var(--c); }
  .dex b { font-size: 11px; line-height: 1.15; }
  .dex small + small { display: none; }
  .grid2 { grid-template-columns: 1fr; }
}
/* celular deitado: gaveta à esquerda, mais alta */
@media (pointer: coarse) and (max-height: 520px) {
  #side { right: auto; width: min(440px, 62%); }
  #side section[data-panel], #side section.panel-hidden[data-panel] { max-height: calc(100dvh - var(--nav) - 12px); border-radius: 0 14px 0 0; }
  #joy { width: 100px; height: 100px; }
  #chat { bottom: 124px; width: min(40%, 300px); }
}
/* celular deitado: pouca altura, sobra largura — golpes numa linha só e luta numa linha */
@media (max-width: 820px) and (max-height: 520px), (pointer: coarse) and (max-height: 520px) {
  #hud { width: min(440px, calc(100% - 140px)); }
  .hotbar { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
  .hotbar button { min-height: 46px; }
  body.petout #mfight, #modebar #modeBtn { flex: 1 1 auto; }
}
@keyframes sheetIn { from { transform: translateY(24px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { #side > section.sheet-on { animation: none; } }

@media (prefers-reduced-motion: reduce) {
  .bar.hp.low, #stage.lowhp::after, .hint-pulse, .hotbar button.deny, .hotbar button.ready,
  .autostate.on::before, .confirming, .toast, .toast.nag, .feed, #npcbox, #targetframe, #tut, #hero, #hero::before, #hero::after { animation: none; }
  .bar i, #npcbox.closing { transition: none; }
  /* a faixa de aviso continua rolando (é o próprio aviso); só a descida do jogo fica instantânea */
  #app, #side, .modal, #paneldock { transition: none; }
}
/* automático: poções que pode usar / não usar (arrastar ou clicar troca de lado) */
.autoitems { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.aicol { display: grid; align-content: start; gap: 4px; min-height: 92px; padding: 6px; background: #0b1017aa; border: 1px dashed var(--line2); border-radius: var(--r); }
.aicol.use { border-color: #59d66f88; }
.aicol.block { border-color: #ff7a7a88; }
.aicol h5 { margin: 0 0 2px; font: 600 11px/1.2 var(--font-ui); text-transform: uppercase; letter-spacing: .06em; color: #cfe8d2; }
.aicol.block h5 { color: #ffb0b0; }
.aicol button { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: center; gap: 6px; padding: 3px 6px; text-align: left; cursor: grab; }
.aicol button img { width: 22px; height: 22px; image-rendering: pixelated; }
.aicol button span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 12px; }
.aicol button b { font-size: 11px; font-variant-numeric: tabular-nums; }
.aicol button.none { opacity: .45; }
/* Dex: cabeçalho com o ⋯ (continente e filtros) */
.dexhead { display: flex; align-items: center; gap: 8px; }
.dexhead .dexbar { flex: 1; min-width: 0; }
.dexmore { position: relative; flex: none; width: 34px; height: 30px; font-size: 18px; line-height: 1; }
.dexmore.on { border-color: var(--accent); color: var(--accent); }
.dexmore i { position: absolute; top: -6px; right: -6px; display: grid; place-items: center; min-width: 16px; height: 16px; padding: 0 3px; color: #1a1205; font: 700 10px/1 var(--font-ui); font-style: normal; background: var(--accent); border-radius: 8px; }
.dexmenu { display: grid; gap: 4px; margin: 6px 0 8px; padding: 8px 10px; background: #0b1017cc; border: 1px solid var(--line2); border-radius: var(--r); }
.dexmenu h5 { margin: 4px 0 0; color: #d8c39d; font: 600 11px/1.2 var(--font-ui); text-transform: uppercase; letter-spacing: .06em; }
/* ---------- admin: aba Drops (lista de bichos + editor de drop) ---------- */
.loot { display: grid; grid-template-columns: minmax(220px, 300px) minmax(0, 1fr); gap: 12px; min-height: 420px; }
.loot-list { display: grid; grid-template-rows: auto auto minmax(0, 1fr); gap: 6px; min-height: 0; }
.loot-list .chips button { padding: 3px 8px; font-size: 11px; }
#lootQ { width: 100%; padding: 7px 9px; }
.loot-sps { display: grid; align-content: start; gap: 3px; max-height: 52vh; overflow-y: auto; padding-right: 3px; scrollbar-width: thin; }
.loot-sps button { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 6px; padding: 2px 6px; text-align: left; }
.loot-sps button.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.loot-sps button img { width: 30px; height: 30px; object-fit: contain; image-rendering: pixelated; }
.loot-sps button span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 12px; }
.loot-sps button i { color: #ffd84a; font-style: normal; }
.loot-edit { min-width: 0; }
.loot-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.loot-head img { width: 48px; height: 48px; object-fit: contain; image-rendering: pixelated; }
.loot-head > div { flex: 1; display: grid; }
.loot-head small { color: var(--muted); }
.loot-t { width: 100%; border-collapse: collapse; font-size: 12px; }
.loot-t th { padding: 3px 4px; color: var(--muted); font-weight: 600; text-align: left; border-bottom: 1px solid var(--line); }
.loot-t td { padding: 3px 4px; border-bottom: 1px solid #ffffff0d; }
.loot-t td img { width: 24px; height: 24px; image-rendering: pixelated; }
.loot-t select { width: 100%; max-width: 260px; }
.loot-t input { width: 66px; }
.loot .warn { color: #ffb36b; }
@media (max-width: 820px) { .loot { grid-template-columns: 1fr; } .loot-sps { max-height: 30vh; } }
/* ---------- admin: aba Itens (catálogo) ---------- */
.items-admin { display: grid; gap: 8px; }
.items-admin #itemsQ { flex: 1; min-width: 220px; padding: 7px 9px; }
.items-admin .chips button { padding: 3px 9px; font-size: 11px; }
.igrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 8px; max-height: 58vh; overflow-y: auto; padding-right: 3px; scrollbar-width: thin; }
.icard { display: grid; align-content: start; gap: 4px; padding: 8px 10px; background: var(--panel2); border: 1px solid var(--line); border-radius: var(--r); }
.icard p { margin: 0; font-size: 12px; color: #cfd6e2; }
.icard .ihead { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.icard .ihead img { width: 32px; height: 32px; image-rendering: pixelated; }
.icard .ihead small { display: block; overflow: hidden; color: var(--muted); font-size: 10px; white-space: nowrap; text-overflow: ellipsis; }
.icard .ihead button { padding: 3px 8px; font-size: 11px; }
.icard button.link { padding: 0; color: var(--accent); font-size: 11px; background: none; border: 0; box-shadow: none; cursor: pointer; }
.idrops { display: flex; flex-wrap: wrap; gap: 4px; }
.idrops span { display: grid; justify-items: center; width: 40px; }
.idrops img { width: 28px; height: 28px; object-fit: contain; image-rendering: pixelated; }
.idrops small { font-size: 9px; color: var(--muted); }
/* ---------- pop-up do painel admin (valor + confirmar/cancelar) ---------- */
.amodal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: #04060ab8; animation: amodalIn .12s ease-out; }
.amodal-card { display: grid; gap: 10px; width: min(380px, 100%); padding: 16px 18px; background: linear-gradient(180deg, #1d2532, #111821); border: 1px solid var(--bronze-dark); border-top: 3px solid var(--accent); border-radius: 6px; box-shadow: 0 18px 50px #000c; }
.amodal-card.danger { border-top-color: #ff5a5a; }
.amodal-card h3 { margin: 0; font: 700 18px/1.2 var(--font-display); color: var(--accent); }
.amodal-card.danger h3 { color: #ff8a8a; }
.amodal-card p { margin: 0; color: #cfd6e2; font-size: 13px; }
.amodal-card p img { width: 24px; height: 24px; vertical-align: middle; image-rendering: pixelated; }
.amodal-card label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
.amodal-card input, .amodal-card select { width: 100%; padding: 8px 10px; font-size: 14px; }
.amodal-err { min-height: 1em; color: #ff8a8a !important; }
.amodal-err:empty { display: none; }
.amodal-acts { display: flex; justify-content: flex-end; gap: 8px; }
.amodal-acts button { min-width: 96px; }
.amodal-acts button:disabled { opacity: .45; cursor: not-allowed; }
.icard .iacts { display: flex; gap: 4px; }
@keyframes amodalIn { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .amodal { animation: none; } }
/* ---------- admin: aba NPCs ---------- */
.npc-list { display: grid; grid-auto-rows: max-content; align-content: start; gap: 3px; max-height: 60vh; overflow-y: auto; scrollbar-width: thin; }
.npc-list h5 { margin: 8px 0 2px; color: #d8c39d; font: 600 12px/1.2 var(--font-ui); }
.npc-list button { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 6px; padding: 4px 8px; text-align: left; }
.npc-list button.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.npc-list button small { grid-column: 1 / -1; color: var(--muted); font-size: 10px; }
.npc-list button i { color: #ffd84a; font-style: normal; }
.npc-form { display: grid; gap: 8px; max-height: 62vh; overflow-y: auto; padding-right: 4px; scrollbar-width: thin; }
.npc-form > label { display: grid; gap: 3px; font-size: 12px; color: var(--muted); }
.npc-form h5 { margin: 6px 0 0; color: #d8c39d; font: 600 12px/1.2 var(--font-ui); }
.npc-pos { display: flex; flex-wrap: wrap; align-items: end; gap: 6px; }
.npc-pos label { display: grid; gap: 3px; font-size: 12px; color: var(--muted); }
.npc-pos input { width: 80px; }


/* Repertório: controles nativos, sem depender de arrastar ou de cores. */
.movebook-grid,.movebook-tools{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-block:12px 20px}
.movebook-grid label,.movebook-tools label{display:flex;flex-direction:column;gap:6px;min-width:0}
.movebook-grid select,.movebook-tools input,.movebook-tools select{width:100%;max-width:100%;min-height:40px}
.movebook-card{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 0;border-bottom:1px solid #ffffff18}
.movebook-card div{min-width:0}.movebook-card small{display:block;margin-top:6px}.movebook-card p{margin:6px 0;line-height:1.5}
.movebook-card button{flex-shrink:0;white-space:normal}
.movebook-open{min-height:32px;padding:4px 8px;font-size:10px}
@media(max-width:600px){.movebook-grid,.movebook-tools{grid-template-columns:minmax(0,1fr)}.movebook-card{align-items:stretch;flex-direction:column}.movebook-grid select,.movebook-tools input,.movebook-tools select{font-size:16px;min-height:44px}}
/* ---------- pokébolas com bicho na mochila ---------- */
.boxgrid { display: grid; grid-template-columns: repeat(6, 1fr); grid-auto-rows: max-content; gap: 4px; }
.boxgrid button { position: relative; aspect-ratio: 1; padding: 2px; display: grid; place-items: center; background: var(--panel2); border-radius: var(--r); }
.boxgrid button b { position: absolute; right: 2px; font-size: 10px; text-shadow: 0 1px 0 #000, 0 0 2px #000; }
button.mball { overflow: hidden; cursor: grab; }
.mball img.px { position: absolute; left: 2px; top: 2px; width: 10px; height: 10px; }
.mball img.mi { width: 100%; height: 100%; margin: 0; object-fit: contain; }
#bag .mball b, .mball b { top: 1px; bottom: auto; }
.mball .bar { position: absolute; left: 3px; right: 3px; bottom: 2px; height: 3px; }
.mball.ko img.mi { filter: grayscale(1) opacity(.5); }
.mball.locked { opacity: .45; cursor: not-allowed; }
.mball.drop, .boxgrid.drop, .boxempty.drop, .boxfree.drop { outline: 2px dashed var(--accent); outline-offset: 1px; }
#side [data-panel='box'] { width: 250px; }
#boxp { display: grid; gap: 6px; }
#boxp h4 { display: flex; align-items: center; margin: 2px 0 0; font: 600 12px/1.2 var(--font-display); color: #d8c39d; }
.boxempty { margin: 0; padding: 12px 8px; color: var(--muted); text-align: center; border: 1px dashed var(--line2); border-radius: var(--r); }
.boxfree { margin: 0; padding: 8px; color: #ff9a9a; text-align: center; border: 1px dashed #7a2a2a; border-radius: var(--r); }
.boxhelp { margin: 0; font-size: 11px; }
#party .inball { position: absolute; left: -1px; top: -1px; display: grid; place-items: center; width: 11px; height: 11px; }
#party .inball img.px { width: 11px; height: 11px; filter: drop-shadow(0 1px 1px #000c); }
#party li.vaga > button { border-style: dashed; border-left-width: 1px; background: transparent; box-shadow: none; cursor: default; }
#party li.vaga img.px { width: 18px; height: 18px; opacity: .3; filter: grayscale(1); }
#party li.vaga .pn b { color: var(--muted); font-weight: 600; }
#bag.drop, #party.drop, #party li.drop { outline: 2px dashed var(--accent); outline-offset: 2px; }
.boxbtn { margin-left: auto; padding: 1px 8px; font: 600 11px/18px var(--font-ui); letter-spacing: 0; text-transform: none; }
#bagpart h4 { display: flex; align-items: center; }
.boxhint { margin: 0 0 4px; color: var(--muted); }
.boxhint.off { color: #ffcf8a; }
.boxcol { min-height: 120px; padding: 6px; border: 1px dashed transparent; border-radius: var(--r); }
.boxcol.drop { border-color: var(--accent); background: #ffcf4a0d; }
.boxcol .monrow[draggable] { cursor: grab; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 820px) { .grid3 { grid-template-columns: 1fr; } }
#boxp h4 .cnt { margin-left: 6px; color: var(--muted); font: 600 11px/1 var(--font-ui); }
/* botão Golpes: faixa fina sob o card (a regra geral de #party li > button o deixava com 48px) */
#party li > button.movebook-open { display: block; height: auto; min-height: 0; margin-top: 2px; padding: 1px 4px; border-left-width: 1px; font: 600 10px/14px var(--font-ui); text-align: center; color: var(--muted); }
#party li > button.movebook-open:hover { color: var(--text); }
#party li.vaga > button { height: 66px; }

/* ---------- painel Golpes: espaços em cards, ícones de tipo e categoria ---------- */
.movebook { display: grid; gap: 8px; }
.mvhead { display: flex; align-items: center; gap: 10px; }
.mvhead img.mi { width: 56px; height: 42px; margin: 0; }
.mvhead small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.mvcredit { margin: 0; padding: 6px 10px; border-radius: var(--r); color: var(--accent); background: #ffcf4a14; }
.mvslots { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.mvslot { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 6px; align-items: center; min-height: 54px; padding: 6px 8px 6px 20px; text-align: left; border-left: 3px solid var(--c, var(--line)); }
.mvslot kbd { position: absolute; left: 6px; top: 5px; font: 700 10px/1 var(--font-ui); color: var(--muted); }
.mvslot .mvicons { grid-row: 1 / 3; }
.mvslot .mvname { overflow: hidden; font-size: 12px; font-weight: 700; white-space: nowrap; text-overflow: ellipsis; }
.mvslot small { color: var(--muted); font-size: 10px; }
.mvslot.on { border-color: var(--accent); border-left-color: var(--c); background: #ffcf4a14; box-shadow: 0 0 0 1px var(--accent) inset; }
.mvslot.empty { border-style: dashed; color: var(--muted); }
.mvicons { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; }
.mvty { width: 22px; height: 22px; }
.mvcls { width: 18px; height: 18px; vertical-align: middle; }
.mvpick { display: flex; align-items: center; gap: 8px; margin: 0; }
@media (max-width: 600px) {
  .mvslots { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* raridade sorteada na captura */
.rstar { font-style: normal; font-weight: 800; line-height: 1; text-shadow: 0 1px 1px #000c, 0 0 4px currentColor; }
.rstar.r1, .rtxt.r1 { color: #5aa9ff; }
.rstar.r2, .rtxt.r2 { color: #c27bff; }
.rstar.r3, .rtxt.r3 { color: #ffcf4a; }
#party .pic .rstar { position: absolute; right: -2px; top: -3px; font-size: 12px; }
.mball b .rstar { margin-right: 1px; font-size: 9px; }
.rtxt { font-weight: 700; }
.mvrolled { color: #ffcf4a; font-style: normal; font-weight: 700; }

/* painéis laterais com ✕ no título */
.pclose { margin-left: auto; padding: 0 7px; font: 700 12px/20px var(--font-ui); color: var(--muted); background: transparent; border-color: transparent; box-shadow: none; letter-spacing: 0; }
.pclose:hover:not(:disabled) { color: var(--text); background: #ffffff14; border-color: var(--line2); }
#side > section > h3 { display: flex; align-items: center; }

/* Golpes compacto (painel e janela) */
#side [data-panel='moves'] { width: 300px; }
.movebook { gap: 6px; }
.mvhead img.mi { width: 40px; height: 30px; }
.mvslots { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
.mvslot { min-height: 0; padding: 4px 6px 4px 18px; grid-template-columns: auto minmax(0, 1fr); }
.mvslot kbd { top: 50%; transform: translateY(-50%); }
.mvslot .mvicons, .mvslot .mvty { grid-row: auto; width: 18px; height: 18px; }
.mvslot .mvname { font-size: 11px; }
.mvpick { font-size: 11px; color: var(--muted); }
.mvpick b { color: var(--text); }
.mvtools { display: flex; align-items: center; gap: 6px; }
.mvtools input[type=search] { flex: 1; min-width: 0; padding: 5px 8px; }
.mvlist { display: grid; gap: 3px; max-height: 260px; overflow-y: auto; padding-right: 2px; scrollbar-width: thin; }
.mvrow { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; align-items: center; gap: 5px; padding: 3px 6px; text-align: left; border-left: 3px solid var(--c, var(--line)); }
.mvrow .mvty { width: 18px; height: 18px; }
.mvrow .mvcls { width: 15px; height: 15px; }
.mvrow span { overflow: hidden; font-size: 12px; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
.mvrow small { color: var(--muted); font-size: 10px; white-space: nowrap; }
.mvrow.on { border-color: var(--good); border-left-color: var(--c); }
.mvrow.on small { color: var(--good); }
.mvrow.off { opacity: .5; cursor: default; }

/* ---------- Grupo e Clã (janelas) ---------- */
.soc-empty { margin: 0; padding: 8px; color: var(--muted); font-size: 12px; }
.soc-help { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.4; }
.soc-add { display: flex; gap: 4px; }
.soc-add input { flex: 1; min-width: 0; padding: 5px 8px; }
.soc-invite { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--accent); border-radius: var(--r); background: #ffcf4a14; }
.crown { color: var(--accent); font-style: normal; }
.face { display: grid; place-items: center; width: 34px; height: 30px; border-radius: var(--r); background: #0b1018; overflow: hidden; }
.face img.mi { width: 40px; height: 30px; margin: 0; }
.small { font-size: 11px; }
#paneldock button.ping, #mnav button.ping { position: relative; }
#mnav button.ping::after { content: ''; position: absolute; top: 6px; left: calc(50% + 7px); width: 8px; height: 8px; border-radius: 50%; background: #ff5a5a; box-shadow: 0 0 0 2px #1a1f28; }
#paneldock button.ping::after { content: ''; position: absolute; top: 2px; right: 2px; width: 7px; height: 7px; border-radius: 50%; background: #ff5a5a; box-shadow: 0 0 0 2px #141b26; }
.ico-btn { width: 26px; height: 26px; padding: 0; font-size: 13px; }
.ico-btn.danger { color: #ff8a8a; }

/* Grupo: convites | próximos + grupo | chat */
.party { display: grid; grid-template-columns: 230px minmax(0, 1fr) 250px; grid-template-areas: 'req mid chat' 'foot foot foot'; gap: 10px; min-height: 420px; }
.pt-col { display: grid; align-content: start; gap: 6px; min-width: 0; padding: 8px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel2); }
.pt-req { grid-area: req; } .pt-mid { grid-area: mid; } .pt-chat { grid-area: chat; grid-template-rows: auto minmax(0, 1fr) auto; }
.pt-col h4 { display: flex; align-items: center; gap: 6px; margin: 2px 0; font: 600 12px/1.2 var(--font-display); color: #d8c39d; }
.pt-col h4 .linkbtn { margin-left: auto; font: 600 11px var(--font-ui); }
.pt-list { display: grid; gap: 4px; max-height: 210px; overflow-y: auto; scrollbar-width: thin; }
.pt-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 4px 6px; border: 1px solid var(--line); border-radius: var(--r); background: #0f151e; }
.pt-card.me { border-color: var(--line2); }
.pt-card b { display: block; overflow: hidden; font-size: 12px; white-space: nowrap; text-overflow: ellipsis; }
.pt-card small { color: var(--muted); font-size: 10px; }
.pt-card .bar { height: 4px; margin-top: 2px; }
.pt-card .aform { flex-wrap: nowrap; }
.pt-card .aform button, .pt-card > button { padding: 3px 8px; font-size: 11px; }
.pt-req .pt-card { grid-template-columns: auto minmax(0, 1fr); }
.pt-req .pt-card .aform, .pt-req .pt-card > button { grid-column: 1 / -1; justify-self: end; }
.pt-acts { display: flex; gap: 3px; }
.pt-chatlog { min-height: 200px; overflow-y: auto; padding: 6px; border-radius: var(--r); background: #0b1018; font-size: 12px; scrollbar-width: thin; }
.pt-chatlog p { margin: 0 0 3px; color: #c9d3e1; overflow-wrap: anywhere; }
.pt-chatlog b { color: #7fe3d4; }
.pt-chat input { padding: 6px 8px; }
.pt-foot { grid-area: foot; display: flex; align-items: center; gap: 10px; }
.pt-foot .soc-help { flex: 1; }

/* Clã: lateral com brasão | estatísticas + abas */
.guild { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 12px; min-height: 460px; }
.gl-side { display: grid; align-content: start; justify-items: center; gap: 6px; padding: 12px 8px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel2); text-align: center; }
.gl-name { color: var(--accent); font: 700 14px/1.2 var(--font-display); }
.gl-side > small { color: var(--muted); }
.gl-side nav { display: grid; gap: 6px; width: 100%; margin-top: 10px; }
.gl-side nav button { display: grid; gap: 1px; padding: 8px 10px; text-align: left; }
.gl-side nav button small { color: var(--muted); font-size: 10px; }
.gl-side nav button.on { border-color: var(--accent); background: #ffcf4a14; box-shadow: inset 3px 0 0 var(--accent); }
.gl-main { display: grid; align-content: start; gap: 10px; min-width: 0; }
.gl-main h4 { margin: 4px 0 0; font: 600 13px/1.2 var(--font-display); color: #d8c39d; }
.gl-stats { display: grid; grid-template-columns: repeat(3, auto) minmax(0, 1fr); gap: 8px; align-items: stretch; }
.gl-stats > div { display: grid; align-content: start; gap: 2px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel2); }
.gl-stats small { color: var(--muted); font-size: 11px; }
.gl-stats b { font: 700 18px/1.1 var(--font-display); color: var(--text); }
.gl-motd p { margin: 0; color: #e8dcc2; }
.gl-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.gl-tabs button { padding: 5px 12px; border-bottom-left-radius: 0; border-bottom-right-radius: 0; background: transparent; box-shadow: none; }
.gl-tabs button.on { border-color: var(--line); border-bottom-color: var(--bg); background: var(--panel2); color: var(--accent); }
.pill { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 99px; background: #ff5a5a; color: #fff; font: 700 10px/16px var(--font-ui); font-style: normal; text-align: center; }
.gl-table { display: grid; gap: 2px; max-height: 320px; overflow-y: auto; scrollbar-width: thin; }
.gl-row { display: grid; grid-template-columns: 38px minmax(0, 1.4fr) 60px 90px 52px 92px 92px; align-items: center; gap: 8px; width: 100%; min-height: 36px; padding: 2px 8px; text-align: left; border: 1px solid transparent; border-radius: var(--r); background: #0f151e; box-shadow: none; font: inherit; }
.gl-row.head { min-height: 0; background: transparent; color: var(--muted); font-size: 11px; font-weight: 600; }
button.gl-row:hover:not(:disabled) { border-color: var(--line2); background: #141c28; }
.gl-row.sel { border-color: var(--accent); background: #ffcf4a10; }
.gl-row.me b { color: var(--accent); }
.gl-row b { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.gl-row b small { color: var(--muted); font-weight: 400; }
.gl-table.browse .gl-row { grid-template-columns: 38px minmax(0, 1fr) 70px 80px auto; }
.gl-table.roles .gl-row { grid-template-columns: 100px minmax(0, 1fr); padding: 8px; }
.gl-row .gl-acts, .gl-bar .gl-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; justify-content: flex-end; }
.gl-table .gl-row:not(.head) .gl-acts { grid-column: 3 / -1; }
.role { font-size: 11px; font-weight: 700; }
.role.r2 { color: var(--accent); } .role.r1 { color: #9ad0ff; } .role.r0 { color: #c9d3e1; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #c0392b; }
.dot.on { background: var(--good); box-shadow: 0 0 5px var(--good); }
.gl-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding-top: 6px; border-top: 1px solid var(--line); }
.gl-bar small { color: var(--muted); }
.gl-config { display: grid; gap: 14px; }
.gl-config section { display: grid; gap: 8px; justify-items: start; }
.emb-edit { display: flex; gap: 14px; align-items: flex-start; }
.emb-colors, .emb-icons { display: flex; flex-wrap: wrap; gap: 4px; max-width: 420px; }
.emb-colors button { width: 26px; height: 26px; padding: 0; border-radius: 50%; background: var(--bg); }
.emb-colors button.on, .emb-icons button.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.emb-icons button { width: 32px; height: 32px; padding: 2px; }
.emb-icons img { width: 26px; height: 26px; }
.soc-create { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; }
.soc-create .afield.grow { flex: 1 1 200px; }
.soc-create input { width: 100%; padding: 6px 8px; }
.soc-create .afield:not(.grow) input { width: 72px; text-transform: uppercase; }
/* brasão: escudo com a cor do clã e o símbolo no meio */
.emb { display: inline-grid; place-items: center; flex: none; background: radial-gradient(circle at 50% 35%, #ffffff40, transparent 60%), var(--bg); border: 2px solid #ffffff55; clip-path: polygon(50% 0, 100% 14%, 100% 58%, 50% 100%, 0 58%, 0 14%); }
.emb img { width: 62%; height: 62%; filter: drop-shadow(0 1px 1px #000a); }
.emb.sm { width: 30px; height: 34px; } .emb.md { width: 40px; height: 46px; } .emb.lg { width: 76px; height: 88px; } .emb.xl { width: 96px; height: 110px; }
@container (max-width: 700px) {
  .party { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'req' 'mid' 'chat' 'foot'; }
  .guild { grid-template-columns: minmax(0, 1fr); }
  .gl-side { grid-template-columns: auto minmax(0, 1fr); justify-items: start; text-align: left; }
  .gl-side nav { grid-column: 1 / -1; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; }
  .gl-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .gl-motd { grid-column: 1 / -1; }
  .gl-row { grid-template-columns: 34px minmax(0, 1fr) 54px 72px 30px; }
  .gl-row > :nth-child(6), .gl-row > :nth-child(7) { display: none; }
}

/* ---------- Novidades (megafone) ---------- */
.newsdot { position: absolute; top: 3px; right: 3px; width: 8px; height: 8px; border-radius: 50%; background: #ff5a5a; box-shadow: 0 0 0 2px #141b26; }
/* Novidades: linha do tempo das atualizações à esquerda, cartões da selecionada à direita */
.news { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 14px; align-items: start; }
.news-nav { position: sticky; top: 0; display: grid; gap: 6px; }
.news-nav button { position: relative; display: grid; gap: 2px; padding: 9px 10px 9px 12px; text-align: left; background: var(--panel2); border: 1px solid var(--line); border-radius: var(--r); }
.news-nav small { color: var(--muted); font-size: 11px; }
.news-nav b { padding-right: 34px; font: 600 13px/1.2 var(--font-display); color: var(--text); }
.news-nav button[aria-current="true"] { border-color: var(--accent); background: linear-gradient(90deg, #2c2511, #151c27 75%); box-shadow: inset 3px 0 0 var(--accent); }
.news-nav button[aria-current="true"] b { color: var(--accent); }
.news-new { position: absolute; top: 8px; right: 8px; padding: 0 6px; font: 700 10px/16px var(--font-ui); font-style: normal; color: #10161f; background: var(--accent); border-radius: 999px; }
.news-head { margin-bottom: 12px; padding: 16px 18px; background: linear-gradient(120deg, #33290f 0%, #1c2638 58%, #141b26 100%); border: 1px solid #5a4a1c; border-radius: var(--r-lg); }
.news-head small { color: var(--accent); font-weight: 600; letter-spacing: .02em; }
#wbody .news-head h3 { margin: 4px 0 0; font: 600 24px/1.15 var(--font-display); color: var(--text); letter-spacing: 0; }
.news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.news-grid article { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 12px; align-content: start; padding: 13px 14px; background: var(--panel2); border: 1px solid var(--line); border-radius: var(--r-lg); }
.news-ico { display: grid; place-items: center; width: 36px; height: 36px; color: var(--accent); background: #2a2412; border: 1px solid #4d3f19; border-radius: 10px; }
.news-ico svg { width: 18px; height: 18px; fill: currentColor; }
.news-grid article > div > b { display: block; font: 600 14px/1.25 var(--font-display); color: var(--text); }
.news-grid p { margin: 5px 0 0; font-size: 12.5px; line-height: 1.55; color: #c3cddb; }
.news-grid p b { color: var(--accent); }
.news-grid kbd { display: inline-block; min-width: 22px; margin: 1px 0; padding: 1px 6px; font: 700 12px/18px var(--font-ui); text-align: center; color: var(--text); background: #0b1017; border: 1px solid var(--line2); border-bottom-width: 2px; border-radius: 5px; }
/* Como jogar: botões no fim do tópico */
.help-foot { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-top: 12px; }
/* boas-vindas da conta nova */
.welcome { display: grid; gap: 12px; }
.welcome > p { color: #c3cddb; line-height: 1.5; }
.welcome .btn-primary { justify-self: stretch; }
@media (max-width: 720px) {
  .news { grid-template-columns: minmax(0, 1fr); }
  .news-nav { position: static; grid-auto-flow: column; grid-auto-columns: max-content; overflow-x: auto; padding-bottom: 4px; }
  .news-grid { grid-template-columns: minmax(0, 1fr); }
  #wbody .news-head h3 { font-size: 20px; }
}

/* chat: pílulas de canal acima do campo */
#chatch { display: flex; gap: 2px; margin-top: 3px; pointer-events: auto; }
#chatch button { padding: 1px 8px; font: 600 10px/16px var(--font-ui); color: var(--muted); background: rgba(8, 12, 18, .78); border-color: transparent; border-radius: var(--r) var(--r) 0 0; box-shadow: none; }
#chatch button.on { color: var(--text); background: rgba(8, 12, 18, .92); border-color: var(--line2); border-bottom-color: transparent; }
#chatch button[data-ch=global].on { color: #9ad0ff; }
#chatch button[data-ch=group].on { color: #7fe3d4; }
#chatch button[data-ch=guild].on { color: #9fe07f; }
#chat[data-ch=global] #say { box-shadow: inset 2px 0 0 #9ad0ff; }
#chat[data-ch=group] #say { box-shadow: inset 2px 0 0 #7fe3d4; }
#chat[data-ch=guild] #say { box-shadow: inset 2px 0 0 #9fe07f; }
#log .pt { color: #7fe3d4; }
#log .cl { color: #9fe07f; }
#say { border-top-left-radius: 0; }

/* clã: progresso do nível, fatos e ranking */
.gl-xp { display: grid; gap: 4px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel2); }
.gl-xp-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; font-size: 12px; }
.gl-xp-top span { color: var(--muted); }
.gl-xp-top span b { color: var(--accent); }
.gl-xp .bar.xp { height: 8px; }
.gl-xp .bar.xp i { background: linear-gradient(#c9a0ff, #8a5cf0); }
.gl-xp small { color: var(--muted); font-size: 11px; }
.gl-xp small b { color: var(--good); }
.gl-facts { display: grid; gap: 4px; width: 100%; margin: 6px 0 0; }
.gl-facts div { display: flex; justify-content: space-between; gap: 6px; font-size: 11px; }
.gl-facts dt { color: var(--muted); }
.gl-facts dd { margin: 0; font-weight: 700; }
.gl-table.rank .gl-row { grid-template-columns: 40px 38px minmax(0, 1fr) 70px 80px 100px; }
.medal { font-style: normal; font-weight: 800; color: var(--muted); text-align: center; }
.medal.m0 { color: #ffd84a; } .medal.m1 { color: #d6dde8; } .medal.m2 { color: #d48a4a; }

/* painel admin: bichos fora do spawn */
.nat-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.nat-chip { display: inline-flex; align-items: center; gap: 2px; padding: 0 2px 0 4px; border: 1px solid #7a2a2a; border-radius: 99px; background: #2a1418; font-size: 12px; }
.nat-chip img.mi { width: 28px; height: 21px; margin: 0; }
.nat-chip button { padding: 0 6px; }

/* clã: meta de contribuição */
.q-sum { margin: 0; color: var(--muted); font-size: 12px; }
.q-ok { color: var(--good); }
.q-low { color: #ff8a8a; font-weight: 700; }

/* Depósito compacto: vagas fixas e caixas */
#boxp { gap: 4px; }
#boxp .boxgrid { gap: 3px; }
#boxp .boxgrid button, #boxp .slot { aspect-ratio: 1; min-width: 0; border-radius: 5px; }
#boxp .slot { border: 1px dashed #2a3446; background: #0b1018; }
#boxp .slot.drop { border-color: var(--accent); background: #ffcf4a14; }
#boxp .mball b { font-size: 9px; }
.boxpages { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; }
.boxpages button { width: 22px; height: 20px; padding: 0; font: 700 13px/1 var(--font-ui); }
.boxpages small { color: var(--muted); font: 600 10px var(--font-ui); }
#boxp .boxhint { margin: 0; font-size: 11px; }
#boxp .boxfree { padding: 4px; font-size: 11px; }

/* Depósito: abas Bichos/Itens e itens guardados */
.boxtabs { display: flex; gap: 3px; }
.boxtabs button { flex: 1; padding: 3px 6px; font: 600 11px/16px var(--font-ui); background: transparent; box-shadow: none; }
.boxtabs button.on { border-color: var(--accent); color: var(--accent); background: #ffcf4a14; }
.boxtabs small { color: var(--muted); font-weight: 400; }
#boxp .bitem { position: relative; padding: 2px; display: grid; place-items: center; background: var(--panel2); cursor: grab; }
#boxp .bitem img.px { width: 26px; height: 26px; }
#boxp .bitem b { position: absolute; right: 2px; bottom: 0; font-size: 9px; text-shadow: 0 1px 0 #000, 0 0 2px #000; }
#boxp .bitem.locked { opacity: .45; cursor: not-allowed; }

/* Arena ranqueada e rankings: mesma moldura da janela de duelo */
.competitive { display: grid; gap: 10px; }
.competitive p { margin: 0; line-height: 1.45; }
.competitive h3 { margin: 4px 0 0; font: 600 14px/1.2 var(--font-display); color: #ead9b2; }
.competitive [hidden] { display: none !important; }
.competitive-nav, .competitive-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.competitive-filters { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; }
.competitive-filters label { display: grid; gap: 4px; flex: 1 1 110px; color: var(--muted); font-size: 12px; }
.competitive-filters input, .competitive-filters select { width: 100%; min-height: 34px; box-sizing: border-box; }
em.pc { flex: none; padding: 1px 7px; border: 1px solid #c9a04a88; border-radius: 99px; background: #2a1f0c; color: #ffd76a; font: 700 12px/1.5 var(--font-display); font-style: normal; white-space: nowrap; }
.arena-status { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel2); }
.arena-rating { display: grid; text-align: center; min-width: 70px; }
.arena-rating small { color: var(--muted); font-size: 11px; }
.arena-rating b { color: var(--accent); font: 700 26px/1 var(--font-display); }
.arena-season { display: grid; gap: 2px; flex: 1 1 160px; }
.arena-season small { color: #aeb8c8; font-size: 12px; }
.arena-season .bar { height: 5px; margin-top: 2px; }
.arena-flag { padding: 3px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; }
.arena-flag.wait { background: #1d3550; color: #9fd0ff; animation: emblemGlow 2.6s ease-in-out infinite; }
.arena-flag.live { background: #4a1d14; color: #ffb59a; }
.arena-flag.off { background: #3a2a2a; color: #e6a0a0; }
.arena-pets { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px; margin: 0; padding: 8px; border: 1px solid var(--line); border-radius: var(--r); }
.arena-pets legend { padding: 0 4px; color: #ead9b2; font-weight: 600; }
.arena-pet { display: flex; align-items: center; gap: 8px; padding: 4px 8px 4px 4px; border: 1px solid var(--line); border-left: 3px solid var(--c); border-radius: 4px; background: #121820; cursor: pointer; }
.arena-pet:has(input:checked) { border-color: var(--accent); background: #2a2112; box-shadow: 0 0 0 1px var(--accent) inset; }
.arena-pet:has(input:disabled) { opacity: .6; cursor: default; }
.arena-pet input { position: absolute; opacity: 0; pointer-events: none; }
.arena-pet:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.arena-pet img.mi { width: 40px; height: 40px; object-fit: contain; flex: none; }
.arena-pet span { display: grid; flex: 1; min-width: 0; }
.arena-pet span b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.arena-pet small { color: var(--muted); font-size: 11px; }
.arena-rules summary { cursor: pointer; color: #c5cedb; }
.arena-rules p { margin-top: 6px; color: #aeb8c8; font-size: 13px; }
.arena-history { display: grid; gap: 4px; }
.arena-match { display: flex; align-items: center; gap: 10px; padding: 5px 10px; border-left: 3px solid var(--line); border-radius: 3px; background: #121820; }
.arena-match > b { width: 62px; flex: none; }
.arena-match > span { display: grid; flex: 1; min-width: 0; }
.arena-match small { color: var(--muted); font-size: 11px; }
.arena-match em { font-style: normal; font-weight: 700; }
.arena-match.win { border-color: #4fbf6a; } .arena-match.win > b, .arena-match.win em { color: #7fe39a; }
.arena-match.loss { border-color: #d0573a; } .arena-match.loss > b, .arena-match.loss em { color: #ff9a80; }
.arena-match.draw > b { color: #c5cedb; }
.rank-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding: 4px; background: #0b1017; border: 1px solid var(--line); border-radius: 8px; }
.rank-tabs button { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 34px; border: 1px solid transparent; border-radius: 6px; background: none; color: var(--muted); }
.rank-tabs button svg { width: 15px; height: 15px; fill: currentColor; flex: none; }
.rank-tabs button.on { background: linear-gradient(#3a2c0e, #261c09); border-color: #c9a04a88; color: var(--accent); box-shadow: inset 0 1px 0 #ffd76a33; }
.rank-status { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 28px; }
.rank-me-btn { padding: 3px 10px; font-size: 12px; border-radius: 99px; border-color: var(--accent); color: var(--text); background: #2a2112; }
.rank-me-btn b { color: var(--accent); }
/* pódio: 2º, 1º, 3º; o 1º mais alto, com coroa */
.rank-podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; gap: 8px; margin: 6px 0 2px; padding: 0; list-style: none; }
.podium { --m: #c9d2de; --g: #6d7a8c33; position: relative; display: grid; justify-items: center; gap: 3px; min-width: 0; padding: 26px 8px 0; text-align: center; background: linear-gradient(180deg, var(--g), #121820 70%); border: 1px solid color-mix(in srgb, var(--m) 45%, transparent); border-bottom: 0; border-radius: 10px 10px 0 0; }
.podium.p1 { --m: #ffcf4a; --g: #ffcf4a33; padding-top: 34px; }
.podium.p3 { --m: #d98a4a; --g: #d98a4a2e; }
.podium.me { box-shadow: 0 0 0 2px var(--accent); }
.rank-medal { position: absolute; top: -18px; left: 50%; width: 30px; height: 39px; transform: translateX(-50%); filter: drop-shadow(0 2px 2px #000a); }
.podium.p1 .rank-medal { top: -12px; width: 36px; height: 47px; }
.rank-crown { position: absolute; top: -30px; left: 50%; width: 30px; transform: translateX(-50%); filter: drop-shadow(0 0 6px #ffcf4a88); }
.podium.p1 { margin-top: 18px; }
.podium-pic { width: 64px; height: 64px; object-fit: contain; image-rendering: pixelated; filter: drop-shadow(0 3px 0 #0007); }
.podium.p1 .podium-pic { width: 84px; height: 84px; }
.podium-av .duel-av { width: 52px; height: 52px; font-size: 22px; }
.podium.p1 .podium-av .duel-av { width: 64px; height: 64px; font-size: 28px; }
.podium > b { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 600 14px/1.2 var(--font-display); }
.podium.p1 > b { font-size: 16px; color: #ffe69a; }
.podium > small { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 11px; }
.podium em.pc { margin-top: 2px; }
.podium-base { justify-self: stretch; margin: 8px -8px 0; padding: 6px 0; font: 700 18px/1 var(--font-display); color: #10161f; background: linear-gradient(var(--m), color-mix(in srgb, var(--m) 55%, #000)); border-radius: 0; text-shadow: 0 1px 0 #fff6; }
.podium.p1 .podium-base { padding: 12px 0; font-size: 22px; }
.podium.p2 .podium-base { padding: 8px 0; }
/* emblema da arena */
.rank-tier { flex: none; padding: 1px 8px; border-radius: 4px; font: 700 10px/16px var(--font-ui); font-style: normal; letter-spacing: .04em; text-transform: uppercase; border: 1px solid; }
.rank-tier.competidor { color: #9fb4cf; border-color: #4a5d78; background: #16202e; }
.rank-tier.veterano { color: #7ee0c8; border-color: #2f8f78; background: #10261f; }
.rank-tier.mestre { color: #ffd76a; border-color: #c9a04a; background: linear-gradient(#3a2c0e, #241a08); box-shadow: 0 0 8px #ffcf4a44; }
.rank-team { display: flex; flex: none; }
.rank-team img.mi { width: 26px; height: 22px; margin: 0 -3px 0 0; }
.podium .rank-team { flex-wrap: wrap; justify-content: center; gap: 2px; }
.podium .rank-team img.mi { width: 34px; height: 28px; margin: 0; }
/* demais posições: barra atrás da linha mostra a força em relação ao 1º */
.rank-list { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.rank-row { position: relative; display: flex; align-items: center; gap: 10px; padding: 5px 10px 5px 6px; border: 1px solid var(--line); border-radius: 6px; background: #121820; overflow: hidden; }
.rank-row::before { content: ''; position: absolute; inset: 0 auto 0 0; width: var(--w, 0%); background: linear-gradient(90deg, #ffcf4a14, #ffcf4a05); pointer-events: none; }
.rank-row > * { position: relative; }
.rank-row img.mi { width: 40px; height: 30px; flex: none; margin: 0; }
.rank-row > span:not(.rank-pos, .rank-team) { display: grid; flex: 1; min-width: 0; }
.rank-row b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-row small { color: var(--muted); font-size: 11px; }
.rank-pos { display: grid; place-items: center; width: 28px; height: 28px; flex: none; color: var(--muted); font: 700 13px/1 var(--font-display); background: #0b1017; border: 1px solid var(--line); border-radius: 50%; }
.rank-row.me { border-color: var(--accent); background: #1d1a10; }
.rank-row.me .rank-pos { color: var(--accent); border-color: var(--accent); }
:is(.rank-row, .podium).flash { animation: rankFlash 1.2s ease-out; }
@keyframes rankFlash { 0%, 40% { box-shadow: 0 0 0 2px var(--accent), 0 0 18px #ffcf4a88; } }
@media (prefers-reduced-motion: reduce) { :is(.rank-row, .podium).flash { animation: none; } }

/* ---------- Mercado (painel arrastável): filtros | cartões e itens | últimas vendas ---------- */
/* largos deixam folga para a coluna de zoom (+/−) à direita, que fica por cima dos painéis */
#side [data-panel="group"] { width: min(820px, calc(100vw - 112px)); }
#side [data-panel="guild"] { width: min(900px, calc(100vw - 112px)); }
#side [data-panel="market"] { width: min(1000px, calc(100vw - 112px)); }
#side section.wide { container-type: inline-size; }

/* ---------- Personagem: boneco no meio, slots em volta (arrastar da mochila) ---------- */
#side [data-panel="char"] { width: min(440px, calc(100vw - 112px)); }
#side [data-panel="char"] h3 { justify-content: center; text-transform: uppercase; letter-spacing: .04em; }
.char-name { color: var(--accent); margin-left: 4px; text-transform: none; }
.char { padding: 4px 2px 2px; }
.char-grid { display: grid; grid-template-columns: 1fr 1.15fr 1fr; grid-template-rows: auto repeat(3, auto); gap: 8px; align-items: stretch; }
.gslot { display: grid; grid-template-rows: auto 1fr auto; justify-items: center; gap: 3px; min-height: 92px; padding: 5px 4px 6px; background: linear-gradient(#18212f, #10161f); border: 1px solid var(--line2); border-radius: var(--r); }
.gslot b { font: 600 12px/1.1 var(--font-display); color: var(--text); }
.gslot .gpic { position: relative; display: grid; place-items: center; width: 46px; height: 46px; background: #0b1017; border: 1px solid var(--line); border-radius: var(--r); }
.gslot .gpic img { width: 34px; height: 34px; image-rendering: pixelated; }
.gslot .gpic i { position: absolute; right: -6px; bottom: -6px; padding: 0 3px; font: 700 10px/14px var(--font-ui); font-style: normal; color: #10161f; background: var(--accent); border-radius: 4px; }
.gslot small { font-size: 11px; color: var(--muted); text-align: center; }
.gslot.full small { color: var(--good); }
.gslot.drop-ok { border-color: var(--good); box-shadow: 0 0 0 2px #7cf29a55, 0 0 14px #7cf29a66; }
.gslot.drop-bad { border-color: var(--bad); box-shadow: 0 0 0 2px #ff707055, 0 0 14px #ff707066; }
#bag.drop { outline: 2px dashed var(--accent); outline-offset: 2px; }
.char-doll { grid-row: 2 / 5; grid-column: 2; display: grid; justify-items: center; align-content: center; gap: 6px; }
.doll-stage { position: relative; display: grid; place-items: end center; width: 100%; min-height: 214px; padding-bottom: 14px; cursor: grab; touch-action: pan-y; user-select: none; background: radial-gradient(closest-side, #ffcf4a1f, transparent) center 40% / 100% 80% no-repeat; }
.doll-stage:active { cursor: grabbing; }
/* sombra no chão embaixo dos pés */
.doll-stage::after { content: ''; position: absolute; bottom: 8px; left: 50%; width: 92px; height: 16px; transform: translateX(-50%); background: radial-gradient(closest-side, #000a, transparent); }
.doll-stage img { position: relative; z-index: 1; max-width: 100%; object-fit: contain; image-rendering: pixelated; filter: drop-shadow(0 0 1px #000) drop-shadow(0 2px 0 #0008); }
.doll-turn { position: absolute; z-index: 2; bottom: 0; width: 28px; height: 28px; padding: 0; font: 700 18px/1 var(--font-ui); border-radius: 50%; }
.doll-turn[data-turn="-1"] { left: 2px; }
.doll-turn[data-turn="1"] { right: 2px; }
.char-doll > b { font: 600 15px/1 var(--font-display); }
.char-gender { display: flex; gap: 6px; }
.char-gender button { width: 30px; height: 26px; padding: 0; font-size: 16px; }
.char-gender button[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.char-sum { margin: 10px 0 0; padding: 7px 9px; background: #0b1017; border: 1px solid var(--line); border-radius: var(--r); font-size: 12px; text-align: center; color: var(--muted); }
.char-sum b { color: var(--text); }
#side section.wide .party, #side section.wide .guild { min-height: 0; }
.mk { display: grid; gap: 8px; }
.mk-top { flex-wrap: wrap; }
.mk-title { flex: 1 1 220px; }
#mkQ { flex: 1 1 260px; min-width: 0; }
.mk-wallet { display: flex; gap: 10px; align-items: center; white-space: nowrap; color: #aeb8c8; }
.mk-wallet b { color: var(--accent); font-family: var(--font-display); }
.mk-grid { display: grid; grid-template-columns: 200px minmax(0, 1fr) 230px; gap: 10px; min-height: 0; }
.mk-grid.two { grid-template-columns: minmax(0, 1fr) 230px; }
.mk-filters, .mk-side { position: sticky; top: 0; align-self: start; }
.mk-filters, .mk-box, .mk-form { padding: 8px 10px; border: 1px solid var(--bronze-dark); border-top-color: var(--bronze); border-radius: 4px; background: linear-gradient(#141b26, #0f151e); box-shadow: inset 0 1px 0 #e4bd7630; }
.mk-filters summary { cursor: pointer; font: 600 14px/1.6 var(--font-display); color: var(--accent); }
.mk-filters fieldset { margin: 0 0 6px; padding: 4px 0 6px; border: 0; border-bottom: 1px solid var(--line); }
.mk-filters legend { padding: 0; color: #d6b77a; font: 600 13px/1.6 var(--font-display); letter-spacing: .03em; }
.mk-filters .acheck { min-height: 26px; }
.mk-range { display: flex; gap: 4px; align-items: center; }
.mk-range input { width: 100%; min-width: 0; }
.mk-filters > .btn-ghost { width: 100%; margin-top: 6px; }
.mk-main h3, .mk-side h3, .mk-pick h3, .mk-form h3 { margin: 4px 0 6px !important; }
.mk-count { margin: 0 0 2px; font-size: 12px; }
.mk-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: 8px; margin-bottom: 10px; }
.mk-card { --rc: var(--bronze); position: relative; display: grid; justify-items: center; gap: 3px; padding: 8px 8px 10px; text-align: center; border: 1px solid var(--rc); border-radius: 6px; background: radial-gradient(90% 60% at 50% 32%, color-mix(in srgb, var(--rc) 30%, transparent), transparent 70%), linear-gradient(#1a2230, #0d121a); box-shadow: inset 0 1px 0 #ffffff14, 0 3px 10px #0006; }
.mk-card.r1 { --rc: #5aa9ff; } .mk-card.r2 { --rc: #c27bff; } .mk-card.r3 { --rc: #ffcf4a; }
.mk-card h4 { margin: 0; padding: 0 22px; font: 700 15px/1.2 var(--font-display); color: #f3e3bf; }
.mk-card .rtxt { font-size: 12px; min-height: 16px; }
.mk-card .rtxt.r0 { color: var(--muted); font-weight: 400; }
.mk-pic { position: relative; display: grid; place-items: center; width: 120px; height: 96px; }
.mk-pic img { width: 120px; height: 96px; object-fit: contain; image-rendering: pixelated; filter: drop-shadow(0 4px 6px #000a); }
.mk-stats { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; margin: 0; }
.mk-stats div { display: grid; }
.mk-stats dt { color: var(--muted); font-size: 11px; }
.mk-stats dd { margin: 0; font: 700 15px/1.2 var(--font-display); }
.mk-price { margin: 2px 0 0 !important; }
.mk-coin { white-space: nowrap; color: #c9d2df; }
.mk-coin b { font: 700 15px/1.2 var(--font-display); color: var(--accent); }
.mk-coin.c1 b { color: #8fe3ff; }
.mk-card small { font-size: 11px; }
.mk-card > button:last-child { width: 100%; margin-top: 4px; }
.mk-ok { animation: mkPulse 1s ease-in-out infinite; }
@keyframes mkPulse { 50% { box-shadow: 0 0 0 3px #ffcf4a55; } }
.mk-fav { position: absolute; top: 4px; right: 4px; padding: 0 6px; color: #d6b77a; font-size: 16px; line-height: 1.4; }
.mk-fav[aria-pressed=true] { color: var(--accent); }
.mk-items { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.mk-item { position: relative; display: flex; align-items: center; gap: 8px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 4px; background: #111823; }
.mk-item .mk-fav { position: static; }
.mk-item > span:not(.mk-coin) { display: grid; flex: 1; min-width: 0; }
.mk-item img.mi { width: 48px; height: 36px; margin: -4px -6px; }
.mk-recent { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.mk-recent li { display: flex; align-items: center; gap: 6px; padding: 3px 0; border-bottom: 1px solid var(--line); }
.mk-recent li > span:not(.mk-coin) { display: grid; flex: 1; min-width: 0; font-size: 12px; }
.mk-recent img.mi { width: 40px; height: 30px; margin: -4px -6px; }
.mk-recent .mk-coin b { font-size: 13px; }
.mk-side { display: grid; align-content: start; gap: 8px; }
.mk-rules { margin: 0 0 6px; padding-left: 16px; }
.mk-rules li.off { color: var(--bad); }
.mk-sell { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 10px; min-height: 0; overflow: auto; }
.mk-pick h4 { margin: 6px 0 4px; color: #d6b77a; font: 600 13px/1.2 var(--font-display); }
.mk-pets { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 4px; }
.mk-pet { display: flex; align-items: center; gap: 6px; padding: 4px 8px; text-align: left; }
.mk-pet span { display: grid; min-width: 0; }
.mk-pet small { color: var(--muted); font-size: 11px; }
.mk-pet img.mi { width: 48px; height: 36px; margin: -4px -6px; }
.mk-pet.on { border-color: var(--accent); background: linear-gradient(#3a2c0e, #1a1408); }
.mk-form { display: grid; align-content: start; gap: 8px; position: sticky; top: 0; }
.mk-preview { display: grid; justify-items: center; gap: 2px; text-align: center; }
.mk-big { width: 110px; height: 88px; object-fit: contain; image-rendering: pixelated; }
.mk-net { margin: 0 !important; min-height: 20px; }
@media (prefers-reduced-motion: reduce) { .mk-ok { animation: none; } }
.mk button:disabled { opacity: .45; filter: grayscale(.7); cursor: not-allowed; }
/* painel estreito (arrastado/encolhido ou gaveta do celular): colunas viram uma */
@container (max-width: 900px) {
  .mk-grid { grid-template-columns: 180px minmax(0, 1fr); }
  .mk-grid > .mk-side { grid-column: 1 / -1; position: static; }
  .mk-grid.two { grid-template-columns: minmax(0, 1fr); }
}
@container (max-width: 640px) {
  .mk-grid, .mk-sell { grid-template-columns: minmax(0, 1fr); }
  .mk-filters, .mk-form { position: static; }
  .mk-cards { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .mk-form { order: -1; }
  .mk-wallet { width: 100%; justify-content: space-between; }
}
@container (min-width: 641px) { .mk-filters summary { display: none; } }
#side [data-panel="rankings"] { width: min(640px, calc(100vw - 112px)); }
/* ✕ sempre no canto direito do título; ⠿ (arrastar) ou ? (dica) ficam logo antes dele */
#side > section > h3:has(> .pclose)::after { order: 1; margin-left: auto; }
#side > section > h3 > .pclose { order: 2; margin-left: 4px; }
/* celular: sem ⠿ (não arrasta); o ✕ é que vai para o canto */
@media (max-width: 820px), (pointer: coarse) and (max-height: 520px) {
  #side > section > h3:has(> .pclose)::after { margin-left: 6px; }
  #side > section > h3 > .pclose { margin-left: auto; }
}

/* editor de mapa (admin): barra de ferramentas, paleta com miniaturas da arte do jogo */
[data-panel="mapedit"] { width: 316px; }
.mapedit { display: grid; gap: 8px; }
.mapedit svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.me-live { margin: 0; font-size: 11px; color: #9fb3d1; display: flex; align-items: center; gap: 6px; }
.me-live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #7cf29a; box-shadow: 0 0 6px #7cf29a; }
.me-bar { display: flex; gap: 2px; padding: 3px; border-radius: 10px; background: rgba(8, 12, 19, .55); border: 1px solid var(--line); }
.me-tool { width: 31px; height: 31px; padding: 0; display: grid; place-items: center; border-radius: 8px; background: transparent; border-color: transparent; color: #c9d6ea; }
.me-tool[aria-pressed="true"] { background: linear-gradient(#ffcf4a, #e8a92a); color: #2a1a00; border-color: #ffe08a; box-shadow: 0 2px 8px #ffcf4a44; }
.me-tool:disabled { opacity: .35; }
.me-sep { flex: 1; }
.me-size { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; padding: 2px; border-radius: 8px; background: rgba(8, 12, 19, .55); border: 1px solid var(--line); }
.me-size button { border: 0; background: transparent; font-size: 11px; padding: 4px 0; border-radius: 6px; }
.me-size button[aria-checked="true"] { background: #2c3a56; color: var(--accent); }
.me-cur { display: flex; gap: 10px; align-items: center; padding: 6px; border-radius: 10px; background: linear-gradient(135deg, rgba(255, 207, 74, .12), rgba(20, 27, 38, .2)); border: 1px solid #ffcf4a55; }
.me-cur img { width: 56px; height: 56px; border-radius: 8px; image-rendering: pixelated; background: #0b0f16; box-shadow: inset 0 0 0 1px #ffffff22; }
.me-cur div { display: grid; line-height: 1.25; }
.me-cur small { color: #9fb3d1; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.me-recent { display: flex; gap: 4px; min-height: 0; flex-wrap: wrap; }
.me-recent:empty { display: none; }
.me-mini { width: 32px; height: 32px; padding: 0; border-radius: 7px; overflow: hidden; }
.me-mini img { width: 100%; height: 100%; image-rendering: pixelated; display: block; }
.me-tabs { display: flex; gap: 4px; align-items: center; }
.me-tabs button { border-radius: 999px; padding: 3px 10px; font-size: 12px; }
.me-tabs button[aria-selected="true"] { border-color: var(--accent); color: var(--accent); }
.me-tabs input { flex: 1; min-width: 0; padding: 4px 8px; border-radius: 999px; font-size: 12px; }
.me-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; max-height: 260px; overflow: auto; padding: 2px; }
.me-cell { display: grid; gap: 3px; justify-items: center; padding: 4px 2px; border-radius: 9px; font-size: 10px; line-height: 1.1; text-align: center; background: rgba(8, 12, 19, .45); transition: transform .08s, border-color .08s; }
.me-cell:hover { transform: translateY(-1px); }
.me-cell img, .me-keep { width: 52px; height: 52px; border-radius: 7px; image-rendering: pixelated; background: repeating-conic-gradient(#1b2433 0 25%, #141b26 0 50%) 0 0 / 12px 12px; }
.me-keep { display: grid; place-items: center; color: #9fb3d1; }
.me-keep svg { width: 26px; height: 26px; }
.me-cell.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 4px 12px #ffcf4a33; color: var(--accent); }
.me-status { margin: 0; font-size: 11px; color: #9fb3d1; min-height: 1.3em; font-variant-numeric: tabular-nums; }
body.mapediting #ov { cursor: crosshair !important; }

/* ---------- aviso lateral de convite de party ---------- */
#invites { position: fixed; top: calc(var(--tk, 0px) + 150px); right: max(12px, env(safe-area-inset-right)); z-index: 7; display: grid; gap: 8px; width: min(290px, calc(100vw - 24px)); pointer-events: none; }
.inv-card { position: relative; display: grid; gap: 8px; padding: 10px 12px 12px; overflow: hidden; pointer-events: auto; background: linear-gradient(#1d2840f2, #121a28f2); border: 1px solid var(--accent); border-radius: var(--r-lg); box-shadow: 0 0 0 1px #000, 0 10px 30px #000a, 0 0 18px #ffcf4a33; animation: invIn .25s ease-out; }
.inv-card header { display: flex; align-items: center; gap: 6px; font: 600 12px/1 var(--font-display); letter-spacing: .04em; text-transform: uppercase; color: var(--accent); }
.inv-card header svg { width: 14px; height: 14px; fill: currentColor; }
.inv-who { display: flex; align-items: center; gap: 10px; }
.inv-who .face { flex: none; }
.inv-who p { margin: 0; font-size: 13px; line-height: 1.35; color: #d6deea; }
.inv-who b { color: var(--text); font-family: var(--font-display); }
.inv-who small { display: block; color: var(--muted); font-size: 11px; }
.inv-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.inv-acts button { min-height: 32px; }
.inv-x { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; padding: 0; font-size: 12px; background: none; border: 0; color: var(--muted); }
.inv-time { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--accent); transform-origin: left; animation: invTime linear forwards; }
@keyframes invIn { from { transform: translateX(24px); opacity: 0; } }
@keyframes invTime { to { transform: scaleX(0); } }
@media (max-width: 820px) { #invites { top: 58px; right: 8px; } }
@media (prefers-reduced-motion: reduce) { .inv-card { animation: none; } }

/* ---------- troca entre jogadores: mesa de troca (você × outro), mochila embaixo ---------- */
.trade { display: grid; grid-template-rows: auto auto minmax(96px, 1fr) auto; gap: 10px; min-height: 100%; }
/* os dois treinadores frente a frente */
.tr-vs { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 10px; }
.tr-who { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 8px 12px; background: linear-gradient(90deg, #1b2538, #121a27); border: 1px solid var(--line2); border-radius: var(--r-lg); }
.tr-who:not(.me) { flex-direction: row-reverse; text-align: right; background: linear-gradient(270deg, #1b2538, #121a27); }
.tr-who .duel-av { flex: none; width: 38px; height: 38px; font-size: 17px; }
.tr-who > span { display: grid; min-width: 0; flex: 1; }
.tr-who b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 600 15px/1.2 var(--font-display); color: var(--text); }
.tr-who small { color: var(--muted); font-size: 11px; }
.tr-flag { flex: none; padding: 2px 9px; border-radius: 99px; font: 600 11px/18px var(--font-ui); font-style: normal; color: var(--muted); background: #0b1017; border: 1px solid var(--line); }
.tr-who.ok { border-color: #3f9a5c; box-shadow: 0 0 14px #7cf29a26; }
.tr-who.ok .tr-flag { color: #0f2416; background: var(--good); border-color: var(--good); }
.tr-swap { display: grid; place-items: center; width: 42px; height: 42px; font: 700 22px/1 var(--font-ui); color: #10161f; background: radial-gradient(circle at 35% 30%, #fff3b0, #ffcf4a 55%, #b9780a); border-radius: 50%; box-shadow: 0 0 0 3px #2a2112, 0 0 18px #ffcf4a55; }
/* as duas mesas */
.tr-boards { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.tr-board { position: relative; display: grid; gap: 8px; padding: 10px; background: repeating-linear-gradient(45deg, #ffffff03 0 6px, transparent 6px 12px), linear-gradient(#172133, #111823); border: 1px solid var(--line2); border-radius: var(--r-lg); transition: border-color .2s, box-shadow .2s; }
.tr-board h4, .tr-bag h4 { display: flex; align-items: baseline; gap: 8px; margin: 0; font: 600 14px/1.2 var(--font-display); color: #ead9b2; }
.tr-board h4 small, .tr-bag h4 small { font: 400 11px/1.2 var(--font-ui); color: var(--muted); }
.tr-bag h4 small b { color: var(--accent); }
.tr-board.ok { border-color: var(--good); box-shadow: inset 0 0 0 1px #7cf29a44, 0 0 18px #7cf29a1f; }
.tr-board.mine.drop, .tr-bag.drop { outline: 2px dashed var(--accent); outline-offset: 2px; }
.tr-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.tr-slot { position: relative; display: grid; justify-items: center; align-content: start; gap: 2px; min-width: 0; height: 92px; padding: 6px 3px 4px; background: radial-gradient(circle at 50% 30%, #23314a, #0d131c 70%); border: 1px solid #3a4a66; border-radius: 8px; }
.tr-slot.empty { place-items: center; background: #0c121a; border: 1px dashed var(--line); }
.tr-slot.empty i { font: 400 20px/1 var(--font-ui); font-style: normal; color: #2f3c52; }
.tr-slot[draggable] { cursor: grab; }
.tr-slot img { width: 34px; height: 34px; image-rendering: pixelated; filter: drop-shadow(0 2px 0 #0008); }
.tr-slot small { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; color: #b9c4d6; }
.tr-slot em { padding: 0 7px; border-radius: 99px; font: 700 12px/18px var(--font-display); font-style: normal; color: #10161f; background: var(--accent); }
.tr-step { display: flex; align-items: center; gap: 2px; }
.tr-step button { width: 20px; height: 20px; padding: 0; font: 700 13px/1 var(--font-ui); border-radius: 5px; }
.tr-step b { min-width: 22px; text-align: center; font: 700 13px/1 var(--font-display); color: var(--text); }
.tr-del { position: absolute; top: 2px; right: 2px; width: 17px; height: 17px; padding: 0; font-size: 9px; line-height: 1; border-radius: 50%; background: #2a1414; border-color: #6b2b2b; color: #ff9a9a; opacity: 0; transition: opacity .15s; }
.tr-slot:hover .tr-del, .tr-del:focus-visible { opacity: 1; }
.tr-coin { flex: none; width: 18px; height: 18px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff3b0, #ffcf4a 50%, #a8670a); box-shadow: inset 0 0 0 2px #c98a1a, 0 1px 0 #000a; }
.tr-coins { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 7px 10px; background: #0b1017; border: 1px solid var(--line); border-radius: var(--r); }
.tr-coins input { width: 110px; min-height: 28px; }
.tr-coins button { min-height: 28px; padding: 2px 9px; font-size: 12px; }
.tr-coins b { color: var(--accent); font: 700 17px/1 var(--font-display); }
.tr-coins small { margin-left: auto; color: var(--muted); font-size: 11px; }
/* mochila: faixa de baixo */
.tr-bag { display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 8px; min-height: 0; padding: 10px; background: var(--panel2); border: 1px solid var(--line); border-radius: var(--r-lg); }
.tr-inv { display: grid; grid-template-columns: repeat(auto-fill, minmax(50px, 1fr)); align-content: start; gap: 6px; min-height: 0; overflow-y: auto; }
.tr-item { position: relative; display: grid; place-items: center; aspect-ratio: 1; padding: 0; background: #0b1017; border: 1px solid var(--line); border-radius: 8px; cursor: grab; transition: transform .1s, border-color .1s; }
.tr-item:hover { border-color: var(--accent); transform: translateY(-2px); }
.tr-item img { width: 32px; height: 32px; image-rendering: pixelated; }
.tr-item i { position: absolute; right: 4px; bottom: 2px; font: 700 11px/1 var(--font-ui); font-style: normal; color: var(--text); text-shadow: 0 1px 0 #000, 0 0 2px #000; }
/* rodapé: resumo do que sai e do que entra */
.tr-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; background: #0b1017; border: 1px solid var(--line); border-radius: var(--r-lg); }
.tr-sum { display: grid; gap: 3px; flex: 1 1 320px; min-width: 0; }
.tr-sum p { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; color: #d6deea; }
.tr-sum p span { display: inline-block; width: 86px; color: var(--muted); }
.tr-sum small { color: var(--muted); font-size: 11.5px; }
.tr-sum small b { color: var(--accent); }
.tr-accept { min-width: 180px; min-height: 40px; font-size: 15px; }
@media (max-width: 820px) {
  .tr-boards { grid-template-columns: minmax(0, 1fr); }
  .tr-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .tr-swap { width: 32px; height: 32px; font-size: 17px; }
  .tr-who .tr-flag { display: none; }
}

/* ---------- janelas soltas no PC: sem fundo escuro, o jogo continua clicável, arrasta pelo título ---------- */
@media not ((max-width: 820px) or ((pointer: coarse) and (max-height: 520px))) {
  #win { background: none; pointer-events: none; }
  #win .card { pointer-events: auto; box-shadow: 0 0 0 1px #000, 0 0 0 3px #2b3850, 0 0 0 4px #000, 0 24px 60px #000c; }
  #win .card > .row:first-child { cursor: move; user-select: none; touch-action: none; }
}

/* ---------- Profissão: escolha em cartões e oficina (nível, fila, receitas) ---------- */
.prof-pick { display: grid; gap: 10px; }
.prof-lead { margin: 0; color: #c3cddb; font-size: 13px; }
.prof-lead b { color: var(--accent); }
.prof-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.prof-card { display: grid; justify-items: start; gap: 5px; padding: 12px; text-align: left; background: linear-gradient(160deg, color-mix(in srgb, var(--c) 14%, #172031), #111823 70%); border: 1px solid color-mix(in srgb, var(--c) 35%, var(--line)); border-radius: var(--r-lg); transition: transform .12s, border-color .12s, box-shadow .12s; }
.prof-card:hover { transform: translateY(-2px); border-color: var(--c); }
.prof-card.on { border-color: var(--c); box-shadow: 0 0 0 2px color-mix(in srgb, var(--c) 45%, transparent), 0 0 18px color-mix(in srgb, var(--c) 30%, transparent); }
.prof-card > b { font: 600 16px/1.1 var(--font-display); color: var(--c); }
.prof-card > small { font-size: 12px; line-height: 1.4; color: #c3cddb; }
.prof-ico { display: grid; place-items: center; flex: none; width: 36px; height: 36px; color: var(--c); background: color-mix(in srgb, var(--c) 16%, #0b1017); border: 1px solid color-mix(in srgb, var(--c) 40%, transparent); border-radius: 10px; }
.prof-ico svg { width: 19px; height: 19px; fill: currentColor; }
.prof-makes { display: flex; gap: 3px; margin-top: 2px; }
.prof-makes i { display: grid; place-items: center; width: 30px; height: 30px; background: #0b1017; border: 1px solid var(--line); border-radius: 7px; }
.prof-makes img, .prof-job img, .prof-rec-top img { image-rendering: pixelated; }
.prof-makes img { width: 24px; height: 24px; }
.prof-confirm { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; background: #2a2112; border: 1px solid #c9a04a88; border-radius: var(--r-lg); }
.prof-confirm span { flex: 1 1 160px; color: #ead9b2; }
.prof-confirm b { color: var(--accent); }
.prof-shop { display: grid; gap: 10px; }
.prof-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: linear-gradient(120deg, color-mix(in srgb, var(--c) 16%, #172031), #121a27 70%); border: 1px solid color-mix(in srgb, var(--c) 40%, var(--line)); border-radius: var(--r-lg); }
.prof-head > span:not(.prof-ico) { display: grid; gap: 3px; flex: 1; min-width: 0; }
.prof-head b { font: 600 17px/1.1 var(--font-display); color: var(--c); }
.prof-head small { color: var(--muted); font-size: 11px; }
.prof-lvbig { flex: none; font: 700 20px/1 var(--font-display); font-style: normal; color: var(--text); }
.prof-queue, .prof-h { margin: 0; }
.prof-queue { display: grid; gap: 6px; }
.prof-queue h4, .prof-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0; font: 600 14px/1.2 var(--font-display); color: #ead9b2; }
.prof-queue h4 button { min-height: 28px; padding: 2px 12px; font-size: 12px; }
.prof-job { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto auto; align-items: center; gap: 8px; padding: 6px 8px; background: #0b1017; border: 1px solid var(--line); border-radius: var(--r); }
.prof-job img { width: 32px; height: 32px; }
.prof-job > span { display: grid; gap: 4px; min-width: 0; }
.prof-job b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.prof-bar { display: block; height: 5px; background: #1a2230; border-radius: 3px; overflow: hidden; }
.prof-bar i { display: block; height: 100%; background: linear-gradient(90deg, color-mix(in srgb, var(--c) 60%, #000), var(--c)); transition: width 1s linear; }
.prof-left { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.prof-job.ready { border-color: var(--good); }
.prof-job.ready .prof-left { color: var(--good); font-weight: 700; }
.prof-speed { min-height: 26px; padding: 2px 9px; font-size: 11px; }
.prof-recs { display: grid; gap: 6px; }
.prof-rec { display: grid; gap: 7px; padding: 9px 10px; background: var(--panel2); border: 1px solid var(--line); border-radius: var(--r-lg); }
.prof-rec.locked { opacity: .55; }
.prof-rec-top { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.prof-rec-top img { width: 34px; height: 34px; }
.prof-rec-top span { display: grid; min-width: 0; }
.prof-rec-top b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 600 14px/1.2 var(--font-display); }
.prof-rec-top small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 11px; }
.prof-meta, .prof-lv { flex: none; font-size: 11px; font-style: normal; color: var(--muted); white-space: nowrap; }
.prof-lv { padding: 1px 8px; color: #ffd76a; background: #2a2112; border: 1px solid #c9a04a66; border-radius: 99px; font-weight: 700; }
.prof-ing { display: flex; flex-wrap: wrap; gap: 4px; }
.prof-ing span { display: flex; align-items: center; gap: 3px; padding: 2px 6px 2px 3px; background: #0b1017; border: 1px solid var(--line); border-radius: 99px; }
.prof-ing img { width: 20px; height: 20px; image-rendering: pixelated; }
.prof-ing b { font: 700 11px/1 var(--font-ui); }
.prof-ing .ok b { color: var(--good); }
.prof-ing .no { border-color: #6b2b2b; }
.prof-ing .no b { color: #ff8a8a; }
.prof-make { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.prof-make .btn-primary { min-height: 30px; padding: 3px 14px; }
@media (max-width: 420px) { .prof-cards { grid-template-columns: minmax(0, 1fr); } }

/* ---------- PvP: nome do bicho no aviso e Registro de PvP ---------- */
.feed-who { display: grid; line-height: 1.1; }
.feed-who small { color: #c3cddb; font-size: 11px; font-weight: 500; }
.feed .feed-dead { color: #eef2ff; }
.pvplog { display: grid; gap: 10px; }
.pvplog-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.pvplog-score { color: #c3cddb; font-size: 13px; }
.pvplog-score b { color: var(--accent); font-family: var(--font-display); }
.pvplog-list { display: grid; gap: 5px; max-height: min(52dvh, 440px); margin: 0; padding: 0 2px 0 0; overflow-y: auto; list-style: none; scrollbar-width: thin; }
.pvplog-list li { display: grid; grid-template-columns: 44px minmax(0, 1fr) 16px minmax(0, 1fr); align-items: center; gap: 6px; padding: 6px 8px; background: var(--panel2); border: 1px solid var(--line); border-left: 3px solid #ff8a6a; border-radius: var(--r); }
.pvplog-list li.mine { border-left-color: var(--accent); background: linear-gradient(90deg, #2a2112, var(--panel2) 60%); }
.pvplog-list li.lost { border-left-color: #ff5a5a; background: linear-gradient(90deg, #2a1414, var(--panel2) 60%); }
.pvplog-list time { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.pvplog-side { display: flex; align-items: center; gap: 4px; min-width: 0; }
.pvplog-side img.mi { width: 32px; height: 28px; margin: -3px 0; flex: none; }
.pvplog-side > span { display: grid; min-width: 0; line-height: 1.15; }
.pvplog-side b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.pvplog-side small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 11px; }
.pvplog-x { width: 14px; height: 14px; fill: #ff8a6a; }
.pvplog-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pvplog-foot small { color: var(--muted); font-size: 11px; }
/* Profissão: vagas de produção ao mesmo tempo */
.prof-slots { margin-left: 6px; padding: 1px 7px; border-radius: 99px; font: 700 11px/16px var(--font-ui); color: var(--text); background: #0b1017; border: 1px solid var(--line); }
.prof-slots.full { color: #10161f; background: var(--accent); border-color: var(--accent); }
.prof-full { margin: 0; padding: 6px 10px; font-size: 12px; color: #ead9b2; background: #2a2112; border: 1px solid #c9a04a66; border-radius: var(--r); }
