/* =========================================================
   Pokémon Bullet Heaven — interface
   Paleta baseada nas cores da franquia: amarelo e azul do
   logo, vermelho/branco da Poké Ball, azul-noite de fundo.
   ========================================================= */
:root {
  --yellow: #ffcb05;
  --yellow-deep: #e8a900;
  --blue: #2a75bb;
  --blue-deep: #1b4f8a;
  --blue-logo: #3b4cca;
  --red: #ee1515;
  --red-deep: #a81414;
  --white: #f6f8ff;

  --bg-0: #070b18;
  --bg-1: #0e1530;
  --bg-2: #16204a;
  --bg-3: #1e2b5e;
  --line: #2d3c78;
  --line-soft: #243063;

  --text: #eaf0ff;
  --muted: #93a3cf;
  --ok: #57d18a;
  --danger: #ff5c5c;
  --xp: #59c1ff;

  --radius: 14px;
  --radius-sm: 9px;
  --font: "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  --shadow: 0 18px 40px rgba(0, 0, 0, .45);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--bg-0);
  color: var(--text);
  font-family: var(--font);
  overflow: hidden;
  user-select: none;
}

#app {
  position: relative;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(1200px 700px at 50% -10%, #223066 0%, transparent 60%),
    radial-gradient(900px 600px at 100% 100%, #1a2550 0%, transparent 55%),
    var(--bg-0);
}

.hidden { display: none !important; }

/* ============================ SCROLLBARS ============================ */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: rgba(0, 0, 0, .25); border-radius: 8px; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--blue); }

/* ============================ SIDE RAIL ============================ */
#side-rail {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rail-btn {
  display: flex;
  align-items: center;
  gap: 0;
  height: 54px;
  padding: 0 14px;
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border: 2px solid var(--line);
  border-radius: 16px;
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  letter-spacing: 1px;
  cursor: pointer;
  overflow: hidden;
  white-space: nowrap;
  transition: border-color .18s, box-shadow .18s, transform .18s, background .18s;
}
.rail-btn .rail-icon { font-size: 22px; line-height: 1; }
.rail-btn .rail-label {
  max-width: 0;
  opacity: 0;
  transition: max-width .22s ease, opacity .18s ease, margin .22s ease;
}
.rail-btn:hover {
  border-color: var(--yellow);
  box-shadow: 0 0 0 3px rgba(255, 203, 5, .12), var(--shadow);
  transform: translateX(3px);
}
.rail-btn:hover .rail-label { max-width: 140px; opacity: 1; margin-left: 10px; }

/* ============================= TELAS ============================= */
.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 28px 28px 28px 110px;
  overflow: hidden;
}
.screen.scrollable, #screen-campaign, #screen-starter { overflow-y: auto; }

.screen-head { text-align: center; display: flex; flex-direction: column; gap: 6px; }
.screen-title {
  font-size: clamp(20px, 2.6vw, 30px);
  letter-spacing: 4px;
  color: var(--yellow);
  text-shadow: 0 3px 0 var(--blue-deep), 0 0 22px rgba(255, 203, 5, .25);
}
.subtitle { color: var(--muted); text-align: center; max-width: 760px; line-height: 1.5; }
.subtitle.small { font-size: 12.5px; }
.version-tag { position: absolute; bottom: 14px; right: 18px; color: #4a5a8a; font-size: 12px; }

/* ========================= MENU PRINCIPAL ========================= */
.title-screen { justify-content: center; }

.poke-bg { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.poke-orb {
  position: absolute;
  width: 760px; height: 760px;
  right: -230px; top: 50%;
  transform: translateY(-50%);
  border-radius: 50%;
  background:
    linear-gradient(180deg, rgba(238, 21, 21, .16) 0 49%, rgba(255, 255, 255, .07) 51% 100%);
  border: 26px solid rgba(255, 255, 255, .05);
  box-shadow: inset 0 0 120px rgba(0, 0, 0, .5);
  animation: spin 90s linear infinite;
}
.poke-orb::after {
  content: '';
  position: absolute;
  inset: 0;
  margin: auto;
  width: 150px; height: 150px;
  border-radius: 50%;
  border: 24px solid rgba(255, 255, 255, .06);
  background: rgba(10, 16, 34, .35);
}
.poke-stripe {
  position: absolute;
  left: 0; right: 0; top: 50%;
  height: 26px;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, .18);
}
@keyframes spin { to { transform: translateY(-50%) rotate(360deg); } }

.title-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 26px;
}

