* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; overflow: hidden; background: #0d1424; font-family: system-ui, "Segoe UI", Roboto, sans-serif; color: #eaf0ff; }
.hidden { display: none !important; }
.muted { color: #9fb0d0; font-size: 14px; }
.error { color: #ff8080; font-size: 14px; min-height: 18px; margin-top: 8px; }

#game { display: block; width: 100vw; height: 100vh; image-rendering: auto; background: #0a3a1f; touch-action: none; }

/* Overlays */
.overlay {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(1200px 600px at 50% -10%, #21345e, #0d1424); z-index: 20; padding: 16px;
}
.panel {
  width: 100%; max-width: 360px; background: #16223f; border: 1px solid #2c416f;
  border-radius: 16px; padding: 24px; box-shadow: 0 20px 60px rgba(0,0,0,.5); text-align: center;
}
.logo { font-size: 30px; font-weight: 800; letter-spacing: .5px; margin-bottom: 6px; }
.logo span { color: #ffcb05; }
.panel p { margin-bottom: 14px; }
.panel input {
  width: 100%; padding: 12px 14px; margin-top: 10px; border-radius: 10px;
  border: 1px solid #34507f; background: #0f1830; color: #fff; font-size: 16px;
}
.panel input:focus { outline: none; border-color: #ffcb05; }
.row { display: flex; gap: 10px; margin-top: 14px; }
button {
  flex: 1; padding: 12px 14px; border: none; border-radius: 10px; cursor: pointer;
  background: #3a6df0; color: #fff; font-size: 16px; font-weight: 600;
}
button:active { transform: translateY(1px); }
button.secondary { background: #2c416f; }

/* HUD */
#hud { position: relative; z-index: 15; }
#topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50; display: flex; justify-content: space-between;
  padding: 10px 14px; background: linear-gradient(#0d1424cc, #0d142400); pointer-events: none; font-weight: 600;
}
#onlineCount { font-weight: 500; }
.hud-status {
  display: flex; flex-direction: column; align-items: flex-end; gap: 2px;
  flex: 0 0 auto; min-width: 0; max-width: min(38vw, 220px); pointer-events: auto;
}
#mapLocation {
  font-size: 12px; font-weight: 700; color: #ffcb05;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
}

/* Chat */
#chat { position: fixed; left: 50%; transform: translateX(-50%); bottom: 10px; z-index: 10; width: min(42vw, 340px); }
#chatLog {
  max-height: 26vh; overflow-y: auto; display: flex; flex-direction: column; gap: 3px;
  font-size: 13px; margin-bottom: 6px; text-shadow: 0 1px 2px #000;
}
#chatLog .line { background: #0d1424aa; padding: 3px 8px; border-radius: 8px; width: fit-content; max-width: 100%; }
#chatLog .line b { color: #ffcb05; }
#chatLog .sys { color: #9fb0d0; font-style: italic; }
#chatForm { display: flex; gap: 6px; }
#chatInput { flex: 1; padding: 9px 10px; border-radius: 8px; border: 1px solid #34507f; background: #0f1830cc; color: #fff; font-size: 14px; }
#chatForm button { flex: 0 0 auto; padding: 9px 14px; font-size: 14px; }

/* Banner de área (nome do mapa) */
#areaBanner {
  position: fixed; top: 64px; left: 50%; transform: translateX(-50%); z-index: 12;
  background: #0d1424e0; border: 2px solid #ffcb05; color: #fff; font-weight: 700;
  padding: 8px 18px; border-radius: 10px; box-shadow: 0 6px 20px rgba(0,0,0,.5);
  transition: opacity .4s; font-size: 16px;
}

/* Caixa de diálogo */
#dialog {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 25;
  width: min(92vw, 680px); background: #0d1424f2; border: 3px solid #3a6df0;
  border-radius: 14px; padding: 16px 18px; box-shadow: 0 10px 40px rgba(0,0,0,.6); cursor: pointer;
}
#dialogText { font-size: 17px; line-height: 1.4; min-height: 48px; }
#dialogHint { text-align: right; color: #9fb0d0; font-size: 12px; margin-top: 6px; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .3; } }

/* Botão correr */
#btnRun {
  position: fixed; right: 16px; bottom: 196px; z-index: 11; flex: 0 0 auto;
  padding: 10px 14px; border-radius: 12px; font-size: 14px; font-weight: 700;
  background: #16223fcc; border: 1px solid #34507f; color: #cfe0ff;
}
#btnRun.on { background: #ffcb05; color: #1b2a4a; border-color: #ffcb05; }

/* Zoom da câmera */
.zoom-controls {
  position: fixed; right: 16px; bottom: 248px; z-index: 11;
  display: flex; align-items: center; gap: 6px;
  padding: 6px 8px; border-radius: 12px;
  background: #16223fcc; border: 1px solid #34507f;
}
.zoom-btn {
  width: 36px; height: 36px; padding: 0; border-radius: 10px;
  font-size: 20px; font-weight: 700; line-height: 1;
  background: #0f1830; border: 1px solid #34507f; color: #cfe0ff; cursor: pointer;
}
#zoomLbl { min-width: 34px; text-align: center; font-size: 13px; font-weight: 700; color: #ffcb05; }
.opt-zoom { margin-top: 16px; }
.opt-zoom > span:first-child { display: block; margin-bottom: 8px; }
.zoom-opt-row { display: flex; align-items: center; gap: 8px; }
.zoom-opt-row input[type=range] { flex: 1; accent-color: #ffcb05; }

/* D-pad (mobile) — esquerda */
#dpad { position: fixed; left: 16px; bottom: 16px; z-index: 40; width: 168px; height: 168px; }
#dpad button {
  position: absolute; width: 56px; height: 56px; border-radius: 14px; font-size: 22px;
  background: #16223fcc; border: 1px solid #34507f; color: #cfe0ff; touch-action: manipulation;
}
#dpad .up { top: 0; left: 56px; }
#dpad .left { top: 56px; left: 0; }
#dpad .right { top: 56px; left: 112px; }
#dpad .down { top: 112px; left: 56px; }

/* Botão A — direita (falar / confirmar diálogo / batalha) */
#btnA {
  position: fixed; right: 16px; bottom: 64px; z-index: 40;
  width: 72px; height: 72px; border-radius: 50%;
  font-size: 22px; font-weight: 800;
  background: #ffcb05cc; color: #1b2a4a; border: 2px solid #a08000;
  touch-action: manipulation; cursor: pointer;
}

