/* =====================================================================
   Interface GBA (experimental) — estilo Pokémon Emerald
   Tudo aqui vale só com <body class="theme-gba"> (Opções > Interface).
   Peças recortadas de Recursos/ em assets/gba/: sign-wood, sign-town, ball, hp-label, types.
   ===================================================================== */
.dock-sign { display: none; }

.theme-gba {
  --gba-line: #484860;       /* contorno escuro dos painéis */
  --gba-white: #f8f8f8;
  --gba-text: #404040;
  --gba-shadow: #d8d0d8;
  --gba-blue: #3890d8; --gba-blue-2: #80c0d8; --gba-blue-3: #2878b0;
  --gba-sel: #78d0e8; --gba-sel-2: #a8e8f8; --gba-orange: #f87030;
  --gba-cream: #ffdf80;
  --gba-purple: #7058b0;
  --gba-navy: #22304e;
  --gba-font: "Nunito", var(--font);   /* antes Pixelify Sans (pixelada): difícil de ler */
  --accent: #f87030;
}
/* listras verdes do menu de Pokémon (versão clara e escura) */
.theme-gba .gba-stripes, .theme-gba .dock { background: repeating-linear-gradient(180deg, #c8d078 0 2px, #b0b058 2px 4px); }

/* ---------------- textbox branco (HUD, abas, campos) ---------------- */
.theme-gba .hud-trainer, .theme-gba .hud-pill, .theme-gba .hud-money > *, .theme-gba .dock-btn, .theme-gba .nav-btn.dock-btn, .theme-gba .dock-bag,
.theme-gba .shop-tab, .theme-gba .ac-tab {
  background: var(--gba-white); color: var(--gba-text);
  border: 2px solid var(--gba-line); border-radius: 6px;
  box-shadow: inset 0 0 0 1px #fff, inset -2px -2px 0 var(--gba-shadow);
}
.theme-gba .hud-tname, .theme-gba .hud-pill, .theme-gba .hud-pill.green { color: var(--gba-text); text-shadow: 1px 1px 0 var(--gba-shadow); }
.theme-gba .hud-tname, .theme-gba .hud-rank, .theme-gba .hud-pill { font-family: var(--gba-font); }
.theme-gba .hud-rank { color: var(--gba-orange); }
.theme-gba .hud-texp { background: #c8c8c8; }
.theme-gba .hud-pill.charm { color: #c0409c; } .theme-gba .hud-pill.repel { color: var(--gba-purple); }

/* painéis azuis (cartões do HUD e das janelas): o "azul Emerald" escurecido para o texto claro continuar legível */
.theme-gba .hud-card, .theme-gba .win-body .card, .theme-gba .ac-card, .theme-gba .mkc, .theme-gba .hud-chat {
  background: var(--gba-navy); border: 2px solid var(--gba-line); border-radius: 6px;
  box-shadow: inset 0 0 0 1px var(--gba-blue-2), inset 0 -3px 0 var(--gba-blue-3);
}
.theme-gba .card-title, .theme-gba .ac-title, .theme-gba .win-body h3 { font-family: var(--gba-font); letter-spacing: .3px; }

/* ---------------- janelas ---------------- */
.theme-gba .win-box {
  border: 3px solid var(--gba-line); border-radius: 10px;
  box-shadow: inset 0 0 0 2px var(--gba-white), 0 0 0 2px #283030, 0 18px 50px rgba(0,0,0,.55);
  background: #1c2a1c;
}
.theme-gba .win-head {
  background: linear-gradient(180deg, var(--gba-blue-2) 0 2px, var(--gba-blue) 2px calc(100% - 3px), var(--gba-blue-3) calc(100% - 3px));
  border-bottom: 2px solid var(--gba-line); margin: 2px 2px 0; border-radius: 6px 6px 0 0;
  font-family: var(--gba-font); font-size: 17px; color: #fff; text-shadow: 2px 2px 0 var(--gba-line);
}
.theme-gba .win-close { background: var(--gba-orange); border: 2px solid var(--gba-line); color: #fff; text-shadow: 1px 1px 0 #903010; box-shadow: inset 0 0 0 1px #ffb080; }
.theme-gba .win-close:hover { background: #ff8a50; }
.theme-gba .win-nav { background: repeating-linear-gradient(180deg, #c8d078 0 2px, #b0b058 2px 4px); border-right: 2px solid var(--gba-line); margin-left: 2px; margin-bottom: 2px; }
.theme-gba .win-nav .nav-btn {
  font-family: var(--gba-font); font-size: 14px; color: var(--gba-text); background: var(--gba-white);
  border: 2px solid var(--gba-line); border-radius: 6px; box-shadow: inset -2px -2px 0 var(--gba-shadow); position: relative;
}
.theme-gba .win-nav .nav-btn:hover { background: var(--gba-sel-2); }
.theme-gba .win-nav .nav-btn.active { background: var(--gba-sel); border-color: var(--gba-orange); color: var(--gba-text); box-shadow: inset 0 -3px 0 var(--gba-sel-2); }
.theme-gba .win-nav .nav-btn.active::after { content: "▶"; position: absolute; right: 6px; font-size: 10px; color: var(--gba-orange); }
.theme-gba .win-body { background: repeating-linear-gradient(180deg, #2f4a2a 0 2px, #2a4226 2px 4px); margin-right: 2px; margin-bottom: 2px; }

/* ---------------- botões e abas ---------------- */
.theme-gba .btn {
  font-family: var(--gba-font); font-weight: 600; letter-spacing: .3px; color: #fff; text-shadow: 1px 1px 0 var(--gba-line);
  background: var(--gba-purple); border: 2px solid var(--gba-line); border-radius: 8px; box-shadow: inset 0 0 0 1px #9888d8, inset 0 -3px 0 #50408c;
}
.theme-gba .btn:hover { background: #8068c8; border-color: var(--gba-line); }
.theme-gba .btn-primary { background: var(--gba-orange); box-shadow: inset 0 0 0 1px #ffb080, inset 0 -3px 0 #c04818; }
.theme-gba .btn-primary:hover { background: #ff8a50; }
.theme-gba .btn-danger { background: #d84848; box-shadow: inset 0 0 0 1px #ff9090, inset 0 -3px 0 #a02828; }
.theme-gba .btn-gems, .theme-gba .btn-gold { background: var(--gba-blue); box-shadow: inset 0 0 0 1px var(--gba-blue-2), inset 0 -3px 0 var(--gba-blue-3); }
.theme-gba .btn-evo { background: #58a048; box-shadow: inset 0 0 0 1px #a0e088, inset 0 -3px 0 #3a7030; }
.theme-gba .btn-ghost { background: transparent; box-shadow: none; border-color: transparent; }
.theme-gba .shop-tab, .theme-gba .ac-tab { font-family: var(--gba-font); font-size: 14px; }
.theme-gba .shop-tab:hover, .theme-gba .ac-tab:hover { background: var(--gba-sel-2); border-color: var(--gba-line); }
.theme-gba .shop-tab.active, .theme-gba .ac-tab.active { background: var(--gba-sel); border-color: var(--gba-orange); color: var(--gba-text); box-shadow: inset 0 -3px 0 var(--gba-sel-2); }
.theme-gba .win-body select, .theme-gba .win-body input[type=text], .theme-gba .win-body input[type=number], .theme-gba .win-body input:not([type]),
.theme-gba .ac-select, .theme-gba .ac-num, .theme-gba #modal select, .theme-gba #modal input[type=number] {
  background: var(--gba-white); color: var(--gba-text); border: 2px solid var(--gba-line); border-radius: 6px; box-shadow: inset 2px 2px 0 var(--gba-shadow);
}
.theme-gba .ac-start { font-family: var(--gba-font); font-size: 15px; background: #58a048; border: 2px solid var(--gba-line); box-shadow: inset 0 0 0 1px #a0e088, inset 0 -3px 0 #3a7030; text-shadow: 1px 1px 0 var(--gba-line); }
.theme-gba .ac-start.stop { background: #d84848; box-shadow: inset 0 0 0 1px #ff9090, inset 0 -3px 0 #a02828; }
.theme-gba .ac-foot { background: linear-gradient(transparent, #2a4226 30%); }

/* ---------------- itens (inventário, loja) como caixinhas GBA ---------------- */
.theme-gba .inv-slot, .theme-gba .shop-item .ibox {
  background: var(--gba-cream); border: 2px solid var(--gba-line); border-radius: 6px; box-shadow: inset -2px -2px 0 #e0b848, inset 2px 2px 0 #fff0b8;
}
.theme-gba .inv-slot:hover { background: var(--gba-sel); border-color: var(--gba-orange); }
.theme-gba .inv-slot .count { color: var(--gba-text); text-shadow: 1px 1px 0 #fff; font-family: var(--gba-font); font-size: 11px; }

/* ---------------- ícones de tipo do Emerald (folha 128x112, células 32x16) ---------------- */
.theme-gba .chip.tipo {
  width: 48px; height: 21px; padding: 0; border: 0; border-radius: 0; font-size: 0; color: transparent; overflow: hidden; vertical-align: middle;
  background: url("../assets/gba/types.png") no-repeat; background-size: 192px 168px; image-rendering: pixelated; flex-shrink: 0;
}
.theme-gba .tipo-normal { background-position: 0 0 !important; }        .theme-gba .tipo-lutador { background-position: -48px 0 !important; }
.theme-gba .tipo-voador { background-position: -96px 0 !important; }    .theme-gba .tipo-veneno { background-position: -144px 0 !important; }
.theme-gba .tipo-terra { background-position: 0 -24px !important; }     .theme-gba .tipo-pedra { background-position: -48px -24px !important; }
.theme-gba .tipo-inseto { background-position: -96px -24px !important; } .theme-gba .tipo-fantasma { background-position: -144px -24px !important; }
.theme-gba .tipo-aco { background-position: 0 -48px !important; }       .theme-gba .tipo-fogo { background-position: -96px -48px !important; }
.theme-gba .tipo-agua { background-position: -144px -48px !important; } .theme-gba .tipo-planta { background-position: 0 -72px !important; }
.theme-gba .tipo-eletrico { background-position: -48px -72px !important; } .theme-gba .tipo-psiquico { background-position: -96px -72px !important; }
.theme-gba .tipo-gelo { background-position: -144px -72px !important; } .theme-gba .tipo-dragao { background-position: 0 -96px !important; }
.theme-gba .tipo-sombrio { background-position: -48px -96px !important; }

/* ---------------- barra de baixo: menus | placa | equipe (colada à direita) ---------------- */
.theme-gba .dock { border-top: 3px solid var(--gba-line); box-shadow: 0 -2px 0 #889828 inset, 0 -4px 12px rgba(0,0,0,.4); }
.theme-gba .dock-map { border: 3px solid var(--gba-line); border-radius: 6px; box-shadow: 0 0 0 2px var(--gba-white); }
.theme-gba .dock-map-tag { font-family: var(--gba-font); background: var(--gba-orange); color: #fff; border: 1px solid var(--gba-line); }
.theme-gba .dock-grid { border-right: 0; padding-right: 0; }
.theme-gba .dock-btn:hover, .theme-gba .nav-btn.dock-bag:hover, .theme-gba .dock-btn.active { background: var(--gba-sel); border-color: var(--gba-orange); }
.theme-gba .dock-bag span { font-family: var(--gba-font); color: var(--gba-text); }
.theme-gba .nav-btn.dock-bag.active, .theme-gba .nav-btn.dock-btn.active { background: var(--gba-sel) !important; border-color: var(--gba-orange) !important; }
.theme-gba .nav-btn em { background: var(--gba-orange); color: #fff; border: 1px solid var(--gba-line); }

.theme-gba .dock-sign {
  display: flex; flex: 1 1 auto; min-width: 0; align-items: center; justify-content: center; align-self: center; container-type: inline-size; padding: 0 4px;
}
.theme-gba .dock-sign span {
  display: flex; align-items: center; justify-content: center; width: 100%; min-width: 90px; padding: 0 10px 3px; height: 72px; line-height: 1; text-align: center; box-sizing: border-box;
  border-style: solid; border-width: 14px 26px; border-image: url("../assets/gba/sign-wood.png") 7 13 fill / 14px 26px round; image-rendering: pixelated;
  font: 700 clamp(14px, calc((100cqw - 76px) / (var(--chars, 8) * 0.6)), 28px) var(--gba-font); color: #fff; letter-spacing: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-shadow: 2px 0 0 var(--gba-line), -2px 0 0 var(--gba-line), 0 2px 0 var(--gba-line), 0 -2px 0 var(--gba-line), 2px 2px 0 var(--gba-line);
}
.theme-gba .dock-sign.town span { border-image-source: url("../assets/gba/sign-town.png"); }

.theme-gba .dock-team { flex: 0 0 auto; margin-left: auto; gap: 6px; }
/* líder: painel grande azul do menu de Pokémon */
.theme-gba .dock-lead {
  flex: 0 1 300px; min-width: 230px; position: relative;
  background: linear-gradient(180deg, var(--gba-blue-2) 0 2px, var(--gba-blue) 2px 62%, var(--gba-blue-2) 62% calc(100% - 3px), var(--gba-blue-3) calc(100% - 3px));
  border: 3px solid var(--gba-line); border-radius: 8px; color: #fff; padding: 4px 10px 4px 6px;
}
.theme-gba .dock-lead:hover { border-color: var(--gba-orange); background: linear-gradient(180deg, var(--gba-sel-2) 0 2px, var(--gba-sel) 2px 62%, var(--gba-sel-2) 62%); }
.theme-gba .dock-lead .lead-lv, .theme-gba .dock-lead .lead-name { font-family: var(--gba-font); color: #fff; text-shadow: 2px 2px 0 var(--gba-line); }
.theme-gba .dock-lead .lead-name { font-size: 16px; }
.theme-gba .dock-lead .lead-row { font-family: var(--gba-font); color: #ffd840; text-shadow: 1px 1px 0 var(--gba-line); }
.theme-gba .dock-lead .lead-row:nth-child(2) > span:first-child { font-size: 0; width: 26px; height: 14px; flex-shrink: 0; background: url("../assets/gba/hp-label.png") no-repeat 0 0 / 26px 14px; image-rendering: pixelated; }
.theme-gba .dock-lead .lead-row .bar { height: 8px; background: #505050; border: 2px solid var(--gba-white); border-radius: 4px; box-shadow: 0 0 0 1px var(--gba-line); }
.theme-gba .dock-lead .lead-row .bar.hp > div { background: linear-gradient(180deg, #70f8a8 0 50%, #58d080 50%); }
.theme-gba .dock-lead .lead-row .bar.xp > div { background: linear-gradient(180deg, #58b8f8 0 50%, #2890d8 50%); }
.theme-gba .dock-lead .lead-row .val { color: #fff; text-shadow: 1px 1px 0 var(--gba-line); }
/* demais Pokémon: barras do menu de Pokémon, com a Pokébola no canto */
.theme-gba .dock-slots { gap: 5px; }
.theme-gba .dock-slot {
  width: 94px; border: 3px solid var(--gba-line); border-radius: 7px; color: #fff; justify-content: flex-end; padding-bottom: 5px;
  background: linear-gradient(180deg, var(--gba-blue-2) 0 2px, var(--gba-blue) 2px 70%, var(--gba-blue-2) 70% calc(100% - 3px), var(--gba-blue-3) calc(100% - 3px));
}
.theme-gba .dock-slot::before { content: ""; position: absolute; left: 2px; top: 2px; width: 20px; height: 20px; background: url("../assets/gba/ball.png") no-repeat 0 0 / 20px; image-rendering: pixelated; }
.theme-gba .dock-slot:hover { border-color: var(--gba-orange); background: linear-gradient(180deg, var(--gba-sel-2) 0 2px, var(--gba-sel) 2px 70%, var(--gba-sel-2) 70%); }
.theme-gba .dock-slot .slot-lv { font-family: var(--gba-font); color: #fff; text-shadow: 1px 1px 0 var(--gba-line); }
.theme-gba .dock-slot .slot-hp { width: 76px; height: 7px; background: #505050; border: 2px solid var(--gba-white); box-shadow: 0 0 0 1px var(--gba-line); border-radius: 4px; box-sizing: content-box; }
.theme-gba .dock-slot.fainted { opacity: 1; filter: none; background: linear-gradient(180deg, #f0a0a0 0 2px, #d86060 2px 70%, #f0a0a0 70%); }
.theme-gba .dock-slot.fainted .mon-icon { filter: grayscale(1) brightness(.8); }
.theme-gba .dock-slot.locked { background: var(--gba-cream); border-color: var(--gba-line); box-shadow: inset -2px -2px 0 #e0b848; }
.theme-gba .dock-slot.locked::before { display: none; }
.theme-gba .dock-slot.locked .lock-ic { opacity: .35; filter: brightness(.3); }
@container (max-width: 89px) { .theme-gba .dock-sign span { display: none; } }
@media (max-width: 1500px) { .theme-gba .dock-slot { width: 78px; } .theme-gba .dock-slot .slot-hp { width: 60px; } .theme-gba .dock-lead { flex-basis: 240px; min-width: 200px; } }
@media (max-width: 1400px) { .theme-gba .dock-slots .dock-slot.locked { display: none; } }


/* ---------------- modal ---------------- */
.theme-gba .modal-box, .theme-gba #modal .modal-card { border: 3px solid var(--gba-line); border-radius: 10px; box-shadow: inset 0 0 0 2px var(--gba-white), 0 18px 50px rgba(0,0,0,.55); }

/* ---------------- Mochila (Emerald): painel listrado + lista creme ---------------- */
.bag { display: grid; grid-template-columns: minmax(230px, 280px) 1fr; gap: 10px; min-height: 360px; }
.bag-left { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 10px; border: 3px solid var(--gba-line); border-radius: 8px;
  background: repeating-linear-gradient(180deg, #d068f8 0 2px, #4880f8 2px 4px); box-shadow: inset 0 0 0 2px #283840; }
.bag-pocket { display: flex; align-items: center; gap: 6px; width: 100%; }
.bag-label { flex: 1; text-align: center; background: #f8e088; border: 2px solid #283840; border-radius: 8px; padding: 4px 6px;
  font: 700 17px var(--gba-font); color: var(--gba-text); text-shadow: 1px 1px 0 #f8f8c8; box-shadow: inset 0 -2px 0 #e0b848; }
.bag-arrow { width: 28px; height: 28px; border-radius: 6px; border: 2px solid var(--gba-line); background: #f86830; color: #fff; font-size: 12px; cursor: pointer; box-shadow: inset 0 -2px 0 #b83810; }
.bag-arrow:hover { background: #ff8a50; }
.bag-dots { display: flex; gap: 6px; }
.bag-dots i { width: 10px; height: 10px; border-radius: 50%; background: #f8f8f8; border: 2px solid #283840; cursor: pointer; opacity: .55; }
.bag-dots i.on { background: #f8e088; opacity: 1; }
.bag-sprite { width: 128px; height: 128px; image-rendering: pixelated; animation: bag-shake .35s ease-out; filter: drop-shadow(0 4px 0 rgba(40,56,64,.35)); }
@keyframes bag-shake { 0% { transform: rotate(-6deg); } 40% { transform: rotate(5deg); } 70% { transform: rotate(-2deg); } 100% { transform: none; } }
.bag-info { display: flex; gap: 8px; width: 100%; align-items: stretch; margin-top: auto; }
.bag-icon { width: 64px; height: 64px; flex-shrink: 0; display: grid; place-items: center; background: #f8f8f8; border: 2px solid #787878; border-radius: 4px; box-shadow: inset 0 0 0 2px #d8d8d8; }
.bag-icon img { width: 56px; height: 56px; image-rendering: pixelated; }
.bag-desc { flex: 1; min-height: 64px; background: #f8f8f8; border: 2px solid #787878; border-radius: 8px; padding: 6px 8px; color: var(--gba-text); font-size: 12px; display: flex; flex-direction: column; gap: 2px; box-shadow: inset 0 0 0 2px #d8d8d8; }
.bag-desc b { font-family: var(--gba-font); font-size: 16px; }
.bag-list { display: flex; flex-direction: column; background: #f8f8c8; border: 3px solid #283840; border-radius: 8px; padding: 8px 6px; box-shadow: inset 0 0 0 3px #f8e088, inset 0 0 0 5px #386888; min-width: 0; }
.bag-row { display: flex; align-items: center; gap: 10px; padding: 4px 10px; border-radius: 6px; cursor: pointer; color: var(--gba-text); font-family: var(--gba-font); font-size: 18px; text-shadow: 1px 1px 0 #e0e0b0; }
.bag-row:hover { background: #f0f0b0; }
.bag-row.sel { background: #e8e898; }
.bag-cur { width: 14px; font-style: normal; color: #f86830; font-size: 14px; }
.bag-ico { width: 52px; height: 52px; margin: -4px 0; image-rendering: pixelated; flex-shrink: 0; }
.bag-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bag-count { font-variant-numeric: tabular-nums; }
.bag-empty { color: #787860; padding: 12px; font-size: 13px; }
.bag-actions { display: flex; gap: 6px; margin-top: auto; padding-top: 10px; justify-content: flex-end; }
@media (max-width: 700px) { .bag { grid-template-columns: 1fr; } }
/* Mochila ocupa a janela toda (sem espaço vazio embaixo) */
.theme-gba #panel-inventory.active { height: 100%; display: flex; flex-direction: column; }
.theme-gba #panel-inventory .bag { flex: 1; min-height: 360px; }

/* ---------------- janelas isoladas: sem a barra lateral com todos os menus ---------------- */
.theme-gba .win-nav { display: none; }
.theme-gba .win-body { margin-left: 2px; }
/* nome embaixo dos ícones da barra de baixo */
.theme-gba .dock-lbl { font-family: var(--gba-font); font-size: 10px; font-weight: 600; color: var(--gba-text); }

/* ---------------- página Pokémon: painéis do menu de Pokémon do Emerald ---------------- */
.theme-gba .team-list { grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 10px; }
.theme-gba .win-body .team-card {
  padding: 10px 12px 10px 12px; color: #fff; border: 3px solid var(--gba-line); border-radius: 10px;
  background: linear-gradient(180deg, var(--gba-blue-2) 0 2px, var(--gba-blue) 2px 118px, var(--gba-blue-2) 118px 120px, #5aa8d8 120px calc(100% - 3px), var(--gba-blue-3) calc(100% - 3px));
  box-shadow: inset 0 0 0 1px #a8d8f0;
}
.theme-gba .win-body .team-card.lead {
  border-color: var(--gba-orange); box-shadow: inset 0 0 0 1px #ffb080;
  background: linear-gradient(180deg, var(--gba-sel-2) 0 2px, var(--gba-sel) 2px 118px, var(--gba-sel-2) 118px 120px, #90dcf0 120px calc(100% - 3px), #58b0d0 calc(100% - 3px));
}
.theme-gba .win-body .team-card.fainted { opacity: 1; background: linear-gradient(180deg, #f0a0a0 0 2px, #d86060 2px 118px, #f0a0a0 118px 120px, #c87070 120px); }
.theme-gba .win-body .team-card::before { content: ""; position: absolute; left: 6px; top: 6px; width: 20px; height: 20px; background: url("../assets/gba/ball.png") no-repeat 0 0 / 20px; image-rendering: pixelated; }
.theme-gba .win-body .team-card.lead::before { background-image: url("../assets/gba/ball-open.png"); width: 24px; height: 24px; left: 4px; top: 4px; background-size: 24px; }
.theme-gba .win-body .team-card .team-top { gap: 10px; padding-left: 10px; }
.theme-gba .win-body .team-card .team-top b { font: 800 16px var(--gba-font); color: #fff; text-shadow: 2px 2px 0 var(--gba-line); }
.theme-gba .win-body .team-card .team-top .chip:not(.tipo) { font: 700 13px var(--gba-font); background: none; border: 0; color: #fff; text-shadow: 2px 2px 0 var(--gba-line); padding: 0 2px; }
.theme-gba .win-body .team-card .team-top .chip.green { color: #ffe060; }
.theme-gba .win-body .team-card .team-top .chip.purple { color: #f0d0ff; }
.theme-gba .win-body .team-card .drag-handle { color: #fff; text-shadow: 1px 1px 0 var(--gba-line); }
.theme-gba .win-body .team-card.lead .team-top b, .theme-gba .win-body .team-card.lead .team-top .chip:not(.tipo), .theme-gba .win-body .team-card.lead .mini-vital .mono { color: var(--gba-text); text-shadow: 1px 1px 0 #fff; }
.theme-gba .win-body .team-card.lead .team-top .chip.green { color: #c04818; }
/* barras: selo "HP" amarelo, moldura branca e números grandes */
.theme-gba .mini-vital { grid-template-columns: 30px 1fr auto; gap: 8px; margin-top: 6px; font: 600 14px var(--gba-font); color: #ffd840; text-shadow: 1px 1px 0 var(--gba-line); }
.theme-gba .mini-vital:first-of-type > span:first-child { font-size: 0; width: 30px; height: 16px; background: url("../assets/gba/hp-label.png") no-repeat 0 0 / 30px 16px; image-rendering: pixelated; }
.theme-gba .mini-vital .bar { height: 10px; background: #505050; border: 2px solid var(--gba-white); border-radius: 5px; box-shadow: 0 0 0 1px var(--gba-line); }
.theme-gba .mini-vital .bar-hp > div { background: linear-gradient(180deg, #70f8a8 0 50%, #58d080 50%); }
.theme-gba .mini-vital .bar-exp > div { background: linear-gradient(180deg, #58b8f8 0 50%, #2890d8 50%); }
.theme-gba .mini-vital .mono { font: 700 17px var(--gba-font); color: #fff; text-shadow: 2px 2px 0 var(--gba-line); min-width: 74px; text-align: right; }
.theme-gba .win-body .team-card .move-chips { margin-top: 6px; }
.theme-gba .win-body .team-card .move-chip { font: 600 12px var(--gba-font); border: 1px solid rgba(0,0,0,.35); text-shadow: 1px 1px 0 rgba(0,0,0,.4); }
.theme-gba .win-body .team-card .evo-next, .theme-gba .win-body .team-card .muted { color: #f0f8ff; text-shadow: 1px 1px 0 var(--gba-line); font-family: var(--gba-font); font-size: 13px; }
.theme-gba .win-body .team-card.lead .evo-next { color: var(--gba-text); text-shadow: none; }
.theme-gba #panel-team > .panel-sub { color: #e8f0d8; }
/* números com fonte legível (a pixel confundia 6/8/0) */
.theme-gba { --gba-num: "Nunito", "Inter", system-ui, sans-serif; }   /* números na fonte do FireRed (legível; a Pixelify confundia 6/8/0) */
.theme-gba .mini-vital .mono, .theme-gba .win-body .team-card .team-top .chip:not(.tipo), .theme-gba .dock-lead .lead-row .val, .theme-gba .dock-lead .lead-lv,
.theme-gba .dock-slot .slot-lv, .theme-gba .bag-count, .theme-gba .inv-slot .count { font-family: var(--gba-num) !important; font-weight: 800; font-synthesis: none; font-variant-numeric: tabular-nums; letter-spacing: 0; }
.theme-gba .mini-vital .mono { font-size: 16px; }
/* os 6 Pokémon cabem na altura da janela (3 x 2), golpes numa linha */
/* a janela da equipe encolhe até o conteúdo (sem sobra verde) */
.theme-gba .win-box:has(#panel-team.active) { height: auto; }
.theme-gba #panel-team .team-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.theme-gba .win-body .team-card { gap: 4px; padding: 8px 10px; overflow: hidden; }
.theme-gba .win-body .team-card .move-chips { display: flex; flex-wrap: nowrap; gap: 3px; overflow: hidden; margin-top: 4px; }
.theme-gba .win-body .team-card .move-chip { font-size: 10px; padding: 1px 5px; white-space: nowrap; flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.theme-gba .win-body .team-card .team-actions { margin-top: 4px; }
@media (max-width: 1000px) { .theme-gba #panel-team .team-list { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: auto; } }
/* Exp Share ao lado da Pokébola (não em cima) */
.theme-gba .dock-slot .slot-xs { left: 22px; top: 0; width: 24px; height: 24px; filter: drop-shadow(0 1px 0 var(--gba-line)); }
.theme-gba .dock-slot:has(.slot-xs) { border-color: var(--gba-line); }
/* card da equipe alinhado: HP, Exp, golpes e botões na mesma altura em todos; evolução por último */
.theme-gba .win-body .team-card .tc-xs { left: 26px; top: 3px; z-index: 1; filter: drop-shadow(0 1px 0 var(--gba-line)); }
.theme-gba .win-body .team-card .team-top .chip.green { display: none; }
.theme-gba .win-body .team-card .team-top { min-height: 92px; }
.theme-gba .win-body .team-card .team-actions { margin-top: 6px; }
.theme-gba .win-body .team-card > .evo-next, .theme-gba .win-body .team-card > .row:last-child { margin-top: 6px; }

/* ---------------- menu de batalha (e PvP) no estilo Emerald: caixa branca, moldura escura, cursor ▶ ---------------- */
.theme-gba .battle-ui {
  background: var(--gba-white); border: 4px solid #283840; border-radius: 10px; padding: 8px 10px 0;
  box-shadow: inset 0 0 0 2px #f8e088, inset 0 0 0 4px #386888, 0 6px 0 rgba(0,0,0,.35);
}
.theme-gba .bt-title { font: 700 14px var(--gba-font); color: var(--gba-text); letter-spacing: .5px; text-shadow: 1px 1px 0 var(--gba-shadow); }
.theme-gba .bt-title.your-turn { color: #fff; background: var(--gba-orange); text-shadow: 1px 1px 0 #903010; border: 2px solid var(--gba-line); }
.theme-gba .bt-btn {
  position: relative; color: var(--gba-text); border: 2px solid var(--gba-line); border-radius: 8px;
  font: 700 16px var(--gba-font); box-shadow: inset -2px -2px 0 var(--gba-shadow); text-shadow: 1px 1px 0 var(--gba-shadow);
}
.theme-gba .bt-btn:hover:not(:disabled) { background: var(--gba-sel-2); border-color: var(--gba-orange); }
.theme-gba .bt-btn:hover:not(:disabled)::before { content: "▶"; position: absolute; left: 8px; color: var(--gba-orange); font-size: 12px; text-shadow: none; }
.theme-gba .bt-btn .bt-ic { color: #c04818; }
.theme-gba .bt-btn small { color: #707080; font-family: var(--gba-num); font-weight: 700; text-shadow: none; }
/* golpes: caixa da cor do tipo, como os ícones de tipo do GBA */
.theme-gba .bt-btn.bt-move { color: #fff; text-shadow: 1px 1px 0 rgba(0,0,0,.45); border-color: var(--gba-line); box-shadow: inset 0 0 0 1px rgba(255,255,255,.35), inset 0 -3px 0 rgba(0,0,0,.25); background-image: none; }
.theme-gba .bt-btn.bt-move small { color: rgba(255,255,255,.9); }
.theme-gba .bt-btn.bt-move:hover:not(:disabled) { filter: brightness(1.12); border-color: var(--gba-orange); }
.theme-gba .bt-btn.bt-move:hover:not(:disabled)::before { color: #fff; }
.theme-gba .bt-run { background: #f8e0d8; }
.theme-gba .bt-empty { color: #707080; }
.theme-gba .battle-timer { background: #d8d0d8; margin: 0 -10px; height: 4px; border-radius: 0 0 6px 6px; }
.theme-gba .battle-timer > div { background: var(--gba-orange); }
/* barra de nível e golpes rápidos fora da batalha */
.theme-gba .lvl-bar { background: var(--gba-white); border: 2px solid var(--gba-line); box-shadow: inset -2px -2px 0 var(--gba-shadow); color: var(--gba-text); font-family: var(--gba-font); }
.theme-gba .lvl-bar #top-level { font-family: var(--gba-num); font-weight: 800; color: #c04818; }
.theme-gba .move-bar .jutsu-cd .ic { background: var(--gba-white); border: 2px solid var(--gba-line); border-radius: 8px; box-shadow: inset -2px -2px 0 var(--gba-shadow); }
.theme-gba .move-bar .jutsu-cd small { color: #fff; font-family: var(--gba-font); text-shadow: 1px 1px 0 var(--gba-line), -1px 0 0 var(--gba-line); }
/* PvP: log e rodapé na mesma caixa branca */
.theme-gba .pvp-box .pv-log { background: var(--gba-white); color: var(--gba-text); border-top: 3px solid #283840; font-family: var(--gba-num); }
.theme-gba .pvp-box .pv-log .turn { color: #c04818; }
.theme-gba .pvp-box .sw-foot { background: var(--gba-white); border-top: 2px solid var(--gba-shadow); }
.theme-gba .pv-turn-banner { background: var(--gba-orange); color: #fff; font-family: var(--gba-font); text-shadow: 1px 1px 0 #903010; border: 2px solid var(--gba-line); }
.theme-gba .lvl-bar .lvl-label { color: var(--gba-text); }
.theme-gba .lvl-bar .lvl-track { background: #505050; border: 2px solid var(--gba-white); box-shadow: 0 0 0 1px var(--gba-line); }
.theme-gba .bt-btn:not(.bt-move) { background: #f8f8f8; }
.theme-gba .bt-btn.bt-run { background: #f8e0d8; }
.theme-gba .bt-btn:not(.bt-move):hover:not(:disabled) { background: var(--gba-sel-2); }

/* ---------------- tooltip e janelas modais (golpes, itens…) no padrão GBA ---------------- */
.theme-gba .tooltip {
  background: var(--gba-navy); border: 3px solid var(--gba-line); border-radius: 8px; color: #e8eef8;
  box-shadow: inset 0 0 0 1px var(--gba-blue-2), inset 0 -3px 0 var(--gba-blue-3), 0 8px 24px rgba(0,0,0,.5);
}
.theme-gba .tooltip.pinned { border-color: var(--gba-orange); box-shadow: inset 0 0 0 1px #ffb080, 0 8px 24px rgba(0,0,0,.5); }
.theme-gba .tooltip .item-name { font: 700 17px var(--gba-font); color: #fff; text-shadow: 2px 2px 0 var(--gba-line); }
.theme-gba .tooltip .item-stats b, .theme-gba .tooltip .iv-row b { font-family: var(--gba-num); }
.theme-gba .tooltip .iv-hint, .theme-gba .tooltip .pin-hint { border-color: #4a5a80; }

.theme-gba .modal-box {
  background: var(--gba-navy); border: 3px solid var(--gba-line); border-radius: 10px; padding: 0 14px 14px;
  box-shadow: inset 0 0 0 2px var(--gba-white), 0 0 0 2px #283030, 0 18px 50px rgba(0,0,0,.55);
}
.theme-gba .modal-head {
  margin: 2px -12px 12px; padding: 9px 12px; border-radius: 7px 7px 0 0; border-bottom: 2px solid var(--gba-line);
  background: linear-gradient(180deg, var(--gba-blue-2) 0 2px, var(--gba-blue) 2px calc(100% - 3px), var(--gba-blue-3) calc(100% - 3px));
  font: 700 18px var(--gba-font); color: #fff; text-shadow: 2px 2px 0 var(--gba-line);
}
.theme-gba .modal-head #modal-close { background: var(--gba-orange); border: 2px solid var(--gba-line); color: #fff; text-shadow: 1px 1px 0 #903010; box-shadow: inset 0 0 0 1px #ffb080; width: 30px; height: 30px; padding: 0; }
.theme-gba .modal-body .muted { color: #b8c4dc; }

/* lista de golpes: painéis do menu de Pokémon; marcados = azul-claro com borda laranja */
.theme-gba .move-opt { background: #2c3c64; border: 2px solid var(--gba-line); border-radius: 8px; box-shadow: inset 0 0 0 1px #4a6aa0; color: #fff; }
.theme-gba .move-opt b { font: 700 16px var(--gba-font); text-shadow: 1px 1px 0 var(--gba-line); }
.theme-gba .move-opt.on { background: var(--gba-blue); border-color: var(--gba-orange); box-shadow: inset 0 0 0 1px var(--gba-blue-2), inset 0 -3px 0 var(--gba-blue-3); }
.theme-gba .move-opt.on .muted, .theme-gba .move-opt.on small { color: #eaf6ff; }
.theme-gba .move-opt.off { opacity: .5; }
.theme-gba .move-opt:hover:not(.off) { border-color: var(--gba-orange); }
.theme-gba .move-opt input { accent-color: var(--gba-orange); width: 18px; height: 18px; }
.theme-gba .move-pick .num { font: 700 15px var(--gba-font); text-shadow: 1px 1px 0 var(--gba-line); }
.theme-gba .move-head { font: 700 13px var(--gba-font); color: #fff; text-shadow: 1px 1px 0 var(--gba-line); background: var(--gba-line, #283050); border-radius: 6px; }
/* golpes: ícones de tipo/categoria a 1,5x (altura do nome), recortando só a área útil 32x14 da célula 32x16 (pula a linha 0 transparente) */
.theme-gba .move-opt .chip.tipo { width: 48px; height: 21px; background-size: 192px 168px; margin-left: 0; }
.theme-gba .move-opt .cat-ic { width: 27px; height: 21px; }
.theme-gba .move-opt .tipo-normal { background-position: 0px -1.5px !important; }
.theme-gba .move-opt .tipo-lutador { background-position: -48px -1.5px !important; }
.theme-gba .move-opt .tipo-voador { background-position: -96px -1.5px !important; }
.theme-gba .move-opt .tipo-veneno { background-position: -144px -1.5px !important; }
.theme-gba .move-opt .tipo-terra { background-position: 0px -25.5px !important; }
.theme-gba .move-opt .tipo-pedra { background-position: -48px -25.5px !important; }
.theme-gba .move-opt .tipo-inseto { background-position: -96px -25.5px !important; }
.theme-gba .move-opt .tipo-fantasma { background-position: -144px -25.5px !important; }
.theme-gba .move-opt .tipo-aco { background-position: 0px -49.5px !important; }
.theme-gba .move-opt .tipo-fogo { background-position: -96px -49.5px !important; }
.theme-gba .move-opt .tipo-agua { background-position: -144px -49.5px !important; }
.theme-gba .move-opt .tipo-planta { background-position: 0px -73.5px !important; }
.theme-gba .move-opt .tipo-eletrico { background-position: -48px -73.5px !important; }
.theme-gba .move-opt .tipo-psiquico { background-position: -96px -73.5px !important; }
.theme-gba .move-opt .tipo-gelo { background-position: -144px -73.5px !important; }
.theme-gba .move-opt .tipo-dragao { background-position: 0px -97.5px !important; }
.theme-gba .move-opt .tipo-sombrio { background-position: -48px -97.5px !important; }
@media (max-width: 1400px) { .theme-gba .dock-slot { width: 72px; } .theme-gba .dock-slot .slot-hp { width: 54px; } .theme-gba .dock-lead { flex-basis: 220px; min-width: 190px; } }
@container (max-width: 200px) { .theme-gba .dock-sign span { white-space: normal; line-height: 1.05; font-size: 12px; letter-spacing: 0; border-width: 14px 14px; border-image-width: 14px 14px; padding: 0 2px; overflow-wrap: normal; } }
/* sprite dos Pokémon da barra mais para cima (logo abaixo da Pokébola/nível), HP embaixo */
.theme-gba .dock-slot { justify-content: flex-start; padding: 20px 0 6px; gap: 0; }
.theme-gba .dock-slot .mon-icon { margin-top: 0; }
.theme-gba .dock-slot .slot-hp { margin-top: auto; }
/* HP e Exp logo abaixo da sprite (não mais no rodapé do slot) */
.theme-gba .dock-slot { padding: 20px 0 0; }
.theme-gba .dock-slot .slot-hp { margin-top: 2px; }
.theme-gba .dock-slot .slot-xp { width: 76px; height: 4px; margin-top: 3px; background: #505050; border: 2px solid var(--gba-white); box-shadow: 0 0 0 1px var(--gba-line); border-radius: 3px; box-sizing: content-box; }
.theme-gba .dock-slot .slot-xp > div { background: linear-gradient(180deg, #58b8f8 0 50%, #2890d8 50%); }
@media (max-width: 1500px) { .theme-gba .dock-slot .slot-xp { width: 60px; } }
@media (max-width: 1400px) { .theme-gba .dock-slot .slot-xp { width: 54px; } }
/* card "Vitória!" no estilo de caixa de texto do GBA */
.theme-gba .victory-card { background: var(--gba-cream, #f8f0c8); color: var(--gba-text, #383838); border: 3px solid var(--gba-line); border-radius: 8px;
  box-shadow: inset 0 0 0 2px #fff, 0 4px 0 rgba(0,0,0,.35); font: 700 14px var(--gba-font); }
.theme-gba .vc-head b { color: #2f8a28; font-size: 16px; text-shadow: 1px 1px 0 #c8e8b8; }
.theme-gba .vc-head small { color: #5a5a6a; }
.theme-gba .vc-stat.xp { color: #2860b8; } .theme-gba .vc-stat.txp { color: #a06800; } .theme-gba .vc-stat.gold { color: #a07800; }
.theme-gba .vc-share { color: #2f7a28; } .theme-gba .vc-loot { color: #6a3a98; }
.theme-gba .vc-evs { color: #7a3ab8; }
.theme-gba .dshop-bal { background: var(--gba-cream, #f8f0c8); border: 2px solid var(--gba-line); color: var(--gba-text, #383838); font: 700 14px var(--gba-font); }
.theme-gba .dshop-bal b { color: #2860b8; font-family: var(--gba-num); }

/* nomes e números dos Pokémon (card do líder embaixo, Pokémon da equipe no rodapé, cards da página Pokémon):
   fonte do FireRed/LeafGreen, legível; sem negrito falso (a fonte não tem negrito e ficaria borrada) */
.theme-gba .dock-lead .lead-name, .theme-gba .dock-lead .lead-lv, .theme-gba .dock-lead .lead-row, .theme-gba .dock-slot .slot-lv,
.theme-gba .win-body .team-card .team-top b, .theme-gba .mini-vital, .theme-gba .mini-vital .mono {
  font-family: var(--gba-font); font-weight: 700; text-shadow: 1px 1px 0 var(--gba-line);
}
/* nome do Pokémon sempre inteiro (a fonte Nunito é mais larga): os tipos descem para a linha de baixo quando não cabem */
.theme-gba .win-body .team-card .team-name { flex-wrap: wrap; row-gap: 3px; }
.theme-gba .win-body .team-card .team-name > b { flex-shrink: 0; max-width: 100%; }
/* placa: ao entrar em outra cidade/rota (main.js updateSign) dá um "pulo" e brilha um instante */
.theme-gba .dock-sign.flash span { animation: sign-flash .9s ease-out; }
@keyframes sign-flash { 0% { transform: translateY(6px) scale(.92); filter: brightness(1.6); } 35% { transform: translateY(-3px) scale(1.04); filter: brightness(1.3); } 100% { transform: none; filter: none; } }