.logo-block { text-align: center; }
.logo-main {
  font-size: clamp(46px, 9vw, 104px);
  font-weight: 900;
  letter-spacing: 6px;
  color: var(--yellow);
  -webkit-text-stroke: 3px var(--blue-logo);
  text-shadow:
    0 6px 0 var(--blue-deep),
    0 10px 26px rgba(0, 0, 0, .55);
  line-height: .95;
}
.logo-sub {
  display: inline-block;
  margin-top: 8px;
  padding: 7px 26px;
  background: linear-gradient(180deg, var(--red), var(--red-deep));
  border: 3px solid var(--white);
  border-radius: 999px;
  box-shadow: var(--shadow);
}
.logo-sub span {
  font-size: clamp(14px, 2.2vw, 24px);
  font-weight: 800;
  letter-spacing: 7px;
  color: var(--white);
}
.tagline { margin-top: 14px; color: var(--muted); letter-spacing: 2px; font-size: 13px; }

.progress-strip {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  color: var(--muted);
  font-size: 12.5px;
}
.progress-strip .pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  background: rgba(10, 16, 34, .6);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
}
.progress-strip .pill b { color: var(--yellow); }

/* ============================= BOTÕES ============================= */
.menu-column { display: flex; flex-direction: column; gap: 11px; width: min(380px, 86vw); }
.row-buttons { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

.menu-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: linear-gradient(180deg, var(--bg-3), var(--bg-2));
  border: 2px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  letter-spacing: 1.5px;
  cursor: pointer;
  transition: transform .1s, border-color .18s, box-shadow .18s, background .18s;
}
.menu-btn .btn-text { flex: 1; text-align: left; }
.menu-btn:hover:not(:disabled) {
  border-color: var(--yellow);
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(0, 0, 0, .45), 0 0 0 3px rgba(255, 203, 5, .12);
}
.menu-btn:disabled { opacity: .4; cursor: not-allowed; }
.menu-btn.primary {
  background: linear-gradient(180deg, var(--blue), var(--blue-deep));
  border-color: #5a9de0;
}
.menu-btn.danger:hover { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(255, 92, 92, .12); }
.menu-btn.ghost { background: rgba(10, 16, 34, .55); }
.menu-btn.slim { padding: 9px 16px; font-size: 13px; width: auto; align-self: center; }
.menu-btn.back { width: min(240px, 80vw); justify-content: center; }
.menu-btn.back .btn-text { text-align: center; }

/* bolinha estilo Poké Ball nos botões */
.btn-ball, .ball-icon {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--red) 0 46%, #1b1b1b 46% 54%, var(--white) 54% 100%);
  border: 2px solid #12172b;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .15);
  flex: none;
}
.ball-icon.big { width: 46px; height: 46px; border-width: 3px; }

.icon-btn {
  background: rgba(10, 16, 34, .7);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 9px;
  padding: 5px 10px;
  font-family: var(--font);
  font-size: 13px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.icon-btn:hover { border-color: var(--yellow); background: var(--bg-2); }
.icon-btn.close { position: absolute; top: 12px; right: 12px; }

/* ======================= ESCOLHA DO INICIAL ======================= */
.starter-grid { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; }

.starter-card {
  width: 268px;
  padding: 18px;
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border: 2px solid var(--line);
  border-radius: 18px;
  cursor: pointer;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transition: transform .14s, border-color .18s, box-shadow .18s;
}
.starter-card:hover {
  transform: translateY(-6px);
  border-color: var(--yellow);
  box-shadow: var(--shadow), 0 0 0 3px rgba(255, 203, 5, .12);
}
.starter-card img { width: 150px; height: 150px; object-fit: contain; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .5)); }
.starter-card h3 { font-size: 20px; letter-spacing: 2px; }
.starter-card .role { font-size: 12px; color: var(--yellow); letter-spacing: 1px; }
.starter-card p { font-size: 13px; color: var(--muted); line-height: 1.5; }
.starter-card .move-box {
  width: 100%;
  background: rgba(8, 12, 26, .6);
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 9px 11px;
  text-align: left;
}
.starter-card .move-box b { font-size: 13px; color: var(--text); }
.starter-card .move-box span { display: block; font-size: 11.5px; color: var(--muted); margin-top: 3px; line-height: 1.4; }