/* Em telas com teclado (desktop), o d-pad é opcional; mantemos visível mas discreto */
@media (hover: hover) and (pointer: fine) {
  #dpad { opacity: .5; }
}

/* Sprite de Pokémon (GIF animado, exibido inteiro) */
.spr { display: inline-block; vertical-align: middle; }
.spr > img { display: block; width: 100%; height: 100%; object-fit: contain; image-rendering: auto; }

.topright { display: flex; align-items: center; gap: 10px; pointer-events: auto; }
button.mini { flex: 0 0 auto; padding: 6px 12px; font-size: 13px; background: #ffcb05; color: #1b2a4a; }

.avatar-panel { max-width: 720px; }
.avatar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 12px;
  max-height: 55vh;
  overflow-y: auto;
}
.avatar-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 8px;
  border-radius: 12px;
  border: 2px solid #34507f;
  background: #16223f;
  cursor: pointer;
  color: #eaf0ff;
  font-size: 13px;
  font-weight: 600;
}
.avatar-card img {
  width: 60px;
  height: 64px;
  object-fit: none;
  object-position: 0 0;
  image-rendering: auto;
}
.avatar-card.selected {
  border-color: #ffcb05;
  box-shadow: 0 0 0 2px rgba(255, 203, 5, 0.35);
  background: #1e3058;
}
.avatar-card:active { transform: translateY(1px); }

