/* ===== UI clássica (Gen 4 HP / Gen 5 party) — carrega após theme.css ===== */

/* ---------- Barras de HP estilo Gen 4 ---------- */
.bbar {
  position: relative;
  background: #f8f8f8 !important;
  border: 3px solid #303030 !important;
  border-radius: 0 !important;
  padding: 6px 10px 5px !important;
  min-width: 200px;
  max-width: min(92vw, 300px);
  margin: 0 auto 8px;
  color: #101010 !important;
  box-shadow:
    4px 4px 0 rgba(0, 0, 0, 0.35),
    inset 0 0 0 2px #e8e8e8 !important;
  backdrop-filter: none !important;
  font-family: "Segoe UI", system-ui, sans-serif;
}
.benemy .bbar {
  border-radius: 18px 4px 4px 4px !important;
  clip-path: none;
}
.bplayer .bbar {
  border-radius: 4px 4px 4px 18px !important;
}

.bbar-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.bbar .bname {
  float: none;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #101010 !important;
  font-family: "Press Start 2P", "Segoe UI", monospace;
  font-size: 10px;
  line-height: 1.4;
}
.bbar .blv {
  float: none;
  flex-shrink: 0;
  color: #101010 !important;
  font-weight: 800;
  font-size: 11px;
  font-family: "Press Start 2P", "Segoe UI", monospace;
  letter-spacing: 0;
}
.bbar .blv::before {
  content: "";
}
.brarity {
  float: none;
  display: inline-block;
  clear: none;
  margin: 0 0 4px;
  font-size: 10px;
}