/* tipos */
.type-row { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.type-tag {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 999px;
  color: #10162a;
}

/* ========================= MAPA DA JORNADA ========================= */
.journey-team {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  padding: 10px 14px;
  background: rgba(8, 12, 26, .55);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
}
.journey-team .jt-mon {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 4px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
}
.journey-team img { width: 34px; height: 34px; object-fit: contain; image-rendering: pixelated; }
.journey-team .jt-lv { color: var(--yellow); font-weight: 700; }
.journey-team .empty { color: var(--muted); font-size: 12.5px; padding: 6px 10px; }

.stage-list { display: flex; flex-direction: column; gap: 12px; width: min(820px, 94vw); }

.stage-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  background: linear-gradient(90deg, var(--bg-2), var(--bg-1));
  border: 2px solid var(--line);
  border-left-width: 6px;
  border-radius: var(--radius);
  transition: transform .12s, border-color .18s, box-shadow .18s;
}
.stage-card.clickable { cursor: pointer; }
.stage-card.clickable:hover {
  transform: translateX(4px);
  border-color: var(--yellow);
  box-shadow: var(--shadow);
}
.stage-card.locked { opacity: .45; }
.stage-card.done { border-left-color: var(--ok); }
.stage-card .stage-icon { font-size: 30px; width: 44px; text-align: center; }
.stage-card .stage-body { flex: 1; }
.stage-card h4 { font-size: 16px; letter-spacing: 1.5px; }
.stage-card p { font-size: 12.5px; color: var(--muted); margin-top: 4px; line-height: 1.45; }
.stage-card .stage-meta { font-size: 11.5px; color: #6b7cab; margin-top: 5px; }
.stage-card .stage-boss { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 76px; }
.stage-card .stage-boss img { width: 56px; height: 56px; object-fit: contain; image-rendering: pixelated; }
.stage-card .stage-boss span { font-size: 10px; color: var(--muted); letter-spacing: 1px; }
.stage-card .stage-state { font-size: 12px; color: var(--muted); text-align: right; min-width: 92px; }
.stage-card .stage-state.done { color: var(--ok); font-weight: 700; }
.stage-card .stage-state.play { color: var(--yellow); font-weight: 700; }

/* ============================ LISTAS ============================ */
.node-list { display: flex; flex-direction: column; gap: 10px; }

.node {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-1);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 12px 15px;
}
.node.locked { opacity: .5; }
.node .node-icon { font-size: 24px; width: 34px; text-align: center; }
.node .node-body { flex: 1; }
.node .node-body h4 { font-size: 14.5px; letter-spacing: 1px; }
.node .node-body p { font-size: 12px; color: var(--muted); margin-top: 3px; line-height: 1.4; }
.node .node-meta { font-size: 11px; color: #64749f; margin-top: 4px; }
.node .node-state { font-size: 12px; color: var(--muted); text-align: right; min-width: 74px; }
.node .node-state.done { color: var(--ok); font-weight: 700; }
.node img.node-sprite { width: 52px; height: 52px; object-fit: contain; image-rendering: pixelated; }

.stat-list { display: flex; flex-direction: column; gap: 7px; width: 100%; }
.stat-list div { display: flex; justify-content: space-between; gap: 20px; font-size: 13.5px; color: var(--muted); }
.stat-list div b { color: var(--text); }

/* ============================= MODAIS ============================= */
.modal {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(4, 7, 18, .78);
  backdrop-filter: blur(3px);
  animation: fade-in .16s ease-out;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.modal-card {
  position: relative;
  width: min(640px, 94vw);
  max-height: min(84vh, 760px);
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border: 2px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: pop-in .18s ease-out;
}
.modal-card.wide { width: min(1040px, 96vw); }
@keyframes pop-in { from { transform: translateY(14px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }

.modal-head {
  position: relative;
  padding: 16px 52px 14px 20px;
  background: linear-gradient(90deg, var(--red) 0%, var(--red-deep) 100%);
  border-bottom: 3px solid rgba(0, 0, 0, .35);
}
.modal-head h3 { font-size: 16px; letter-spacing: 2.5px; color: var(--white); }
.modal-head .modal-sub { display: block; font-size: 11.5px; color: rgba(255, 255, 255, .78); margin-top: 3px; }
.modal-head .icon-btn.close { background: rgba(0, 0, 0, .3); border-color: rgba(255, 255, 255, .25); }

.modal-body { padding: 18px 20px 22px; overflow-y: auto; }

.help-grid { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.help-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-1);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 9px 14px;
}
.help-item b { min-width: 120px; color: var(--yellow); font-size: 13px; letter-spacing: 1px; }
.help-item span { font-size: 12.5px; color: var(--muted); }

/* ============================= POKÉDEX ============================= */
.dex-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 8px;
}
.dex-cell {
  background: var(--bg-1);
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 7px 4px 6px;
  text-align: center;
  font-size: 10.5px;
  color: var(--muted);
  transition: transform .12s, border-color .15s;
}
.dex-cell img { width: 58px; height: 58px; object-fit: contain; image-rendering: pixelated; }
.dex-cell .dex-num { font-size: 10px; color: #5a6a99; letter-spacing: .5px; }
/* não capturado = silhueta escura */
.dex-cell.unknown img { filter: brightness(0) invert(.16); }
.dex-cell.unknown .dex-name { color: #4a5680; }
.dex-cell.caught {
  border-color: var(--yellow);
  background: linear-gradient(180deg, #23306a, var(--bg-1));
  color: var(--text);
}
.dex-cell.caught .dex-num { color: var(--yellow); }
.dex-cell.caught:hover { transform: translateY(-3px); }

/* =============================== JOGO =============================== */
#stage-wrapper {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #04060e;
}
#game-canvas { width: 100%; height: 100%; object-fit: contain; display: block; image-rendering: pixelated; }

#hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 14px 18px 16px;
}
#hud button, #hud .mon-card, #hud .bench-mon { pointer-events: auto; }

.hud-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.hud-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: rgba(8, 12, 26, .82);
  border: 2px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
}
.stage-chip { flex-direction: column; align-items: flex-start; gap: 1px; border-radius: 16px; }
#stage-name { font-size: 13px; letter-spacing: 2px; }
#objective { font-size: 10.5px; letter-spacing: 2px; color: var(--yellow); }
.timer-chip { padding: 6px 22px; }
#timer { font-size: 26px; letter-spacing: 2px; font-weight: 700; }
.stats-chip { font-size: 13px; }
#kill-count::before { content: '⚔ '; color: var(--danger); }
#ball-count::before { content: '◓ '; color: var(--yellow); }

/* ====== equipe no HUD ====== */
#team-hud { display: flex; flex-direction: column; align-items: center; gap: 8px; }

.active-row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

.mon-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 218px;
  padding: 8px 12px 8px 8px;
  background: rgba(8, 12, 26, .88);
  border: 2px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .4);
  cursor: pointer;
  transition: border-color .15s, transform .12s;
}
.mon-card:hover { transform: translateY(-2px); }
.mon-card.selected { border-color: var(--yellow); box-shadow: 0 0 0 3px rgba(255, 203, 5, .18); }
.mon-card.fainted { filter: grayscale(1); opacity: .5; }
.mon-card img { width: 46px; height: 46px; object-fit: contain; image-rendering: pixelated; flex: none; }
.mon-card .mon-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.mon-card .mon-top { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
.mon-card .mon-name {
  font-size: 12px; letter-spacing: .8px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.mon-card .mon-lv { font-size: 11px; color: var(--yellow); font-weight: 700; flex: none; }
.mon-card .key-hint {
  position: absolute; top: -8px; left: -8px;
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-3); border: 2px solid var(--line);
  border-radius: 7px; font-size: 10px; color: var(--muted);
}

.bench-block { display: flex; align-items: center; gap: 12px; }
.bench-row { display: flex; gap: 7px; }

.bench-mon {
  position: relative;
  width: 58px;
  padding: 4px 4px 5px;
  background: rgba(8, 12, 26, .85);
  border: 2px solid var(--line);
  border-radius: 11px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, transform .12s;
}
.bench-mon:hover { transform: translateY(-2px); border-color: var(--yellow); }
.bench-mon.disabled { opacity: .55; cursor: not-allowed; }
.bench-mon.fainted { filter: grayscale(1); opacity: .42; cursor: not-allowed; }
.bench-mon.empty { opacity: .28; cursor: default; border-style: dashed; }
.bench-mon img { width: 38px; height: 38px; object-fit: contain; image-rendering: pixelated; }
.bench-mon .bench-lv { font-size: 9.5px; color: var(--yellow); font-weight: 700; }
.bench-mon .key-hint {
  position: absolute; top: -7px; left: -7px;
  background: var(--bg-3); border: 1px solid var(--line);
  border-radius: 5px; font-size: 9px; padding: 0 4px; color: var(--muted);
}

/* botão de subir nível acumulado */
.level-btn {
  position: absolute;
  top: -9px; right: -9px;
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, var(--yellow), var(--yellow-deep));
  color: #1b2340;
  border: 2px solid #fff;
  border-radius: 50%;
  font-size: 12px; font-weight: 900;
  cursor: pointer;
  box-shadow: 0 0 12px rgba(255, 203, 5, .55);
  animation: pulse-up 1.1s ease-in-out infinite;
}
@keyframes pulse-up {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}
.level-btn .count {
  position: absolute; bottom: -7px; right: -5px;
  background: var(--red); color: #fff;
  font-size: 9px; font-weight: 700;
  border-radius: 999px; padding: 0 4px;
  border: 1px solid #fff;
}