/* Party HUD */
#party { position: fixed; top: 44px; left: 10px; z-index: 9; display: flex; flex-direction: column; gap: 6px; }
.pmon { display: flex; align-items: center; gap: 6px; background: #0d1424bb; border: 1px solid #2c416f; border-radius: 10px; padding: 4px 8px 4px 4px; width: 170px; }
.pmon .spr { flex: 0 0 auto; }
.pmon.fainted { opacity: .5; }
.pinfo { flex: 1; min-width: 0; }
.pname { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pname .lv { color: #9fb0d0; font-weight: 400; }
.pbar { height: 6px; background: #22324f; border-radius: 4px; overflow: hidden; margin-top: 2px; }
.pbar > div { height: 100%; background: linear-gradient(#5fe06a, #2fae3a); }

/* Painel largo + cards do inicial */
.panel.wide { max-width: 640px; }
.panel.starter-panel { max-width: 920px; }
.startergroups { max-height: 62vh; overflow-y: auto; margin-top: 10px; padding-right: 4px; }
.startergen { margin-bottom: 16px; }
.startergen h3 { margin: 0 0 8px; font-size: 14px; color: #9fe6ff; text-align: left; font-weight: 700; }
.startergrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.startergrid .card { width: auto; padding: 8px 6px; }
.startergrid .card .cname { font-size: 13px; }
.startergrid .card .ctypes { font-size: 11px; }
.cards { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }
.card { width: 170px; background: #0f1830; border: 1px solid #34507f; border-radius: 14px; padding: 12px; cursor: pointer; transition: transform .1s, border-color .1s; }
.card:hover { transform: translateY(-3px); border-color: #ffcb05; }
.card .spr { margin: 0 auto; }
.cname { font-weight: 700; margin-top: 6px; }
.ctypes { color: #9fb0d0; font-size: 13px; }

.overlay:has(.bag-device),
.overlay:has(.dex-device),
.overlay:has(.party-device),
.overlay:has(.pause-device),
.overlay:has(.pc-device) {
  background: rgba(8, 12, 24, .82);
}
.game-btn {
  display: block; margin: 12px auto 0; padding: 10px 28px; flex: none;
  background: linear-gradient(#f8f8f8, #d0d0d0); color: #303030; border: 3px solid #505050;
  border-radius: 8px; font-size: 15px; font-weight: 800; letter-spacing: 1px;
  box-shadow: inset 0 2px 0 #fff, 0 3px 0 #303030;
}
.game-btn:active { transform: translateY(2px); box-shadow: inset 0 1px 0 #fff, 0 1px 0 #303030; }

/* ===== MOCHILA (estilo GBA — bolsos) ===== */
.bag-device { width: min(96vw, 520px); }
.bag-frame {
  background: linear-gradient(180deg, #e8f4ff 0%, #b8d4f0 100%);
  border: 4px solid #2860a8; border-radius: 12px;
  box-shadow: inset 0 0 0 3px #fff, 0 8px 24px rgba(0,0,0,.45);
  overflow: hidden;
}
.bag-header {
  background: linear-gradient(#4080c8, #2860a8); color: #fff; text-align: center;
  font-weight: 800; font-size: 18px; letter-spacing: 2px; padding: 10px;
  border-bottom: 3px solid #184878; text-shadow: 0 1px 0 #184878;
}
.bag-body { display: flex; min-height: 320px; }
.bag-pockets {
  display: flex; flex-direction: column; width: 108px; flex-shrink: 0;
  background: #2860a8; border-right: 3px solid #184878;
}
.bag-pocket {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; padding: 8px 4px; border: none; border-bottom: 1px solid #184878;
  background: #4080c8; color: #c8e0ff; cursor: pointer; border-radius: 0;
  font-size: 11px; font-weight: 700; letter-spacing: .5px; min-height: 52px;
}
.bag-pocket:hover { background: #5090d8; }
.bag-pocket.sel { background: #f0f0f0; color: #2860a8; box-shadow: inset 0 0 0 2px #2860a8; }
.bag-pocket-icon { font-size: 18px; line-height: 1; }
.bag-pocket-label { font-size: 9px; text-align: center; line-height: 1.1; }
.bag-main { flex: 1; display: flex; flex-direction: column; background: #f8f8f8; min-width: 0; }
.bag-items-head {
  background: #2860a8; color: #fff; font-size: 12px; font-weight: 700;
  padding: 6px 12px; letter-spacing: 1px; border-bottom: 2px solid #184878;
}
.bag-items {
  list-style: none; flex: 1; overflow-y: auto; margin: 0; padding: 0;
  max-height: 220px;
}
.bag-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 12px; cursor: pointer; border-bottom: 1px solid #d0d8e0;
  font-size: 14px; color: #303030;
}
.bag-row:hover { background: #e8f0f8; }
.bag-row.sel { background: #2860a8; color: #fff; }
.bag-row-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bag-row-qty { font-weight: 800; min-width: 28px; text-align: right; }
.bag-empty { padding: 24px; text-align: center; color: #888; font-style: italic; }
.bag-desc {
  background: #fff; border-top: 3px solid #2860a8; padding: 10px 12px;
  font-size: 13px; line-height: 1.4; color: #404040; min-height: 56px;
}

/* ===== EQUIPE (party — estilo GBA) ===== */
.party-device { width: min(96vw, 520px); }
.party-frame {
  background: linear-gradient(180deg, #e8f4ff 0%, #b8d4f0 100%);
  border: 4px solid #2860a8; border-radius: 12px;
  box-shadow: inset 0 0 0 3px #fff, 0 8px 24px rgba(0,0,0,.45);
  overflow: hidden;
}
.party-header {
  background: linear-gradient(#4080c8, #2860a8); color: #fff; text-align: center;
  font-weight: 800; font-size: 18px; letter-spacing: 2px; padding: 10px;
  border-bottom: 3px solid #184878; text-shadow: 0 1px 0 #184878;
}
.party-body { display: flex; min-height: 300px; }
.party-list {
  list-style: none; flex: 1; margin: 0; padding: 0; overflow-y: auto;
  max-height: 320px; background: #f8f8f8; border-right: 3px solid #2860a8;
}
.party-slot {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  cursor: pointer; border-bottom: 1px solid #d0d8e0; color: #303030;
}
.party-slot:hover { background: #e8f0f8; }
.party-slot.sel { background: #2860a8; color: #fff; }
.party-slot.fainted { opacity: .55; }
.party-slot.empty { opacity: .4; cursor: default; font-style: italic; }
.party-slot-num {
  font-weight: 800; font-size: 13px; min-width: 18px; text-align: center;
  color: #2860a8;
}
.party-slot.sel .party-slot-num { color: #ffd23f; }
.party-slot-info { flex: 1; min-width: 0; }
.party-slot-name { font-weight: 700; font-size: 14px; }
.party-slot-lv { font-size: 12px; opacity: .85; }
.party-slot-bar {
  height: 6px; background: #c0c8d0; border-radius: 3px; margin-top: 4px; overflow: hidden;
}
.party-slot-bar > div { height: 100%; border-radius: 3px; background: linear-gradient(#5fe06a,#2fae3a); }
.party-slot.fainted .party-slot-bar > div { background: linear-gradient(#888,#555); }
.party-detail {
  width: 168px; flex-shrink: 0; padding: 12px 10px; background: #fff;
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
.party-detail-empty { color: #888; font-size: 13px; margin-top: 40px; }
.party-detail-spr { margin-bottom: 8px; }
.party-detail-name { font-weight: 800; font-size: 15px; color: #2860a8; }
.party-detail-hp { font-size: 13px; color: #404040; margin: 6px 0; }
.party-detail-moves { font-size: 11px; color: #606060; text-align: left; width: 100%; margin-top: 8px; }
.party-detail-moves li { margin: 2px 0; }
.party-actions {
  display: flex; gap: 8px; padding: 10px 12px; background: #2860a8;
  border-top: 3px solid #184878;
}
.party-move {
  flex: 1; padding: 10px; font-weight: 800; font-size: 13px;
  background: linear-gradient(#f8f8f8, #d0d0d0); color: #2860a8;
  border: 2px solid #184878; border-radius: 8px; cursor: pointer;
}
.party-move:disabled { opacity: .4; cursor: not-allowed; }
.party-hint { margin: 0; padding: 8px 12px 12px; text-align: center; background: #e8f0f8; }

/* ===== MENU DE PAUSA ===== */
.pause-device { width: min(92vw, 320px); }
.pause-header {
  background: linear-gradient(#4080c8, #2860a8); color: #fff; text-align: center;
  font-weight: 800; font-size: 20px; letter-spacing: 3px; padding: 14px;
  border: 4px solid #184878; border-radius: 12px 12px 0 0;
}
.pause-list { display: flex; flex-direction: column; background: #f8f8f8; border: 4px solid #2860a8; border-top: none; }
.pause-list button {
  padding: 14px 16px; border: none; border-bottom: 1px solid #d0d8e0;
  background: #fff; color: #2860a8; font-size: 16px; font-weight: 700; text-align: left; cursor: pointer;
}
.pause-list button:hover:not(:disabled) { background: #e8f0f8; }
.pause-list button:disabled { opacity: .45; cursor: not-allowed; color: #888; }
.card-badges { list-style: none; padding: 0; margin: 8px 0; text-align: left; font-size: 14px; }
.card-badges li { padding: 4px 0; }
.opt-row { display: block; margin: 12px 0; font-size: 15px; cursor: pointer; }

/* ===== PC ===== */
.pc-device { width: min(96vw, 560px); }
.pc-toolbar {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: center;
  padding: 8px; background: #2860a8; color: #fff; font-weight: 700;
}
.pc-body { display: flex; min-height: 280px; }
.pc-list {
  list-style: none; flex: 1; margin: 0; padding: 4px; overflow-y: auto; max-height: 280px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 2px; background: #f0f0f0;
}
.pc-slot {
  display: flex; align-items: center; gap: 4px; padding: 4px 6px; font-size: 12px;
  background: #fff; border: 1px solid #d0d8e0; cursor: pointer; border-radius: 4px;
}
.pc-slot.sel { background: #2860a8; color: #fff; }
.pc-slot.empty { color: #aaa; justify-content: center; }
.pc-party-pick-list {
  list-style: none; margin: 0; padding: 8px; background: #e8f0f8;
  display: flex; flex-wrap: wrap; gap: 6px; max-height: 80px; overflow-y: auto;
}
.pc-party-pick-list.hidden { display: none; }
.pc-party-pick {
  padding: 6px 10px; background: #fff; border: 2px solid #2860a8; border-radius: 8px;
  cursor: pointer; font-size: 13px; display: flex; align-items: center; gap: 4px;
}
.bmenu { grid-template-columns: 1fr 1fr 1fr; }

/* ===== POKéDEX (estilo dispositivo vermelho) ===== */
.dex-device { width: min(96vw, 680px); }
.dex-bezel {
  background: linear-gradient(145deg, #e85050, #c03030 40%, #a02020);
  border-radius: 20px; padding: 16px 16px 12px;
  box-shadow: inset 0 2px 0 rgba(255,255,255,.25), 0 10px 30px rgba(0,0,0,.5);
}
.dex-lights { display: flex; gap: 8px; margin-bottom: 10px; padding-left: 4px; }
.dex-lights span {
  width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(0,0,0,.3);
}
.dex-lights span:nth-child(1) { background: radial-gradient(circle at 35% 35%, #88ff88, #208820); }
.dex-lights span:nth-child(2) { background: radial-gradient(circle at 35% 35%, #ffff88, #a0a020); }
.dex-lights span:nth-child(3) { background: radial-gradient(circle at 35% 35%, #88ccff, #2060a0); }
.dex-screen {
  background: #f0e8c8; border: 4px solid #303030; border-radius: 8px;
  box-shadow: inset 0 0 12px rgba(0,0,0,.15); overflow: hidden;
}
.dex-topbar {
  display: flex; justify-content: space-between; align-items: center;
  background: linear-gradient(#2860a8, #184878); color: #fff;
  padding: 8px 12px; font-weight: 800; font-size: 14px; letter-spacing: 1px;
}
.dex-stats { font-size: 11px; font-weight: 600; color: #c8e0ff; letter-spacing: 0; }
.dex-body { display: flex; min-height: 340px; }
.dex-list-panel {
  width: 42%; border-right: 3px solid #303030; display: flex; flex-direction: column;
  background: #fff;
}
.dex-list-head {
  background: #2860a8; color: #fff; font-size: 11px; font-weight: 700;
  padding: 5px 10px; letter-spacing: 1px;
}
.dex-list {
  list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; max-height: 300px;
}
.dex-row {
  display: flex; gap: 8px; padding: 5px 10px; cursor: pointer;
  border-bottom: 1px solid #e0d8c0; font-size: 13px; color: #303030;
}
.dex-row:hover { background: #f8f0d8; }
.dex-row.sel { background: #2860a8; color: #fff; }
.dex-row.unknown { color: #a0a0a0; }
.dex-row.seen .dex-row-name { color: #6080a0; }
.dex-row.sel .dex-row-name, .dex-row.sel .dex-row-num { color: #fff; }
.dex-row-num { font-weight: 700; min-width: 36px; color: #2860a8; }
.dex-row-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dex-detail {
  flex: 1; padding: 12px; background: #f8f4e8; display: flex; flex-direction: column;
  align-items: center; text-align: center; min-width: 0;
}
.dex-detail-empty { color: #888; margin: auto; font-style: italic; }
.dex-detail-num { font-size: 13px; font-weight: 800; color: #2860a8; align-self: flex-start; }
.dex-detail-sprite { margin: 8px 0; min-height: 100px; display: flex; align-items: center; justify-content: center; }
.dex-detail-sprite.unknown { font-size: 64px; color: #c0b8a0; font-weight: 800; }
.dex-detail-sprite.seen img { filter: grayscale(1) brightness(.55); }
.dex-detail-name { font-size: 20px; font-weight: 800; color: #303030; margin-bottom: 6px; }
.dex-detail-types { display: flex; gap: 6px; justify-content: center; margin-bottom: 8px; flex-wrap: wrap; }
.type-badge {
  display: inline-block; padding: 2px 10px; border-radius: 4px;
  font-size: 11px; font-weight: 800; color: #fff; text-shadow: 0 1px 0 rgba(0,0,0,.3);
  border: 2px solid rgba(0,0,0,.15);
}
.dex-detail-stats {
  display: flex; gap: 8px; flex-wrap: wrap; justify-content: center;
  font-size: 11px; font-weight: 700; color: #505050; margin-bottom: 8px;
}
.dex-detail-stats span { background: #e8e0c8; padding: 2px 6px; border-radius: 4px; border: 1px solid #c0b8a0; }
.dex-detail-entry {
  font-size: 12px; line-height: 1.45; color: #505050; background: #fff;
  border: 2px solid #c0b8a0; border-radius: 6px; padding: 8px 10px;
  width: 100%; text-align: left; margin-top: auto;
}

/* Pokédex legado (grid) — removido */

/* Batalha */
#battle { position: fixed; inset: 0; z-index: 30; display: flex; flex-direction: column; background: #1a5080; contain: strict; }
.bscene {
  position: relative; flex: 1; overflow: hidden;
  background: #5eb0e8;
}
.bscene-bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.bscene-sky {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, #2d7ec8 0%, #5eb0e8 28%, #9ad4f5 52%, #b8e86a 52%, #7bc44a 72%, #5a9e38 100%);
}
.bscene-cloud {
  position: absolute; border-radius: 50px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 24px 8px 0 rgba(255, 255, 255, 0.65), 48px 2px 0 rgba(255, 255, 255, 0.45);
  opacity: 0.9;
  animation: bCloudDrift 48s linear infinite;
}
.bscene-cloud-a { width: 72px; height: 28px; top: 8%; left: 12%; animation-duration: 55s; }
.bscene-cloud-b { width: 96px; height: 32px; top: 14%; left: 58%; animation-duration: 42s; animation-delay: -12s; }
.bscene-cloud-c { width: 60px; height: 24px; top: 6%; left: 78%; animation-duration: 38s; animation-delay: -20s; opacity: 0.7; }
@keyframes bCloudDrift {
  0% { transform: translateX(0); }
  100% { transform: translateX(-18vw); }
}
.bscene-hills {
  position: absolute; left: -5%; right: -5%; top: 38%; height: 22%;
  background:
    radial-gradient(ellipse 38% 100% at 18% 100%, #4a8e3a 0%, transparent 70%),
    radial-gradient(ellipse 42% 100% at 55% 100%, #3d7a32 0%, transparent 72%),
    radial-gradient(ellipse 36% 100% at 88% 100%, #5a9e42 0%, transparent 68%);
  opacity: 0.55;
}
.bscene-ground {
  position: absolute; left: 0; right: 0; bottom: 0; height: 42%;
  background: linear-gradient(180deg, #6fbf4a 0%, #4a9638 45%, #3d7a2e 100%);
}
.bscene-plat {
  position: absolute; border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(95, 160, 65, 0.95) 0%, rgba(70, 130, 50, 0.55) 55%, transparent 72%);
  box-shadow: inset 0 -4px 12px rgba(0, 0, 0, 0.12);
}
.bscene-plat-enemy { width: min(42vw, 220px); height: min(14vw, 70px); top: 48%; right: 10%; }
.bscene-plat-player { width: min(52vw, 280px); height: min(18vw, 90px); bottom: 6%; left: 6%; }
.benemy { position: absolute; top: 8%; right: 6%; text-align: center; z-index: 2; }
.bplayer { position: absolute; bottom: 4%; left: 6%; text-align: center; z-index: 2; }
.spr.enemy { width: min(40vw, 200px); height: min(40vw, 200px); }
.spr.player { width: min(46vw, 230px); height: min(46vw, 230px); }
.spr > img {
  width: 100%; height: 100%; object-fit: contain;
  image-rendering: pixelated;
  will-change: transform;
  transform: translateZ(0);
}
.bbar { background: #0d1424dd; border: 2px solid #2c416f; border-radius: 10px; padding: 6px 10px; min-width: 180px; margin: 0 auto 6px; color: #fff; }
.bname { font-weight: 700; }
.blv { float: right; color: #9fb0d0; }
.hpbar { height: 8px; background: #22324f; border-radius: 5px; overflow: hidden; margin-top: 4px; }
.hpbar > div {
  height: 100%; width: 100%; transform-origin: left center;
  background: linear-gradient(#5fe06a, #2fae3a);
  transition: transform 0.32s ease-out;
  will-change: transform;
}
.hptext { font-size: 12px; color: #cfe0ff; text-align: right; margin-top: 2px; }
.expbar { height: 5px; background: #22324f; border-radius: 4px; overflow: hidden; margin-top: 4px; }
.expbar > div {
  height: 100%; width: 100%; transform-origin: left center;
  background: linear-gradient(#5cc8ff, #3a8fe0);
  transition: transform 0.4s ease-out;
  will-change: transform;
}

/* Animações de golpe — GPU */
.spr.lunge-r { animation: lungeR .28s ease-out; }
.spr.lunge-l { animation: lungeL .28s ease-out; }
.spr.hit { animation: hitShake .38s ease-out; }
@keyframes lungeR { 50% { transform: translate3d(22px, -16px, 0); } }
@keyframes lungeL { 50% { transform: translate3d(-22px, 16px, 0); } }
@keyframes hitShake {
  0%, 100% { transform: translate3d(0, 0, 0); opacity: 1; }
  15% { opacity: .3; }
  30% { transform: translate3d(-9px, 0, 0); }
  50% { transform: translate3d(9px, 0, 0); opacity: .45; }
  70% { transform: translate3d(-5px, 0, 0); }
  85% { transform: translate3d(5px, 0, 0); }
}
.spr.suck { transition: transform .4s ease-in, opacity .4s; transform: scale(0.05) translateY(20px); opacity: 0; }
.spr.unsuck { transition: transform .3s ease-out, opacity .3s; transform: scale(1); opacity: 1; }

/* Poké Bola (animação de captura) */
#ball {
  position: fixed; z-index: 40; width: 30px; height: 30px; border-radius: 50%;
  background:
    linear-gradient(#ee2b3a 0 47%, #111 47% 53%, #f5f5f5 53% 100%);
  border: 2px solid #111; box-shadow: 0 3px 6px rgba(0,0,0,.4);
}
#ball::after { content: ""; position: absolute; left: 50%; top: 50%; width: 9px; height: 9px; margin: -4.5px; border-radius: 50%; background: #fff; border: 2px solid #111; }
#ball.wobble { animation: ballWobble .8s ease-in-out; }
@keyframes ballWobble { 0%,100% { transform: rotate(0); } 25% { transform: rotate(-22deg); } 75% { transform: rotate(22deg); } }
#ball.caught { animation: ballCaught .5s; }
@keyframes ballCaught { 0% { box-shadow: 0 0 0 0 #ffe066; } 100% { box-shadow: 0 0 24px 8px rgba(255,224,102,0); } }
.bbox { background: #16223f; border-top: 3px solid #2c416f; padding: 14px; min-height: 120px; }
#bmsg { font-size: 16px; min-height: 44px; margin-bottom: 10px; }
.bmenu { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; max-width: 520px; }
.bforms { display: flex; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.bforms button { padding: 8px 12px; font-size: 13px; font-weight: 700; border-radius: 8px; border: 2px solid #ffd23f; background: #2860a8; color: #fff; cursor: pointer; }
.bforms button.hidden { display: none; }
.field-hm-list, .fly-list { list-style: none; padding: 0; margin: 12px 0; max-height: 320px; overflow-y: auto; }
.field-hm-row, .fly-row { padding: 12px; margin: 6px 0; background: #0f1830; border: 1px solid #34507f; border-radius: 10px; cursor: pointer; }
.field-hm-row.locked { opacity: .45; cursor: not-allowed; }
.field-hm-row b { display: block; margin-bottom: 4px; color: #ffd23f; }
.fly-row:hover { border-color: #ffd23f; }
.bmenu button { padding: 14px; font-size: 16px; }
.bmenu button.back { grid-column: 1 / -1; background: #2c416f; }

/* Grupo / Guilda / Co-op */
.social-panel { max-width: 480px; text-align: left; }
.social-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.tab-row { display: flex; gap: 8px; }
.tab-row button { padding: 8px 16px; border-radius: 8px; background: #2c416f; color: #fff; border: none; cursor: pointer; }
.tab-row button.active { background: #4a7fd4; }
.social-actions { flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.social-actions button { flex: 1 1 auto; min-width: 120px; }
.party-row { padding: 6px 0; border-bottom: 1px solid #2c416f44; }
.guild-banner { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.guild-tag { color: #ffd23f; }
.guild-members { list-style: none; padding: 0; max-height: 120px; overflow-y: auto; }
.guild-members li { padding: 4px 0; font-size: 14px; color: #9fb0d0; }
.invite-bar { position: fixed; top: 48px; left: 50%; transform: translateX(-50%); z-index: 25; background: #16223fdd; border: 2px solid #4a7fd4; border-radius: 12px; padding: 10px 16px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.small { font-size: 12px; }
.coop-wrap { background: linear-gradient(180deg, #1b2a4a 0%, #0b1020 100%); border: 3px solid #4a7fd4; border-radius: 16px; padding: 20px; max-width: 520px; width: 92vw; margin: auto; }
.coop-title { font-size: 20px; font-weight: 800; color: #ffd23f; text-align: center; margin-bottom: 16px; }
.coop-boss { display: flex; gap: 16px; align-items: center; margin-bottom: 16px; }
.coop-boss-spr { width: 120px; height: 120px; flex-shrink: 0; }
.coop-boss-info { flex: 1; color: #fff; }
.hpbar.boss { height: 14px; margin: 8px 0; }
.hpbar.boss > div { background: linear-gradient(#ff6a5f, #d63a2f); }
.hpbar.sm { height: 6px; margin: 4px 0; }
.coop-players { display: grid; gap: 8px; margin-bottom: 12px; }
.coop-pl { background: #16223f; border-radius: 8px; padding: 8px 10px; color: #cfe0ff; font-size: 14px; }
.coop-pl.ready { border-left: 3px solid #5fe06a; }
.coop-msg { min-height: 40px; color: #fff; margin-bottom: 12px; font-size: 15px; }
.coop-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.coop-actions button { padding: 12px; font-size: 15px; }
#coopBattle { z-index: 35; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.75); }
#eventBanner { position: fixed; top: 48px; left: 0; right: 0; z-index: 40; display: none; }
#eventBanner:not(.hidden) { display: block; }
body.event-live #party { top: 86px; }
body.event-live #areaBanner { top: 118px; }
.hub-body { max-height: 60vh; overflow-y: auto; padding: 8px 0; }
.hub-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.hub-tabs button { padding: 8px 12px; font-size: 13px; border-radius: 8px; border: 1px solid #4a7fd4; background: #16223f; color: #cfe0ff; cursor: pointer; }
.hub-tabs button.active { background: #4a7fd4; color: #fff; }
.hub-panel { display: none; }
.hub-panel.active { display: block; }
.hub-list { display: grid; gap: 8px; margin: 8px 0; }
.hub-card { background: #16223f; border: 1px solid #3a5a8a; border-radius: 10px; padding: 10px 12px; font-size: 14px; color: #e8f0ff; }
.hub-card button { margin-top: 6px; }
.trade-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 600px) { .trade-columns { grid-template-columns: 1fr; } }
