:root {
  --font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --bg: #0b1020; --panel: rgba(20, 26, 48, .72); --line: rgba(255, 255, 255, .12);
  --text: #eef1ff; --muted: #9aa3c7; --red: #ff4d5e; --red2: #ff7a59; --blue: #4da3ff; --green: #3ddc97; --gold: #ffcf5c;
  --r: 16px; --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); overflow: hidden;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
#game { position: fixed; inset: 0; }
#game canvas { display: block; }
kbd { font: 600 11px var(--font); padding: 2px 6px; border-radius: 6px; background: rgba(255,255,255,.14); }

.glass { background: var(--panel); border: 1px solid var(--line); backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%); box-shadow: 0 8px 30px rgba(0,0,0,.35); }

/* ---------- PokÃ©bola ---------- */
.ball { display: inline-block; width: 44px; height: 44px; border-radius: 50%; position: relative; flex: none;
  background: linear-gradient(#ff4d5e 0 46%, #1b1f33 46% 54%, #f4f6ff 54%); border: 3px solid #1b1f33; box-shadow: 0 4px 14px rgba(255,77,94,.5); }
.ball::after { content: ""; position: absolute; left: 50%; top: 50%; width: 30%; height: 30%; transform: translate(-50%, -50%);
  border-radius: 50%; background: #f4f6ff; border: 3px solid #1b1f33; }
.ball.sm { width: 20px; height: 20px; border-width: 2px; box-shadow: none; }
.ball.sm::after { border-width: 2px; }

/* ---------- Telas (login / offline) ---------- */
.screen { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 20px; overflow-x: hidden; overflow-y: auto;
  background: radial-gradient(1200px 700px at 20% 10%, #1d2a5c 0, transparent 60%), radial-gradient(900px 600px at 90% 90%, #4a1636 0, transparent 60%), var(--bg); }
.orb { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55; animation: float 14s ease-in-out infinite; pointer-events: none; }
.o1 { width: 320px; height: 320px; background: #ff4d5e; left: 8%; top: 12%; }
.o2 { width: 380px; height: 380px; background: #4da3ff; right: 6%; bottom: 8%; animation-delay: -5s; }
.o3 { width: 240px; height: 240px; background: #3ddc97; left: 50%; top: 60%; animation-delay: -9s; opacity: .3; }
@keyframes float { 50% { transform: translate(40px, -30px) scale(1.12); } }

.panel { position: relative; width: min(400px, 100%); padding: 28px; border-radius: 24px; background: var(--panel); border: 1px solid var(--line);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); box-shadow: 0 30px 80px rgba(0,0,0,.55); animation: rise .6s cubic-bezier(.2,.8,.2,1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(24px) scale(.97); } }
.auth { display: flex; flex-direction: column; gap: 14px; }
.logo { display: flex; align-items: center; gap: 14px; }
.logo .ball { animation: wobble 3.2s ease-in-out infinite; }
@keyframes wobble { 0%, 60%, 100% { transform: rotate(0); } 70% { transform: rotate(-16deg); } 80% { transform: rotate(14deg); } 90% { transform: rotate(-8deg); } }
h1 { margin: 0; font-size: 38px; letter-spacing: -1px; font-weight: 800; }
h1 span { background: linear-gradient(90deg, var(--red), var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tag { margin: 0 0 4px; color: var(--muted); font-size: 14px; line-height: 1.45; }

.tabs { position: relative; display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 12px; background: rgba(255,255,255,.06); }
.tab { position: relative; z-index: 1; border: 0; background: none; color: var(--muted); padding: 10px; font: 600 14px var(--font); cursor: pointer; transition: color .2s; }
.tab.active { color: #fff; }
.tab-ind { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: 9px; background: rgba(255,255,255,.12); transition: transform .3s cubic-bezier(.2,.8,.2,1); }
.tabs[data-mode="register"] .tab-ind { transform: translateX(100%); }

.field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.field input { padding: 13px 14px; border-radius: 12px; border: 1px solid var(--line); background: rgba(0,0,0,.28); color: var(--text); font: 500 16px var(--font); outline: none; transition: border-color .2s, box-shadow .2s; }
.field input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(77,163,255,.2); }
#err { min-height: 18px; color: #ff8a97; font-size: 13px; }

.btn { border: 0; cursor: pointer; padding: 14px 18px; border-radius: 12px; font: 700 15px var(--font); color: #fff; transition: transform .15s, filter .2s, box-shadow .2s; }
.btn.primary { background: linear-gradient(135deg, var(--red), var(--red2)); box-shadow: 0 10px 26px rgba(255,77,94,.4); }
.btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn:disabled { opacity: .6; cursor: wait; }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; z-index: 10; pointer-events: none; padding: calc(12px + var(--safe-t)) 12px calc(12px + var(--safe-b)); display: flex; flex-direction: column; justify-content: space-between; }
#hud > * { pointer-events: none; }
.hud-top, .hud-bottom { display: flex; gap: 10px; align-items: flex-start; }
.hud-top { flex-wrap: wrap; }
.hud-bottom { align-items: flex-end; justify-content: space-between; }
.chip { display: flex; align-items: center; gap: 8px; padding: 8px 14px 8px 8px; border-radius: 999px; font-size: 14px; }
.chip.plain { padding-left: 14px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: linear-gradient(135deg, var(--blue), #7c5cff); text-transform: uppercase; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.btn-icon { margin-left: auto; pointer-events: auto !important; cursor: pointer; color: var(--text); font: 600 14px var(--font); padding: 8px 12px; transition: transform .15s, background .2s; }
.btn-icon:hover { transform: translateY(-2px); background: rgba(40, 50, 90, .85); }

.minimap { position: relative; padding: 6px; border-radius: 16px; line-height: 0; }
.minimap canvas { width: 150px; height: 150px; border-radius: 11px; image-rendering: pixelated; }
.minimap span { position: absolute; left: 10px; bottom: 10px; line-height: 1; font-size: 11px; padding: 3px 7px; border-radius: 6px; background: rgba(0,0,0,.6); font-variant-numeric: tabular-nums; }
.hint { padding: 9px 16px; border-radius: 999px; font-size: 13px; color: var(--muted); }

/* Joystick (touch) */
.joy { position: absolute; right: calc(20px + env(safe-area-inset-right, 0px)); bottom: calc(24px + var(--safe-b)); width: 130px; height: 130px; border-radius: 50%;
  background: rgba(255,255,255,.08); border: 2px solid var(--line); backdrop-filter: blur(6px); pointer-events: auto !important; touch-action: none; }
.joy .knob { position: absolute; left: 50%; top: 50%; width: 56px; height: 56px; margin: -28px; border-radius: 50%; background: linear-gradient(135deg, #fff, #b9c3ff); box-shadow: 0 6px 16px rgba(0,0,0,.4); }

/* ---------- Drawer da Party ---------- */
.drawer { position: fixed; z-index: 20; top: 0; right: 0; bottom: 0; width: min(380px, 100%); padding: calc(18px + var(--safe-t)) 18px 18px; border-radius: 24px 0 0 24px;
  transform: translateX(105%); transition: transform .4s cubic-bezier(.2,.8,.2,1); display: flex; flex-direction: column; }
.drawer.open { transform: none; }
.drawer header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.drawer h2 { margin: 0; font-size: 22px; }
.close { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: rgba(255,255,255,.06); color: var(--text); cursor: pointer; font-size: 14px; }
.close:hover { background: rgba(255,255,255,.14); }
.list { overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding-bottom: 12px; }
.section-title { margin: 8px 2px 0; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.empty { color: var(--muted); text-align: center; padding: 30px 0; }

.mon { display: grid; grid-template-columns: 84px 1fr; gap: 12px; padding: 12px; border-radius: 16px; background: linear-gradient(135deg, rgba(255,255,255,.08), rgba(255,255,255,.03)); border: 1px solid var(--line); animation: rise .45s both; }
.mon .art { display: grid; place-items: center; border-radius: 12px; background: radial-gradient(circle at 50% 60%, rgba(77,163,255,.3), transparent 70%), rgba(0,0,0,.25); }
.mon img { width: 76px; height: 76px; image-rendering: pixelated; filter: drop-shadow(0 6px 6px rgba(0,0,0,.4)); }
.mon .top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.mon .name { font-weight: 700; text-transform: capitalize; }
.lv { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: rgba(255,207,92,.16); color: var(--gold); }
.stat { display: grid; grid-template-columns: 34px 1fr 28px; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); margin-top: 4px; }
.bar { height: 6px; border-radius: 6px; background: rgba(255,255,255,.1); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 6px; width: 0; transition: width .8s cubic-bezier(.2,.8,.2,1); }
.hp i { background: linear-gradient(90deg, #3ddc97, #8bf0c0); } .atk i { background: linear-gradient(90deg, #ff7a59, #ffb199); }
.def i { background: linear-gradient(90deg, #4da3ff, #9ccbff); } .xp i { background: linear-gradient(90deg, #a78bfa, #d0bfff); }
.stat b { color: var(--text); text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Toasts ---------- */
#toasts { position: fixed; z-index: 40; left: 50%; top: calc(64px + var(--safe-t)); transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { padding: 9px 16px; border-radius: 999px; font-size: 13px; background: var(--panel); border: 1px solid var(--line); backdrop-filter: blur(12px); animation: toast 3.2s both; }
@keyframes toast { 0% { opacity: 0; transform: translateY(-10px); } 10%, 85% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-6px); } }

/* ---------- Responsivo ---------- */
@media (max-width: 640px) {
  .hint { display: none; }
  .btn-icon kbd { display: none; }
  .minimap canvas { width: 110px; height: 110px; }
  .drawer { border-radius: 24px 24px 0 0; top: auto; height: 78vh; width: 100%; transform: translateY(105%); padding-top: 18px; }
  .drawer.open { transform: none; }
  h1 { font-size: 32px; }
  .panel { padding: 22px; }
}
@media (max-height: 480px) { .minimap { display: none; } .screen { place-items: start center; } }
@media (prefers-reduced-motion: reduce) { * { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* ---------- Batalha ---------- */
.battle { position: fixed; inset: 0; z-index: 35; display: flex; flex-direction: column; animation: battleIn .8s ease both;
  background: linear-gradient(#5fb4ff 0, #bfe6ff 46%, #6cc36f 46%, #3f9e4a 100%); }
@keyframes battleIn { 0% { clip-path: circle(0% at 50% 50%); filter: brightness(3); } 100% { clip-path: circle(150% at 50% 50%); filter: none; } }
.b-field { position: relative; flex: 1; min-height: 0; overflow: hidden; }
.platform { position: absolute; border-radius: 50%; background: radial-gradient(ellipse at center, rgba(0,0,0,.28), rgba(0,0,0,0) 70%); }
.foe-plat { right: 6%; top: calc(12% + clamp(96px, 24vmin, 210px) - 26px); width: min(46vw, 300px); height: 50px; }
.my-plat { left: 2%; bottom: 3%; width: min(56vw, 380px); height: 70px; }
.b-sprite { position: absolute; image-rendering: pixelated; filter: drop-shadow(0 8px 6px rgba(0,0,0,.35)); transition: transform .5s, opacity .5s; }
.foe-sprite { right: 12%; top: 12%; width: clamp(96px, 24vmin, 210px); animation: appear .7s .3s both, idle 2.6s 1s ease-in-out infinite; }
.my-sprite { left: 10%; bottom: 6%; width: clamp(120px, 32vmin, 280px); animation: appearL .7s .3s both, idle 2.6s 1s ease-in-out infinite; }
@keyframes appear { from { transform: translateX(80px); opacity: 0; } }
@keyframes appearL { from { transform: translateX(-80px); opacity: 0; } }
@keyframes idle { 50% { translate: 0 -6px; } }
.hit { animation: hit .45s !important; }
@keyframes hit { 0%, 100% { transform: none; opacity: 1; } 15% { transform: translateX(-10px); opacity: .3; } 30% { transform: translateX(10px); opacity: 1; } 45% { transform: translateX(-8px); opacity: .3; } 60% { transform: translateX(8px); opacity: 1; } }
.in-ball { transform: scale(.05); opacity: 0; }
.released { animation: appear .5s both; }

.b-card { position: absolute; width: min(280px, 60vw); padding: 10px 14px; border-radius: 14px; color: var(--text); }
.b-card.foe { left: 12px; top: calc(12px + var(--safe-t)); }
.b-card.mine { right: 12px; bottom: 12px; }
.b-name { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; text-transform: capitalize; }
.hpbar, .xpbar { height: 9px; border-radius: 9px; background: rgba(255,255,255,.14); overflow: hidden; }
.xpbar { height: 5px; margin-top: 6px; }
.hpbar i, .xpbar i { display: block; height: 100%; width: 100%; border-radius: 9px; transition: width .8s cubic-bezier(.2,.8,.2,1), background .4s; background: var(--green); }
.hpbar i[data-lvl="mid"] { background: var(--gold); } .hpbar i[data-lvl="low"] { background: var(--red); }
.xpbar i { background: linear-gradient(90deg, #a78bfa, #d0bfff); }
.hp-txt { font-size: 12px; color: var(--muted); text-align: right; margin-top: 4px; font-variant-numeric: tabular-nums; }

#ballFx { position: absolute; left: 24%; bottom: 26%; opacity: 0; z-index: 3; width: 34px; height: 34px; }
#ballFx.throw { animation: throwBall 1s ease-in both; }
@keyframes throwBall { 0% { opacity: 1; transform: translate(0, 0) rotate(0); } 60% { opacity: 1; transform: translate(45vw, -34vh) rotate(540deg); } 100% { opacity: 0; transform: translate(50vw, -30vh) rotate(720deg) scale(.6); } }

.b-panel { padding: 14px 16px calc(14px + var(--safe-b)); border-radius: 22px 22px 0 0; display: flex; flex-direction: column; gap: 12px; }
#bMsg { margin: 0; min-height: 44px; font-size: 17px; font-weight: 600; line-height: 1.35; }
.b-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.act { position: relative; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 14px 10px; border: 1px solid var(--line); border-radius: 14px; cursor: pointer;
  font: 700 15px var(--font); color: #fff; transition: transform .15s, filter .2s, opacity .2s; }
.act small { position: absolute; right: 8px; top: 5px; font-size: 10px; font-weight: 600; opacity: .7; }
.act em { font-style: normal; background: rgba(0,0,0,.3); padding: 1px 7px; border-radius: 999px; font-size: 12px; }
.act:hover:not(:disabled) { transform: translateY(-2px); filter: brightness(1.12); }
.act:disabled { opacity: .45; cursor: not-allowed; }
.a1 { background: linear-gradient(135deg, #ff4d5e, #ff7a59); } .a2 { background: linear-gradient(135deg, #ff9f43, #ffcf5c); color: #2b1d00; }
.a3 { background: linear-gradient(135deg, #3d8bff, #6fb4ff); } .a4 { background: linear-gradient(135deg, #4a5480, #6b76a8); }

/* Centro PokÃ©mon (rÃ³tulo no mapa Ã© desenhado pelo Phaser) */
@media (max-width: 640px) { .b-card { width: 56vw; padding: 8px 10px; } .foe-sprite { right: 6%; } .act { padding: 12px 6px; font-size: 14px; } }
@media (max-height: 520px) { .b-actions { grid-template-columns: repeat(4, 1fr); } #bMsg { min-height: 0; font-size: 14px; } .b-panel { gap: 8px; } }

.mon.fainted { filter: grayscale(.9); opacity: .7; }

.lv { white-space: nowrap; }

/* ---------- Raridade, bolsa e craft ---------- */
.btn-icon.nomargin { margin-left: 0; }
.rar { display: inline-block; font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; color: #fff; background: color-mix(in srgb, var(--rc, #7c86b3) 55%, transparent); border: 1px solid var(--rc, #7c86b3); }
.mon { border-left: 3px solid var(--rc, transparent); }
.mon .rar { margin: -2px 0 4px; }
.b-card .rar { margin-top: 6px; }
.ball.t-poke { background: linear-gradient(#ff4d5e 0 46%, #1b1f33 46% 54%, #f4f6ff 54%); }
.ball.t-great { background: linear-gradient(#3d8bff 0 46%, #1b1f33 46% 54%, #f4f6ff 54%); }
.ball.t-ultra { background: linear-gradient(#ffcf5c 0 46%, #1b1f33 46% 54%, #f4f6ff 54%); }
.ball.t-master { background: linear-gradient(#8f5cff 0 46%, #1b1f33 46% 54%, #f4f6ff 54%); box-shadow: 0 0 10px #8f5cff; }
.mats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mat { padding: 12px; border-radius: 14px; background: rgba(255,255,255,.06); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.mat b { font-size: 24px; } .mat span { font-size: 12px; color: var(--muted); }
.item { display: grid; grid-template-columns: 24px 1fr auto 34px; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,.05); border: 1px solid var(--line); }
.item small { display: block; font-size: 11px; color: var(--muted); }
.item em { font-style: normal; font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; }
.recipe { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,.05); border: 1px solid var(--line); }
.recipe .ball { vertical-align: middle; margin-right: 8px; }
.costs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.cost { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: rgba(61,220,151,.16); color: var(--green); }
.cost.short { background: rgba(255,77,94,.16); color: #ff8a97; }
.btn.small { padding: 9px 16px; font-size: 13px; background: linear-gradient(135deg, #3d8bff, #6fb4ff); }
.btn.small:disabled { opacity: .4; cursor: not-allowed; filter: none; transform: none; }
.hintline { font-size: 12px; color: var(--muted); margin: 4px 2px; }
.act.wide { grid-column: 1 / -1; }
.act.bl { background: rgba(255,255,255,.1); color: #fff; }
.act.bl .ball { flex: none; }
.evolving { animation: evolving 1.3s ease-in-out both !important; }
@keyframes evolving { 0%, 100% { filter: none; transform: scale(1); } 25%, 65% { filter: brightness(10) saturate(0); transform: scale(1.12); } 45%, 85% { filter: brightness(1.2); transform: scale(1.02); } }
.evolved { animation: evolved .8s cubic-bezier(.2,.9,.3,1.4) both !important; }
@keyframes evolved { from { transform: scale(1.4); filter: brightness(4); } to { transform: none; filter: none; } }
.item { grid-template-columns: 24px minmax(0, 1fr) auto auto; }
.item em { min-width: 26px; }
.item .rar { font-size: 9px; padding: 2px 6px; }

/* ---------- Tipos, grupo, boss, raid ---------- */
.tchip { display: inline-block; font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; color: #fff; background: var(--tc, #777); text-shadow: 0 1px 0 rgba(0,0,0,.35); }
.tags { display: flex; flex-wrap: wrap; gap: 4px; margin: -2px 0 6px; }
.b-card .tags { margin: 6px 0 0; }
#bActions .act[data-act=attack], #bActions .act[data-act=strong] { flex-wrap: wrap; row-gap: 2px; background: linear-gradient(135deg, var(--tc, #a8a878), color-mix(in srgb, var(--tc, #a8a878) 62%, #000)); color: #fff; }
.mvname { font-weight: 800; }
.efx { font-style: normal; font-size: 10px; font-weight: 800; padding: 2px 7px; border-radius: 999px; background: rgba(0,0,0,.4); }
.efx.up { background: #0f9d58; } .efx.down { background: #b3261e; } .efx.no { background: #444; }
.boss-chip { color: var(--text); }
.boss-chip.live { background: linear-gradient(135deg, #f0b400, #ff7a59); color: #2b1d00; font-weight: 800; animation: bossPulse 1.6s infinite; }
@keyframes bossPulse { 50% { box-shadow: 0 0 22px rgba(240,180,0,.8); } }
.toast.big { animation-duration: 6.2s; background: linear-gradient(135deg, #f0b400, #ff7a59); color: #2b1d00; font-weight: 800; }
.invite { position: fixed; z-index: 45; left: 50%; top: calc(70px + var(--safe-t)); transform: translateX(-50%); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; padding: 12px 16px; border-radius: 16px; max-width: 92vw; animation: rise .4s both; }
.btn.ghost { background: rgba(255,255,255,.12); }
.btn.danger { background: linear-gradient(135deg, #ff4d5e, #ff7a59); }
.gm { grid-template-columns: 32px 1fr; }
.avatar.sm { width: 28px; height: 28px; font-size: 13px; }
.invite-form { display: flex; gap: 8px; }
.invite-form input { flex: 1; min-width: 0; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: rgba(0,0,0,.28); color: var(--text); font: 500 14px var(--font); outline: none; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { border: 1px solid var(--line); background: rgba(255,255,255,.08); color: var(--text); padding: 6px 12px; border-radius: 999px; cursor: pointer; font: 600 13px var(--font); }
.chips button:hover { background: rgba(255,255,255,.16); }

.foe-sprite.boss { width: clamp(130px, 34vmin, 270px); filter: drop-shadow(0 0 18px rgba(240,180,0,.85)) drop-shadow(0 8px 6px rgba(0,0,0,.35)); }
.foe-sprite.exhausted { filter: grayscale(.6) brightness(.85) drop-shadow(0 8px 6px rgba(0,0,0,.35)); }
.raidbar { position: absolute; z-index: 4; left: 12px; top: calc(96px + var(--safe-t)); display: flex; flex-direction: column; gap: 5px; width: min(200px, 44vw); }
.rm { padding: 5px 9px; border-radius: 10px; background: rgba(11,16,32,.72); border: 1px solid var(--line); font-size: 12px; color: var(--text); }
.rm.turn { border-color: var(--gold); box-shadow: 0 0 12px rgba(255,207,92,.5); }
.rm.out { opacity: .45; filter: grayscale(1); }
.rm i { display: block; height: 5px; border-radius: 5px; background: rgba(255,255,255,.14); margin-top: 4px; overflow: hidden; }
.rm u { display: block; height: 100%; background: var(--green); text-decoration: none; transition: width .6s; }
.turninfo { font-weight: 800; font-size: 13px; letter-spacing: .04em; padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,.1); align-self: flex-start; }
.turninfo.mine { background: linear-gradient(135deg, #f0b400, #ff7a59); color: #2b1d00; animation: bossPulse 1.2s infinite; }
@media (max-width: 640px) { .raidbar { top: calc(118px + var(--safe-t)); width: 40vw; } }

/* ---------- Trocar de PokÃ©mon e montar a equipe ---------- */
.act.a5 { background: linear-gradient(135deg, #7c5cff, #a78bfa); }
.switchpicker { display: flex; flex-direction: column; gap: 8px; }
.sw-title { font-weight: 800; font-size: 14px; }
.sw-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; max-height: 38vh; overflow-y: auto; }
.sw-item { position: relative; display: grid; grid-template-columns: 44px 1fr; gap: 8px; align-items: center; text-align: left; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.08); color: var(--text); cursor: pointer; font: 600 13px var(--font); }
.sw-item:hover:not(:disabled) { background: rgba(255,255,255,.16); transform: translateY(-1px); }
.sw-item:disabled { opacity: .4; cursor: not-allowed; }
.sw-item.active { border-color: var(--gold); }
.sw-item img { width: 44px; height: 44px; image-rendering: pixelated; }
.sw-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sw-info b { text-transform: capitalize; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sw-info small { color: var(--muted); font-size: 11px; display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.sw-info .tchip { font-size: 8px; padding: 1px 6px; }
.sw-info i { display: block; height: 5px; border-radius: 5px; background: rgba(255,255,255,.14); overflow: hidden; }
.sw-info u { display: block; height: 100%; background: var(--green); text-decoration: none; }
.sw-item em { position: absolute; right: 8px; top: 6px; font-style: normal; font-size: 10px; color: var(--muted); }
.sw-item kbd { position: absolute; right: 8px; bottom: 6px; font-size: 9px; }
@media (max-width: 640px) { .sw-list { grid-template-columns: 1fr; max-height: 30vh; } }

.party-hint { font-size: 12px; color: var(--muted); margin: 0 2px 4px; line-height: 1.4; }
.swap-banner { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; border-radius: 12px; background: rgba(255,207,92,.16); border: 1px solid var(--gold); font-size: 13px; }
.mon-actions { grid-column: 1 / -1; display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.mon-actions button { flex: 1; min-width: 64px; padding: 7px 10px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255,255,255,.08); color: var(--text); cursor: pointer; font: 700 12px var(--font); }
.mon-actions button:hover:not(:disabled) { background: rgba(255,255,255,.18); }
.mon-actions button:disabled { opacity: .35; cursor: not-allowed; }
.mon-actions button.primary { background: linear-gradient(135deg, #3d8bff, #6fb4ff); border: 0; }
.mon-actions button.warn { background: linear-gradient(135deg, #ff9f43, #ffcf5c); color: #2b1d00; border: 0; }
.mon .slotnum { position: absolute; top: 8px; right: 10px; font-size: 11px; font-weight: 800; color: var(--muted); }
.mon { position: relative; }

.list { overflow-x: hidden; }


/* ================= HUD mobile-first + Chat ================= */
#hudName { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip .lbl { display: none; }
.boss-chip { pointer-events: auto; cursor: pointer; color: var(--text); font: 700 13px var(--font); }

/* Botões flutuantes (celular): coluna no canto inferior direito, ao alcance do polegar */
.hud-actions { position: absolute; z-index: 11; right: 12px; bottom: calc(14px + var(--safe-b)); display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.fab { pointer-events: auto; position: relative; width: 52px; height: 52px; padding: 0; border-radius: 50%; display: grid; place-items: center; color: var(--text); cursor: pointer; font-size: 22px; transition: transform .15s, background .2s; }
.fab:active { transform: scale(.92); }
.fab .ic { display: grid; place-items: center; line-height: 1; }
.fab .lbl, .fab kbd { display: none; }
.badge { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--red); color: #fff; font: 800 11px/20px var(--font); text-align: center; font-style: normal; box-shadow: 0 2px 8px rgba(0,0,0,.4); }
.fab .ball.sm { width: 22px; height: 22px; }

/* Desktop: botões em pílulas no topo direito */
@media (min-width: 641px) {
  .hud-actions { top: calc(12px + var(--safe-t)); bottom: auto; right: 12px; flex-direction: row; }
  .fab { width: auto; height: auto; padding: 8px 14px; border-radius: 999px; display: flex; align-items: center; gap: 8px; font: 600 14px var(--font); }
  .fab:hover { transform: translateY(-2px); background: rgba(40, 50, 90, .85); }
  .fab .lbl, .fab kbd { display: inline; }
  .fab .ic { font-size: 16px; }
  .fab .ball.sm { width: 20px; height: 20px; }
  .chip .lbl { display: inline; }
  .badge { top: -6px; right: -4px; }
}
@media (max-width: 640px) {
  .hud-top { padding-right: 0; }
  .chip { padding: 6px 12px 6px 6px; font-size: 13px; }
  .chip.plain { padding-left: 10px; }
  .minimap canvas { width: 104px; height: 104px; }
  .minimap span { font-size: 10px; }
}
@media (max-width: 640px) and (max-height: 520px) { /* celular deitado: botões em linha para caber */
  .hud-actions { flex-direction: row; bottom: calc(10px + var(--safe-b)); right: calc(10px + env(safe-area-inset-right, 0px)); }
  .fab { width: 46px; height: 46px; }
}

/* ---------- Chat ---------- */
#chat { position: fixed; z-index: 26; display: none; flex-direction: column; overflow: hidden; }
#chat.open { display: flex; }
#chat.gone { display: none !important; }
#chat header { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.ctabs { display: flex; gap: 6px; flex: 1; min-width: 0; }
.ctab { position: relative; border: 0; background: rgba(255,255,255,.08); color: var(--muted); padding: 0 16px; min-height: 40px; border-radius: 999px; font: 700 13px var(--font); cursor: pointer; }
.ctab.active { background: var(--blue); color: #fff; }
.ctab[hidden] { display: none; }
.udot { position: absolute; top: 6px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
.cbtn { flex: none; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: rgba(255,255,255,.06); color: var(--text); cursor: pointer; font-size: 15px; }
.chat-log { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 12px; display: flex; flex-direction: column; gap: 5px; font-size: 14px; line-height: 1.4; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.chat-log:empty::before { content: 'Nenhuma mensagem ainda. Diga oi! 👋'; color: var(--muted); font-size: 13px; }
.cm { word-break: break-word; overflow-wrap: anywhere; }
.cm .t { color: var(--muted); font-size: 11px; margin-right: 6px; }
.cm b { margin-right: 6px; cursor: pointer; }
.cm.g .tag { color: var(--green); font-weight: 700; margin-right: 6px; }
.cm.w { color: #d9c9ff; }
.cm.me b { text-decoration: underline dotted; }
.chat-form { display: flex; gap: 8px; padding: 8px 10px calc(8px + var(--safe-b)); border-top: 1px solid var(--line); }
.chat-form input { flex: 1; min-width: 0; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(0,0,0,.28); color: var(--text); font: 500 16px var(--font); outline: none; }
.chat-form input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(77,163,255,.2); }
.chat-form .btn.small { min-height: 44px; }

@media (min-width: 641px) { /* desktop: painel fixo ao lado do minimapa */
  #chat { left: 200px; bottom: 12px; width: 360px; height: 250px; border-radius: 16px; }
  #chat.min { height: 58px; }
  #chat.min .chat-log, #chat.min .chat-form { display: none; }
  #chat .cclose { display: none; }
  .chat-form { padding-bottom: 8px; }
  .chat-form input { font-size: 14px; padding: 10px 12px; }
  .chat-form .btn.small { min-height: 0; }
}
@media (max-width: 640px) { /* celular: gaveta inferior */
  #chat { left: 0; right: 0; bottom: 0; height: min(64vh, 480px); border-radius: 22px 22px 0 0; }
  #chat #chatMin { display: none; }
}

/* Alvos de toque de pelo menos 44px nos controles principais do celular */
@media (max-width: 640px) {
  .close, .btn.small, .mon-actions button, .chips button, .sw-item, .act { min-height: 44px; }
  .drawer { padding-bottom: calc(18px + var(--safe-b)); }
}

/* Ajustes finos (mobile): alvo de toque do fechar e posição do número do slot */
.mon .slotnum { top: 6px; left: 8px; right: auto; padding: 1px 6px; border-radius: 6px; background: rgba(0,0,0,.6); color: #fff; z-index: 1; }
@media (max-width: 640px) { .close, .cbtn { min-width: 44px; min-height: 44px; } }
/* Desktop: a dica do rodapé não pode ficar atrás do chat (que ocupa a esquerda) */
@media (min-width: 641px) {
  .hint { margin-left: auto; max-width: calc(100vw - 620px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
@media (min-width: 641px) and (max-width: 1000px) { .hint { display: none; } }
/* ================= Painel de administração (mobile-first) ================= */
#admin { width: min(480px, 100%); }
.atabs { display: flex; gap: 6px; overflow-x: auto; padding: 0 0 10px; scrollbar-width: none; }
.atabs::-webkit-scrollbar { display: none; }
.atabs button { flex: 1 0 auto; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,.06); color: var(--muted); font: 700 13px var(--font); cursor: pointer; }
.atabs button.active { background: var(--blue); color: #fff; border-color: transparent; }
.af { width: 100%; min-width: 0; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(0,0,0,.28); color: var(--text); font: 500 16px var(--font); outline: none; }
.af:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(77,163,255,.2); }
select.af { appearance: auto; }
textarea.af { resize: vertical; }
.al { display: flex; flex-direction: column; gap: 4px; font-size: 11px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; flex: 1; min-width: 0; }
.arow2 { display: flex; gap: 8px; }
.arow2 > * { flex: 1; min-width: 0; }
#adminBody { gap: 10px; }
.arow { border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.05); overflow: hidden; }
.ahead { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; min-height: 48px; cursor: pointer; }
.ahead b { text-transform: none; }
.apos { margin-left: auto; font-size: 11px; color: var(--muted); }
.aacts { display: none; grid-template-columns: 1fr 1fr; gap: 8px; padding: 0 12px 12px; }
.arow.open .aacts { display: grid; }
.ab { min-height: 44px; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.08); color: var(--text); font: 700 13px var(--font); cursor: pointer; }
.ab:hover { background: rgba(255,255,255,.16); }
.ab.danger { background: rgba(255,77,94,.22); border-color: rgba(255,77,94,.5); }
.ab.ok { background: rgba(61,220,151,.2); border-color: rgba(61,220,151,.5); }
.aform { grid-column: 1 / -1; display: grid; gap: 8px; }
.ahint { grid-column: 1 / -1; font-size: 12px; color: var(--muted); }
.abadge { font-style: normal; font-size: 10px; font-weight: 800; padding: 2px 7px; border-radius: 999px; background: rgba(255,255,255,.14); }
.abadge.adm { background: var(--red); color: #fff; }
.abadge.bn { background: #7a1f2b; color: #fff; }
.abadge.off { color: var(--muted); }
.astats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.astats > div { padding: 10px; border-radius: 12px; background: rgba(255,255,255,.06); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.astats b { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.astats span { font-size: 11px; color: var(--muted); }
.alog { font-size: 12px; padding: 6px 2px; border-bottom: 1px solid var(--line); word-break: break-word; }
.alog span { color: var(--muted); }
.cm .adm { display: inline-block; background: var(--red); color: #fff; font-size: 9px; font-weight: 800; padding: 1px 5px; border-radius: 6px; margin-right: 5px; vertical-align: 1px; }
@media (max-width: 640px) { #admin { height: 88vh; } .astats { grid-template-columns: 1fr 1fr; } }

/* itens de listas rolaveis nao devem encolher (ex.: caixa de aviso do painel admin) */
.list > * { flex-shrink: 0; }

/* ---------- Arena: clã, PvP, ranking ---------- */
.ctag { color: var(--gold); font-weight: 800; margin-right: 4px; }
.cm.c .tag { color: var(--gold); font-weight: 700; margin-right: 6px; }
.cm.c { color: #ffe9b0; }
.modes { display: flex; gap: 6px; flex-wrap: wrap; }
.modes button { flex: 1 1 auto; min-height: 44px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.06); color: var(--muted); font: 700 13px var(--font); cursor: pointer; }
.modes button.active { background: linear-gradient(135deg, var(--red), var(--red2)); color: #fff; border-color: transparent; }
.plist { display: flex; flex-direction: column; gap: 8px; }
.item.pl { grid-template-columns: 28px minmax(0, 1fr) auto; }
.item.rk { grid-template-columns: 26px minmax(0, 1fr) auto; }
.item.rk > b { color: var(--gold); text-align: center; }
.item.cm-row { grid-template-columns: 12px minmax(0, 1fr) auto; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: #56607f; }
.dot.on { background: var(--green); box-shadow: 0 0 8px var(--green); }
.mact { display: flex; gap: 4px; }
.mact button { min-width: 40px; min-height: 40px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255,255,255,.08); cursor: pointer; font-size: 15px; }
.clanhead { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 17px; }
.clanhead span { font-size: 12px; color: var(--gold); font-weight: 700; }
.clanfoot { display: flex; gap: 8px; flex-wrap: wrap; }
.invite-form { flex-wrap: wrap; }
.list .btn.small { align-self: flex-start; }

/* batalha PvP */

.pv-top { position: absolute; z-index: 4; right: 12px; top: calc(12px + var(--safe-t)); display: flex; gap: 10px; align-items: center; font-weight: 800; font-size: 13px; padding: 6px 12px; border-radius: 999px; background: rgba(0,0,0,.35); color: #fff; }
.pv-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.pips { display: inline-flex; gap: 4px; }
.pips i { width: 10px; height: 10px; border-radius: 50%; background: var(--green); border: 1px solid rgba(255,255,255,.5); }
.pips i.ko { background: #55506b; }
.pv-duels { position: absolute; z-index: 4; left: 12px; top: calc(112px + var(--safe-t)); display: flex; flex-direction: column; gap: 4px; max-width: 54vw; }
.pv-duels span { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 8px; background: rgba(0,0,0,.4); color: #d5d9f2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv-duels span.me { outline: 1px solid var(--gold); color: #fff; }
.pv-duels span.done { opacity: .6; }
.pv-msg { margin: 0; min-height: 44px; font-size: 16px; font-weight: 600; line-height: 1.35; }
.pvres { text-align: center; padding: 10px; border-radius: 14px; background: rgba(255,255,255,.08); }
.pvres h3 { margin: 0 0 4px; font-size: 24px; }
.pvres p { margin: 4px 0; }
.pvres.win h3 { color: var(--gold); } .pvres.lose h3 { color: var(--red); }
#pvActions .act:not(.a1):not(.a2) { grid-column: auto; }
@media (max-width: 640px) { .pv-duels { top: calc(132px + var(--safe-t)); max-width: 48vw; } }
@media (max-height: 520px) { #pvActions { grid-template-columns: repeat(4, 1fr); } .pv-msg { min-height: 0; font-size: 14px; } }

/* menu ao tocar em outro jogador */
.pmenu { position: fixed; z-index: 30; min-width: 210px; max-width: calc(100vw - 16px); padding: 10px; border-radius: 16px; display: flex; flex-direction: column; gap: 6px; animation: rise .2s both; }
.pmenu[hidden] { display: none; }
.pm-name { font-weight: 800; padding: 2px 4px 4px; }
.pm-name small { color: var(--green); font-weight: 600; }
.pmenu button { min-height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.08); color: var(--text); font: 700 14px var(--font); text-align: left; cursor: pointer; }
.pmenu button:hover { background: rgba(255,255,255,.18); }
.pmenu button.ghost { color: var(--muted); text-align: center; }

/* ---------- Configurações e voz ---------- */
.profile-chip { border: 1px solid var(--line); color: var(--text); font-family: var(--font); cursor: pointer; pointer-events: auto; transition: transform .15s, background .2s; }
.profile-chip:hover { transform: translateY(-2px); background: rgba(40, 50, 90, .85); }
.profile-chip b { font-size: 14px; }
.profile-chip .gear { opacity: .7; font-size: 15px; margin-left: 2px; }
.voice-chip { pointer-events: auto; border: 1px solid var(--line); color: var(--text); font: 700 13px var(--font); cursor: pointer; padding: 8px 14px; min-height: 40px; }
.voice-chip[hidden] { display: none; }
.voice-chip:not(.muted) { border-color: var(--green); }
.voice-chip.muted { color: var(--red); border-color: var(--red); }
.setrow { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px; border-radius: 12px; background: rgba(255,255,255,.05); border: 1px solid var(--line); cursor: pointer; }
.setrow.col { flex-direction: column; align-items: stretch; }
.setrow small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.setrow input[type=range] { width: 100%; min-height: 32px; accent-color: var(--blue); }
.switch { appearance: none; -webkit-appearance: none; flex: none; width: 52px; height: 30px; border-radius: 999px; background: #4a5480; position: relative; cursor: pointer; transition: background .2s; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch:checked { background: var(--green); }
.switch:checked::after { transform: translateX(22px); }
.voipstat { font-size: 13px; padding: 8px 12px; border-radius: 10px; background: rgba(255,255,255,.06); color: var(--muted); }
.voipstat.on { color: var(--green); } .voipstat.wait { color: var(--gold); }
.item.vm { grid-template-columns: 28px minmax(0, 1fr) auto; }
.avatar.speaking { box-shadow: 0 0 0 3px var(--green), 0 0 12px var(--green); }

/* dentro do laboratório do Centro Pokémon */
.in-lab .hud-bottom { display: none; }

/* ---------- Efeitos de golpe e dano flutuante ---------- */
.fxc { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 6; }
.dmgpop { position: absolute; z-index: 7; transform: translate(-50%, 0); font: 900 26px var(--font); color: #fff; text-shadow: 0 2px 0 #0b1020, 0 0 8px rgba(0,0,0,.6); pointer-events: none; animation: dmgUp 1.1s ease-out forwards; }
.dmgpop.super { color: #ffb02e; font-size: 30px; }
.dmgpop.weak { color: #c5cbe6; font-size: 20px; }
.dmgpop.crit { color: #ffe14d; font-size: 36px; text-shadow: 0 2px 0 #b02338, 0 0 14px #ff5a28; }
@keyframes dmgUp { 0% { opacity: 0; transform: translate(-50%, 10px) scale(.6); } 15% { opacity: 1; transform: translate(-50%, -6px) scale(1.15); } 100% { opacity: 0; transform: translate(-50%, -54px) scale(1); } }

/* ---------- Cenários de batalha por bioma (o servidor diz onde a luta acontece) ---------- */
.battle::before, .battle::after { content: ''; position: absolute; left: 0; right: 0; pointer-events: none; z-index: 0; }
.battle::before { bottom: 54%; height: clamp(60px, 15vh, 130px); background-repeat: repeat-x; background-position: left bottom; background-size: auto 100%; }
.battle::after { top: 46%; bottom: 0; }
.battle > .b-field, .battle > .b-panel { position: relative; z-index: 1; }
.battle > .b-panel { z-index: 2; }

/* campo (padrão) */
.battle[data-biome="field"]::before { background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%20200%20100'%20preserveAspectRatio%3D'none'%3E%3Cpath%20d%3D'M0%20100V58Q50%2018%20100%2052T200%2046V100Z'%20fill%3D'%2357b35f'%2F%3E%3Cpath%20d%3D'M0%20100V80Q60%2048%20120%2076T200%2070V100Z'%20fill%3D'%234aa553'%2F%3E%3C%2Fsvg%3E"); }
.battle[data-biome="field"]::after { background: radial-gradient(ellipse at 20% 0, rgba(255,255,255,.18), transparent 50%); }

/* grama alta */
.battle[data-biome="meadow"] { background: linear-gradient(#63b6ff 0, #cbeaff 46%, #56b85c 46%, #2f8f45 100%); }
.battle[data-biome="meadow"]::before { background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%20200%20100'%20preserveAspectRatio%3D'none'%3E%3Cpath%20d%3D'M0%20100V62%20L3%2038%20L7%2062%20L13%2050%20L17%2062%20L23%2038%20L27%2062%20L33%2050%20L37%2062%20L43%2038%20L47%2062%20L53%2050%20L57%2062%20L63%2038%20L67%2062%20L73%2050%20L77%2062%20L83%2038%20L87%2062%20L93%2050%20L97%2062%20L103%2038%20L107%2062%20L113%2050%20L117%2062%20L123%2038%20L127%2062%20L133%2050%20L137%2062%20L143%2038%20L147%2062%20L153%2050%20L157%2062%20L163%2038%20L167%2062%20L173%2050%20L177%2062%20L183%2038%20L187%2062%20L193%2050%20L197%2062%20L200%2062V100Z'%20fill%3D'%232f8f45'%2F%3E%3Crect%20y%3D'84'%20width%3D'200'%20height%3D'16'%20fill%3D'%233aa352'%2F%3E%3C%2Fsvg%3E"); }
.battle[data-biome="meadow"]::after { background:
  radial-gradient(circle, #fff 0 2px, transparent 2.6px) 0 0 / 38px 26px,
  radial-gradient(circle, #ffd54a 0 2px, transparent 2.6px) 19px 13px / 46px 34px,
  radial-gradient(circle, #ff8fb8 0 2px, transparent 2.6px) 8px 20px / 57px 30px,
  repeating-linear-gradient(90deg, rgba(20,90,40,.16) 0 3px, transparent 3px 12px); }

/* floresta */
.battle[data-biome="forest"] { background: linear-gradient(#2a6b58 0, #8fcfa8 46%, #2f7a3c 46%, #1c4d29 100%); }
.battle[data-biome="forest"]::before { height: clamp(90px, 21vh, 180px); background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%20200%20100'%20preserveAspectRatio%3D'none'%3E%3Cpolygon%20points%3D'-6%2C100%2010%2C18%2026%2C100'%20fill%3D'%231d5a35'%2F%3E%3Cpolygon%20points%3D'22%2C100%2038%2C26%2054%2C100'%20fill%3D'%231d5a35'%2F%3E%3Cpolygon%20points%3D'50%2C100%2066%2C34%2082%2C100'%20fill%3D'%231d5a35'%2F%3E%3Cpolygon%20points%3D'78%2C100%2094%2C18%20110%2C100'%20fill%3D'%231d5a35'%2F%3E%3Cpolygon%20points%3D'106%2C100%20122%2C26%20138%2C100'%20fill%3D'%231d5a35'%2F%3E%3Cpolygon%20points%3D'134%2C100%20150%2C34%20166%2C100'%20fill%3D'%231d5a35'%2F%3E%3Cpolygon%20points%3D'162%2C100%20178%2C18%20194%2C100'%20fill%3D'%231d5a35'%2F%3E%3Cpolygon%20points%3D'190%2C100%20206%2C26%20222%2C100'%20fill%3D'%231d5a35'%2F%3E%3Cpolygon%20points%3D'2%2C100%2020%2C28%2038%2C100'%20fill%3D'%23123b25'%2F%3E%3Cpolygon%20points%3D'30%2C100%2048%2C16%2066%2C100'%20fill%3D'%23123b25'%2F%3E%3Cpolygon%20points%3D'58%2C100%2076%2C4%2094%2C100'%20fill%3D'%23123b25'%2F%3E%3Cpolygon%20points%3D'86%2C100%20104%2C22%20122%2C100'%20fill%3D'%23123b25'%2F%3E%3Cpolygon%20points%3D'114%2C100%20132%2C10%20150%2C100'%20fill%3D'%23123b25'%2F%3E%3Cpolygon%20points%3D'142%2C100%20160%2C28%20178%2C100'%20fill%3D'%23123b25'%2F%3E%3Cpolygon%20points%3D'170%2C100%20188%2C16%20206%2C100'%20fill%3D'%23123b25'%2F%3E%3Crect%20y%3D'92'%20width%3D'200'%20height%3D'8'%20fill%3D'%23123b25'%2F%3E%3C%2Fsvg%3E"); }
.battle[data-biome="forest"]::after { top: 0; background: repeating-linear-gradient(105deg, rgba(255,255,190,.11) 0 26px, transparent 26px 96px); mix-blend-mode: screen; animation: beams 9s ease-in-out infinite alternate; }
@keyframes beams { from { opacity: .55; } to { opacity: 1; } }

/* praia */
.battle[data-biome="beach"] { background: linear-gradient(#6cc7ff 0, #dff4ff 46%, #f3dda0 46%, #e2c078 100%); }
.battle[data-biome="beach"]::before { height: clamp(50px, 12vh, 100px); background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%20200%20100'%20preserveAspectRatio%3D'none'%3E%3Crect%20y%3D'38'%20width%3D'200'%20height%3D'62'%20fill%3D'%232f9fe0'%2F%3E%3Crect%20y%3D'38'%20width%3D'200'%20height%3D'8'%20fill%3D'%238fd8ff'%2F%3E%3Cpath%20d%3D'M0%2060Q12%2054%2025%2060T50%2060T75%2060T100%2060T125%2060T150%2060T175%2060T200%2060'%20fill%3D'none'%20stroke%3D'%23ffffff'%20stroke-opacity%3D'.55'%20stroke-width%3D'2'%2F%3E%3Cpath%20d%3D'M0%2078Q12%2072%2025%2078T50%2078T75%2078T100%2078T125%2078T150%2078T175%2078T200%2078'%20fill%3D'none'%20stroke%3D'%23ffffff'%20stroke-opacity%3D'.4'%20stroke-width%3D'2'%2F%3E%3Cpath%20d%3D'M0%2038Q40%2030%2080%2036T160%2034T200%2038V44H0Z'%20fill%3D'%237a6a48'%20opacity%3D'.0'%2F%3E%3C%2Fsvg%3E"); background-size: auto 100%; animation: waves 6s linear infinite; }
@keyframes waves { to { background-position: -200px bottom; } }
.battle[data-biome="beach"]::after { background: radial-gradient(circle, rgba(150,105,45,.35) 0 1px, transparent 1.6px) 0 0 / 14px 11px, radial-gradient(circle, rgba(255,255,255,.3) 0 1px, transparent 1.6px) 6px 5px / 19px 15px; }

/* lago (o chão é água) */
.battle[data-biome="lake"] { background: linear-gradient(#8fc7f2 0, #d8efff 46%, #2f86d0 46%, #14508f 100%); }
.battle[data-biome="lake"]::before { height: clamp(70px, 17vh, 140px); background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%20200%20100'%20preserveAspectRatio%3D'none'%3E%3Cpolygon%20points%3D'0%2C100%2030%2C30%2060%2C100'%20fill%3D'%237c93b8'%2F%3E%3Cpolygon%20points%3D'40%2C100%2085%2C14%20130%2C100'%20fill%3D'%236b83aa'%2F%3E%3Cpolygon%20points%3D'110%2C100%20150%2C34%20190%2C100'%20fill%3D'%237c93b8'%2F%3E%3Cpolygon%20points%3D'160%2C100%20190%2C52%20220%2C100'%20fill%3D'%236b83aa'%2F%3E%3Cpolygon%20points%3D'85%2C14%2076%2C34%2094%2C34'%20fill%3D'%23fff'%20opacity%3D'.85'%2F%3E%3Crect%20y%3D'90'%20width%3D'200'%20height%3D'10'%20fill%3D'%233f8fc7'%2F%3E%3C%2Fsvg%3E"); }
.battle[data-biome="lake"]::after { background: repeating-linear-gradient(180deg, rgba(255,255,255,.16) 0 2px, transparent 2px 15px); animation: shimmer 5s linear infinite; }
@keyframes shimmer { to { background-position: 0 15px; } }
.battle[data-biome="lake"] .platform { background: radial-gradient(ellipse at center, rgba(255,255,255,.35), rgba(255,255,255,0) 70%); }

/* praça do Centro Pokémon */
.battle[data-biome="town"] { background: linear-gradient(#7fc4ff 0, #d9efff 46%, #c9ccd8 46%, #9aa0b8 100%); }
.battle[data-biome="town"]::before { height: clamp(60px, 14vh, 120px); background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%20200%20100'%20preserveAspectRatio%3D'none'%3E%3Crect%20x%3D'4'%20y%3D'56'%20width%3D'34'%20height%3D'44'%20fill%3D'%23e9edf9'%2F%3E%3Crect%20x%3D'1'%20y%3D'48'%20width%3D'40'%20height%3D'10'%20fill%3D'%23e53950'%2F%3E%3Crect%20x%3D'9'%20y%3D'66'%20width%3D'7'%20height%3D'9'%20fill%3D'%238fd3ff'%2F%3E%3Crect%20x%3D'21'%20y%3D'66'%20width%3D'7'%20height%3D'9'%20fill%3D'%238fd3ff'%2F%3E%3Crect%20x%3D'44'%20y%3D'70'%20width%3D'42'%20height%3D'30'%20fill%3D'%23e9edf9'%2F%3E%3Crect%20x%3D'41'%20y%3D'62'%20width%3D'48'%20height%3D'10'%20fill%3D'%233d8bff'%2F%3E%3Crect%20x%3D'49'%20y%3D'80'%20width%3D'7'%20height%3D'9'%20fill%3D'%238fd3ff'%2F%3E%3Crect%20x%3D'61'%20y%3D'80'%20width%3D'7'%20height%3D'9'%20fill%3D'%238fd3ff'%2F%3E%3Crect%20x%3D'73'%20y%3D'80'%20width%3D'7'%20height%3D'9'%20fill%3D'%238fd3ff'%2F%3E%3Crect%20x%3D'92'%20y%3D'50'%20width%3D'30'%20height%3D'50'%20fill%3D'%23e9edf9'%2F%3E%3Crect%20x%3D'89'%20y%3D'42'%20width%3D'36'%20height%3D'10'%20fill%3D'%23e53950'%2F%3E%3Crect%20x%3D'97'%20y%3D'60'%20width%3D'7'%20height%3D'9'%20fill%3D'%238fd3ff'%2F%3E%3Crect%20x%3D'109'%20y%3D'60'%20width%3D'7'%20height%3D'9'%20fill%3D'%238fd3ff'%2F%3E%3Crect%20x%3D'128'%20y%3D'64'%20width%3D'38'%20height%3D'36'%20fill%3D'%23e9edf9'%2F%3E%3Crect%20x%3D'125'%20y%3D'56'%20width%3D'44'%20height%3D'10'%20fill%3D'%23ffb02e'%2F%3E%3Crect%20x%3D'133'%20y%3D'74'%20width%3D'7'%20height%3D'9'%20fill%3D'%238fd3ff'%2F%3E%3Crect%20x%3D'145'%20y%3D'74'%20width%3D'7'%20height%3D'9'%20fill%3D'%238fd3ff'%2F%3E%3Crect%20x%3D'157'%20y%3D'74'%20width%3D'7'%20height%3D'9'%20fill%3D'%238fd3ff'%2F%3E%3Crect%20x%3D'170'%20y%3D'54'%20width%3D'30'%20height%3D'46'%20fill%3D'%23e9edf9'%2F%3E%3Crect%20x%3D'167'%20y%3D'46'%20width%3D'36'%20height%3D'10'%20fill%3D'%236ecf8a'%2F%3E%3Crect%20x%3D'175'%20y%3D'64'%20width%3D'7'%20height%3D'9'%20fill%3D'%238fd3ff'%2F%3E%3Crect%20x%3D'187'%20y%3D'64'%20width%3D'7'%20height%3D'9'%20fill%3D'%238fd3ff'%2F%3E%3C%2Fsvg%3E"); }
.battle[data-biome="town"]::after { background: linear-gradient(rgba(0,0,0,.13) 1px, transparent 1px) 0 0 / 52px 30px, linear-gradient(90deg, rgba(0,0,0,.13) 1px, transparent 1px) 0 0 / 52px 30px; }

/* arena lendária (raid) */
.battle[data-biome="legend"] { background: linear-gradient(#150a2b 0, #5a1f4f 46%, #2b1418 46%, #120a0d 100%); }
.battle[data-biome="legend"]::before { height: clamp(70px, 17vh, 140px); background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%20200%20100'%20preserveAspectRatio%3D'none'%3E%3Cpolygon%20points%3D'0%2C100%2020%2C50%2040%2C74%2070%2C26%20100%2C70%20130%2C40%20160%2C78%20185%2C44%20200%2C100'%20fill%3D'%231a0d1f'%2F%3E%3Cpolygon%20points%3D'70%2C26%2062%2C44%2078%2C44'%20fill%3D'%23ff5a28'%20opacity%3D'.8'%2F%3E%3Cpolygon%20points%3D'130%2C40%20124%2C54%20136%2C54'%20fill%3D'%23ff8a3d'%20opacity%3D'.7'%2F%3E%3C%2Fsvg%3E"); }
.battle[data-biome="legend"]::after { top: 0; background: radial-gradient(ellipse at 30% 90%, rgba(255,90,40,.32), transparent 45%), radial-gradient(ellipse at 80% 100%, rgba(255,140,60,.25), transparent 40%); animation: storm 5s ease-in-out infinite; }
@keyframes storm { 0%, 88%, 100% { filter: none; } 90% { filter: brightness(2.2); } 93% { filter: brightness(1.2); } 95% { filter: brightness(2.6); } }
.battle[data-biome="legend"] .platform { background: radial-gradient(ellipse at center, rgba(255,90,40,.35), rgba(255,90,40,0) 70%); }
.battle.pvp:not([data-biome]) { background: linear-gradient(#3a2a6e 0, #7a5cc8 46%, #4a3b7a 46%, #2c2350 100%); }

/* ---------- Cenários dos mundos extras ---------- */
.battle[data-biome="snow"] { background: linear-gradient(#a5c9e8 0, #eef7ff 46%, #f2f8ff 46%, #cfe0f0 100%); }
.battle[data-biome="snow"]::before { height: clamp(80px, 19vh, 150px); background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%20200%20100'%20preserveAspectRatio%3D'none'%3E%3Cpolygon%20points%3D'-6%2C100%209%2C24%2024%2C100'%20fill%3D'%235f8fa6'%2F%3E%3Cpolygon%20points%3D'3%2C44%209%2C24%2015%2C44'%20fill%3D'%23ffffff'%2F%3E%3Cpolygon%20points%3D'20%2C100%2035%2C40%2050%2C100'%20fill%3D'%235f8fa6'%2F%3E%3Cpolygon%20points%3D'29%2C60%2035%2C40%2041%2C60'%20fill%3D'%23ffffff'%2F%3E%3Cpolygon%20points%3D'46%2C100%2061%2C32%2076%2C100'%20fill%3D'%235f8fa6'%2F%3E%3Cpolygon%20points%3D'55%2C52%2061%2C32%2067%2C52'%20fill%3D'%23ffffff'%2F%3E%3Cpolygon%20points%3D'72%2C100%2087%2C24%20102%2C100'%20fill%3D'%235f8fa6'%2F%3E%3Cpolygon%20points%3D'81%2C44%2087%2C24%2093%2C44'%20fill%3D'%23ffffff'%2F%3E%3Cpolygon%20points%3D'98%2C100%20113%2C40%20128%2C100'%20fill%3D'%235f8fa6'%2F%3E%3Cpolygon%20points%3D'107%2C60%20113%2C40%20119%2C60'%20fill%3D'%23ffffff'%2F%3E%3Cpolygon%20points%3D'124%2C100%20139%2C32%20154%2C100'%20fill%3D'%235f8fa6'%2F%3E%3Cpolygon%20points%3D'133%2C52%20139%2C32%20145%2C52'%20fill%3D'%23ffffff'%2F%3E%3Cpolygon%20points%3D'150%2C100%20165%2C24%20180%2C100'%20fill%3D'%235f8fa6'%2F%3E%3Cpolygon%20points%3D'159%2C44%20165%2C24%20171%2C44'%20fill%3D'%23ffffff'%2F%3E%3Cpolygon%20points%3D'176%2C100%20191%2C40%20206%2C100'%20fill%3D'%235f8fa6'%2F%3E%3Cpolygon%20points%3D'185%2C60%20191%2C40%20197%2C60'%20fill%3D'%23ffffff'%2F%3E%3Cpolygon%20points%3D'1%2C100%2018%2C26%2035%2C100'%20fill%3D'%233f6f86'%2F%3E%3Cpolygon%20points%3D'12%2C52%2018%2C26%2024%2C52'%20fill%3D'%23ffffff'%2F%3E%3Cpolygon%20points%3D'27%2C100%2044%2C32%2061%2C100'%20fill%3D'%233f6f86'%2F%3E%3Cpolygon%20points%3D'38%2C58%2044%2C32%2050%2C58'%20fill%3D'%23ffffff'%2F%3E%3Cpolygon%20points%3D'53%2C100%2070%2C8%2087%2C100'%20fill%3D'%233f6f86'%2F%3E%3Cpolygon%20points%3D'64%2C34%2070%2C8%2076%2C34'%20fill%3D'%23ffffff'%2F%3E%3Cpolygon%20points%3D'79%2C100%2096%2C14%20113%2C100'%20fill%3D'%233f6f86'%2F%3E%3Cpolygon%20points%3D'90%2C40%2096%2C14%20102%2C40'%20fill%3D'%23ffffff'%2F%3E%3Cpolygon%20points%3D'105%2C100%20122%2C20%20139%2C100'%20fill%3D'%233f6f86'%2F%3E%3Cpolygon%20points%3D'116%2C46%20122%2C20%20128%2C46'%20fill%3D'%23ffffff'%2F%3E%3Cpolygon%20points%3D'131%2C100%20148%2C26%20165%2C100'%20fill%3D'%233f6f86'%2F%3E%3Cpolygon%20points%3D'142%2C52%20148%2C26%20154%2C52'%20fill%3D'%23ffffff'%2F%3E%3Cpolygon%20points%3D'157%2C100%20174%2C32%20191%2C100'%20fill%3D'%233f6f86'%2F%3E%3Cpolygon%20points%3D'168%2C58%20174%2C32%20180%2C58'%20fill%3D'%23ffffff'%2F%3E%3Cpolygon%20points%3D'183%2C100%20200%2C8%20217%2C100'%20fill%3D'%233f6f86'%2F%3E%3Cpolygon%20points%3D'194%2C34%20200%2C8%20206%2C34'%20fill%3D'%23ffffff'%2F%3E%3Crect%20y%3D'94'%20width%3D'200'%20height%3D'6'%20fill%3D'%23e7f2fb'%2F%3E%3C%2Fsvg%3E"); }
.battle[data-biome="snow"]::after { top: 0; background:
  radial-gradient(circle, #fff 0 2px, transparent 2.6px) 0 0 / 46px 58px,
  radial-gradient(circle, rgba(255,255,255,.85) 0 1.6px, transparent 2.2px) 23px 29px / 61px 73px;
  animation: snowfall 7s linear infinite; }
@keyframes snowfall { to { background-position: 14px 58px, 8px 102px; } }
.battle[data-biome="snow"] .platform { background: radial-gradient(ellipse at center, rgba(90,120,160,.35), rgba(90,120,160,0) 70%); }

.battle[data-biome="volcano"] { background: linear-gradient(#2a0a12 0, #b23a1f 46%, #2a1416 46%, #0f0708 100%); }
.battle[data-biome="volcano"]::before { height: clamp(80px, 19vh, 150px); background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%20200%20100'%20preserveAspectRatio%3D'none'%3E%3Cpolygon%20points%3D'0%2C100%2024%2C58%2046%2C80%2090%2C14%20134%2C78%20160%2C50%20200%2C100'%20fill%3D'%23170a0c'%2F%3E%3Cpolygon%20points%3D'90%2C14%2078%2C42%20102%2C42'%20fill%3D'%23ff5a1f'%2F%3E%3Cpolygon%20points%3D'90%2C14%2084%2C30%2096%2C30'%20fill%3D'%23ffd27a'%2F%3E%3Cpath%20d%3D'M90%2042%20Q86%2070%2070%20100%20M90%2042%20Q96%2072%20110%20100'%20stroke%3D'%23ff7a28'%20stroke-width%3D'3'%20fill%3D'none'%20opacity%3D'.85'%2F%3E%3C%2Fsvg%3E"); }
.battle[data-biome="volcano"]::after { top: 0; background:
  radial-gradient(ellipse at 25% 100%, rgba(255,90,40,.35), transparent 45%),
  radial-gradient(ellipse at 80% 100%, rgba(255,140,60,.28), transparent 42%),
  radial-gradient(circle, rgba(255,170,80,.9) 0 1.5px, transparent 2.2px) 0 0 / 54px 70px;
  animation: embers 5s linear infinite; }
@keyframes embers { to { background-position: 0 0, 0 0, 10px -70px; } }
.battle[data-biome="volcano"] .platform { background: radial-gradient(ellipse at center, rgba(255,90,40,.4), rgba(255,90,40,0) 70%); }

/* chip do mundo atual no HUD */
#worldChip { font-weight: 700; white-space: nowrap; }

/* ---------- PC: a barra de cima (perfil, mundo, online...) nunca colide com os botões de ação ----------
   O JS mede a largura dos botões (--act-w) e a barra da esquerda quebra de linha no espaço que sobra.
   Em telas menores os botões perdem os atalhos e depois os rótulos (só ícones). */
@media (min-width: 641px) {
  .hud-top { max-width: calc(100% - var(--act-w, 0px) - 12px); }
}
@media (min-width: 641px) and (max-width: 1499px) { .fab kbd { display: none; } }
@media (min-width: 641px) and (max-width: 1099px) {
  .fab .lbl { display: none; }
  .fab { padding: 10px 13px; }
  .fab .ic { font-size: 18px; }
}

/* PC: as gavetas laterais começam abaixo da barra de botões, para os botões continuarem clicáveis com a gaveta aberta */
@media (min-width: 641px) {
  .drawer { top: calc(62px + var(--safe-t)); padding-top: 16px; }
}

/* PC: o painel de acoes da batalha fica centralizado e com largura confortavel (antes esticava pela tela toda) */
@media (min-width: 900px) {
  .battle > .b-panel { width: min(780px, 100%); align-self: center; }
}

/* Poder Lendário: botão dourado que brilha quando está pronto */
.a6 { background: linear-gradient(135deg, #f0b400, #ff7a59 55%, #b04cff); color: #fff; grid-column: 1 / -1; }
.act.legend { box-shadow: 0 0 0 2px rgba(255, 214, 90, .55), 0 0 18px rgba(240, 180, 0, .45); animation: legendGlow 1.6s ease-in-out infinite; }
.act.legend:disabled { animation: none; box-shadow: none; filter: grayscale(.5); }
.act.legend[hidden] { display: none; }
@keyframes legendGlow { 50% { box-shadow: 0 0 0 3px rgba(255, 230, 120, .9), 0 0 28px rgba(255, 190, 40, .8); } }

/* Fila de PvP */
.queue-chip { border: 1px solid var(--line); color: var(--text); font: 700 13px var(--font); cursor: pointer; pointer-events: auto; padding: 8px 14px; min-height: 40px; animation: pulseQ 1.6s ease-in-out infinite; }
.queue-chip[hidden] { display: none; }
@keyframes pulseQ { 50% { box-shadow: 0 0 0 3px rgba(77, 163, 255, .5); } }
.qbox { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 18px 12px; border-radius: 16px; background: rgba(77, 163, 255, .12); border: 1px solid rgba(77, 163, 255, .45); text-align: center; }
.qbox strong { font-size: 30px; font-variant-numeric: tabular-nums; }
.qbox small { color: var(--muted); font-size: 12px; }
.qspin { font-size: 30px; animation: qspin 1.4s linear infinite; display: inline-block; }
@keyframes qspin { to { transform: rotate(360deg); } }
.qinfo { font-size: 13px; color: var(--muted); }
.qinfo span { font-weight: 800; color: var(--text); font-size: 16px; }
#qJoin, #qCancel { width: 100%; min-height: 48px; }

/* ---------- Pokédex ---------- */
#dex { overflow: hidden; }
.dexstat { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.dexstat div { padding: 10px 6px; border-radius: 12px; background: rgba(255,255,255,.06); border: 1px solid var(--line); text-align: center; display: flex; flex-direction: column; }
.dexstat b { font-size: 22px; } .dexstat span { font-size: 11px; color: var(--muted); }
.dexbar { height: 8px; border-radius: 8px; background: rgba(255,255,255,.12); overflow: hidden; }
.dexbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--blue), var(--green)); border-radius: 8px; }
.dexsearch { width: 100%; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line); background: rgba(0,0,0,.28); color: var(--text); font: 500 var(--font-size, 15px) var(--font); outline: none; }
.dexgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.dexcard { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.06); color: var(--text); cursor: pointer; font: 600 12px var(--font); min-height: 44px; }
.dexcard:hover { background: rgba(255,255,255,.14); }
.dexcard img { width: 64px; height: 64px; image-rendering: pixelated; }
.dexcard small { color: var(--muted); font-size: 10px; }
.dexcard b { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; text-transform: capitalize; }
.dexcard.seen img { filter: brightness(0) opacity(.55); }
.dexcard.seen b { color: var(--muted); }
.dextabs button { flex: 1 1 0; }
#dexDetail { position: absolute; left: 0; right: 0; bottom: 0; top: 64px; z-index: 5; background: rgba(14, 19, 38, .98); padding: 14px 18px calc(18px + var(--safe-b)); overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
#dexDetail[hidden] { display: none; }
#dexDetail h3 { margin: 0; font-size: 22px; text-transform: capitalize; } #dexDetail h3 small { color: var(--muted); font-size: 14px; }
.dexhero { display: grid; place-items: center; padding: 10px; border-radius: 18px; background: radial-gradient(circle at 50% 60%, color-mix(in srgb, var(--rc, #4da3ff) 35%, transparent), transparent 70%), rgba(255,255,255,.05); border: 1px solid var(--line); }
.dexhero img { width: 150px; height: 150px; image-rendering: pixelated; filter: drop-shadow(0 8px 6px rgba(0,0,0,.4)); }
.dexhero.seen img { filter: brightness(0) opacity(.6); }
.dexchips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.dexdesc { margin: 0; line-height: 1.45; }
.dexinfo { padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,.05); border: 1px solid var(--line); font-size: 14px; line-height: 1.5; }
.dexinfo > b { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 4px; }
.dexinfo small { display: block; color: var(--muted); margin-top: 6px; }
.dexinfo .stat { display: grid; grid-template-columns: 56px 1fr 34px; gap: 8px; align-items: center; margin: 3px 0; font-size: 12px; }
.dexinfo .bar { height: 7px; border-radius: 7px; background: rgba(255,255,255,.12); overflow: hidden; } .dexinfo .bar i { display: block; height: 100%; background: var(--green); }
.graytxt { color: var(--muted); }

/* ---------- Modo História: marcador, diário, diálogo e dicas ---------- */
.quest-chip { border: 1px solid var(--line); color: var(--text); font: 700 13px var(--font); cursor: pointer; pointer-events: auto; padding: 8px 14px; min-height: 40px; max-width: min(340px, 100%); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; text-align: left; }
.quest-chip[hidden] { display: none; }
.chap { grid-template-columns: 24px minmax(0, 1fr) auto; } .chap.done { opacity: .75; } .chap.lock { opacity: .55; } .chap.now { border-color: var(--gold); }
.chap .chi { text-align: center; } .chap em { font-style: normal; font-size: 20px; }
.stepq { display: grid; grid-template-columns: 22px 1fr; gap: 8px; padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,.04); border: 1px solid transparent; }
.stepq.active { background: rgba(255, 207, 92, .1); border-color: rgba(255, 207, 92, .5); }
.stepq.done { opacity: .6; } .stepq small { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; line-height: 1.4; }
.stepq .cmp { color: var(--gold); font-weight: 700; }
.sbar { height: 7px; border-radius: 7px; background: rgba(255,255,255,.12); overflow: hidden; margin-top: 6px; } .sbar i { display: block; height: 100%; background: var(--gold); border-radius: 7px; }
.rewardq { padding: 10px 12px; border-radius: 12px; background: rgba(61, 220, 151, .1); border: 1px solid rgba(61, 220, 151, .4); font-size: 13px; }

.dialog { position: fixed; z-index: 60; left: 50%; bottom: calc(14px + var(--safe-b)); transform: translateX(-50%); width: min(640px, calc(100vw - 20px)); padding: 14px 16px 16px; border-radius: 20px; animation: rise .3s both; }
.dialog[hidden] { display: none; }
.dlg-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; } .dlg-face { font-size: 30px; }
#dlgText { margin: 0 0 12px; font-size: 16px; line-height: 1.5; min-height: 48px; }
.dlg-choices { display: flex; flex-wrap: wrap; gap: 8px; }
.dlg-choices .btn { min-height: 44px; display: inline-flex; align-items: center; gap: 6px; }
.dlg-choices .btn img { width: 34px; height: 34px; image-rendering: pixelated; margin: -4px 0; }

.tips-wrap { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 12px; background: rgba(5, 8, 18, .75); }
.tips-wrap[hidden] { display: none; }
.tips-card { width: min(440px, 100%); padding: 18px; border-radius: 22px; display: flex; flex-direction: column; gap: 10px; text-align: center; animation: rise .3s both; }
.tips-top { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 13px; }
.tips-icon { font-size: 54px; line-height: 1; } .tips-card h3 { margin: 0; font-size: 22px; } .tips-card p { margin: 0; line-height: 1.55; color: #dfe4ff; min-height: 96px; }
.tips-dots { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; } .tips-dots i { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.2); } .tips-dots i.on { background: var(--gold); }
.tips-nav { display: flex; gap: 10px; justify-content: space-between; } .tips-nav .btn { flex: 1; min-height: 46px; }

/* ===== Eventos: chip do HUD e overlay do quiz (Salão de Eventos) ===== */
.event-chip { border: 1px solid var(--line); color: var(--text); font: 700 13px var(--font); cursor: pointer; pointer-events: auto; padding: 8px 14px; min-height: 40px; max-width: min(340px, 100%); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; text-align: left; background: linear-gradient(90deg, rgba(176,124,255,.35), rgba(61,139,255,.3)); animation: pulseQ 1.6s ease-in-out infinite; }
.event-chip[hidden] { display: none; }
.quiz { position: fixed; z-index: 25; left: 8px; right: 8px; bottom: calc(8px + var(--safe-b, 0px)); max-height: 66vh; overflow-y: auto; padding: 14px 14px 12px; border-radius: 20px; animation: rise .3s both; }
.quiz[hidden] { display: none; }
.quiz.min #quizBody { display: none; }
.quiz.min { padding: 6px; max-height: none; left: auto; width: 56px; }
.quiz.min .quiz-hide { position: static; transform: rotate(180deg); }
.quiz-hide { position: absolute; top: 6px; right: 8px; width: 40px; height: 32px; border: 0; border-radius: 10px; background: rgba(255,255,255,.08); color: var(--text); font-size: 16px; cursor: pointer; }
.qz-top-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding-right: 44px; font-weight: 700; font-size: 13px; color: var(--muted); }
.qz-time { font-size: 16px; color: var(--text); } .qz-time.hot { color: #ff6b6b; }
.qz-bar { height: 8px; border-radius: 99px; background: rgba(255,255,255,.1); overflow: hidden; margin: 8px 0 10px; }
.qz-bar i { display: block; height: 100%; background: linear-gradient(90deg, #3ddc97, #ffd54a, #ff6b6b); transition: width .5s linear; }
.qz-q { margin: 4px 0 10px; font-size: 18px; line-height: 1.35; }
.qz-opts { display: grid; grid-template-columns: 1fr; gap: 8px; }
.qz-opt { display: flex; align-items: center; gap: 10px; min-height: 50px; padding: 8px 12px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255,255,255,.07); color: var(--text); font: 600 15px var(--font); text-align: left; cursor: pointer; }
.qz-opt b { flex: 0 0 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--blue); color: #fff; font-size: 13px; }
.qz-opt:disabled { cursor: default; opacity: .75; }
.qz-opt.sel { outline: 2px solid #ffd54a; background: rgba(255,213,74,.16); }
.qz-opt.right { background: rgba(61,220,151,.28); border-color: #3ddc97; } .qz-opt.right b { background: #3ddc97; color: #06281a; }
.qz-opt.wrong { background: rgba(255,107,107,.26); border-color: #ff6b6b; } .qz-opt.wrong b { background: #ff6b6b; }
.qz-opt.dim { opacity: .5; }
.qz-hint { margin: 8px 0 0; text-align: center; font-size: 13px; color: var(--muted); } .qz-hint.good { color: #3ddc97; font-weight: 700; font-size: 15px; } .qz-hint.bad { color: #ff8a8a; font-weight: 700; font-size: 15px; }
.qz-top { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 4px; }
.qz-top li { display: flex; gap: 10px; align-items: center; padding: 6px 10px; border-radius: 10px; background: rgba(255,255,255,.06); font-size: 14px; }
.qz-top li.me { background: rgba(61,139,255,.3); } .qz-top li span { width: 18px; color: var(--muted); } .qz-top li b { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .qz-top li em { font-style: normal; font-weight: 700; }
.qz-top.mini li { padding: 3px 10px; font-size: 12px; }
.qz-wait, .qz-end { text-align: center; padding: 6px 30px 4px 0; } .qz-wait h3, .qz-end h3 { margin: 4px 0; font-size: 20px; } .qz-wait p, .qz-end p { margin: 4px 0; color: var(--muted); line-height: 1.45; }
.qz-ico, .qz-medal { font-size: 44px; line-height: 1.1; } .qz-count { font-size: 34px; font-weight: 800; color: var(--text) !important; }
.qz-prize { margin: 8px 0 2px; padding: 8px 12px; border-radius: 12px; background: rgba(255,213,74,.16); border: 1px solid rgba(255,213,74,.5); font-weight: 700; font-size: 14px; }
@media (min-width: 641px) { .quiz { left: auto; right: 16px; width: clamp(400px, calc(100vw - 620px), 600px); bottom: 16px; max-height: 62vh; } .quiz.min { width: 56px; } }
@media (min-width: 1200px) { .qz-opts { grid-template-columns: 1fr 1fr; } }
@media (max-height: 520px) { .quiz { max-height: 78vh; } .qz-q { font-size: 15px; margin: 2px 0 6px; } .qz-opt { min-height: 40px; } }
.ev-now, .ev-type { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-radius: 14px; background: rgba(255,255,255,.06); border: 1px solid var(--line); margin-bottom: 8px; }
.ev-now { border-color: #b07cff; } .ev-type small { display: block; color: var(--muted); font-size: 12px; line-height: 1.4; margin-top: 2px; }
