/* ============================================================
   HOODMONS — a PVP Arena (js/arena-hall.js, js/arena.js, js/battle.js)
   ------------------------------------------------------------
   A cena é a mesma dos outros salões (.hall-*, .rpg-*, em base.css). Aqui: o retrato do
   Keeper, o conteúdo das abas (fases, cards de lutador, mochila, regras) e a tela de luta.
   Arquivo próprio porque é um bloco grande e fechado — base.css já passa de 2 mil linhas.
   ============================================================ */

/* O Arena Keeper: recorte do bicho amarelo de óculos no mural de missões (222,225 · 106px). */
.dialog-portrait.arena-portrait {
  background: url("../assets/arena.webp") no-repeat;
  background-size: calc(1672px * 84 / 106) calc(941px * 84 / 106);
  background-position: calc(-222px * 84 / 106) calc(-225px * 84 / 106);
  image-rendering: pixelated;
}

/* Seis abas não cabem numa linha no celular: rolam de lado. */
.ar-rpg .rpg-tabs { overflow-x: auto; scrollbar-width: none; }
.ar-rpg .rpg-tabs button { white-space: nowrap; flex: none; }
.ar-rpg .rpg-bar { border-bottom: 4px solid #000; margin-bottom: 14px; }

#ar-panel { color: #20201c; }
#ar-panel .empty h3, #ar-panel .empty p { color: #20201c; }
.ar-loading { font-size: 10px; text-align: center; padding: 30px 0; color: #6b6252; }
.ar-intro, .ar-note { font-size: 14px; line-height: 1.55; margin: 0 0 14px; }
.ar-note { color: #8a5a10; }

.ar-el, .ar-tier {
  display: inline-block; font-family: "Press Start 2P", monospace; font-size: 7px;
  padding: 4px 5px 3px; border: 2px solid #000; margin-right: 4px; vertical-align: middle;
  color: #fff; text-shadow: 1px 1px 0 #000;
}
.ar-el { background: var(--el); }
.ar-tier { background: var(--tier); }

/* ---- Missões ---- */
.ar-resume {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  background: #1d2d6b; color: #fdd66a; border: 3px solid #000; padding: 12px 14px; margin-bottom: 14px;
  font-family: "Press Start 2P", monospace; font-size: 9px;
}
.ar-cap { font-size: 13px; margin-bottom: 14px; display: flex; gap: 10px; flex-wrap: wrap; align-items: baseline; }
.ar-cap span { color: #6b6252; font-size: 12px; }
.ar-chapter { margin-bottom: 20px; }
.ar-chapter h3 { font-size: 10px; margin: 0 0 6px; color: #1d2d6b; }
.ar-blurb { font-size: 13px; color: #6b6252; margin: 0 0 10px; }
.ar-stages { display: flex; flex-direction: column; gap: 8px; }
.ar-stage {
  display: grid; grid-template-columns: 44px 1fr auto auto auto; align-items: center; gap: 12px;
  background: #fff; border: 3px solid #000; padding: 10px 12px; box-shadow: 3px 3px 0 #00000055;
}
.ar-stage.is-boss { background: #fbe3d6; border-color: #7a1c10; }
.ar-stage.is-locked { opacity: .5; }
.ar-stage-id { font-size: 10px; color: #b3341f; }
.ar-stage-main b { font-size: 14px; }
.ar-stage-meta { font-size: 12px; color: #6b6252; margin-top: 4px; }
.ar-reward { font-family: "Press Start 2P", monospace; font-size: 7px; color: #6b6252; text-align: right; }
.ar-reward b { display: block; font-size: 9px; color: var(--gold-dk); margin-top: 4px; }
.ar-stars i { font-style: normal; color: #cfc6ad; font-size: 16px; }
.ar-stars i.on { color: #f2a91c; text-shadow: 1px 1px 0 #000; }

/* ---- Preparação da luta ---- */
.ar-back { font-family: "Press Start 2P", monospace; font-size: 8px; background: none; border: 0; color: #1d2d6b; padding: 4px 0 12px; cursor: pointer; }
.ar-brief { background: #fff; border: 3px solid #000; padding: 12px 14px; margin-bottom: 16px; }
.ar-brief h3 { font-size: 10px; margin: 0 0 8px; color: #b3341f; }
.ar-brief p { font-size: 14px; line-height: 1.55; margin: 0 0 8px; }
.ar-tip { font-weight: 700; color: #1d2d6b; }
.ar-sub { font-size: 9px; margin: 16px 0 10px; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.ar-sub span { font-family: inherit; font-size: 7px; color: #6b6252; }
.ar-go { width: 100%; margin-top: 18px; }
.ar-empty-line { font-size: 13px; color: #6b6252; }

/* ---- Card de lutador ---- */
.ar-roster { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.ar-mon {
  position: relative; text-align: left; font: inherit; color: inherit;
  background: #fff; border: 3px solid #000; padding: 8px; box-shadow: 3px 3px 0 #00000055;
  display: flex; flex-direction: column; gap: 6px;
}
button.ar-mon { cursor: pointer; }
button.ar-mon:hover { background: #fff6dc; }
.ar-mon.is-picked { outline: 3px solid var(--gold); outline-offset: -7px; background: #fff6dc; }
.ar-order {
  position: absolute; top: 6px; left: 6px; z-index: 1; font-size: 9px;
  background: #b3341f; color: #fff; border: 2px solid #000; padding: 4px 6px 3px;
}
.ar-mon-art { background: #e6dec4; border: 2px solid #000; aspect-ratio: 1; }
.ar-mon-art img { width: 100%; height: 100%; image-rendering: pixelated; display: block; }
.ar-mon-name { font-size: 12px; font-weight: 700; }
.ar-stats { display: grid; grid-template-columns: repeat(4, 1fr); font-size: 10px; color: #6b6252; text-align: center; }
.ar-stats b { display: block; font-size: 12px; color: #20201c; }
.ar-perks { margin: 0; padding-left: 14px; font-size: 11px; color: #6b6252; }

/* ---- Mochila ---- */
.ar-items { display: flex; flex-direction: column; gap: 8px; }
.ar-item {
  display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center;
  background: #fff; border: 3px solid #000; padding: 10px 12px;
}
.ar-item b { font-size: 13px; }
.ar-item small { display: block; font-size: 12px; color: #6b6252; margin-top: 3px; }
.ar-have { font-family: "Press Start 2P", monospace; font-size: 10px; color: var(--gold-dk); }
.ar-store { margin-top: 14px; }

/* ---- Como jogar ---- */
.ar-howto section { margin-bottom: 18px; }
.ar-howto h3 { font-size: 10px; color: #1d2d6b; margin: 0 0 8px; }
.ar-howto p { font-size: 14px; line-height: 1.55; margin: 0 0 8px; }
.ar-cycle { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; margin: 10px 0; }
.ar-cycle div { background: #fff; border: 3px solid #000; padding: 10px; font-size: 13px; }
.ar-cycle small { display: block; color: #6b6252; margin-top: 5px; line-height: 1.45; }
.ar-beats, .ar-tiers, .ar-itemlist { margin: 0; padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }

@media (max-width: 760px) {
  .ar-stage { grid-template-columns: 36px 1fr auto; }
  .ar-stage .ar-stars, .ar-stage .ar-reward { grid-column: 2; text-align: left; }
  .ar-stage .btn { grid-column: 3; grid-row: 1 / span 3; }
  .ar-roster { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   A LUTA (js/battle.js + js/battle-fx.js)
   ------------------------------------------------------------
   Toda animação em `steps()`: quadros inteiros, como no cartucho. Um movimento suave
   aqui leria como "site", e o resto do jogo inteiro é pixel.
   ============================================================ */
body.battle-open { overflow: hidden; }
.bt {
  position: fixed; inset: 0; z-index: 60; background: #0b0706;
  display: flex; flex-direction: column;
}
.bt[hidden] { display: none; }
.bt-stage {
  position: relative; flex: 1 1 auto; min-height: 0; overflow: hidden;
  background-size: cover; background-position: center; image-rendering: pixelated;
}
/* Sem arte: um chão de pedra com brilho de lava. */
.bt-stage:not(.has-art) {
  background:
    radial-gradient(ellipse 60% 20% at 50% 72%, #6b5a4a 0 60%, transparent 61%),
    linear-gradient(to bottom, #2a0f0a 0%, #5a1a0c 38%, #3a3431 38.2%, #2b2624 100%);
}

/* Tremor de tela: Heavy e crítico. */
.bt-stage.is-shake { animation: bt-shake .3s steps(6); }
.bt-stage.is-shake-hard { animation: bt-shake-hard .42s steps(8); }
@keyframes bt-shake { 20% { translate: -6px 3px; } 40% { translate: 5px -3px; } 60% { translate: -4px 2px; } 80% { translate: 3px 0; } }
@keyframes bt-shake-hard { 12% { translate: -12px 6px; } 25% { translate: 11px -7px; } 37% { translate: -9px 5px; } 50% { translate: 8px -4px; } 62% { translate: -6px 3px; } 75% { translate: 4px -2px; } 87% { translate: -2px 1px; } }

.bt-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 4; pointer-events: none; image-rendering: pixelated; }
.bt-fx { position: absolute; inset: 0; pointer-events: none; z-index: 5; }
.bt-flash { position: absolute; inset: 0; z-index: 7; pointer-events: none; opacity: 0; }
.bt-flash.is-on { animation: bt-flash .22s steps(2); }
@keyframes bt-flash { from { opacity: .85; } to { opacity: 0; } }

.bt-turn {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 3;
  font-size: 9px; color: #fdd66a; background: #000a; border: 2px solid #000; padding: 6px 9px;
}

/* ---- HUDs ---- */
.bt-hud {
  position: absolute; top: 44px; z-index: 3; width: min(340px, 44%);
  background: #f8f4e4; border: 4px solid #000; padding: 9px 11px;
  box-shadow: inset 0 0 0 2px #e0a93a, 5px 5px 0 #000a; color: #20201c;
  transition: translate .45s steps(5);
}
.bt-hud.you { left: 3%; }
.bt-hud.foe { right: 3%; }
.bt-name { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font-size: 13px; }
.bt-name b { margin-right: 6px; }
.bt-fast {
  font-family: "Press Start 2P", monospace; font-size: 6px; padding: 3px 4px; border: 2px solid #000;
  background: #fdd66a; color: #20201c;
}
.bt-hp { position: relative; height: 12px; background: #3a3431; border: 2px solid #000; margin-top: 7px; overflow: hidden; }
.bt-hp i { position: absolute; left: 0; top: 0; bottom: 0; display: block; }
/* O fantasma: a vida que acabou de sair, em branco, descendo atrasada. */
.bt-hp .ghost { background: #fff3c4; transition: width .5s steps(6); }
.bt-hp .bar { transition: width .28s steps(4); }
.bt-hp .bar.ok { background: #46b04a; }
.bt-hp .bar.mid { background: #f2b21c; }
.bt-hp .bar.low { background: #d8402a; }
.bt-hud.is-low .bt-hp .bar { animation: bt-low .6s steps(2) infinite; }
@keyframes bt-low { 50% { background: #ff8f7a; } }
.bt-hp-num { font-family: "Press Start 2P", monospace; font-size: 8px; text-align: right; margin-top: 4px; }
.bt-row { display: flex; align-items: center; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.bt-energy { display: inline-flex; gap: 3px; }
.bt-energy i { width: 12px; height: 12px; border: 2px solid #000; background: #cfc6ad; }
.bt-energy i.on { background: #fdd66a; box-shadow: inset -2px -2px 0 #e0a93a; }
.bt-tags { display: inline-flex; gap: 4px; }
.bt-tag { font-family: "Press Start 2P", monospace; font-size: 6px; padding: 3px 4px; border: 2px solid #000; color: #fff; }
.bt-tag.charged { background: #b066e8; }
.bt-tag.solar { background: #e2552b; }
.bt-tag.charm { background: #2f7fd8; }
.bt-bench { display: flex; gap: 4px; margin-top: 6px; }
.bt-bench i { width: 10px; height: 10px; border-radius: 50%; border: 2px solid #000; background: #46b04a; }
.bt-bench i.in { background: #fdd66a; }
.bt-bench i.down { background: #3a3431; }

/* ---- Os lutadores ----
   Posição e tamanho vêm de btLayout(), medidos sobre a arte. O contêiner é que anda
   (avanço, tranco, queda); a imagem só respira e fica vermelha — assim uma animação não
   apaga a outra. O de lá é espelhado para olhar para cá. */
.bt-mon {
  position: absolute; top: var(--bt-topo, 50%); width: var(--bt-lado, 150px); aspect-ratio: 1; z-index: 2;
  transform: translateX(-50%); transition: left .5s steps(6), opacity .3s steps(3);
}
.bt-mon.you { left: var(--bt-x-you, 30%); }
.bt-mon.foe { left: var(--bt-x-foe, 70%); }
.bt-mon img {
  width: 100%; height: 100%; image-rendering: pixelated; display: block;
  animation: bt-bob 1.1s steps(2) infinite;
}
.bt-mon.foe img { transform: scaleX(-1); animation-delay: -.55s; }
@keyframes bt-bob { 50% { translate: 0 -3%; } }
.bt-mon.is-down { opacity: .12; }
.bt-mon.is-down img { animation: none; filter: grayscale(1); }

/* Avanço do atacante na direção do outro. */
.bt-mon.you.is-lunge { animation: bt-lunge-r .38s steps(4); }
.bt-mon.foe.is-lunge { animation: bt-lunge-l .38s steps(4); }
@keyframes bt-lunge-r { 40% { transform: translateX(-20%); } }
@keyframes bt-lunge-l { 40% { transform: translateX(-80%); } }
/* O tranco de quem apanha: para trás. */
.bt-mon.you.is-knock { animation: bt-knock-l .3s steps(3); }
.bt-mon.foe.is-knock { animation: bt-knock-r .3s steps(3); }
.bt-mon.you.is-knock-hard { animation: bt-knock-l-hard .42s steps(5); }
.bt-mon.foe.is-knock-hard { animation: bt-knock-r-hard .42s steps(5); }
@keyframes bt-knock-l { 35% { transform: translateX(-62%); } }
@keyframes bt-knock-r { 35% { transform: translateX(-38%); } }
@keyframes bt-knock-l-hard { 25% { transform: translate(-74%, -4%); } 60% { transform: translateX(-58%); } }
@keyframes bt-knock-r-hard { 25% { transform: translate(-26%, -4%); } 60% { transform: translateX(-42%); } }
/* Dano: o sprite inteiro fica VERMELHO e pisca. */
.bt-mon.is-hurt img { animation: bt-hurt .42s steps(4); }
@keyframes bt-hurt {
  0%, 50% { filter: brightness(.9) sepia(1) saturate(9) hue-rotate(-35deg); }
  25%, 75% { filter: brightness(2.2); }
}
/* Cura: brilho verde. */
.bt-mon.is-heal img { animation: bt-heal .7s steps(4); }
@keyframes bt-heal { 30%, 70% { filter: brightness(1.3) drop-shadow(0 0 10px #4fd15a); } }
/* Heavy carregando: treme no lugar e acende na cor do golpe. */
.bt-mon.is-windup img { animation: bt-windup .28s steps(4); filter: brightness(1.4) drop-shadow(0 0 12px #ffb02e); }
@keyframes bt-windup { 25% { translate: -3% 0; } 75% { translate: 3% 0; } }
/* Focus: aura roxa enquanto durar o turno. */
.bt-mon.is-focusing img { filter: drop-shadow(0 0 6px #c07cff) drop-shadow(0 0 14px #7d3cc7); }
/* Guard: a bolha de escudo. */
.bt-shield {
  position: absolute; inset: 6% 4% 8%; border-radius: 50%; pointer-events: none; opacity: 0;
  border: 4px solid #9fd0ff; background: radial-gradient(circle, #6fb2ff22 40%, #6fb2ff55 70%, #bfe0ff88);
  box-shadow: 0 0 0 3px #2f6fd8, 0 0 18px #6fb2ff;
}
.bt-mon.is-guarding .bt-shield { opacity: 1; animation: bt-shield-in .25s steps(3); }
.bt-mon.is-charm .bt-shield { border-color: #fff3a0; box-shadow: 0 0 0 3px #f2a91c, 0 0 22px #ffd95a; }
.bt-mon.is-block .bt-shield { animation: bt-shield-hit .3s steps(3); }
@keyframes bt-shield-in { from { transform: scale(.4); opacity: 0; } }
@keyframes bt-shield-hit { 50% { transform: scale(1.12); filter: brightness(2); } }
/* Troca e desmaio. */
.bt-mon.is-leave { animation: bt-leave .26s steps(3) forwards; }
@keyframes bt-leave { to { transform: translateX(-50%) scale(.2); opacity: 0; } }
.bt-mon.is-enter { animation: bt-enter .38s steps(4); }
@keyframes bt-enter { from { transform: translate(-50%, -30%) scale(.3); opacity: 0; } }
.bt-mon.is-fall { animation: bt-fall .7s steps(6) forwards; }
@keyframes bt-fall { 20% { transform: translate(-50%, -8%); } 100% { transform: translate(-50%, 18%); opacity: .12; } }
/* Vitória: dois pulinhos. */
.bt-mon.is-victory img { animation: bt-jump .35s steps(3) 4 alternate; }
@keyframes bt-jump { to { translate: 0 -14%; } }
.bt.is-defeat .bt-stage { filter: grayscale(.7) brightness(.7); transition: filter .6s steps(4); }

/* ---- A abertura: VS, e os dois entrando pelos lados ---- */
.bt.is-intro .bt-mon.you { left: -30%; }
.bt.is-intro .bt-mon.foe { left: 130%; }
.bt.is-intro .bt-hud { translate: 0 -160%; }
.bt.is-intro .bt-panel { opacity: .35; }

/* ---- Palavras e números ---- */
.bt-num, .bt-word {
  position: absolute; top: calc(var(--bt-topo, 40%) - 8px); transform: translateX(-50%);
  font-family: "Press Start 2P", monospace; color: #fff; text-shadow: 3px 3px 0 #000, -2px -2px 0 #000;
  white-space: nowrap;
}
.bt-num { font-size: 22px; animation: bt-num 1.1s steps(8) forwards; }
.bt-num.you, .bt-word.you { left: var(--bt-x-you, 30%); }
.bt-num.foe, .bt-word.foe { left: var(--bt-x-foe, 70%); }
.bt-num.big { font-size: 28px; color: #ffd95a; }
.bt-num.crit { font-size: 34px; color: #ffe14a; }
.bt-num.heal { color: #7ee07a; }
@keyframes bt-num {
  0% { translate: 0 10px; scale: .6; }
  15% { translate: 0 -14px; scale: 1.25; }
  30% { translate: 0 -8px; scale: 1; }
  100% { translate: 0 -70px; opacity: 0; }
}
.bt-word { font-size: 12px; top: calc(var(--bt-topo, 40%) - 44px); animation: bt-word 1.3s steps(8) forwards; }
.bt-word.block { color: #9fd0ff; }
.bt-word.bad { color: #ff8f7a; }
.bt-word.good { color: #fdd66a; }
.bt-word.strong { color: #ffb02e; font-size: 14px; }
.bt-word.weak { color: #b8b0a0; }
.bt-word.crit { color: #ffe14a; font-size: 15px; }
.bt-word.item { color: #9ff59a; }
@keyframes bt-word { 0% { scale: .3; } 12% { scale: 1.2; } 22% { scale: 1; } 80% { opacity: 1; } 100% { translate: 0 -24px; opacity: 0; } }

/* ---- As cartas do turno: as duas escolhas reveladas juntas ---- */
.bt-card {
  position: absolute; z-index: 6; top: calc(var(--bt-topo, 40%) - 76px); transform: translateX(-50%);
  font-family: "Press Start 2P", monospace; font-size: 12px; color: #20201c;
  background: #f8f4e4; border: 4px solid #000; padding: 10px 12px 9px; box-shadow: 4px 4px 0 #000;
  animation: bt-card-in .3s steps(4);
}
.bt-card.you { left: var(--bt-x-you, 30%); }
.bt-card.foe { left: var(--bt-x-foe, 70%); }
.bt-card.strike { background: #ffe1c4; }
.bt-card.heavy { background: #ffc9bd; }
.bt-card.guard { background: #cfe0ff; }
.bt-card.focus { background: #e8d6ff; }
.bt-card em {
  position: absolute; top: -14px; right: -14px; font-style: normal; font-size: 7px;
  background: #b3341f; color: #fff; border: 2px solid #000; padding: 4px 5px 3px;
}
@keyframes bt-card-in { from { transform: translateX(-50%) rotateY(90deg); } }

/* ---- A faixa do meio: VS, FIGHT!, a regra do turno, VICTORY ---- */
.bt-banner {
  position: absolute; left: 50%; top: 38%; z-index: 8; transform: translate(-50%, -50%);
  font-family: "Press Start 2P", monospace; font-size: 15px; color: #20201c; white-space: nowrap;
  background: #f8f4e4; border: 4px solid #000; padding: 12px 18px 11px; box-shadow: 6px 6px 0 #000;
  animation: bt-banner-in .25s steps(3);
}
.bt-banner[hidden] { display: none; }
.bt-banner.rule { background: #1d2d6b; color: #fdd66a; font-size: 12px; }
.bt-banner.fight { font-size: 34px; color: #fff; background: #b3341f; padding: 16px 28px 14px; }
.bt-banner.win { font-size: 30px; color: #20201c; background: #fdd66a; }
.bt-banner.lose { font-size: 30px; color: #fff; background: #3a3431; }
.bt-banner.is-vs {
  display: flex; align-items: center; gap: 22px; background: none; border: 0; box-shadow: none; padding: 0;
}
.bt-vs {
  font-size: 54px; color: #ffd95a; text-shadow: 5px 5px 0 #b3341f, -3px -3px 0 #000, 3px -3px 0 #000;
  animation: bt-vs-slam .45s steps(4);
}
.bt-vs-name {
  font-size: 13px; color: #fff; background: #000c; border: 3px solid #000; padding: 8px 10px 7px;
}
.bt-vs-name.you { animation: bt-from-left .4s steps(4); }
.bt-vs-name.foe { animation: bt-from-right .4s steps(4); }
@keyframes bt-banner-in { from { transform: translate(-50%, -50%) scale(.3); } }
@keyframes bt-vs-slam { 0% { scale: 4; opacity: 0; } 70% { scale: .9; opacity: 1; } }
@keyframes bt-from-left { from { translate: -60vw 0; } }
@keyframes bt-from-right { from { translate: 60vw 0; } }

/* ---- O Keeper no Tutorial: caixa de fala por cima do chão, com o retrato dele ---- */
.bt-coach {
  position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); z-index: 9;
  width: min(760px, calc(100% - 24px)); display: flex; gap: 12px; align-items: center;
  background: #f8f4e4; color: #20201c; border: 4px solid #000; padding: 10px 14px 10px 10px;
  box-shadow: inset 0 0 0 2px #e0a93a, 6px 6px 0 #000a;
}
.bt-coach[hidden] { display: none; }
.bt-coach .dialog-portrait { flex: none; width: 64px; height: 64px; border: 3px solid #000;
  background-size: calc(1672px * 64 / 106) calc(941px * 64 / 106);
  background-position: calc(-222px * 64 / 106) calc(-225px * 64 / 106); }
.bt-coach-text { margin: 0; font-size: 15px; line-height: 1.5; }
.bt-coach.is-pop { animation: bt-coach-pop .3s steps(3); }
@keyframes bt-coach-pop { from { transform: translateX(-50%) translateY(20px); opacity: 0; } }
/* A jogada que o Keeper está pedindo pisca em dourado. */
.bt-act.is-hint { animation: bt-hint .7s steps(2) infinite; }
@keyframes bt-hint { 50% { background: var(--gold); box-shadow: 3px 3px 0 #000, 0 0 0 3px #fff; } }
.bt-partner, .bt-pick em {
  font-family: "Press Start 2P", monospace; font-size: 6px; padding: 3px 4px; border: 2px solid #000;
  background: #46a64a; color: #fff; font-style: normal;
}
.bt-lesson { font-size: 14px; line-height: 1.5; background: #e9f5dc; border: 3px solid #000; padding: 10px 12px; margin: 12px 0; text-align: left; }
.bt-kit { font-family: "Press Start 2P", monospace; font-size: 9px; color: #1d2d6b; margin: 8px 0 14px; line-height: 1.8; }
.bt-kit small { display: block; font-family: inherit; font-size: 7px; color: #6b6252; }
.ar-chapter.is-tutorial { background: #e9f5dc; border: 3px solid #000; padding: 12px; }
.ar-chapter.is-tutorial h3 { color: #23632a; }

/* ---- PvP: o dono do Hoodmon do outro lado, "READY" e o relógio apertando ---- */
.bt-owner { font-family: "Press Start 2P", monospace; font-size: 7px; color: #6b6252; margin-top: 4px; }
.bt-tag.ready { background: #46a64a; animation: bt-hint .8s steps(2) infinite; }
.bt-turn.is-hurry { background: #b3341f; color: #fff; animation: bt-hint .5s steps(2) infinite; }

/* ---- PvP: a contagem gigante dos últimos 5 segundos ---- */
.bt-count {
  position: absolute; left: 50%; top: 42%; z-index: 8; transform: translate(-50%, -50%);
  font-size: clamp(90px, 18vh, 170px); line-height: 1; color: #fdd66a; pointer-events: none;
  text-shadow: 6px 6px 0 #b3341f, -4px -4px 0 #000, 4px -4px 0 #000, -4px 4px 0 #000;
}
.bt-count[hidden] { display: none; }
.bt-count.is-last { color: #ff5a3c; text-shadow: 6px 6px 0 #000, -4px -4px 0 #000, 4px -4px 0 #000, -4px 4px 0 #000; }
.bt-count.is-pulse { animation: bt-count-pulse .9s steps(6) forwards; }
@keyframes bt-count-pulse {
  0% { transform: translate(-50%, -50%) scale(2.2); opacity: 0; }
  20% { transform: translate(-50%, -50%) scale(.9); opacity: 1; }
  35% { transform: translate(-50%, -50%) scale(1.05); }
  100% { transform: translate(-50%, -50%) scale(1); opacity: .85; }
}

/* ---- PvP: as duas portas (procurar / criar) ---- */
.pvp-portas { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 18px; }
.pvp-porta {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center;
  font: inherit; color: #20201c; cursor: pointer; padding: 26px 16px 22px;
  background: #fff; border: 4px solid #000; box-shadow: 5px 5px 0 #000;
}
.pvp-porta:hover { background: #fff6dc; }
.pvp-porta:active { transform: translate(4px, 4px); box-shadow: 1px 1px 0 #000; }
.pvp-porta.find { background: #ffe9d6; }
.pvp-porta.create { background: #e3ecff; }
.pvp-porta-icone { width: 44px; height: 44px; filter: drop-shadow(3px 3px 0 #00000033); }
.pvp-porta b { font-size: 11px; }
.pvp-porta span { font-size: 13px; color: #6b6252; }
.pvp-porta em {
  position: absolute; top: -12px; right: -10px; font-style: normal; font-size: 7px;
  background: #b3341f; color: #fff; border: 2px solid #000; padding: 5px 6px 4px;
}

/* ---- PvP: o aviso "fulano aceitou!" (fora das páginas, por cima de tudo) ---- */
.pvp-confirm { position: fixed; inset: 0; z-index: 90; background: #000c; display: grid; place-items: center; padding: 16px; }
.pvp-confirm[hidden] { display: none; }
.pvp-confirm-box {
  width: min(460px, 100%); text-align: center; background: #f8f4e4; color: #20201c;
  border: 4px solid #000; box-shadow: inset 0 0 0 3px #e0a93a, 8px 8px 0 #000; padding: 22px 18px 16px;
  animation: bt-banner-pop .3s steps(4);
}
.pvp-confirm-kicker { font-size: 9px; color: #b3341f; margin: 0 0 12px; }
.pvp-confirm-box h2 { font-size: 15px; line-height: 1.5; margin: 0 0 10px; }
.pvp-confirm-aposta { font-size: 14px; margin: 0 0 14px; }
.pvp-confirm-seg b { display: block; font-size: 44px; color: #1d2d6b; }
.pvp-confirm-seg small { font-family: system-ui, sans-serif; font-size: 12px; color: #6b6252; }
.pvp-confirm.is-hurry .pvp-confirm-seg b { color: #b3341f; animation: bt-hint .5s steps(2) infinite; }
.pvp-confirm-barra { height: 10px; background: #3a3431; border: 2px solid #000; margin: 12px 0 16px; }
.pvp-confirm-barra i { display: block; height: 100%; background: #46b04a; transition: width .2s linear; }
.pvp-confirm.is-hurry .pvp-confirm-barra i { background: #d8402a; }
.pvp-confirm-botoes { display: grid; grid-template-columns: 2fr 1fr; gap: 10px; }
.pvp-confirm-nota { font-size: 12px; color: #6b6252; margin: 12px 0 0; }

@media (max-width: 760px) {
  .pvp-portas { grid-template-columns: 1fr; }
}

/* ---- PvP: o lobby ---- */
.pvp-box { background: #fff; border: 3px solid #000; padding: 14px; margin-bottom: 18px; box-shadow: 3px 3px 0 #00000055; }
.pvp-box h3 { font-size: 10px; margin: 0 0 12px; color: #b3341f; }
.pvp-box p { font-size: 14px; line-height: 1.5; margin: 0 0 10px; }
.pvp-box.is-waiting { background: #fff6dc; }
.pvp-dots::after { content: "…"; animation: pvp-dots 1.2s steps(4) infinite; }
@keyframes pvp-dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }
.pvp-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.pvp-label { font-family: "Press Start 2P", monospace; font-size: 8px; min-width: 96px; color: #20201c; }
.pvp-hint { font-size: 12px; color: #6b6252; }
.pvp-input {
  font: inherit; font-size: 14px; padding: 9px 10px; border: 3px solid #000; background: #f8f4e4; color: #20201c;
  width: min(220px, 100%);
}
.pvp-input:focus { outline: none; border-color: var(--gold-dk); }
.pvp-seg { display: flex; }
.pvp-seg button {
  font-family: "Press Start 2P", monospace; font-size: 8px; padding: 9px 11px; border: 3px solid #000;
  background: #e6dec4; color: #6b6252; cursor: pointer;
}
.pvp-seg button + button { border-left: 0; }
.pvp-seg button.is-on { background: #1d2d6b; color: #fdd66a; }
.pvp-seg button:disabled { opacity: .45; cursor: not-allowed; }
.pvp-refresh { font-size: 14px; background: none; border: 0; cursor: pointer; color: #1d2d6b; margin-left: 6px; }
.pvp-ch { grid-template-columns: 44px 1fr auto auto auto; }
.pvp-ladder { width: 100%; border-collapse: collapse; background: #fff; border: 3px solid #000; }
.pvp-ladder th { font-family: "Press Start 2P", monospace; font-size: 8px; text-align: left; background: #1d2d6b; color: #fdd66a; padding: 9px 10px; }
.pvp-ladder td { font-size: 14px; padding: 9px 10px; border-top: 2px solid #e6dec4; }
.pvp-ladder td.px { font-size: 10px; }
.pvp-ladder tr:first-child td:first-child { color: #f2a91c; }
.pvp-ladder tr.is-me td { background: #fff6dc; font-weight: 700; }
@media (max-width: 760px) {
  .pvp-label { min-width: 0; width: 100%; }
  .pvp-ch { grid-template-columns: 36px 1fr auto; }
}

/* ---- O painel de baixo: a narração e os botões ---- */
.bt-panel {
  flex: none; background: #1d2d6b; border-top: 4px solid #000; box-shadow: inset 0 3px 0 #e0a93a;
  padding: 12px 16px 14px; color: #f8f4e4; transition: opacity .3s steps(3);
}
.bt-log {
  min-height: 2.9em; margin: 0 0 10px; font-size: 15px; line-height: 1.45;
  background: #f8f4e4; color: #20201c; border: 3px solid #000; padding: 8px 12px;
}
.bt-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.bt-act {
  font: inherit; text-align: left; border: 3px solid #000; padding: 9px 10px; cursor: pointer;
  background: #f8f4e4; color: #20201c; box-shadow: 3px 3px 0 #000;
}
.bt-act b { display: block; font-family: "Press Start 2P", monospace; font-size: 9px; }
.bt-act small { display: block; font-size: 11px; color: #6b6252; margin-top: 5px; }
.bt-act.strike { background: #ffe1c4; }
.bt-act.heavy { background: #ffc9bd; }
.bt-act.guard { background: #cfe0ff; }
.bt-act.focus { background: #e8d6ff; }
.bt-act:hover:not(:disabled) { background: var(--gold); }
.bt-act:active:not(:disabled) { transform: translate(3px, 3px); box-shadow: 0 0 0; }
.bt-act:disabled { opacity: .45; cursor: not-allowed; }
.bt-sub { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.bt-sub > p { width: 100%; margin: 0 0 2px; font-size: 9px; color: #fdd66a; }
.bt-sub > p small { font-family: system-ui, sans-serif; font-size: 11px; color: #cfc6ad; margin-left: 8px; }
.bt-pick {
  display: flex; align-items: center; gap: 8px; text-align: left; font: inherit; cursor: pointer;
  background: #f8f4e4; color: #20201c; border: 3px solid #000; padding: 6px 10px 6px 6px;
}
.bt-pick img { width: 40px; height: 40px; image-rendering: pixelated; background: #e6dec4; }
.bt-pick small { display: block; font-size: 11px; color: #6b6252; }
.bt-pick em { font-style: normal; font-family: "Press Start 2P", monospace; font-size: 7px; color: #46a64a; }
.bt-pick:hover:not(:disabled) { background: var(--gold); }
.bt-pick:disabled { opacity: .45; cursor: not-allowed; }
.bt-cancel, .bt-forfeit {
  font-family: "Press Start 2P", monospace; font-size: 8px; background: #4a4f5c; color: #e9e4d4;
  border: 3px solid #000; padding: 9px 11px; cursor: pointer;
}
.bt-forfeit:disabled { opacity: .45; cursor: not-allowed; }
.bt-none { font-size: 13px; margin: 0; }
.bt-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 10px; }
.bt-cycle { font-family: "Press Start 2P", monospace; font-size: 7px; color: #fdd66a; }

.bt-result { position: absolute; inset: 0; z-index: 10; background: #000b; display: grid; place-items: center; padding: 16px; }
.bt-result[hidden] { display: none; }
.bt-result-box {
  width: min(420px, 100%); text-align: center; background: #f8f4e4; color: #20201c;
  border: 4px solid #000; box-shadow: inset 0 0 0 3px #e0a93a, 8px 8px 0 #000; padding: 22px 18px;
  animation: bt-banner-pop .3s steps(4);
}
@keyframes bt-banner-pop { from { transform: scale(.4); } }
.bt-result-box h2 { font-size: 18px; margin: 0 0 12px; }
.bt-result-box.win h2 { color: #b3341f; }
.bt-result-box .ar-stars i { font-size: 30px; }
.bt-reward { font-family: "Press Start 2P", monospace; font-size: 11px; color: var(--gold-dk); margin: 14px 0; }
.bt-reward.muted { font-family: inherit; font-size: 13px; color: #6b6252; }
.bt-hint { font-size: 13px; color: #6b6252; }

@media (max-width: 760px), (max-height: 500px) and (orientation: landscape) {
  .bt-hud { top: 40px; width: 47%; padding: 7px; }
  .bt-hud.you { left: 2%; }
  .bt-hud.foe { right: 2%; }
  .bt-name { font-size: 11px; }
  .bt-grid { grid-template-columns: repeat(3, 1fr); }
  .bt-act small { display: none; }
  .bt-log { font-size: 13px; }
  .bt-cycle { display: none; }
  .bt-card { font-size: 9px; padding: 8px 9px 7px; }
  .bt-banner { font-size: 11px; }
  .bt-banner.fight, .bt-banner.win, .bt-banner.lose { font-size: 22px; }
  .bt-vs { font-size: 38px; }
  .bt-vs-name { font-size: 9px; }
  .bt-banner.is-vs { gap: 10px; }
  .bt-num { font-size: 16px; }
  .bt-num.crit { font-size: 24px; }
  .bt-word { font-size: 9px; }
  .bt-coach { bottom: 6px; padding: 7px 9px 7px 7px; gap: 8px; }
  .bt-coach .dialog-portrait { width: 44px; height: 44px;
    background-size: calc(1672px * 44 / 106) calc(941px * 44 / 106);
    background-position: calc(-222px * 44 / 106) calc(-225px * 44 / 106); }
  .bt-coach-text { font-size: 12px; }

  /* HUD compacto: as etiquetas cabem numa linha, e o nome corta em vez de empurrar. */
  .bt-hud { padding: 6px 7px; border-width: 3px; box-shadow: inset 0 0 0 2px #e0a93a, 3px 3px 0 #000a; }
  .bt-name { gap: 3px; }
  .bt-name b { flex: 1 1 100%; margin: 0 0 2px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .bt-hud .ar-el, .bt-hud .ar-tier, .bt-fast, .bt-partner { font-size: 6px; padding: 3px 3px 2px; border-width: 1px; margin: 0; }
  .bt-owner { font-size: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .bt-hp { height: 10px; margin-top: 5px; }
  .bt-hp-num { font-size: 7px; margin-top: 3px; }
  .bt-row { margin-top: 4px; gap: 4px; }
  .bt-energy i { width: 9px; height: 9px; }
  .bt-bench { margin-top: 4px; }
  .bt-bench i { width: 8px; height: 8px; }

  /* O painel de baixo, mais baixo: a narração em uma ou duas linhas, e os botões com
     altura de dedo (44 px). */
  .bt-panel { padding: 8px 10px 10px; }
  .bt-log { min-height: 0; font-size: 13px; padding: 6px 9px; margin-bottom: 8px; }
  .bt-grid { gap: 6px; }
  .bt-act { min-height: 44px; padding: 8px; }
  .bt-act b { font-size: 8px; }
  .bt-foot { margin-top: 8px; }
  .bt-forfeit { padding: 8px 10px; font-size: 7px; }
  /* Troca e itens em duas colunas, o BACK ocupando a vaga que sobra: o painel cresce o
     mínimo possível (cada linha a mais é palco a menos). */
  .bt-sub { gap: 6px; }
  .bt-sub > p { font-size: 8px; }
  .bt-pick { flex: 1 1 calc(50% - 6px); min-width: 0; min-height: 50px; padding: 4px 6px 4px 4px; gap: 6px; }
  .bt-pick img { width: 34px; height: 34px; flex: none; }
  .bt-pick span, .bt-pick div { min-width: 0; }
  .bt-pick small { font-size: 10px; }
  .bt-sub .bt-cancel { flex: 1 1 calc(50% - 6px); min-height: 50px; }
  .bt-count { font-size: clamp(80px, 26vw, 130px); }
}

/* Celular DEITADO: pouca altura. O painel vira uma coluna à direita e o palco fica com a
   altura toda — senão a luta caberia numa fresta entre o HUD e os botões. */
@media (max-height: 500px) and (orientation: landscape) {
  .bt { flex-direction: row; }
  .bt-panel {
    width: min(300px, 42vw); overflow-y: auto; border-top: 0; border-left: 4px solid #000;
    box-shadow: inset 3px 0 0 #e0a93a; padding: 8px 10px;
  }
  .bt-grid { grid-template-columns: repeat(2, 1fr); gap: 6px; }
  .bt-act { min-height: 40px; padding: 6px 8px; }
  .bt-act small { display: none; }
  .bt-log { font-size: 12px; min-height: 0; padding: 5px 8px; margin-bottom: 6px; }
  .bt-cycle { display: none; }
  .bt-hud { width: 44%; padding: 5px 7px; }
  .bt-coach { bottom: 6px; }
  .bt-coach-text { font-size: 12px; }
}

/* iPhone: nada embaixo do notch nem da barra de gestos (index.html usa viewport-fit=cover). */
.bt-turn { top: calc(12px + env(safe-area-inset-top)); }
.bt-hud { top: calc(44px + env(safe-area-inset-top)); }
.bt-panel { padding-bottom: calc(14px + env(safe-area-inset-bottom)); padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
@media (max-width: 760px) {
  .bt-turn { top: calc(8px + env(safe-area-inset-top)); }
  .bt-hud { top: calc(38px + env(safe-area-inset-top)); }
  .bt-panel { padding-bottom: calc(10px + env(safe-area-inset-bottom)); padding-left: max(10px, env(safe-area-inset-left)); padding-right: max(10px, env(safe-area-inset-right)); }
}

@media (max-height: 500px) and (orientation: landscape) {
  .bt-turn { top: calc(6px + env(safe-area-inset-top)); }
  .bt-hud { top: calc(34px + env(safe-area-inset-top)); }
  .bt-panel { padding-bottom: calc(8px + env(safe-area-inset-bottom)); padding-right: max(10px, env(safe-area-inset-right)); }
}

/* Toque: sem o atraso de duplo-toque-para-zoom, sem o flash azul do Android, e sem
   selecionar texto ao segurar o dedo num botão. */
.bt button, .ar-rpg button, .pvp-confirm button {
  touch-action: manipulation; -webkit-tap-highlight-color: transparent; -webkit-user-select: none; user-select: none;
}

/* Hover só onde existe mouse. No celular o :hover "gruda" depois do toque, e o botão
   ficava dourado como se ainda estivesse escolhido. */
@media (hover: none) {
  .bt-act:hover:not(:disabled) { background: #f8f4e4; }
  .bt-act.strike:hover:not(:disabled) { background: #ffe1c4; }
  .bt-act.heavy:hover:not(:disabled) { background: #ffc9bd; }
  .bt-act.guard:hover:not(:disabled) { background: #cfe0ff; }
  .bt-act.focus:hover:not(:disabled) { background: #e8d6ff; }
  .bt-pick:hover:not(:disabled), button.ar-mon:hover { background: #f8f4e4; }
  button.ar-mon.is-picked:hover { background: #fff6dc; }
  .pvp-porta:hover { background: #fff; }
  .pvp-porta.find:hover { background: #ffe9d6; }
  .pvp-porta.create:hover { background: #e3ecff; }
  .ar-rpg .rpg-tabs button:hover:not(.is-active) { background: #e6dec4; color: #6b6252; }
  /* O retorno do toque passa a ser o "afundar" (:active), que no celular é imediato. */
  .bt-act:active:not(:disabled), .bt-pick:active:not(:disabled) { background: var(--gold); }
  button.ar-mon:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 #00000055; }
}
@media (prefers-reduced-motion: reduce) {
  .bt-mon, .bt-hp i, .bt-hud { transition: none; }
  .bt-mon img, .bt-stage, .bt-mon, .bt-num, .bt-word, .bt-card, .bt-banner, .bt-vs, .bt-vs-name { animation: none !important; }
}

/* ============================================================
   CELULAR: a janela da Arena (lobby do PvP, times, abas)
   ============================================================ */
@media (max-width: 620px) {
  /* Seis abas: numa linha, metade ficava escondida à direita sem pista de que existia.
     Em grade 3×2 todas aparecem; cada uma vira um botão inteiro. */
  .ar-rpg .rpg-bar { border-bottom: 0; margin-bottom: 12px; }
  .ar-rpg .rpg-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; overflow: visible; width: 100%; }
  .ar-rpg .rpg-tabs button {
    border-bottom: 3px solid #000; border-width: 3px; margin: 0; padding: 11px 4px; min-height: 40px;
    font-size: 7px; text-align: center; box-shadow: 2px 2px 0 #000;
  }
  .ar-rpg .rpg-tabs button.is-active { padding-bottom: 11px; }

  /* As duas portas lado a lado, baixas: ícone em cima, nome embaixo. */
  .pvp-portas { grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
  .pvp-porta { padding: 16px 8px 14px; gap: 8px; box-shadow: 4px 4px 0 #000; }
  .pvp-porta-icone { width: 34px; height: 34px; }
  .pvp-porta b { font-size: 8px; line-height: 1.6; }
  .pvp-porta span { font-size: 12px; line-height: 1.35; }
  .ar-intro { font-size: 13px; line-height: 1.5; }

  /* Voltar: alvo de dedo, não de mouse. */
  .ar-back { font-size: 9px; padding: 10px 12px 10px 0; min-height: 40px; }

  /* Formulário: 16 px no campo (abaixo disso o iPhone dá zoom ao tocar), botões de 44. */
  .pvp-input { font-size: 16px; width: 100%; }
  .pvp-seg { width: 100%; }
  .pvp-seg button { flex: 1; min-height: 44px; }
  .pvp-box { padding: 12px; }
  .pvp-row { margin-bottom: 14px; gap: 8px; }

  /* Escolher o time: três por linha, sem a lista de perks (fica na aba TEAM). */
  .ar-roster { grid-template-columns: repeat(3, 1fr); gap: 7px; }
  button.ar-mon { padding: 5px; gap: 4px; box-shadow: 2px 2px 0 #00000055; }
  button.ar-mon .ar-perks { display: none; }
  button.ar-mon .ar-mon-name { font-size: 11px; line-height: 1.25; }
  button.ar-mon .ar-el, button.ar-mon .ar-tier { font-size: 6px; padding: 3px 3px 2px; margin: 0 2px 2px 0; }
  button.ar-mon .ar-stats { grid-template-columns: repeat(2, 1fr); row-gap: 3px; font-size: 9px; }
  button.ar-mon .ar-stats b { font-size: 11px; }
  button.ar-mon .ar-order { top: 3px; left: 3px; font-size: 8px; padding: 3px 5px 2px; }

  /* O botão de criar/aceitar fica GRUDADO embaixo da janela: antes ele morava depois de
     todos os cards e dos itens, a duas telas e meia de rolagem. */
  .ar-go {
    position: sticky; bottom: -10px; z-index: 2; margin: 16px -10px -10px; width: calc(100% + 20px);
    min-height: 52px; border-left: 0; border-right: 0; border-bottom: 0;
    box-shadow: 0 -4px 0 #000, 0 -10px 16px #f8f4e4;
  }

  /* Lista de desafios: aceitar vira uma faixa larga embaixo de cada um. */
  .pvp-ch { grid-template-columns: 30px 1fr auto auto; column-gap: 10px; row-gap: 8px; }
  .pvp-ch .ar-reward { grid-column: auto; text-align: right; }
  .pvp-ch .btn { grid-column: 1 / -1; grid-row: auto; width: 100%; min-height: 44px; }

  /* Ranking: sem rolagem de lado. */
  .pvp-ladder th, .pvp-ladder td { padding: 8px 6px; }
  .pvp-ladder td { font-size: 13px; }
  .pvp-ladder td:nth-child(2) { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  /* O aviso "fulano aceitou": botões de dedo, um embaixo do outro. */
  .pvp-confirm-botoes { grid-template-columns: 1fr; }
  .pvp-confirm-botoes .btn { min-height: 50px; }
  .pvp-confirm-box { padding: 18px 14px 14px; }
}

/* ---- Como jogar: o resumo, as regras de ouro e o FAQ em sanfona ---- */
.ar-howto-hero { background: #fff6dc; border: 3px solid #000; padding: 12px 14px; box-shadow: 3px 3px 0 #00000055; }
.ar-ring { display: flex; flex-direction: column; gap: 7px; margin-top: 12px; }
.ar-ring > div { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; max-width: 360px; }
.ar-ring .bt-act { box-shadow: 2px 2px 0 #000; padding: 8px; cursor: default; text-align: center; }
.ar-ring .bt-act b { font-size: 8px; }
.ar-ring i { font-style: normal; font-size: 12px; color: #6b6252; }
.ar-rules { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; line-height: 1.45; }
.ar-faq { background: #fff; border: 3px solid #000; margin-bottom: 8px; }
.ar-faq summary {
  cursor: pointer; list-style: none; padding: 12px 36px 12px 12px; position: relative;
  font-weight: 700; font-size: 14px; min-height: 44px; -webkit-tap-highlight-color: transparent;
}
.ar-faq summary::-webkit-details-marker { display: none; }
.ar-faq summary::after { content: "+"; position: absolute; right: 12px; top: 9px; font-family: "Press Start 2P", monospace; font-size: 14px; color: #b3341f; }
.ar-faq[open] summary { background: #fff6dc; border-bottom: 2px solid #e6dec4; }
.ar-faq[open] summary::after { content: "−"; }
.ar-faq > div { padding: 4px 12px 10px; }
.ar-faq p { font-size: 14px; line-height: 1.55; margin: 8px 0 0; }
@media (max-width: 620px) {
  .ar-howto h3 { font-size: 9px; }
  .ar-howto p, .ar-rules, .ar-faq p, .ar-faq summary { font-size: 13px; }
  .ar-cycle { grid-template-columns: 1fr; }
}

/* ============================================================
   A T-0: "How Battles Work" (js/arena-lesson.js)
   ------------------------------------------------------------
   Por cima de tudo (a janela da Arena é 19, a luta 60). Mesma linguagem da luta: papel
   creme, borda preta, animação em quadros (`steps`).
   ============================================================ */
body.lesson-open { overflow: hidden; }
.lz {
  position: fixed; inset: 0; z-index: 70; display: flex; flex-direction: column; gap: 12px;
  padding: calc(12px + env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) calc(14px + env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  background:
    radial-gradient(ellipse 70% 45% at 50% 55%, #5a1a0ccc 0, transparent 70%),
    linear-gradient(#0b0706ee, #1a0d08f2), url("../assets/arena.webp") center / cover no-repeat;
  color: #f8f4e4; overflow-y: auto;
}
.lz[hidden] { display: none; }
.lz.is-opening { animation: rpg-open .2s steps(4, end); }
.lz > * { width: min(760px, 100%); margin: 0 auto; }

.lz-top { display: flex; align-items: center; gap: 12px; }
.lz-top h2 { margin: 0; font-size: 12px; color: #fdd66a; text-shadow: 2px 2px 0 #000; flex: none; }
.lz-dots { display: flex; gap: 5px; flex: 1; justify-content: center; }
.lz-dots i { width: 10px; height: 10px; border: 2px solid #000; background: #4a4f5c; }
.lz-dots i.done { background: #46b04a; }
.lz-dots i.on { background: #fdd66a; animation: bt-hint .8s steps(2) infinite; }
.lz-close {
  font-family: "Press Start 2P", monospace; font-size: 11px; background: #f8f4e4; color: #20201c;
  border: 3px solid #000; padding: 8px 9px; box-shadow: 2px 2px 0 #000; cursor: pointer; flex: none;
}

.lz-keeper {
  display: flex; gap: 12px; align-items: flex-start; cursor: pointer;
  background: #f8f4e4; color: #20201c; border: 4px solid #000; padding: 10px 14px 10px 10px;
  box-shadow: inset 0 0 0 2px #e0a93a, 6px 6px 0 #000a;
}
.lz-keeper .dialog-portrait { flex: none; width: 64px; height: 64px; border: 3px solid #000;
  background-size: calc(1672px * 64 / 106) calc(941px * 64 / 106);
  background-position: calc(-222px * 64 / 106) calc(-225px * 64 / 106); }
.lz-keeper b { font-size: 8px; color: #b3341f; }
.lz-say { margin: 6px 0 0; font-size: 15px; line-height: 1.5; min-height: 3em; }

.lz-stage { flex: 1 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; min-height: 230px; }
.lz-actions { display: flex; flex-direction: column; align-items: stretch; gap: 8px; }

/* ---- a mesa ---- */
.lz-rule { font-size: 10px; color: #fdd66a; background: #1d2d6b; border: 3px solid #000; padding: 7px 10px; }
.lz-score { font-size: 9px; color: #f8f4e4; }
.lz-score b { color: #fdd66a; font-size: 14px; }
.lz-table { position: relative; display: flex; align-items: center; justify-content: center; gap: 18px; }
.lz-slot { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.lz-who { font-size: 8px; color: #cfc6ad; }
.lz-vs { font-size: 18px; color: #ffd95a; text-shadow: 3px 3px 0 #b3341f, -2px -2px 0 #000; }
.lz-card {
  width: 128px; height: 170px; display: grid; place-items: center; border: 4px solid #000;
  background: #f8f4e4; color: #20201c; box-shadow: 5px 5px 0 #000; font-size: 12px;
  transition: opacity .3s steps(3), filter .3s steps(3);
}
.lz-card.is-down {
  font-size: 38px; color: #fdd66a;
  background: repeating-linear-gradient(45deg, #1d2d6b 0 10px, #243a86 10px 20px);
  box-shadow: inset 0 0 0 4px #e0a93a, 5px 5px 0 #000;
}
.lz-card.is-down span { text-shadow: 3px 3px 0 #000; animation: bt-bob 1.1s steps(2) infinite; }
.lz-card.strike { background: #ffe1c4; }
.lz-card.heavy { background: #ffc9bd; }
.lz-card.guard { background: #cfe0ff; }
.lz-card.is-flip { animation: lz-flip .45s steps(5); }
@keyframes lz-flip { 0% { transform: rotateY(90deg) scale(.9); } 60% { transform: rotateY(0) scale(1.08); } }
.lz-card.is-win { animation: lz-win .5s steps(4) both; box-shadow: 0 0 0 4px #fdd66a, 0 0 26px #ffd95a, 5px 5px 0 #000; }
@keyframes lz-win { 30% { transform: translateY(-18px) scale(1.1); } 60% { transform: translateY(0) scale(1.04); } }
.lz-card.is-lose { animation: lz-lose .42s steps(6) both; }
.lz-card.is-lose { filter: grayscale(.8) brightness(.7); }
@keyframes lz-lose { 20% { transform: translateX(-10px) rotate(-4deg); } 40% { transform: translateX(9px) rotate(3deg); } 60% { transform: translateX(-6px); } 80% { transform: translateX(4px); } }
.lz-card.is-tie { animation: lz-lose .3s steps(4); }

/* A palavra do encontro e as faíscas. */
.lz-fx { position: absolute; inset: 0; pointer-events: none; display: grid; place-items: center; }
.lz-word { font-size: 20px; text-shadow: 3px 3px 0 #000, -2px -2px 0 #000; animation: bt-word 1.3s steps(8) both; white-space: nowrap; z-index: 2; }
.lz-fx i { position: absolute; width: 8px; height: 8px; border: 2px solid #000; opacity: 0; animation: lz-spark .6s steps(5); }
@keyframes lz-spark { 0% { opacity: 1; transform: translate(0, 0); } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)); } }

/* As três cartas da jogada. */
.lz-moves { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.lz-move { min-height: 56px; text-align: center; }
.lz-move b { font-size: 10px; }
.lz-move small { display: block; font-size: 11px; color: #6b6252; margin-top: 5px; }
.lz-next { width: 100%; min-height: 52px; }
/* O "tente de novo" é secundário, mas sobre o fundo escuro precisa aparecer. */
.lz .btn.ghost { background: #f8f4e4; color: #20201c; border-color: #000; }

/* A abertura e o ciclo. */
.lz-hero { display: flex; gap: 10px; }
.lz-hero .bt-act { padding: 22px 12px; box-shadow: 4px 4px 0 #000; animation: bt-bob 1.1s steps(2) infinite; }
.lz-hero .bt-act:nth-child(2) { animation-delay: -.37s; }
.lz-hero .bt-act:nth-child(3) { animation-delay: -.74s; }
.lz-cycle > div { animation: lz-row .4s steps(4) both; animation-delay: calc(var(--d) * .45s); color: #f8f4e4; }
.lz-cycle i { color: #fdd66a; }
@keyframes lz-row { from { opacity: 0; transform: translateX(-30px); } }
.lz-done { font-size: 16px; color: #fdd66a; text-shadow: 3px 3px 0 #b3341f, -2px -2px 0 #000; display: flex; gap: 14px; align-items: center; animation: bt-vs-slam .45s steps(4); }

/* A roda de elementos. */
.lz-els { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; width: min(460px, 100%); }
.lz-el {
  position: relative; min-height: 64px; cursor: pointer; font: inherit; color: #fff;
  background: var(--el); border: 4px solid #000; box-shadow: 4px 4px 0 #000;
  text-shadow: 2px 2px 0 #000; font-size: 10px; transition: transform .2s steps(2), filter .2s steps(2);
}
.lz-el em { position: absolute; left: 50%; bottom: -11px; transform: translateX(-50%); font-style: normal; font-size: 6px; white-space: nowrap; border: 2px solid #000; padding: 3px 4px 2px; text-shadow: none; }
.lz-els:has(.is-sel) .lz-el:not(.is-sel):not(.is-beats):not(.is-loses) { filter: grayscale(.8) brightness(.55); }
.lz-el.is-sel { transform: translateY(-4px) scale(1.06); box-shadow: 0 0 0 4px #fff, 4px 4px 0 #000; }
.lz-el.is-sel em { background: #fff; color: #20201c; }
.lz-el.is-beats { animation: bt-hint .7s steps(2) 2; }
.lz-el.is-beats em { background: #46b04a; color: #fff; }
.lz-el.is-loses em { background: #d8402a; color: #fff; }
.lz-el-cycle { font-size: 7px; color: #cfc6ad; text-align: center; line-height: 1.8; margin: 8px 0 0; }
.lz-el-sum { font-size: 14px; line-height: 1.5; text-align: center; margin: 0; max-width: 460px; }

/* O botão LEARN TO PLAY no topo do How to play. */
.ar-learn {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; cursor: pointer; font: inherit;
  margin-bottom: 16px; padding: 14px 16px; color: #20201c;
  background: linear-gradient(#fdd66a, #f2a91c); border: 4px solid #000; box-shadow: 5px 5px 0 #000;
  animation: lz-pulse 1.6s steps(2) infinite;
}
.ar-learn:active { transform: translate(4px, 4px); box-shadow: 1px 1px 0 #000; }
.ar-learn b { display: block; font-size: 12px; }
.ar-learn small { display: block; font-size: 13px; margin-top: 6px; }
.ar-learn-icon { flex: none; display: grid; place-items: center; width: 44px; height: 44px; background: #b3341f; color: #fff; border: 3px solid #000; font-size: 16px; }
@keyframes lz-pulse { 50% { box-shadow: 5px 5px 0 #000, 0 0 0 4px #fff6; } }
.ar-stage.is-lesson { background: #fff6dc; border-color: #b3341f; }

@media (max-width: 620px) {
  .lz { gap: 10px; }
  .lz-top h2 { font-size: 9px; }
  .lz-dots i { width: 8px; height: 8px; }
  .lz-keeper { padding: 8px 10px 8px 8px; gap: 8px; }
  .lz-keeper .dialog-portrait { width: 44px; height: 44px;
    background-size: calc(1672px * 44 / 106) calc(941px * 44 / 106);
    background-position: calc(-222px * 44 / 106) calc(-225px * 44 / 106); }
  .lz-say { font-size: 13px; min-height: 4.5em; }
  .lz-stage { min-height: 200px; }
  .lz-card { width: 104px; height: 140px; font-size: 10px; }
  .lz-card.is-down { font-size: 30px; }
  .lz-table { gap: 10px; }
  .lz-vs { font-size: 14px; }
  .lz-move b { font-size: 9px; }
  .lz-move small { font-size: 10px; }
  .lz-hero .bt-act { padding: 16px 8px; }
  .lz-el { min-height: 56px; font-size: 8px; }
  .ar-learn b { font-size: 10px; }
  .ar-learn small { font-size: 12px; }
}
@media (hover: none) {
  .lz-move:hover:not(:disabled) { background: inherit; }
  .lz-move.strike:hover:not(:disabled) { background: #ffe1c4; }
  .lz-move.heavy:hover:not(:disabled) { background: #ffc9bd; }
  .lz-move.guard:hover:not(:disabled) { background: #cfe0ff; }
}
.lz button { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
@media (prefers-reduced-motion: reduce) {
  .lz *, .ar-learn { animation: none !important; transition: none !important; }
}

/* ============================================================
   GHOST BATTLE (js/arena-pvp.js, 20/10/2026)
   ------------------------------------------------------------
   No estilo do desenho do founder: abas RANKED / GHOST BATTLE, você à esquerda, o fantasma
   translúcido à direita, os níveis no meio e um FIGHT grande.
   ============================================================ */
.pvp-modos { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.pvp-modos button {
  font-family: "Press Start 2P", monospace; font-size: 9px; padding: 11px 8px; min-height: 42px; cursor: pointer;
  background: #3a2e33; color: #cfc6ad; border: 3px solid #000; box-shadow: 3px 3px 0 #000;
}
.pvp-modos button.is-on { background: #d8402a; color: #fff; box-shadow: 3px 3px 0 #000, inset 0 0 0 2px #fdd66a; }

.gh { background: #251b22; color: #f8f4e4; border: 4px solid #000; padding: 14px; box-shadow: inset 0 0 0 2px #7a1c10; }
.gh .ar-sub { color: #fdd66a; }
.gh .ar-sub span, .gh .ar-note { color: #cfc6ad; }
.gh-vs { display: grid; grid-template-columns: 1fr minmax(0, 1.5fr) 1fr; gap: 12px; align-items: center; margin-bottom: 8px; }
.gh-lado { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; position: relative; }
.gh-lado img { width: 100%; max-width: 150px; aspect-ratio: 1; image-rendering: pixelated; filter: drop-shadow(0 4px 0 #0008); }
.gh-lado span { font-size: 8px; color: #fdd66a; }
.gh-lado b { font-size: 8px; line-height: 1.6; }
.gh-vazio { width: 100%; max-width: 150px; aspect-ratio: 1; border: 3px dashed #5a4a52; }
/* O fantasma: translúcido, azulado, flutuando — e sem identidade ("???"). */
.gh-lado.fantasma img { opacity: .55; filter: grayscale(1) brightness(1.5) sepia(.3) hue-rotate(170deg) drop-shadow(0 0 10px #9fd0ff); animation: gh-flutua 1.6s steps(4) infinite alternate; }
.gh-etiqueta { background: #2f6fd8; color: #fff !important; border: 2px solid #000; padding: 4px 6px 3px; }
@keyframes gh-flutua { to { translate: 0 -8px; opacity: .7; } }
.gh-meio { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.gh-vs-palavra { font-size: 30px; color: #ff7a1a; text-shadow: 3px 3px 0 #7a1c10, -2px -2px 0 #000; }
.gh-meio > small { font-size: 8px; color: #cfc6ad; }
.gh-niveis { display: grid; gap: 7px; width: 100%; }
.gh-level {
  position: relative; display: grid; grid-template-columns: 14px 1fr; grid-template-rows: auto auto; column-gap: 10px; row-gap: 4px;
  align-items: center; text-align: left; cursor: pointer; min-height: 48px; padding: 8px 10px;
  background: #3a2e33; color: #f8f4e4; border: 3px solid #000; box-shadow: 3px 3px 0 #000;
}
.gh-level i { grid-row: 1 / span 2; width: 14px; height: 14px; background: var(--gh); border: 2px solid #000; }
.gh-level b { font-size: 11px; }
.gh-level small { font-size: 7px; color: var(--gh); }
.gh-level em { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-style: normal; }
.gh-level.is-on { background: #4a3a24; box-shadow: 3px 3px 0 #000, inset 0 0 0 3px #fdd66a; }
.gh-level.is-on::before { content: "▶"; position: absolute; left: -16px; top: 50%; transform: translateY(-50%); color: #fdd66a; font-size: 11px; }
.gh-level.is-locked { opacity: .55; cursor: not-allowed; }
.gh-level.is-locked small { color: #a89878; }
.gh-go { background: #d8402a; color: #fff; }

/* Na luta: os do outro lado são fantasmas. */
.bt.is-ghost .bt-mon.foe img { opacity: .62; filter: grayscale(.85) brightness(1.4) sepia(.25) hue-rotate(170deg) drop-shadow(0 0 10px #9fd0ff); }
.bt.is-ghost .bt-mon.foe.is-hurt img { opacity: .9; }

@media (max-width: 620px) {
  .gh { padding: 10px; }
  .gh-vs { grid-template-columns: 1fr 1fr; }
  .gh-meio { grid-column: 1 / -1; grid-row: 2; }
  .gh-lado img, .gh-vazio { max-width: 110px; }
  .gh-vs-palavra { font-size: 22px; }
  .pvp-modos button { font-size: 8px; }
}
@media (prefers-reduced-motion: reduce) { .gh-lado.fantasma img { animation: none; } }
