/* Liga Pokémon (ginásios PvE): abas por região, cartões dos líderes, Campeão, insígnias e arena.
   Cor do assunto: dourado (--c-money, data-tone="money"). */
.league-win .win-body { display: flex; flex-direction: column; min-height: 0; }
.lg, .lg-prep { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.lg-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; font-size: 13px; }
.lg-titles { color: var(--c-money, #f5c84c); font-weight: 700; }
.lg-history { display: flex; flex-direction: column; gap: 4px; }
.lg-hist { display: grid; grid-template-columns: 20px 1fr auto; gap: 8px; padding: 4px 8px; border-radius: 6px; background: rgba(20,28,36,.6); }
.lg-hist.won span:first-child { color: var(--good, #5fd38a); } .lg-hist.lost span:first-child { color: var(--bad, #f0605a); }
.lg-prep { overflow: auto; }
.lg-prep-head { display: flex; gap: 12px; align-items: center; }
.lg-prep-head > div:not(.lg-portrait):not(.bc-face) { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.lg-prep-head h3 { margin: 0; }
.lg-reward { padding: 8px 10px; border-radius: 8px; background: rgba(245,200,76,.1); border: 1px solid rgba(245,200,76,.4); font-size: 13px; }
.lg-foe-team { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px; }
.lg-foe-mon { display: flex; gap: 6px; align-items: center; padding: 4px 6px; border-radius: 8px; background: rgba(20,28,36,.7); font-size: 12px; }
.lg-picked { display: flex; flex-direction: column; gap: 3px; }
.lg-slot { display: flex; gap: 6px; align-items: center; padding: 2px 6px; border-radius: 6px; background: rgba(245,200,76,.08); font-size: 13px; }
.lg-slot-btns { margin-left: auto; display: flex; gap: 2px; }
.lg-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 4px; max-height: 260px; overflow: auto; }
.lg-mon { display: grid; grid-template-columns: 32px 1fr; grid-auto-rows: auto; column-gap: 6px; align-items: center; text-align: left; background: rgba(20,28,36,.85); border: 1px solid var(--line, #2f3d4b); border-radius: 8px; padding: 4px 6px; color: inherit; font: inherit; font-size: 12px; cursor: pointer; }
.lg-mon > img, .lg-mon > .missing-sprite { grid-row: span 4; }
.lg-mon.on { border-color: var(--c-money, #f5c84c); background: rgba(245,200,76,.14); }
.lg-mon.off { opacity: .5; cursor: not-allowed; }
.lg-mon .track { height: 4px; }
.lg-go { display: flex; justify-content: flex-end; align-items: center; gap: 10px; padding: 4px 0; }
.lg-won-badge { display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 6px 0; }

/* arena do ginásio (o resto vem de boss.css: log, barra de golpes, relógio) */
.gym-top { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); display: flex; gap: 12px; align-items: center; z-index: 4; pointer-events: auto; width: min(760px, calc(100vw - 24px)); justify-content: space-between; }
.gym-side { background: rgba(12,18,24,.85); border: 1px solid var(--line, #2f3d4b); border-radius: 10px; padding: 6px 10px; display: flex; flex-direction: column; gap: 4px; min-width: 140px; font-size: 13px; }
.gym-side.foe { text-align: right; align-items: flex-end; border-color: rgba(255,176,168,.5); }
.gym-mid { display: flex; gap: 8px; align-items: center; }
.gym-balls { display: flex; gap: 3px; }
.gym-balls i { width: 10px; height: 10px; border-radius: 50%; background: radial-gradient(circle at 50% 50%, #fff 22%, #222 24% 32%, transparent 34%), linear-gradient(#e94b3c 50%, #f4f4f4 50%); border: 1px solid #222; }
.gym-balls i.out { filter: grayscale(1) brightness(.5); }
@media (max-width: 600px) { .gym-top { flex-wrap: wrap; justify-content: center; } .gym-side { min-width: 0; } }

/* ---------- estojo de insígnias (estilo HeartGold/SoulSilver) ---------- */
.bc {
  --bc-blue: #4f6fb3; --bc-blue2: #5b7cc0; --bc-ink: #2b2b38;
  display: flex; flex-direction: column; gap: 10px; min-height: 0; overflow: auto; padding: 10px; border-radius: 10px;
  color: var(--bc-ink);
  background-color: var(--bc-blue);
  background-image:
    linear-gradient(45deg, var(--bc-blue2) 25%, transparent 25%, transparent 75%, var(--bc-blue2) 75%),
    linear-gradient(45deg, var(--bc-blue2) 25%, transparent 25%, transparent 75%, var(--bc-blue2) 75%),
    linear-gradient(135deg, rgba(255,255,255,.06) 25%, transparent 25%);
  background-size: 28px 28px, 28px 28px, 14px 14px;
  background-position: 0 0, 14px 14px, 0 0;
  box-shadow: inset 0 0 0 3px #3d5996;
}
.bc-loading { color: #fff; }
.bc-top { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.bc-title {
  font: 800 13px/1 ui-monospace, monospace; letter-spacing: 1px; color: #fff;
  background: linear-gradient(#f0603f, #c8321c); border: 2px solid #fff; border-radius: 999px;
  padding: 5px 14px 4px; box-shadow: 0 2px 0 #7a1d10, 0 0 0 2px #c8321c; text-shadow: 1px 1px 0 #7a1d10;
}
.bc-pill { background: rgba(255,255,255,.88); border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 700; box-shadow: 0 2px 0 rgba(0,0,0,.25); }
.bc-pill.gold { background: #ffe9a6; }
.bc-btn { margin-left: auto; font: 700 12px inherit; padding: 4px 12px; border-radius: 8px; border: 2px solid #fff; background: #e8eefb; color: var(--bc-ink); cursor: pointer; box-shadow: 0 2px 0 #2f477d; }
.bc-btn:hover, .bc-btn:focus-visible { background: #fff; }
.bc-bands { display: flex; flex-direction: column; gap: 10px; }
.bc-band {
  position: relative; display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center;
  padding: 10px 12px 10px 10px; border-radius: 8px; background: var(--band);
  box-shadow: inset 0 3px 0 rgba(255,255,255,.55), inset 0 -3px 0 rgba(0,0,0,.12), 0 3px 0 rgba(0,0,0,.25);
  border-top: 4px solid #e9edf3; border-bottom: 4px solid #e9edf3;
}
.bc-band.closed .bc-grid, .bc-band.closed .bc-left { filter: grayscale(.85) brightness(.85); }
.bc-left { display: flex; gap: 8px; align-items: center; padding-right: 10px; border-right: 3px solid rgba(255,255,255,.7); }
.bc-emblem { width: 76px; height: 76px; flex: none; filter: drop-shadow(0 2px 0 rgba(0,0,0,.25)); }
.bc-ring {
  width: 64px; height: 64px; border-radius: 50%; flex: none; display: grid; place-items: center; overflow: hidden; padding: 0;
  background: #fff; border: 8px solid #8a7f72; box-shadow: inset 0 2px 4px rgba(0,0,0,.25), 0 2px 0 rgba(0,0,0,.2); cursor: pointer; font: inherit;
}
.bc-ring.available { border-color: #d6a73a; animation: bc-pulse 1.6s ease-in-out infinite; }
.bc-ring.defeated { border-color: #e8c34c; box-shadow: 0 0 0 2px #fff, 0 0 12px #ffd75e; }
.bc-ring.empty { cursor: default; }
.bc-ring-txt { font: 800 13px ui-monospace, monospace; color: #8a7f72; }
@keyframes bc-pulse { 50% { box-shadow: 0 0 0 3px #fff, 0 0 14px #ffd75e; } }
.bc-grid { display: grid; grid-template-columns: repeat(4, auto); justify-content: space-around; gap: 8px 18px; }
.bc-slot { position: relative; display: flex; align-items: center; gap: 2px; background: none; border: 0; padding: 0; cursor: pointer; font: inherit; }
.bc-face {
  width: 56px; height: 56px; flex: none; overflow: hidden; border-radius: 6px; display: grid; place-items: start center;
  background: linear-gradient(#bfe3ff, #6fb3ef); border: 3px solid #fff; box-shadow: 0 0 0 2px #6a7e9e, 0 3px 0 rgba(0,0,0,.25);
}
.bc-face .lg-portrait { margin-top: -2px; }
.bc-face.round { width: 48px; height: 48px; border-radius: 50%; border: 0; box-shadow: none; }
.bc-face.big { width: 76px; height: 76px; }
.bc-slot.locked .bc-face { filter: grayscale(.9) brightness(.8); }
.bc-slot:hover .bc-face, .bc-slot:focus-visible .bc-face { box-shadow: 0 0 0 2px #f0603f, 0 0 0 5px #fff; transform: translateY(-1px); }
.bc-badge { display: grid; place-items: center; width: 30px; height: 34px; margin-left: -4px; filter: drop-shadow(0 2px 0 rgba(0,0,0,.3)); }
.bc-badge .lg-badge-img.off { filter: grayscale(1) brightness(1.6) contrast(.5); opacity: .5; }
.bc-badge.owned { filter: drop-shadow(0 0 3px #fff) drop-shadow(0 0 6px #ffd75e); animation: bc-shine 2.4s ease-in-out infinite; }
@keyframes bc-shine { 50% { filter: drop-shadow(0 0 4px #fff) drop-shadow(0 0 10px #ffe27a); } }
.bc-slot.defeated .bc-face { box-shadow: 0 0 0 2px #e0b13a, 0 3px 0 rgba(0,0,0,.25); }
.bc-badge.big { width: 60px; height: 60px; }
.bc-tag { position: absolute; top: -12px; right: 12px; background: var(--deep); color: #fff; font-size: 11px; border-radius: 999px; padding: 2px 10px; border: 2px solid #fff; }
.bc-lock { position: absolute; left: 50%; bottom: -12px; transform: translateX(-50%); background: #fff; color: var(--bc-ink); font-size: 12px; font-weight: 700; border-radius: 999px; padding: 3px 12px; box-shadow: 0 2px 0 rgba(0,0,0,.25); white-space: nowrap; }
.bc-soon-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.bc-band.soon { grid-template-columns: auto 1fr; padding: 6px 10px; filter: grayscale(.4); opacity: .9; }
.bc-band.soon .bc-emblem { width: 40px; height: 40px; }
.bc-soon { display: flex; flex-direction: column; font-size: 12px; }
.bc-info {
  display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; min-height: 40px; padding: 8px 12px; font-size: 13px;
  background: #fff; border-radius: 8px; border: 3px solid #e9edf3; box-shadow: 0 3px 0 rgba(0,0,0,.25);
}
.bc-hint { color: #6a7385; }
.bc-st.available { color: #c8321c; font-weight: 700; } .bc-st.defeated { color: #2c8a4a; font-weight: 700; } .bc-st.locked { color: #6a7385; }
.bc-history { display: flex; flex-direction: column; gap: 4px; background: rgba(255,255,255,.9); border-radius: 8px; padding: 8px; }
.bc-history .lg-hist { background: #eef2f8; }
/* tela de desafio: cabeçalho como uma faixa do estojo */
.bc-prep .lg-prep-head.bc-band { display: flex; color: #2b2b38; }
.bc-prep .lg-prep-head .muted { color: #4a4a58; }
@media (max-width: 720px) {
  .bc-band { grid-template-columns: 1fr; }
  .bc-left { border-right: 0; padding-right: 0; justify-content: center; }
  .bc-grid { gap: 8px; }
  .bc-face { width: 46px; height: 46px; }
  .bc-face .lg-portrait { transform: scale(.8); transform-origin: top center; }
}

/* ---- colunas laterais das arenas (battle-roster.js): seus Pokémon à esquerda, os do adversário à direita ---- */
.gym-arena-view .gym-top { justify-content: center; }
.br-col { position: absolute; top: 50%; transform: translateY(-50%); z-index: 4; pointer-events: auto; max-height: calc(100% - 300px); min-height: 120px; display: flex; }
.br-col.mine { left: 12px; }
.br-col.foe { right: 12px; }
.br { width: 176px; background: var(--bag-pink, rgba(12,18,24,.85)); color: var(--bag-ink, #e8eef4); border: 2px solid var(--bag-frame, #2f3d4b); box-shadow: inset 0 0 0 2px var(--bag-in, transparent); border-radius: 8px; padding: 6px; display: flex; flex-direction: column; gap: 4px; overflow: hidden; }
.br-head { display: flex; align-items: center; gap: 6px; padding: 0 2px 4px; border-bottom: 1px dashed var(--bag-frame, #2f3d4b); }
.br-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.br-count { font-family: var(--px, ui-monospace, monospace); font-size: 15px; padding: 1px 6px; border-radius: 6px; background: var(--bag-frame, #2f3d4b); color: #fff; }
.br-count.low { background: #b8323c; }
.br-foe .br-head { flex-direction: row-reverse; text-align: right; }
.br-list { display: flex; flex-direction: column; gap: 3px; overflow-y: auto; scrollbar-width: thin; }
.br-row { display: grid; grid-template-columns: 34px 1fr; grid-template-rows: auto auto; align-items: center; column-gap: 6px; padding: 2px 4px 2px 2px; border-radius: 6px; background: var(--bag-soft, rgba(255,255,255,.04)); border: 1px solid transparent; }
.br-foe .br-row { grid-template-columns: 1fr 34px; text-align: right; }
.br-foe .br-icon { grid-column: 2; grid-row: 1 / span 2; }
.br-foe .br-text { grid-column: 1; grid-row: 1; }
.br-foe .br-hp { grid-column: 1; }
.br-icon { position: relative; width: 32px; height: 32px; grid-row: 1 / span 2; display: grid; place-items: center; }
.br-icon img, .br-icon .missing-sprite { width: 32px; height: 32px; }
.br-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.br-name { font-size: 12px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.br-sub { font-size: 10px; opacity: .75; }
.br-hp { height: 4px; grid-column: 2; margin-top: 2px; }
.br-row.active { border-color: #4a9eff; background: rgba(74,158,255,.16); }
.br-foe .br-row.active { border-color: #ff6b6b; background: rgba(255,107,107,.14); }
.br-row.out .br-icon img { filter: grayscale(1) brightness(.55); opacity: .7; }
.br-row.out .br-name { text-decoration: line-through; opacity: .6; }
.br-row.out .br-sub { color: #ff8a80; opacity: 1; font-weight: 700; }
.br-x { position: absolute; inset: 0; display: grid; place-items: center; color: #e74c3c; font: 700 20px/1 sans-serif; text-shadow: 0 0 2px #000, 0 0 2px #000; }
.br-row.unseen { opacity: .7; }
.br-ball { width: 16px; height: 16px; border-radius: 50%; border: 1px solid #222; background: radial-gradient(circle at 50% 50%, #fff 22%, #222 24% 32%, transparent 34%), linear-gradient(#e94b3c 50%, #f4f4f4 50%); }

/* tela estreita / celular: só os ícones, mais finos, colados nas bordas */
@media (max-width: 900px) {
  .br-col { max-height: calc(100% - 260px); }
  .br { width: auto; padding: 4px; }
  .br-head { flex-direction: column !important; gap: 2px; padding-bottom: 3px; }
  .br-title { display: none; }
  .br-count { font-size: 13px; }
  .br-row, .br-foe .br-row { grid-template-columns: 30px; padding: 1px; }
  .br-text { display: none; }
  .br-icon, .br-foe .br-icon { grid-column: 1; width: 30px; height: 30px; }
  .br-icon img, .br-icon .missing-sprite { width: 30px; height: 30px; }
  .br-hp, .br-foe .br-hp { grid-column: 1; grid-row: 3; width: 28px; }
}
:root[data-layout="portrait"] .br-col { top: 128px; transform: none; max-height: calc(100% - 128px - 240px); }
:root[data-layout="landscape"] .br-col { top: 52px; transform: none; max-height: calc(100% - 52px - 96px); }
:root[data-layout="landscape"] .br-col.mine { left: 8px; }
@media (max-width: 900px) { .br-hp.track { padding-left: 0; } .br-hp.track::before { display: none; } }
/* tela estreita: o registro da luta começa depois da coluna da esquerda */
@media (max-width: 900px) { .gym-arena-view .boss-log { left: 64px; width: auto; right: 64px; } }
:root[data-layout="landscape"] .gym-arena-view .boss-log { left: 64px; right: auto; width: min(420px, calc(100vw - 140px)); }
:root[data-layout="landscape"] .br-row { padding: 0; }
:root[data-layout="landscape"] .br-icon, :root[data-layout="landscape"] .br-icon img { width: 24px; height: 24px; }
:root[data-layout="landscape"] .br-list { gap: 2px; }
.lg-team-rule { margin: 0 0 4px; font-weight: 600; }

/* ---------- luta no combate top-down (ui/boss-fight-view.js): a cena no meio, o painel por cima */
.boss-fight-view { background: #101418; }
.boss-fight-view .viewport { display: flex; align-items: center; justify-content: center; }
.boss-fight-view .viewport canvas { width: auto; height: auto; image-rendering: pixelated; }
.boss-fight-view .overlay { pointer-events: none; }
.boss-fight-view .bfh-result { pointer-events: auto; }
.bfv-skip { position: absolute; right: 10px; top: 10px; z-index: 5; }
.bfv-wait { position: absolute; left: 50%; top: 45%; transform: translate(-50%, -50%); z-index: 5; padding: 4px 14px; color: #eef1f4; background: #3c4149; border: 2px solid #16181d; border-radius: 6px; box-shadow: inset 0 0 0 2px #4d535c; font-family: 'idlepoke-pixel', system-ui, sans-serif; }
.bfv-wait[hidden] { display: none; }
@media (max-width: 760px) { .bfv-skip { top: auto; bottom: 64px; } }