.hp-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}
.hp-label {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 14px;
  padding: 0 5px;
  border-radius: 7px;
  background: linear-gradient(180deg, #f06060, #c02020);
  color: #fff;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.06em;
  line-height: 1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
  font-family: "Press Start 2P", monospace;
  font-size: 7px;
}

.hpbar {
  flex: 1;
  height: 10px !important;
  background: #303030 !important;
  border-radius: 2px !important;
  overflow: hidden;
  margin-top: 0 !important;
  border: 2px solid #101010 !important;
  box-shadow: inset 0 0 0 1px #606060 !important;
}
.hpbar > div {
  height: 100%;
  width: 100%;
  transform-origin: left center;
  background: linear-gradient(180deg, #70f870 0%, #28d028 42%, #18b018 100%) !important;
  transition: transform 0.32s ease-out, background 0.25s;
  will-change: transform;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
  border-radius: 0;
}

.hptext {
  font-size: 11px !important;
  color: #101010 !important;
  text-align: right;
  margin-top: 3px;
  font-weight: 800;
  font-family: "Press Start 2P", monospace;
  font-size: 9px !important;
  letter-spacing: 0.02em;
}

.expbar {
  height: 5px !important;
  background:
    repeating-linear-gradient(
      90deg,
      #404040 0 2px,
      #303030 2px 4px
    ) !important;
  border-radius: 0 !important;
  overflow: hidden;
  margin-top: 5px !important;
  border: 2px solid #101010 !important;
  margin-left: -10px;
  margin-right: -10px;
  margin-bottom: -5px;
  width: calc(100% + 20px);
}
.expbar > div {
  height: 100%;
  width: 100%;
  transform-origin: left center;
  background: linear-gradient(180deg, #60d0f8 0%, #2080e0 100%) !important;
  transition: transform 0.4s ease-out;
  will-change: transform;
}

/* HUD de campo — mesma lógica de HP */
.pbar {
  height: 8px;
  background: #202020;
  border: 1px solid #000;
  border-radius: 2px;
  overflow: hidden;
}
.pbar > div {
  background: linear-gradient(180deg, #70f870 0%, #18b018 100%);
}

/* ---------- Menu de batalha (caixa clássica) ---------- */
.bbox {
  background: #f0e8d0 !important;
  border-top: 6px solid #303030 !important;
  padding: 12px 14px !important;
  min-height: 132px;
  box-shadow: 0 -4px 0 #606060, 0 -8px 24px rgba(0, 0, 0, 0.35) !important;
}
.bbox::before {
  display: none !important;
}

#bmsg {
  background: #fff;
  border: 3px solid #303030;
  border-radius: 8px;
  color: #101010 !important;
  padding: 10px 14px;
  margin-bottom: 10px;
  min-height: 2.6em;
  font-weight: 700;
  font-size: 15px;
  line-height: 1.35;
  box-shadow: inset 0 0 0 2px #e8e0c8;
}

.bmenu {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  max-width: 480px;
}
.bmenu button {
  padding: 12px 10px !important;
  font-size: 14px !important;
  font-weight: 800 !important;
  border-radius: 6px !important;
  border: 3px solid #303030 !important;
  background: linear-gradient(180deg, #ffffff 0%, #e8e8e8 100%) !important;
  color: #101010 !important;
  box-shadow: 3px 3px 0 #202020 !important;
  outline: none !important;
  font-family: inherit !important;
}
.bmenu button:active {
  transform: translate(2px, 2px) !important;
  box-shadow: 1px 1px 0 #202020 !important;
}
.bmenu button[data-act="fight"] {
  background: linear-gradient(180deg, #ff9090 0%, #e04040 100%) !important;
  color: #fff !important;
  border-color: #801818 !important;
}
.bmenu button[data-act="catch"] {
  background: linear-gradient(180deg, #ffe566 0%, #e0b000 100%) !important;
  color: #202020 !important;
}
.bmenu button[data-act="run"],
.bmenu button.back {
  background: linear-gradient(180deg, #90b0ff 0%, #4060c0 100%) !important;
  color: #fff !important;
  border-color: #203880 !important;
}
.bmenu button.back {
  grid-column: 1 / -1;
}
.bforms button {
  border: 2px solid #303030 !important;
  border-radius: 6px;
  background: #fff !important;
  color: #101010 !important;
  box-shadow: 2px 2px 0 #202020;
}

/* ---------- Equipe estilo Gen 5 ---------- */
.party-device { width: min(96vw, 560px); }
.party-frame {
  background:
    linear-gradient(180deg, rgba(20, 24, 48, 0.92), rgba(12, 16, 36, 0.96)),
    repeating-linear-gradient(
      0deg,
      transparent 0 18px,
      rgba(80, 120, 200, 0.08) 18px 19px
    ),
    repeating-linear-gradient(
      90deg,
      transparent 0 18px,
      rgba(80, 120, 200, 0.08) 18px 19px
    );
  border: 3px solid #e8e8f0;
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55), inset 0 0 0 1px rgba(100, 160, 255, 0.25);
  overflow: hidden;
}
.party-header {
  background: linear-gradient(90deg, #2840a0, #183070);
  color: #fff;
  text-align: left;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 2px;
  padding: 10px 14px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.2);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  position: relative;
}
.party-header-title { flex: 1; text-align: left; padding-right: 44px; }
.party-close-x {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; min-width: 40px; min-height: 40px;
  padding: 0; border: 2px solid rgba(255,255,255,0.85); border-radius: 8px;
  background: linear-gradient(180deg, #ff6b6b, #c02020); color: #fff;
  font-size: 18px; font-weight: 800; line-height: 1; cursor: pointer;
}
.party-body {
  display: flex;
  min-height: 320px;
  background: transparent;
}
.party-list {
  list-style: none;
  flex: 1;
  margin: 0;
  padding: 10px 8px;
  overflow-y: auto;
  max-height: 360px;
  background: transparent;
  border-right: 2px solid rgba(255, 255, 255, 0.12);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.party-slot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 8px 10px;
  cursor: pointer;
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-radius: 4px;
  color: #fff;
  background: rgba(48, 40, 88, 0.78);
  transform: skewX(-8deg);
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.35);
  border-bottom: 2px solid rgba(255, 255, 255, 0.85);
}
.party-slot > * {
  transform: skewX(8deg);
}
.party-slot:hover {
  background: rgba(64, 72, 140, 0.9);
}
.party-slot.sel {
  background: rgba(20, 140, 230, 0.88);
  border-color: #fff;
  box-shadow: 0 0 0 2px rgba(120, 200, 255, 0.55), 3px 3px 0 rgba(0, 0, 0, 0.35);
}
.party-slot.fainted {
  opacity: 0.55;
  filter: grayscale(0.35);
}
.party-slot.empty {
  opacity: 0.45;
  cursor: default;
  font-style: italic;
  background: rgba(30, 30, 50, 0.55);
}
.party-slot-num {
  font-weight: 800;
  font-size: 12px;
  min-width: 16px;
  color: #a8c8ff;
}
.party-slot.sel .party-slot-num { color: #fff; }
.party-slot-info { flex: 1; min-width: 0; }
.party-slot-name {
  font-weight: 700;
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.party-slot-lv {
  font-size: 12px;
  opacity: 0.9;
  font-weight: 600;
}
.party-hp-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}
.party-hp-label {
  font-size: 10px;
  font-weight: 800;
  font-style: italic;
  color: #d0e0ff;
  min-width: 18px;
}
.party-slot-bar {
  flex: 1;
  height: 8px;
  background: #101018;
  border: 1px solid #000;
  border-radius: 2px;
  margin-top: 0;
  overflow: hidden;
}
.party-slot-bar > div {
  height: 100%;
  border-radius: 0;
  background: linear-gradient(180deg, #70f870 0%, #18b018 100%);
}
.party-slot.fainted .party-slot-bar > div {
  background: linear-gradient(180deg, #888, #444);
}
.party-slot-hpnum {
  font-size: 11px;
  font-weight: 700;
  color: #e8f0ff;
  white-space: nowrap;
  min-width: 64px;
  text-align: right;
}
.party-detail {
  width: 180px;
  flex-shrink: 0;
  padding: 14px 12px;
  background: rgba(16, 20, 40, 0.85);
  color: #e8f0ff;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  border-left: 2px solid rgba(255, 255, 255, 0.1);
}
.party-detail-empty { color: #8898b8; font-size: 13px; margin-top: 40px; }
.party-detail-name { font-weight: 800; font-size: 15px; color: #fff; }
.party-detail-hp { font-size: 13px; color: #c8d8f0; margin: 6px 0; }
.party-detail-moves { font-size: 11px; color: #b0c0d8; text-align: left; width: 100%; margin-top: 8px; }
.party-actions {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(20, 28, 60, 0.95);
  border-top: 2px solid rgba(255, 255, 255, 0.12);
}
.party-move {
  flex: 1;
  padding: 10px;
  font-weight: 800;
  font-size: 12px;
  background: linear-gradient(180deg, #f8f8f8, #d0d8e8);
  color: #183070;
  border: 2px solid #fff;
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.35);
}
.party-move:disabled { opacity: 0.4; cursor: not-allowed; }
.party-hint {
  margin: 0;
  padding: 8px 12px 12px;
  text-align: center;
  background: rgba(12, 16, 36, 0.9);
  color: #a0b0d0 !important;
}

/* ---------- Pokédex mais clássica ---------- */
.dex-bezel {
  background: linear-gradient(145deg, #f06060, #d02828 45%, #a01818);
  border: 4px solid #401010;
  border-radius: 18px;
  padding: 14px 14px 12px;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.28),
    0 10px 28px rgba(0, 0, 0, 0.5);
}
.dex-screen {
  background: #e8f0d8;
  border: 4px solid #202020;
  border-radius: 6px;
  box-shadow: inset 0 0 16px rgba(0, 0, 0, 0.18);
  overflow: hidden;
}
.dex-topbar {
  background: linear-gradient(#3068b0, #184878);
  border-bottom: 3px solid #102040;
  font-family: "Press Start 2P", monospace;
  font-size: 11px;
  letter-spacing: 1px;
}
.dex-list-head {
  background: #204888;
  font-family: "Press Start 2P", monospace;
  font-size: 9px;
  letter-spacing: 1px;
}
.dex-row {
  border-bottom: 1px solid #c8d0b0;
  font-weight: 600;
}
.dex-row.sel {
  background: #2860a8;
  box-shadow: inset 3px 0 0 #ffcb05;
}
.dex-row-num {
  font-family: "Press Start 2P", monospace;
  font-size: 10px;
}
.dex-detail {
  background: #f4f0dc;
}
.dex-detail-name {
  font-family: "Press Start 2P", monospace;
  font-size: 13px;
  line-height: 1.4;
}
.dex-detail-entry {
  border: 3px solid #303030;
  background: #fff;
  border-radius: 4px;
  font-size: 12px;
}

/* Co-op / boss bars */
.hpbar.boss,
.hpbar.sm {
  border: 2px solid #101010 !important;
  background: #303030 !important;
  border-radius: 2px !important;
}

/* ---------- Mochila estilo jogos originais (Gen 4/5) ---------- */
.bag-device {
  width: min(96vw, 540px);
}
.bag-frame {
  background: #1a2038;
  border: 4px solid #e8e8f0;
  border-radius: 12px;
  box-shadow:
    0 12px 36px rgba(0, 0, 0, 0.55),
    inset 0 0 0 2px rgba(80, 120, 200, 0.35);
  overflow: hidden;
}
.bag-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(90deg, #c02828 0%, #901818 100%);
  color: #fff;
  padding: 10px 14px;
  border-bottom: 3px solid #601010;
  text-align: left;
}
.bag-header-title {
  font-weight: 900;
  font-size: 16px;
  letter-spacing: 3px;
  font-family: "Press Start 2P", monospace;
  font-size: 11px;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.35);
}
.bag-header-hint {
  font-size: 12px;
  font-weight: 600;
  opacity: 0.9;
  color: #ffd0d0;
}
.bag-body {
  display: flex;
  min-height: 340px;
  background:
    repeating-linear-gradient(
      0deg,
      transparent 0 16px,
      rgba(100, 140, 220, 0.06) 16px 17px
    ),
    #12182c;
}
.bag-pockets {
  display: flex;
  flex-direction: column;
  width: 96px;
  flex-shrink: 0;
  background: #0c1020;
  border-right: 3px solid #303850;
  gap: 0;
}
.bag-pocket {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 4px;
  border: none;
  border-bottom: 1px solid #283048;
  background: transparent;
  color: #a0b0d0;
  cursor: pointer;
  border-radius: 0;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.4px;
  min-height: 52px;
  position: relative;
}
.bag-pocket:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.bag-pocket.sel {
  background: linear-gradient(90deg, #2860c8, #184898);
  color: #fff;
  box-shadow: inset 3px 0 0 #ffcb05;
}
.bag-pocket-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
  background: rgba(255, 255, 255, 0.12);
  border: 2px solid rgba(255, 255, 255, 0.25);
}
.bag-pocket[data-pocket="items"] .bag-pocket-icon { background: #4060a0; }
.bag-pocket[data-pocket="medicine"] .bag-pocket-icon { background: #e06060; }
.bag-pocket[data-pocket="balls"] .bag-pocket-icon {
  background: linear-gradient(#ee2b3a 0 48%, #1a1a1a 48% 52%, #f5f5f5 52% 100%);
  color: transparent;
  border-color: #1a1a1a;
  position: relative;
}
.bag-pocket[data-pocket="balls"] .bag-pocket-icon::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #1a1a1a;
}
.bag-pocket[data-pocket="tm"] .bag-pocket-icon { background: #50a060; }
.bag-pocket[data-pocket="key"] .bag-pocket-icon { background: #d0a020; color: #1a1a1a; }
.bag-pocket[data-pocket="berries"] .bag-pocket-icon { background: #c050a0; }
.bag-pocket-label {
  font-size: 9px;
  text-align: center;
  line-height: 1.15;
  letter-spacing: 0.5px;
}
.bag-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #f4f0e0;
  min-width: 0;
}
.bag-items-head {
  display: flex;
  justify-content: space-between;
  background: #284878;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 7px 14px;
  letter-spacing: 1px;
  border-bottom: 2px solid #183050;
  font-family: "Press Start 2P", monospace;
  font-size: 8px;
}
.bag-items {
  list-style: none;
  flex: 1;
  overflow-y: auto;
  margin: 0;
  padding: 0;
  max-height: 240px;
  background: #faf6e8;
}
.bag-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid #ddd4b8;
  font-size: 14px;
  color: #202020;
  gap: 10px;
}
.bag-row:hover { background: #ebe4cc; }
.bag-row.sel {
  background: #2860a8;
  color: #fff;
  box-shadow: inset 4px 0 0 #ffcb05;
}
.bag-row-name {
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}
.bag-row-qty {
  font-weight: 900;
  min-width: 36px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.bag-row.sel .bag-row-qty { color: #ffe566; }
.bag-empty {
  padding: 32px 16px;
  text-align: center;
  color: #888;
  font-style: italic;
}
.bag-desc {
  background: #fff;
  border-top: 3px solid #303030;
  border-bottom: none;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.45;
  color: #303030;
  min-height: 64px;
  box-shadow: inset 0 0 0 2px #e8e0c8;
}
.bag-footer {
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  background: #12182c;
  border-top: 2px solid #303850;
}
.bag-btn {
  flex: 1;
  padding: 12px 10px;
  font-weight: 900;
  font-size: 13px;
  letter-spacing: 1px;
  border: 3px solid #303030;
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 3px 3px 0 #101010;
}
.bag-btn:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 #101010;
}
.bag-btn-cancel {
  background: linear-gradient(180deg, #f0f0f0, #d0d0d0);
  color: #202020;
}
.bag-btn-use {
  background: linear-gradient(180deg, #ffe566, #e0b000);
  color: #202020;
}

/* Menu de bolas na batalha */
.bmenu button.ball-opt {
  text-align: left;
  padding-left: 14px !important;
}
.bmenu button.ball-opt .ball-qty {
  float: right;
  opacity: 0.85;
  font-weight: 700;
}