/* barras */
.bar {
  position: relative;
  height: 8px;
  background: rgba(3, 6, 16, .9);
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
}
.bar i { display: block; height: 100%; width: 0%; transition: width .14s linear; }
.bar.hp i { background: linear-gradient(90deg, #35b86a, #6ae39a); }
.bar.hp.low i { background: linear-gradient(90deg, #d9a017, #ffd24a); }
.bar.hp.critical i { background: linear-gradient(90deg, #c0392b, #ff6b6b); }
.bar.xp { height: 5px; }
.bar.xp i { background: linear-gradient(90deg, #2a75bb, var(--xp)); }
.bar.swap { width: 88px; height: 6px; }
.bar.swap i { background: linear-gradient(90deg, #7d63ff, #c063ff); }
.bar.tiny { height: 4px; margin-top: 3px; }

.swap-chip {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 12px;
  background: rgba(8, 12, 26, .85);
  border: 2px solid var(--line);
  border-radius: 12px;
}
.swap-label { font-size: 9px; letter-spacing: 2px; color: var(--muted); }
#swap-text { font-size: 9.5px; color: var(--muted); }

/* ============================ OVERLAYS ============================ */
.overlay {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(4, 7, 18, .84);
  backdrop-filter: blur(2px);
  animation: fade-in .14s ease-out;
}
.overlay-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 24px 28px;
  max-width: 94vw;
  max-height: 92vh;
  overflow-y: auto;
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border: 2px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  animation: pop-in .18s ease-out;
}
.overlay-card.narrow { width: min(440px, 92vw); }
.overlay-card h2 { font-size: 22px; letter-spacing: 3px; }
.glow { color: var(--yellow); text-shadow: 0 0 18px rgba(255, 203, 5, .45); }
#result-title.victory { color: var(--ok); }
#result-title.defeat { color: var(--danger); }

.overlay-head { display: flex; align-items: center; gap: 16px; text-align: left; }
.overlay-head .subtitle { text-align: left; }
.overlay-sprite { width: 76px; height: 76px; object-fit: contain; image-rendering: pixelated; }

.card-row { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }

.card {
  width: 236px;
  padding: 15px;
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border: 2px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  transition: transform .12s, border-color .16s, box-shadow .16s;
}
.card:hover {
  transform: translateY(-5px);
  border-color: var(--yellow);
  box-shadow: var(--shadow), 0 0 0 3px rgba(255, 203, 5, .12);
}
.card.evolution { border-color: var(--yellow); background: linear-gradient(180deg, #3a3416, var(--bg-1)); }
.card h3 { font-size: 15.5px; letter-spacing: 1px; }
.card p { font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.card .card-icon { font-size: 32px; line-height: 1; }
.card img.card-sprite { width: 92px; height: 92px; object-fit: contain; image-rendering: pixelated; }
.card .stack-info { font-size: 11px; color: #6b7cab; }
.card .chip {
  font-size: 10.5px; letter-spacing: 1px; padding: 3px 10px;
  border-radius: 999px; background: rgba(255, 255, 255, .07); color: var(--text);
}

.team-summary { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.team-summary .sum-mon {
  width: 64px; padding: 5px 3px;
  background: var(--bg-1); border: 1px solid var(--line-soft);
  border-radius: 10px; text-align: center; font-size: 10px; color: var(--muted);
}
.team-summary .sum-mon img { width: 40px; height: 40px; object-fit: contain; image-rendering: pixelated; }
.team-summary .sum-mon.fainted { filter: grayscale(1); opacity: .45; }
.team-summary .sum-mon b { display: block; color: var(--yellow); font-size: 10px; }

/* ============================= TOASTS ============================= */
#toast-container {
  position: absolute;
  top: 84px; left: 50%;
  transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 6px; align-items: center;
  z-index: 60; pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 18px;
  background: rgba(8, 12, 26, .94);
  border: 1px solid var(--line);
  border-left: 4px solid var(--yellow);
  border-radius: 10px;
  font-size: 13px; letter-spacing: .6px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .45);
  animation: toast-in .22s ease-out;
}
@keyframes toast-in { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }

/* ============================ RESPONSIVO ============================ */
@media (max-width: 820px) {
  .screen { padding-left: 92px; }
  .mon-card { width: 178px; }
  #side-rail { left: 10px; }
  .rail-btn { height: 46px; padding: 0 11px; }
}


/* ===================== EVOLUÇÃO ===================== */
.evolution-card { text-align: center; }
.evo-stage { display: flex; align-items: center; justify-content: center; gap: 18px; }
.evo-sprite { width: 110px; height: 110px; object-fit: contain; image-rendering: pixelated; }
.evo-sprite.evo-new {
  filter: drop-shadow(0 0 18px rgba(255, 203, 5, .65));
  animation: evo-pop .6s ease-out;
}
.evo-arrow { font-size: 30px; color: var(--yellow); }
@keyframes evo-pop {
  0% { transform: scale(.4); opacity: 0; }
  60% { transform: scale(1.12); opacity: 1; }
  100% { transform: scale(1); }
}

/* ================= MELHORIAS DO TREINADOR ================= */
.shop-item { align-items: center; }
.shop-item .shop-level { font-size: 11px; color: var(--yellow); margin-top: 4px; letter-spacing: 1px; }
.shop-item .bar { margin-top: 6px; }
.buy-btn {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  min-width: 96px; padding: 8px 12px;
  background: linear-gradient(180deg, var(--bg-3), var(--bg-2));
  border: 2px solid var(--line); border-radius: 10px;
  color: var(--text); font-family: var(--font); font-size: 12px; cursor: pointer;
  transition: border-color .15s, transform .12s;
}
.buy-btn b { color: var(--yellow); font-size: 13px; }
.buy-btn:hover:not(:disabled) { border-color: var(--yellow); transform: translateY(-2px); }
.buy-btn:disabled { opacity: .45; cursor: not-allowed; }
.buy-btn.maxed { border-color: var(--ok); color: var(--ok); }

.coin-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 999px;
  background: rgba(255, 203, 5, .12);
  border: 1px solid var(--yellow);
  color: var(--yellow); font-weight: 700; font-size: 12.5px;
}

/* TM e evolução destacadas na tela de melhoria */
.card.tm {
  border-color: #7d63ff;
  background: linear-gradient(180deg, #2a2160, var(--bg-1));
  box-shadow: 0 0 0 3px rgba(125, 99, 255, .18);
}
.card.tm .card-icon { animation: pulse-up 1.4s ease-in-out infinite; }

/* trecho da jornada no HUD */
#segment-name { font-size: 10.5px; letter-spacing: 2px; color: var(--yellow); }


/* ===================== ÍCONES DE ITEM ===================== */
.ui-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  font-size: 15px;
  line-height: 1;
}
.ui-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .55));
}
.ui-icon.big { width: 54px; height: 54px; }
.rail-btn .rail-icon { width: 26px; height: 26px; }
.node-icon .ui-icon { width: 100%; height: 100%; }
.card-icon .ui-icon { width: 44px; height: 44px; }
.progress-strip .pill .ui-icon { width: 18px; height: 18px; }
.stage-icon .ui-icon { width: 34px; height: 34px; }
.toast .ui-icon { width: 20px; height: 20px; }

/* ================= LOJA DO TREINADOR (Shards) ================= */
.shop-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 15px;
  background: linear-gradient(100deg, var(--bg-2) 0%, var(--bg-1) 70%);
  border: 2px solid var(--line);
  border-left: 5px solid var(--blue);
  border-radius: 13px;
  transition: border-color .15s, transform .12s, box-shadow .15s;
}
.shop-card:hover { transform: translateX(3px); border-color: var(--line); box-shadow: 0 8px 20px rgba(0, 0, 0, .35); }
.shop-card.maxed { border-left-color: var(--ok); }
.shop-card.locked { opacity: .62; }

.shop-icon {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(3, 6, 16, .55);
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  flex: none;
}
.shop-body { flex: 1; min-width: 0; }
.shop-title { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.shop-title h4 { font-size: 14.5px; letter-spacing: .8px; }
.shop-level { font-size: 11px; color: var(--yellow); font-weight: 700; }
.shop-body p { font-size: 12px; color: var(--muted); margin-top: 3px; line-height: 1.4; }

.pips { display: flex; gap: 4px; margin-top: 8px; }
.pips .pip {
  width: 100%;
  height: 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, .09);
  border: 1px solid var(--line-soft);
}
.pips .pip.on {
  background: linear-gradient(90deg, var(--yellow), var(--yellow-deep));
  border-color: var(--yellow-deep);
  box-shadow: 0 0 6px rgba(255, 203, 5, .45);
}

.buy-btn b, .claim-btn b { display: inline-flex; align-items: center; gap: 4px; }

/* ================= CONQUISTAS COLETÁVEIS ================= */
.node.achievement { border-left: 4px solid var(--line); }
.node.achievement.claimable {
  border-left-color: var(--yellow);
  background: linear-gradient(100deg, #2d2a13, var(--bg-1) 70%);
  box-shadow: 0 0 0 2px rgba(255, 203, 5, .14);
}
.node.achievement.claimed { border-left-color: var(--ok); }
.node.achievement .node-state { display: inline-flex; align-items: center; gap: 5px; justify-content: flex-end; }

.claim-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 104px;
  padding: 9px 12px;
  background: linear-gradient(180deg, var(--yellow), var(--yellow-deep));
  border: 2px solid #fff6c9;
  border-radius: 11px;
  color: #23305c;
  font-family: var(--font);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  animation: pulse-up 1.4s ease-in-out infinite;
}
.claim-btn:hover { filter: brightness(1.08); }
.claim-btn b { color: #1b2340; font-size: 13px; }

/* insígnias oficiais no mapa */
.badge-img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  image-rendering: pixelated;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, .6));
}
