/* ═══════════════════════════════════════════════════════════════════════════
   Crystal Heroes — menu principal (visual "RPG premium").
   Só aparência: cores, painéis, animações e posição das coisas.
   Os botões e números continuam sendo controlados pelo game.js (mesmos ids).
   Paleta: azul royal, azul escuro, roxo e dourado.
   ═══════════════════════════════════════════════════════════════════════════ */
:root {
  --ch-navy: #060a22;
  --ch-deep: #0c1442;
  --ch-royal: #2a5cff;
  --ch-royal-2: #1838b0;
  --ch-purple: #7a3cf0;
  --ch-purple-2: #3a1690;
  --ch-gold: #ffd54d;
  --ch-gold-2: #f29a17;
  --ch-gold-3: #b86a00;
  --ch-line: rgba(150, 180, 255, .2);
  --ch-text: #eef2ff;
  --ch-muted: #a9b5e8;
  --ch-r: 18px;
  --ch-panel: linear-gradient(165deg, rgba(42, 74, 200, .5) 0%, rgba(20, 22, 84, .78) 48%, rgba(46, 20, 112, .74) 100%);
  --ch-shadow: 0 1px 0 rgba(255, 255, 255, .14) inset, 0 0 0 1px rgba(10, 14, 50, .6), 0 14px 34px rgba(2, 4, 22, .55);
}

/* ───────── fundo do menu: céu azul-royal com auroras roxas ───────── */
body:has(#lobby:not([hidden])) {
  background:
    radial-gradient(70% 55% at 50% 0%, rgba(58, 110, 255, .55), transparent 70%),
    radial-gradient(45% 40% at 0% 100%, rgba(122, 60, 240, .45), transparent 70%),
    radial-gradient(45% 40% at 100% 90%, rgba(60, 40, 200, .45), transparent 70%),
    linear-gradient(180deg, #0d1a5c 0%, #0a0f38 45%, var(--ch-navy) 100%) fixed;
}
.ch-aurora { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.ch-aurora i { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .45; animation: chDrift 18s ease-in-out infinite alternate; }
.ch-aurora i:nth-child(1) { width: 46vw; height: 30vw; left: -10vw; top: 8vh; background: #3b6cff; }
.ch-aurora i:nth-child(2) { width: 40vw; height: 28vw; right: -8vw; top: 30vh; background: #7a3cf0; animation-delay: -6s; }
.ch-aurora i:nth-child(3) { width: 30vw; height: 20vw; left: 35vw; bottom: -6vw; background: #c79bff; opacity: .22; animation-delay: -11s; }
@keyframes chDrift { to { transform: translate(4vw, -3vh) scale(1.12); } }

/* ───────── estrutura geral (celular primeiro) ───────── */
#app:has(#lobby:not([hidden])) { max-width: 600px; }
body #lobby.ch-lobby { position: relative; gap: 10px; padding-top: max(10px, env(safe-area-inset-top, 0px)); padding-bottom: 0; color: var(--ch-text); }
#lobby.ch-lobby > *:not(.ch-aurora) { position: relative; z-index: 1; }
#lobby .ch-left { display: none; }
#lobby .tab-body { scrollbar-width: none; animation: chTabIn .35s ease both; }
#lobby .tab-body::-webkit-scrollbar { display: none; }
@keyframes chTabIn { from { opacity: 0; transform: translateY(10px); } }

/* painel de vidro padrão */
.ch-panel, #lobby .deck-panel {
  position: relative; border-radius: var(--ch-r); padding: 14px;
  background: var(--ch-panel); border: 1px solid var(--ch-line); box-shadow: var(--ch-shadow);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.ch-panel::before, #lobby .deck-panel::before {
  content: ''; position: absolute; left: 18px; right: 18px; top: -1px; height: 2px; border-radius: 2px; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255, 213, 77, .85), transparent);
}
.ch-ph { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.ch-ph h2, #lobby .deck-head h2 { font: 400 17px var(--display); letter-spacing: .04em; text-transform: uppercase; color: #fff; text-shadow: 0 2px 0 rgba(6, 10, 40, .8); }
.ch-ph h2::before { content: ''; display: inline-block; width: 9px; height: 13px; margin-right: 8px; vertical-align: 0; clip-path: polygon(50% 0, 100% 40%, 50% 100%, 0 40%); background: linear-gradient(180deg, #fff3b0, var(--ch-gold) 50%, var(--ch-gold-2)); filter: drop-shadow(0 0 4px rgba(255, 213, 77, .8)); }
.ch-ph-note { margin-left: auto; font: 800 11px var(--body); letter-spacing: .06em; text-transform: uppercase; color: var(--ch-muted); white-space: nowrap; }

/* ═════════ TOPO ═════════ */
.ch-top {
  flex: none; display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 8px 10px; border-radius: 20px;
  background: linear-gradient(180deg, rgba(36, 66, 190, .62), rgba(16, 20, 74, .82));
  border: 1px solid var(--ch-line); box-shadow: var(--ch-shadow);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.ch-top::after { content: ''; position: absolute; left: 24px; right: 24px; bottom: -1px; height: 2px; background: linear-gradient(90deg, transparent, rgba(255, 213, 77, .7), transparent); pointer-events: none; }
.ch-brand { display: flex; align-items: center; gap: 10px; flex: none; }
.ch-home, .ch-gear {
  flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 14px; cursor: pointer; color: #fff; text-decoration: none;
  background: linear-gradient(180deg, rgba(90, 130, 255, .5), rgba(30, 50, 150, .6)); border: 1px solid rgba(170, 200, 255, .35);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 4px 10px rgba(0, 0, 0, .35); transition: transform .2s, filter .2s, background .2s;
}
.ch-home svg, .ch-gear svg { width: 22px; height: 22px; }
.ch-home:hover, .ch-gear:hover { transform: translateY(-2px); filter: brightness(1.2); }
.ch-gear:hover svg { animation: chSpin 1.2s ease-in-out; }
.ch-home:active, .ch-gear:active { transform: translateY(1px) scale(.96); }
@keyframes chSpin { to { transform: rotate(180deg); } }

.ch-logo { display: flex; align-items: center; gap: 8px; }
.ch-logo-gem { width: 26px; height: 34px; flex: none; clip-path: polygon(50% 0, 100% 32%, 82% 100%, 18% 100%, 0 32%); background: linear-gradient(160deg, #e7f4ff 0%, #7fb6ff 30%, #7a3cf0 70%, #3a1690 100%); filter: drop-shadow(0 0 8px rgba(130, 170, 255, .9)); animation: chGemGlow 2.6s ease-in-out infinite; }
@keyframes chGemGlow { 50% { filter: drop-shadow(0 0 14px rgba(190, 150, 255, 1)) brightness(1.15); } }
.ch-logo-txt { display: grid; line-height: .86; }
.ch-logo-txt b { font: 400 17px var(--display); letter-spacing: .06em; color: #fff; text-shadow: 0 2px 0 #1838b0, 0 0 12px rgba(120, 160, 255, .6); }
.ch-logo-txt b + b { font-size: 20px; color: var(--ch-gold); background: linear-gradient(180deg, #fff3b0 10%, var(--ch-gold) 50%, var(--ch-gold-2) 90%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; text-shadow: none; filter: drop-shadow(0 2px 0 #7a3a00); }

.ch-player { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1 1 0; }
.ch-avatar {
  position: relative; flex: none; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  font: 400 20px var(--display); color: #1a1050;
  background: radial-gradient(circle at 35% 30%, #fff6c8, var(--ch-gold) 55%, var(--ch-gold-2));
  box-shadow: 0 0 0 3px #1838b0, 0 0 0 5px rgba(255, 213, 77, .75), 0 0 18px rgba(255, 213, 77, .55);
}
.ch-avatar[data-lv]::after {
  content: attr(data-lv); position: absolute; right: -6px; bottom: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px;
  display: grid; place-items: center; font: 400 11px var(--display); color: #fff; background: linear-gradient(180deg, #8a5cff, #4a1fb0); border: 2px solid #0c1442;
}
.ch-pinfo { min-width: 0; flex: 1; }
.ch-pname { display: flex; align-items: center; gap: 6px; min-width: 0; font: 400 16px var(--display); letter-spacing: .03em; white-space: nowrap; }
.ch-pname #pName { overflow: hidden; text-overflow: ellipsis; text-shadow: 0 2px 0 rgba(6, 10, 40, .8); }
.ch-xp { position: relative; height: 16px; margin-top: 4px; border-radius: 999px; overflow: hidden; background: rgba(4, 8, 32, .75); border: 1px solid rgba(150, 180, 255, .3); max-width: 280px; }
.ch-xp-fill { position: absolute; inset: 0 auto 0 0; width: 10%; border-radius: 999px; background: linear-gradient(90deg, #36d0ff, #4a7cff 55%, #9a6bff); box-shadow: 0 0 10px rgba(80, 160, 255, .8); transition: width .6s ease; }
.ch-xp-fill::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent); transform: translateX(-100%); animation: chSweep 3.2s ease-in-out infinite; }
.ch-xp span { position: relative; display: block; text-align: center; font: 800 10px/14px var(--body); letter-spacing: .06em; text-transform: uppercase; text-shadow: 0 1px 2px #000; }

.ch-cur { display: flex; align-items: center; gap: 8px; flex: 1 1 100%; order: 3; justify-content: space-between; }
.ch-money {
  display: flex; align-items: center; gap: 7px; flex: 1; min-width: 0; height: 36px; padding: 0 12px 0 5px; border-radius: 999px;
  background: linear-gradient(180deg, rgba(4, 8, 34, .78), rgba(14, 20, 70, .78)); border: 1px solid rgba(150, 180, 255, .25);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08); transition: transform .2s, border-color .2s;
}
.ch-money:hover { transform: translateY(-2px); border-color: rgba(255, 213, 77, .6); }
.ch-money b { margin-left: auto; font: 400 16px var(--display); letter-spacing: .03em; color: #fff; font-variant-numeric: tabular-nums; }
.ch-money.tr b { color: #ffe27a; } .ch-money.gd b { color: var(--ch-gold); } .ch-money.sh b { color: #d9b8ff; }
.ch-money .ico-trophy, .ch-money .ico-gold { width: 26px; height: 26px; margin: 0; }
.ch-money .ico-shard { width: 22px; height: 28px; filter: drop-shadow(0 0 6px rgba(170, 110, 255, .9)); animation: chGemGlow 2.6s ease-in-out infinite; }
.ch-top-btns { display: flex; align-items: center; gap: 8px; flex: none; }
.ch-pass-btn {
  display: flex; align-items: center; gap: 6px; height: 42px; padding: 0 14px 0 10px; border-radius: 14px; cursor: pointer; color: #fff;
  font: 400 14px var(--display); letter-spacing: .05em; text-transform: uppercase;
  background: linear-gradient(180deg, #9a6bff, #5a24d0 60%, #3a1690); border: 1px solid rgba(220, 190, 255, .45);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 4px 12px rgba(90, 36, 208, .5); transition: transform .2s, filter .2s;
}
.ch-pass-btn .ti { width: 22px; height: 22px; background: var(--ch-gold); }
.ch-pass-btn:hover { transform: translateY(-2px); filter: brightness(1.15); }
.ch-pass-btn.on { box-shadow: 0 0 0 2px var(--ch-gold), 0 0 18px rgba(255, 213, 77, .6); }

/* ═════════ CENTRO: palco 3D da arena ═════════ */
#lobby #tab-battle { gap: 12px; }
#lobby #tab-battle > * { flex-shrink: 0; }
#lobby .ch-stage {
  border-radius: 22px; border: 0; aspect-ratio: 16 / 11; max-height: none;
  background: radial-gradient(ellipse at 50% 35%, #5a7dff 0%, #3a2ac0 45%, #160f5a 100%);
  box-shadow: 0 0 0 1px rgba(255, 213, 77, .55), 0 0 0 4px rgba(12, 20, 70, .9), 0 0 0 5px rgba(150, 180, 255, .25), 0 0 46px rgba(110, 90, 255, .45), 0 18px 40px rgba(0, 0, 0, .55);
}
#lobby .ch-stage::after { content: ''; position: absolute; inset: 0; z-index: 2; pointer-events: none; border-radius: inherit; box-shadow: inset 0 0 60px rgba(10, 6, 50, .55); background: radial-gradient(120% 70% at 50% 110%, rgba(122, 60, 240, .35), transparent 60%); }
#lobby .ch-arena-label { position: absolute; left: 18px; top: 14px; right: 140px; display: grid; gap: 2px; z-index: 3; }
#lobby .arena-num { justify-self: start; font: 800 11px var(--body); letter-spacing: .14em; text-transform: uppercase; color: #fff3b0; padding: 3px 10px; border-radius: 999px; background: rgba(8, 10, 40, .55); border: 1px solid rgba(255, 213, 77, .5); text-shadow: none; }
#lobby .arena-title { font: 400 clamp(24px, 3vw, 44px) var(--display); letter-spacing: .03em; line-height: 1.05; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-shadow: 0 3px 0 #1838b0, 0 0 22px rgba(130, 170, 255, .85), 0 6px 18px rgba(0, 0, 0, .6); animation: titleIn .6s cubic-bezier(.2, 1.6, .4, 1) both; }
#lobby .ch-online { position: absolute; right: 14px; top: 14px; z-index: 3; display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font: 800 11px var(--body); letter-spacing: .04em; color: #dfffee; background: rgba(8, 10, 40, .6); border: 1px solid rgba(75, 227, 160, .45); }
#lobby .ch-online:empty { display: none; }
#lobby .ch-online::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #4be3a0; box-shadow: 0 0 8px #4be3a0; animation: avatarPulse 2s ease-in-out infinite; }
#lobby .ch-feat { position: absolute; left: 50%; bottom: 14px; translate: -50% 0; z-index: 3; max-width: calc(100% - 28px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font: 400 15px var(--display); letter-spacing: .04em; color: #fff; padding: 6px 16px; border-radius: 999px;
  background: linear-gradient(180deg, rgba(26, 40, 140, .8), rgba(12, 14, 60, .85)); border: 1px solid rgba(255, 213, 77, .55); box-shadow: 0 0 18px rgba(80, 120, 255, .45); }
#lobby .ch-feat:empty { display: none; }
/* cristais mágicos flutuando nas bordas do palco */
.ch-stage-fx { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.ch-stage-fx .cg { position: absolute; width: 22px; height: 34px; clip-path: polygon(50% 0, 100% 35%, 50% 100%, 0 35%); background: linear-gradient(160deg, #ffffff 0%, #9fd0ff 30%, #7a3cf0 75%, #2a1070 100%); filter: drop-shadow(0 0 10px rgba(150, 190, 255, 1)); opacity: .9; animation: chFloat 4.2s ease-in-out infinite, chGemGlow 2.6s ease-in-out infinite; }
.ch-stage-fx .cg1 { left: 4%; top: 30%; }
.ch-stage-fx .cg2 { right: 5%; top: 38%; width: 16px; height: 26px; animation-delay: -1.4s, -.6s; }
.ch-stage-fx .cg3 { left: 12%; bottom: 16%; width: 14px; height: 22px; background: linear-gradient(160deg, #fff, #ffe680 35%, #f29a17 80%); animation-delay: -2.4s, -1.2s; }
.ch-stage-fx .cg4 { right: 14%; bottom: 22%; width: 18px; height: 28px; background: linear-gradient(160deg, #fff, #ffc6f0 30%, #b05cff 80%); animation-delay: -3.2s, -2s; }
@keyframes chFloat { 0%, 100% { transform: translateY(0) rotate(-6deg); } 50% { transform: translateY(-12px) rotate(6deg); } }
#lobby .sparkles i { background: #e6f0ff; box-shadow: 0 0 10px 3px rgba(140, 180, 255, .85); }
#lobby .sparkles i:nth-child(3n) { background: #fff3b0; box-shadow: 0 0 10px 3px rgba(255, 213, 77, .85); }
#lobby .sparkles i:nth-child(9) { left: 15%; animation-delay: 2.7s; width: 3px; height: 3px; }
#lobby .sparkles i:nth-child(10) { left: 44%; animation-delay: 4.6s; }
#lobby .sparkles i:nth-child(11) { left: 70%; animation-delay: 5.2s; width: 3px; height: 3px; }
#lobby .sparkles i:nth-child(12) { left: 83%; animation-delay: 2.1s; }

/* ═════════ botões de jogar ═════════ */
.ch-actions { display: grid; grid-template-columns: 1fr 1fr; grid-template-areas: "battle battle" "train friend"; gap: 10px; }
.ch-battle {
  grid-area: battle; position: relative; overflow: hidden; isolation: isolate; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 14px; min-height: 84px; padding: 10px 22px;
  border-radius: 22px; border: 0; color: #3a1a00;
  background: linear-gradient(180deg, #fff3a0 0%, #ffd54d 30%, #ffb21f 70%, #f08a10 100%);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .8), inset 0 -6px 0 rgba(150, 70, 0, .45), 0 0 0 2px #7a3a00, 0 0 0 4px rgba(255, 213, 77, .35), 0 8px 0 #6a3000, 0 14px 30px rgba(255, 170, 30, .45);
  transition: transform .18s, filter .18s, box-shadow .18s;
  animation: chBattlePulse 2.4s ease-in-out infinite;
}
.ch-battle::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .7) 50%, transparent 65%); transform: translateX(-130%); animation: chSweep 3.4s ease-in-out infinite; }
.ch-battle-glow { position: absolute; inset: -40% 20%; z-index: -2; background: radial-gradient(closest-side, rgba(255, 255, 255, .55), transparent); opacity: .6; }
.ch-battle-ico { flex: none; display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; color: #fff7d0; background: radial-gradient(circle at 35% 30%, #c56a10, #7a3a00); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .3), 0 0 0 3px rgba(255, 255, 255, .45); }
.ch-battle-ico svg { width: 30px; height: 30px; animation: swordWiggle 1.8s ease-in-out infinite; }
.ch-battle-txt { display: grid; text-align: left; line-height: 1; }
.ch-battle-txt b { font: 400 clamp(28px, 2.6vw, 44px) var(--display); letter-spacing: .06em; text-transform: uppercase; color: #fff; -webkit-text-stroke: 0; paint-order: stroke fill;
  text-shadow: 0 3px 0 #a04a00, 2px 0 0 #a04a00, -2px 0 0 #a04a00, 0 -2px 0 #a04a00, 0 5px 0 #6a3000, 0 0 18px rgba(255, 255, 255, .5); }
.ch-battle-txt small { margin-top: 6px; white-space: nowrap; font: 800 11px var(--body); letter-spacing: .06em; text-transform: uppercase; color: #6a3000; }
.ch-battle:hover { transform: translateY(-3px) scale(1.01); filter: brightness(1.06) saturate(1.1); }
.ch-battle:active { transform: translateY(5px); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .8), inset 0 -3px 0 rgba(150, 70, 0, .45), 0 0 0 2px #7a3a00, 0 2px 0 #6a3000; }
@keyframes chBattlePulse { 50% { box-shadow: inset 0 2px 0 rgba(255, 255, 255, .8), inset 0 -6px 0 rgba(150, 70, 0, .45), 0 0 0 2px #7a3a00, 0 0 0 6px rgba(255, 213, 77, .25), 0 8px 0 #6a3000, 0 14px 44px rgba(255, 190, 40, .75); } }
@keyframes chSweep { 0%, 55% { transform: translateX(-130%); } 100% { transform: translateX(130%); } }

.ch-act {
  position: relative; overflow: hidden; display: flex; align-items: center; gap: 10px; min-width: 0; min-height: 62px; padding: 8px 12px; text-align: left; cursor: pointer;
  border-radius: 18px; border: 0; color: #fff;
  transition: transform .18s, filter .18s, box-shadow .18s;
}
.ch-train { grid-area: train; background: linear-gradient(180deg, #5f9bff 0%, #2a5cff 50%, #1838b0 100%); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .45), inset 0 -4px 0 rgba(8, 20, 90, .5), 0 0 0 2px #0a1a6a, 0 6px 0 #0a1450, 0 10px 22px rgba(42, 92, 255, .35); }
.ch-friend { grid-area: friend; background: linear-gradient(180deg, #b78cff 0%, #7a3cf0 50%, #4a1fb0 100%); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .45), inset 0 -4px 0 rgba(40, 10, 100, .5), 0 0 0 2px #2a0a6a, 0 6px 0 #22085a, 0 10px 22px rgba(122, 60, 240, .35); }
.ch-act::after { content: ''; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, .35) 50%, transparent 62%); transform: translateX(-130%); animation: chSweep 4.6s ease-in-out infinite 1s; pointer-events: none; }
.ch-friend::after { animation-delay: 2.2s; }
.ch-act:hover { transform: translateY(-3px); filter: brightness(1.1); }
.ch-act:active { transform: translateY(4px); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .45), 0 0 0 2px #0a1a6a, 0 2px 0 #0a1450; }
.ch-act-ico { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: rgba(255, 255, 255, .18); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35); }
.ch-act-ico svg { width: 24px; height: 24px; }
.ch-act-txt { display: grid; min-width: 0; line-height: 1.1; }
.ch-act-txt b { font: 400 17px var(--display); letter-spacing: .03em; text-transform: uppercase; text-shadow: 0 2px 0 rgba(0, 0, 0, .35); line-height: 1.05; overflow-wrap: anywhere; }
.ch-act-txt small { margin-top: 3px; font: 800 11px var(--body); color: rgba(255, 255, 255, .85); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* caminho das arenas e escolha da arena (no celular; no PC isso fica no painel da esquerda) */
#lobby .ch-road { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; padding: 10px 14px; border-radius: var(--ch-r); background: var(--ch-panel); border: 1px solid var(--ch-line); box-shadow: var(--ch-shadow); }
#lobby .ch-road .road-fill { background: linear-gradient(90deg, #7a3cf0, #b78cff 40%, var(--ch-gold)); box-shadow: 0 0 12px rgba(160, 110, 255, .7); }
#lobby .ch-picker { padding: 12px; border-radius: var(--ch-r); background: var(--ch-panel); border: 1px solid var(--ch-line); box-shadow: var(--ch-shadow); }
#lobby .ch-admin { border-radius: 14px; background: linear-gradient(90deg, rgba(122, 60, 240, .35), rgba(255, 111, 174, .2)); border: 1px solid rgba(255, 111, 174, .6); }
.ch-foot { display: flex; justify-content: center; padding-bottom: 4px; }
#lobby #btnTut { width: auto; }
.ch-link { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px; cursor: pointer; font: 800 13px var(--body); color: var(--ch-muted); background: rgba(8, 12, 44, .45); border: 1px solid var(--ch-line); transition: color .2s, border-color .2s, transform .2s; }
.ch-link:hover { color: #fff; border-color: rgba(255, 213, 77, .6); transform: translateY(-1px); }

/* ═════════ ESQUERDA: progresso e arenas ═════════ */
.ch-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ch-stat {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: center;
  padding: 8px 10px; border-radius: 14px; background: rgba(6, 10, 40, .5); border: 1px solid rgba(150, 180, 255, .16);
  transition: transform .2s, border-color .2s;
}
.ch-stat:hover { transform: translateY(-2px); border-color: rgba(255, 213, 77, .5); }
.ch-stat > i { grid-row: span 2; width: 28px; height: 28px; margin: 0; }
.ch-stat span { font: 800 10px var(--body); letter-spacing: .08em; text-transform: uppercase; color: var(--ch-muted); }
.ch-stat b { font: 400 18px var(--display); letter-spacing: .02em; color: #fff; font-variant-numeric: tabular-nums; line-height: 1.1; }
.ch-stat b small { font-size: 12px; color: var(--ch-muted); }
.ch-stat .ico-gold, .ch-stat .ico-trophy { width: 26px; height: 26px; }
.ch-ico-win, .ch-ico-hero { display: inline-block; background: linear-gradient(180deg, #8fe0ff, #4a7cff); -webkit-mask: var(--m) center / contain no-repeat; mask: var(--m) center / contain no-repeat; }
.ch-ico-win { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2l2.9 6.2 6.8.8-5 4.7 1.3 6.7L12 17.1l-6 3.3 1.3-6.7-5-4.7 6.8-.8z'/%3E%3C/svg%3E"); background: linear-gradient(180deg, #fff3b0, #ffb21f); }
.ch-ico-hero { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='7' r='4.5'/%3E%3Cpath d='M3.5 22c.6-5.2 4-8 8.5-8s7.9 2.8 8.5 8z'/%3E%3C/svg%3E"); background: linear-gradient(180deg, #e2ccff, #9a6bff); }
.ch-next { margin-top: 10px; padding: 10px; border-radius: 14px; background: linear-gradient(180deg, rgba(122, 60, 240, .28), rgba(20, 14, 70, .5)); border: 1px solid rgba(190, 150, 255, .3); }
.ch-next-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 7px; }
.ch-next-top span { font: 800 10px var(--body); letter-spacing: .08em; text-transform: uppercase; color: var(--ch-muted); }
.ch-next-top b { font: 400 14px var(--display); letter-spacing: .03em; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-bar { position: relative; height: 22px; border-radius: 999px; overflow: hidden; background: rgba(4, 6, 30, .8); border: 1px solid rgba(150, 180, 255, .25); }
.ch-bar-fill { position: absolute; inset: 0 auto 0 0; border-radius: 999px; background: linear-gradient(90deg, #7a3cf0, #b78cff 45%, var(--ch-gold)); box-shadow: 0 0 14px rgba(170, 110, 255, .8); transition: width .6s ease; }
.ch-bar-fill::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .5), transparent); transform: translateX(-100%); animation: chSweep 3s ease-in-out infinite; }
.ch-bar span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 4px; font: 400 12px var(--display); letter-spacing: .03em; color: #fff; text-shadow: 0 1px 2px #000, 0 0 4px #000; }
.ch-bar .ico-shard { width: 12px; height: 16px; vertical-align: 0; }

.ch-arenas { display: grid; gap: 5px; }
.ch-arena {
  position: relative; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; width: 100%;
  padding: 5px 10px 5px 5px; border-radius: 13px; text-align: left; color: #fff;
  background: rgba(6, 10, 40, .45); border: 1px solid rgba(150, 180, 255, .14);
  transition: transform .2s, border-color .2s, background .2s;
}
.ch-arena .ar { width: 32px; height: 32px; border-radius: 11px; border: 0; display: grid; place-items: center; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 0 0 2px rgba(6, 10, 40, .8); }
.ch-arena .ar em { font: 400 15px var(--display); font-style: normal; color: #fff; text-shadow: 0 1px 0 #000, 0 0 6px rgba(0, 0, 0, .6); }
.ch-arena-name { display: grid; min-width: 0; line-height: 1.15; }
.ch-arena-name b { font: 400 14px var(--display); letter-spacing: .03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-arena-name small { font: 700 11px var(--body); color: var(--ch-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-arena-st { display: inline-flex; align-items: center; gap: 3px; font: 800 11px var(--body); color: var(--ch-muted); white-space: nowrap; }
.ch-arena-st .ico-shard { width: 11px; height: 14px; vertical-align: 0; }
.ch-arena.open { cursor: pointer; }
.ch-arena.open:hover { transform: translateX(3px); border-color: rgba(255, 213, 77, .55); background: rgba(40, 70, 200, .35); }
.ch-arena.picked { background: linear-gradient(90deg, rgba(255, 213, 77, .26), rgba(122, 60, 240, .22)); border-color: rgba(255, 213, 77, .85); box-shadow: 0 0 16px rgba(255, 213, 77, .3), inset 0 1px 0 rgba(255, 255, 255, .15); }
.ch-arena.picked::before { content: ''; position: absolute; left: -1px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--ch-gold); box-shadow: 0 0 10px var(--ch-gold); }
.ch-arena.picked .ch-arena-st { color: var(--ch-gold); }
.ch-arena.done .ch-arena-st { color: #8ff0b8; }
.ch-arena.done { opacity: .8; }
.ch-arena.locked { opacity: .55; }
.ch-arena.locked .ar { filter: grayscale(.6) brightness(.8); }

/* ═════════ DIREITA: os 6 heróis e o especial ═════════ */
.ch-edit {
  flex: none; height: 32px; padding: 0 14px; border-radius: 11px; cursor: pointer; font: 400 13px var(--display); letter-spacing: .05em; text-transform: uppercase; color: #3a1a00;
  background: linear-gradient(180deg, #fff3a0, var(--ch-gold) 50%, var(--ch-gold-2)); border: 0; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8), 0 0 0 1px #7a3a00, 0 3px 0 #6a3000; transition: transform .18s, filter .18s;
}
.ch-edit:hover { transform: translateY(-2px); filter: brightness(1.08); }
.ch-edit:active { transform: translateY(2px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8), 0 0 0 1px #7a3a00; }
.ch-team .ch-ph { flex-wrap: wrap; row-gap: 2px; }
.ch-team .ch-ph h2 { white-space: nowrap; }
.ch-team .ch-ph-note { margin-left: 0; flex: 1; text-align: right; font-size: 10px; }
.ch-deck { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.ch-hero {
  --rar: #8fb3d9; --glow: #cfe3ff;
  position: relative; isolation: isolate; overflow: hidden; display: block; width: 100%; aspect-ratio: 4 / 5.1; padding: 0; cursor: pointer;
  border-radius: 14px; border: 0; color: #fff;
  background: linear-gradient(180deg, var(--glow), var(--rar) 40%, color-mix(in srgb, var(--rar) 45%, #0a0a30));
  box-shadow: 0 0 0 1px rgba(6, 10, 40, .9), 0 6px 14px rgba(0, 0, 0, .45);
  transition: transform .25s cubic-bezier(.2, 1.4, .4, 1), box-shadow .25s;
  animation: chCardBob 4s ease-in-out infinite; animation-delay: var(--d, 0s);
}
@keyframes chCardBob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -4px; } }
.ch-hero-art { position: absolute; inset: 3px; z-index: 1; border-radius: 11px; overflow: hidden; background: radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--rar) 40%, #2a3a9a), #0c1442 80%); }
.ch-hero-art img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s; }
.ch-hero-art::after { content: ''; position: absolute; inset: 55% 0 0; background: linear-gradient(180deg, transparent, rgba(6, 8, 34, .92)); }
.ch-hero-cost {
  position: absolute; left: 6px; top: 6px; z-index: 3; width: 26px; height: 30px; display: grid; place-items: center; padding-top: 2px;
  font: 400 15px var(--display); color: #fff; text-shadow: 0 1px 0 #2a0a6a, 0 0 4px rgba(0, 0, 0, .6);
  clip-path: polygon(50% 0, 100% 30%, 100% 75%, 50% 100%, 0 75%, 0 30%);
  background: linear-gradient(160deg, #e2ccff 0%, #9a6bff 40%, #5a24d0 100%);
}
.ch-hero-name { position: absolute; left: 6px; right: 6px; bottom: 20px; z-index: 3; text-align: center; font: 400 13px var(--display); letter-spacing: .03em; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 2px 0 #000, 0 0 6px rgba(0, 0, 0, .8); }
.ch-hero-rar { position: absolute; left: 50%; bottom: 5px; translate: -50% 0; z-index: 3; padding: 1px 8px; border-radius: 999px; font: 800 9px var(--body); letter-spacing: .1em; text-transform: uppercase; color: #10082a; background: var(--rar); box-shadow: 0 0 8px color-mix(in srgb, var(--rar) 70%, transparent); white-space: nowrap; }
.ch-hero-sp { position: absolute; right: 6px; top: 6px; z-index: 3; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; color: #3a1a00; background: radial-gradient(circle at 35% 30%, #fff6c8, var(--ch-gold) 60%, var(--ch-gold-2)); box-shadow: 0 0 8px rgba(255, 213, 77, .9); }
.ch-hero:hover { transform: translateY(-6px) scale(1.04); z-index: 2; box-shadow: 0 0 0 2px var(--glow), 0 0 22px color-mix(in srgb, var(--rar) 80%, transparent), 0 12px 22px rgba(0, 0, 0, .5); }
.ch-hero:hover .ch-hero-art img { transform: scale(1.08); }
.ch-hero:active { transform: translateY(-2px) scale(.98); }
/* raridade: rara brilha laranja, épica pulsa roxo, lendária tem borda de luz girando */
.ch-hero.rar-rara { box-shadow: 0 0 0 1px rgba(6, 10, 40, .9), 0 0 14px rgba(255, 157, 59, .45), 0 6px 14px rgba(0, 0, 0, .45); }
.ch-hero.rar-epica { animation: chCardBob 4s ease-in-out infinite var(--d, 0s), chEpic 2.4s ease-in-out infinite var(--d, 0s); }
@keyframes chEpic { 50% { box-shadow: 0 0 0 1px rgba(6, 10, 40, .9), 0 0 22px rgba(192, 107, 255, .75), 0 6px 14px rgba(0, 0, 0, .45); } }
.ch-hero.rar-epica .ch-hero-art::before, .ch-hero.rar-lendaria .ch-hero-art::before { content: ''; position: absolute; inset: 0; z-index: 2; background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, .45) 50%, transparent 65%); transform: translateX(-130%); animation: chSweep 3.6s ease-in-out infinite; animation-delay: var(--d, 0s); pointer-events: none; }
.ch-hero.rar-lendaria { box-shadow: 0 0 0 1px rgba(6, 10, 40, .9), 0 0 22px rgba(255, 213, 77, .65), 0 6px 14px rgba(0, 0, 0, .45); }
.ch-hero.rar-lendaria::before { content: ''; position: absolute; inset: -50%; z-index: 0; background: conic-gradient(from 0deg, transparent 0 60%, #fff6c0 75%, #ffd54d 82%, transparent 92%); animation: chRot 3s linear infinite; }
@keyframes chRot { to { transform: rotate(1turn); } }

.ch-special { display: flex; flex-direction: column; }
.ch-spot { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; min-height: 0; }
.ch-spot-art { position: relative; width: 104px; aspect-ratio: 4 / 5; border-radius: 16px; display: grid; place-items: end center; overflow: hidden;
  background: radial-gradient(circle at 50% 70%, color-mix(in srgb, var(--rar) 70%, transparent), transparent 70%), linear-gradient(180deg, #2a3a9a, #120c50);
  box-shadow: 0 0 0 1px var(--rar), 0 0 22px color-mix(in srgb, var(--rar) 55%, transparent); }
.ch-spot-art::before { content: ''; position: absolute; left: 50%; bottom: 6%; width: 80%; height: 18%; translate: -50% 0; border-radius: 50%; background: radial-gradient(closest-side, var(--glow), transparent); opacity: .8; animation: chGemGlow 2.6s ease-in-out infinite; }
.ch-spot-art img { position: relative; width: 100%; height: 100%; object-fit: contain; animation: chFloat 4s ease-in-out infinite; }
.ch-spot-info { display: grid; gap: 3px; min-width: 0; align-content: center; }
.ch-rar-tag { justify-self: start; padding: 1px 9px; border-radius: 999px; font: 800 9px var(--body); letter-spacing: .1em; text-transform: uppercase; color: #10082a; background: var(--rar); }
.ch-spot-info > b { font: 400 18px var(--display); letter-spacing: .03em; line-height: 1.1; }
.ch-spot-info > small { font: 700 12px var(--body); color: var(--ch-muted); }
.ch-spot-sp { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; font: 400 14px var(--display); letter-spacing: .03em; color: var(--ch-gold); text-shadow: 0 0 10px rgba(255, 213, 77, .5); }
.ch-spot-sp i { font-style: normal; animation: chGemGlow 2.6s ease-in-out infinite; }
.ch-spot-info p { margin: 0; font: 700 12.5px/1.45 var(--body); color: #d6ddff; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
#lobby .ch-tip { margin: 0; font: 700 12.5px/1.5 var(--body); color: var(--ch-muted); padding: 0 4px; }

/* ═════════ RODAPÉ: barra de navegação ═════════ */
:is(#lobby, #builder) #tabbar.ch-nav {
  flex: none; display: grid; grid-template-columns: repeat(5, 1fr); align-items: end; gap: 4px;
  margin: 0 calc(-1 * max(14px, env(safe-area-inset-left, 0px))); padding: 8px max(10px, env(safe-area-inset-left, 0px)) calc(8px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, rgba(24, 40, 140, .92), rgba(8, 10, 44, .97)); border: 0; border-top: 1px solid rgba(150, 180, 255, .3);
  box-shadow: 0 -10px 30px rgba(2, 4, 22, .5); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
:is(#lobby, #builder) #tabbar.ch-nav::before { content: ''; position: absolute; left: 10%; right: 10%; top: -1px; height: 2px; background: linear-gradient(90deg, transparent, rgba(255, 213, 77, .8), transparent); }
:is(#lobby, #builder) #tabbar .ch-nav-hidden { display: none !important; }
:is(#lobby, #builder) #tabbar button {
  display: grid; justify-items: center; gap: 3px; padding: 7px 0 6px; border-radius: 14px; border: 0; cursor: pointer; background: none;
  color: var(--ch-muted); font: 400 12px var(--display); letter-spacing: .06em; text-transform: uppercase; text-shadow: 0 2px 0 rgba(0, 0, 0, .5);
  transform: none; animation: none; box-shadow: none; transition: color .2s, background .2s, transform .2s;
}
:is(#lobby, #builder) #tabbar button .ti { width: 26px; height: 26px; background: currentColor; filter: none; transition: transform .25s cubic-bezier(.2, 1.6, .4, 1); }
:is(#lobby, #builder) #tabbar button:hover { color: #fff; }
:is(#lobby, #builder) #tabbar button:hover .ti { transform: translateY(-3px) scale(1.1); }
:is(#lobby, #builder) #tabbar button.on { color: #fff; background: linear-gradient(180deg, rgba(90, 130, 255, .45), rgba(42, 92, 255, .12)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 0 0 1px rgba(150, 180, 255, .35); }
:is(#lobby, #builder) #tabbar button.on .ti { background: var(--ch-gold); filter: drop-shadow(0 0 6px rgba(255, 213, 77, .9)); }
/* botão central de Batalha: um cristal dourado elevado */
:is(#lobby, #builder) #tabbar .ch-nav-main { position: relative; }
:is(#lobby, #builder) #tabbar .ch-nav-main .ti { width: 50px; height: 50px; margin-top: -26px; border-radius: 50%; -webkit-mask: none; mask: none; background: linear-gradient(180deg, #fff3a0, var(--ch-gold) 45%, var(--ch-gold-2)); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .8), 0 0 0 3px #0c1442, 0 0 0 5px rgba(255, 213, 77, .6), 0 6px 16px rgba(255, 170, 30, .45); position: relative; }
:is(#lobby, #builder) #tabbar .ch-nav-main .ti::after { content: ''; position: absolute; inset: 11px; background: #6a3000; -webkit-mask: var(--m) center / contain no-repeat; mask: var(--m) center / contain no-repeat; }
:is(#lobby, #builder) #tabbar .ch-nav-main.on { background: none; box-shadow: none; color: var(--ch-gold); }
:is(#lobby, #builder) #tabbar .ch-nav-main.on .ti { filter: none; animation: chBattlePulseSm 2.4s ease-in-out infinite; }
:is(#lobby, #builder) #tabbar .ch-nav-main:not(.on) .ti { background: linear-gradient(180deg, #8fb0ff, #4a6cd8); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .6), 0 0 0 3px #0c1442, 0 0 0 5px rgba(150, 180, 255, .4); }
@keyframes chBattlePulseSm { 50% { box-shadow: inset 0 2px 0 rgba(255, 255, 255, .8), 0 0 0 3px #0c1442, 0 0 0 7px rgba(255, 213, 77, .35), 0 6px 22px rgba(255, 190, 40, .8); } }

/* ═════════ outras abas (Loja, Passe, Ranking, Conta) com o mesmo acabamento ═════════ */
#lobby .deck-head { margin-bottom: 10px; }
#lobby .tab-body:not(#tab-battle):not(#tab-deck) { gap: 12px; }
#lobby .tip { color: var(--ch-muted); }

/* ═════════ CONFIGURAÇÕES ═════════ */
.ch-settings { text-align: left !important; background: linear-gradient(170deg, #2a4ac8, #1a1a6a 55%, #3a1690) !important; border: 1px solid rgba(255, 213, 77, .5) !important; box-shadow: 0 0 0 4px rgba(12, 20, 70, .8), 0 30px 80px rgba(0, 0, 0, .6) !important; }
.ch-settings h2 { font-size: 24px; margin-bottom: 14px; text-align: center; }
.ch-set-list { display: grid; gap: 8px; margin-bottom: 14px; }
.ch-toggle { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 12px 14px; border-radius: 14px; cursor: pointer; color: #fff; font: 400 15px var(--display); letter-spacing: .04em; background: rgba(6, 10, 40, .5); border: 1px solid rgba(150, 180, 255, .25); transition: border-color .2s; }
.ch-toggle:hover { border-color: rgba(255, 213, 77, .6); }
.ch-toggle i { position: relative; width: 48px; height: 26px; border-radius: 999px; background: rgba(255, 255, 255, .18); transition: background .25s; flex: none; }
.ch-toggle i::after { content: ''; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, .4); transition: translate .25s cubic-bezier(.2, 1.4, .4, 1); }
.ch-toggle[aria-pressed="true"] i { background: linear-gradient(90deg, #4be3a0, #2ab47a); }
.ch-toggle[aria-pressed="true"] i::after { translate: 22px 0; }
.ch-howto { padding: 12px 14px; margin-bottom: 14px; border-radius: 14px; background: rgba(6, 10, 40, .4); border: 1px solid rgba(150, 180, 255, .18); }
.ch-howto h3 { font-size: 15px; margin-bottom: 8px; color: var(--ch-gold); }
.ch-howto .howto { margin: 0; padding-left: 20px; display: grid; gap: 4px; font-size: 14px; font-weight: 700; color: #d6ddff; }
.ch-howto .howto b { color: #fff; font-family: var(--display); font-weight: 400; }
.ch-settings .stack a.btn { text-decoration: none; }

/* ═════════ CELULAR ═════════ */
@media (max-width: 999px) {
  #lobby .ch-right { gap: 12px; }
  #lobby .ch-right .ch-deck { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .ch-logo { display: none; }
  .ch-top { gap: 8px; padding: 7px 8px; border-radius: 18px; }
  .ch-home, .ch-gear { width: 38px; height: 38px; border-radius: 12px; }
  .ch-pass-btn { height: 38px; padding: 0 10px 0 8px; }
  .ch-pass-btn span { display: none; }
  .ch-avatar { width: 40px; height: 40px; font-size: 18px; }
  .ch-money { height: 32px; padding: 0 10px 0 4px; }
  .ch-money b { font-size: 14px; }
  .ch-money .ico-trophy, .ch-money .ico-gold { width: 22px; height: 22px; }
  .ch-battle { min-height: 72px; gap: 10px; padding: 8px 14px; }
  .ch-battle-ico { width: 44px; height: 44px; } .ch-battle-ico svg { width: 24px; height: 24px; }
  .ch-act { gap: 8px; padding: 8px 10px; min-height: 56px; }
  .ch-act-ico { width: 34px; height: 34px; } .ch-act-ico svg { width: 20px; height: 20px; }
  .ch-act-txt b { font-size: 14px; }
  .ch-act-txt small { font-size: 10px; }
  #lobby .ch-arena-label { left: 14px; top: 12px; right: 110px; }
  #lobby .ch-online { right: 10px; top: 12px; font-size: 10px; padding: 3px 8px; }
  :is(#lobby, #builder) #tabbar button { font-size: 10px; }
  :is(#lobby, #builder) #tabbar .ch-nav-main .ti { width: 44px; height: 44px; margin-top: -22px; }
  .ch-deck { gap: 8px; }
}
@media (max-width: 360px) { .ch-cur { gap: 5px; } .ch-money { padding-right: 8px; } .ch-money .ico-shard { width: 16px; height: 22px; } }

/* ═════════ PC: três colunas, tudo cabe na tela sem rolagem ═════════ */
@media (min-width: 1000px) {
  #app:has(#lobby:not([hidden])) { max-width: 100%; }
  body #lobby.ch-lobby:not([hidden]) {
    display: grid !important;
    grid-template-columns: clamp(250px, 20vw, 330px) minmax(0, 1fr) clamp(300px, 24vw, 400px) !important;
    grid-template-rows: auto minmax(0, 1fr) auto; column-gap: 16px; row-gap: 14px;
    padding: 14px max(20px, env(safe-area-inset-right, 0px)) 0 max(20px, env(safe-area-inset-left, 0px));
  }
  #lobby .ch-top { grid-column: 1 / -1; grid-row: 1; flex-wrap: nowrap; gap: 18px; padding: 8px 12px; }
  .ch-brand { min-width: clamp(220px, calc(20vw - 20px), 310px); }
  .ch-player { flex: 1 1 auto; max-width: 420px; }
  .ch-cur { flex: 0 1 auto; order: 0; justify-content: flex-end; margin-left: auto; }
  .ch-money { flex: none; min-width: 112px; }
  .ch-logo-txt b { font-size: 19px; } .ch-logo-txt b + b { font-size: 23px; }

  #lobby .ch-left { display: flex; flex-direction: column; gap: 14px; grid-column: 1; grid-row: 2; min-height: 0; animation: chSideIn .5s ease both; }
  #lobby .ch-arenas-panel { flex: 1; min-height: 0; display: flex; flex-direction: column; }
  #lobby .ch-arenas { flex: 1; min-height: 0; overflow: auto; scrollbar-width: none; align-content: start; padding: 2px; margin: -2px; }
  #lobby .ch-arenas::-webkit-scrollbar { display: none; }

  #lobby > .tab-body { grid-column: 2 !important; grid-row: 2 !important; min-height: 0; }
  #lobby #tab-battle { display: flex; flex-direction: column; overflow: hidden; padding: 0 2px 10px; margin: 0 -2px; }
  #lobby #tab-battle > .ch-stage { flex: 1 1 auto; min-height: 220px; aspect-ratio: auto; }
  #lobby .ch-road, #lobby .ch-picker { display: none; }
  .ch-actions { grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr) minmax(0, 1fr); grid-template-areas: "train battle friend"; align-items: center; gap: 14px; }
  .ch-battle { min-height: 92px; }
  .ch-act { min-height: 66px; }

  #lobby #tab-deck, #lobby #tab-deck[hidden] { display: flex !important; flex-direction: column; gap: 14px; grid-column: 3 !important; grid-row: 2 !important; min-height: 0; overflow: hidden; animation: chSideIn .5s ease both .08s; }
  #lobby .ch-team { flex: none; }
  #lobby .ch-special { flex: 1 1 auto; min-height: 0; overflow: hidden; }
  #lobby .ch-spot { flex: 1; display: flex; flex-direction: column; align-items: stretch; gap: 10px; }
  #lobby .ch-spot-art { width: 100%; flex: 1 1 auto; min-height: 90px; aspect-ratio: auto; }
  #lobby .ch-spot-art img { position: absolute; inset: 6px 0 0; margin: auto; height: calc(100% - 6px); width: auto; max-width: 100%; }
  #lobby .ch-spot-info { flex: none; }
  #lobby .ch-tip { display: none; }
  @keyframes chSideIn { from { opacity: 0; transform: translateY(14px); } }

  :is(#lobby, #builder) #tabbar.ch-nav { grid-column: 1 / -1; grid-row: 3; justify-self: center; width: min(760px, 100%); margin: 0; padding: 8px 18px 10px; border: 1px solid rgba(150, 180, 255, .3); border-bottom: 0; border-radius: 22px 22px 0 0; }
  :is(#lobby, #builder) #tabbar [data-tab="deck"] { display: grid; }
  :is(#lobby, #builder) #tabbar button { font-size: 13px; }
}
/* PC com tela baixa (notebook): tudo um pouco mais compacto */
@media (min-width: 1000px) and (max-height: 820px) {
  body #lobby.ch-lobby { row-gap: 10px; padding-top: 10px; }
  .ch-panel { padding: 11px; }
  .ch-ph { margin-bottom: 8px; }
  .ch-stat { padding: 6px 8px; }
  .ch-stat b { font-size: 16px; }
  .ch-next { margin-top: 8px; padding: 8px; }
  .ch-arena { padding: 3px 8px 3px 4px; }
  .ch-arena .ar { width: 28px; height: 28px; }
  .ch-arena .ar em { font-size: 13px; }
  .ch-arena-name small { display: none; }
  .ch-battle { min-height: 76px; }
  .ch-act { min-height: 58px; }
  .ch-deck { gap: 8px; }
  .ch-hero { aspect-ratio: 4 / 4.6; }
  .ch-spot-info p { -webkit-line-clamp: 3; }
  .ch-foot { display: none; }
}
@media (min-width: 1000px) and (max-height: 820px) {
  .ch-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
  .ch-stat { grid-template-columns: 1fr; grid-template-rows: auto; justify-items: center; text-align: center; padding: 6px 2px; row-gap: 1px; }
  .ch-stat > i { grid-row: auto; width: 20px; height: 20px; }
  .ch-stat span { font-size: 8px; letter-spacing: .04em; }
  .ch-stat b { font-size: 15px; }
  .ch-arenas { gap: 4px; }
}
@media (min-width: 1000px) and (max-height: 700px) {
  .ch-hero { aspect-ratio: 4 / 4; }
  .ch-hero-rar { display: none; }
  .ch-hero-name { bottom: 6px; }
}
/* PC médio: colunas laterais mais estreitas */
@media (min-width: 1000px) and (max-width: 1279px) {
  .ch-brand { min-width: 0; }
  .ch-logo-txt b { font-size: 16px; } .ch-logo-txt b + b { font-size: 19px; }
  .ch-money { min-width: 0; }
  .ch-pass-btn span { display: none; }
  .ch-pass-btn { padding: 0 10px; }
  .ch-act-txt small { display: none; }
  .ch-act-txt b { font-size: 15px; }
  .ch-act-ico { width: 34px; height: 34px; }
}

/* quem prefere menos movimento: sem animações contínuas */
@media (prefers-reduced-motion: reduce) {
  .ch-aurora i, .ch-logo-gem, .ch-money .ico-shard, .ch-xp-fill::after, .ch-stage-fx .cg, .ch-battle, .ch-battle::after, .ch-battle-ico svg, .ch-act::after,
  .ch-bar-fill::after, .ch-hero, .ch-hero-art::before, .ch-hero::before, .ch-spot-art::before, .ch-spot-art img, .ch-spot-sp i, :is(#lobby, #builder) #tabbar .ch-nav-main .ti, #lobby .tab-body, #lobby .ch-left, #lobby #tab-deck { animation: none !important; }
}

/* o tamanho dos botões acompanha o espaço que sobra no centro (não a tela toda) */
.ch-actions { container-type: inline-size; container-name: chact; }
@container chact (min-width: 640px) and (max-width: 820px) {
  .ch-battle { padding: 8px 12px; gap: 10px; }
  .ch-battle-ico { width: 40px; height: 40px; }
  .ch-battle-ico svg { width: 22px; height: 22px; }
  .ch-battle-txt b { font-size: 30px; }
  .ch-battle-txt small { font-size: 9px; letter-spacing: .03em; }
  .ch-act { padding: 8px 9px; gap: 7px; }
  .ch-act-txt b { font-size: 15px; }
}
@container chact (min-width: 640px) and (max-width: 700px) {
  .ch-battle-ico { display: none; }
  .ch-battle-txt { text-align: center; }
}
.ch-team { container-type: inline-size; container-name: chteam; }
@container chteam (max-width: 340px) {
  .ch-team .ch-ph-note { display: none; }
  .ch-team .ch-ph h2 { font-size: 15px; }
}

/* celular: selo "online" vai para baixo, nome da arena com mais espaço */
@media (max-width: 999px) {
  #lobby .ch-arena-label { right: 14px; }
  #lobby .arena-num { white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; font-size: 10px; letter-spacing: .1em; }
  #lobby .ch-online { top: auto; bottom: 12px; right: 12px; }
  #lobby .ch-feat { left: 14px; translate: 0 0; max-width: calc(100% - 150px); font-size: 13px; }
  #lobby .ch-road .road-num { text-shadow: 0 1px 2px #000, 0 0 3px #000; }
  #lobby .ch-picker .ap { background: rgba(6, 10, 40, .45); border: 1px solid rgba(150, 180, 255, .16); border-radius: 13px; }
  #lobby .ch-picker .ap.on { background: linear-gradient(90deg, rgba(255, 213, 77, .26), rgba(122, 60, 240, .22)); border-color: rgba(255, 213, 77, .85); }
  #lobby .ch-picker .ap .ar { border: 0; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 0 0 2px rgba(6, 10, 40, .8); }
}

/* celular deitado: palco mais baixo para os botões aparecerem sem rolar */
@media (max-width: 999px) and (max-height: 520px) and (orientation: landscape) {
  #app:has(#lobby:not([hidden])) { max-width: 760px; }
  #lobby .ch-stage { aspect-ratio: auto; height: 38vh; min-height: 130px; }
  .ch-actions { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) minmax(0, 1fr); grid-template-areas: "train battle friend"; }
  .ch-battle { min-height: 64px; }
  .ch-battle-ico { display: none; }
  .ch-battle-txt b { font-size: 26px; }
  .ch-act-txt small { display: none; }
  .ch-act { min-height: 56px; }
  .ch-cur { flex: 0 1 auto; order: 0; }
  .ch-top { flex-wrap: nowrap; }
  .ch-logo { display: none; }
}
.ch-ph h2 { white-space: nowrap; }
.ch-ph-note { overflow: hidden; text-overflow: ellipsis; }
.ch-next-top span { white-space: nowrap; }

/* ═════════ janela "Jogar com amigo": tudo cabe na largura, sem barra de arrastar ═════════ */
.modal { overflow-x: hidden; }
.friend-modal { grid-template-columns: minmax(0, 1fr); width: min(400px, 100%); }
.friend-modal > *, .friend-modal .stack > *, .friend-modal .f-join > * { min-width: 0; max-width: 100%; }
.friend-modal .muted { overflow-wrap: anywhere; line-height: 1.35; }
.friend-modal .stack { margin-top: 4px; }
.friend-modal .btn { width: 100%; white-space: normal; }
.friend-modal .f-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.friend-modal .f-row .btn { width: auto; padding-left: 18px; padding-right: 18px; }
.friend-modal .f-row input { width: 100%; letter-spacing: .25em; padding-left: .25em; }
.friend-modal .f-code { font-size: clamp(38px, 12vw, 54px); letter-spacing: .18em; padding: 6px 10px 6px calc(10px + .18em); overflow-wrap: anywhere; }
@media (max-width: 380px) { .friend-modal { padding: 18px 16px; } .friend-modal h2 { font-size: 22px; } }

/* ═══════════════════════════════════════════════════════════════════════════
   TELA DA COLEÇÃO (trocar heróis): cenário de fundo, painéis de vidro e vitrine do herói
   ═══════════════════════════════════════════════════════════════════════════ */
body:has(#builder:not([hidden])) {
  background:
    radial-gradient(70% 55% at 50% 0%, rgba(58, 110, 255, .5), transparent 70%),
    radial-gradient(45% 40% at 0% 100%, rgba(122, 60, 240, .4), transparent 70%),
    linear-gradient(180deg, #0d1a5c 0%, #0a0f38 55%, var(--ch-navy) 100%) fixed;
}
#builder.ch-builder { position: relative; color: var(--ch-text); }
#builder.ch-builder > *:not(.ch-bscene) { position: relative; z-index: 1; }
/* cenário fixo atrás de tudo */
.ch-bscene { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.ch-bscene .ch-aurora { position: absolute; }
.bs-land { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 46vh; opacity: .95; }
.bs-isle { animation: bsFloat 7s ease-in-out infinite; transform-box: fill-box; }
.bs-isle2 { animation: bsFloat 5.5s ease-in-out infinite -2s; transform-box: fill-box; }
@keyframes bsFloat { 50% { transform: translateY(-12px); } }
.bs-win { animation: bsWin 3.2s ease-in-out infinite; }
@keyframes bsWin { 50% { opacity: .55; } }
.bs-gems, .bs-land g[fill^="url(#bsCr)"] { filter: drop-shadow(0 0 6px rgba(150, 190, 255, .9)); animation: chGemGlow 2.8s ease-in-out infinite; }
.bs-rays { position: absolute; inset: 0; }
.bs-rays i { position: absolute; top: -20%; width: 18vw; height: 120%; background: linear-gradient(180deg, rgba(160, 200, 255, .16), transparent 70%); transform-origin: top center; filter: blur(8px); animation: bsRay 9s ease-in-out infinite; }
.bs-rays i:nth-child(1) { left: 12%; transform: rotate(18deg); }
.bs-rays i:nth-child(2) { left: 46%; transform: rotate(-6deg); animation-delay: -3s; width: 12vw; }
.bs-rays i:nth-child(3) { left: 74%; transform: rotate(-20deg); animation-delay: -6s; }
@keyframes bsRay { 50% { opacity: .35; } }
.bs-motes i { position: absolute; bottom: -12px; width: 6px; height: 6px; border-radius: 50%; background: #dfe9ff; box-shadow: 0 0 10px 3px rgba(140, 180, 255, .8); opacity: 0; animation: bsMote 9s linear infinite; }
.bs-motes i:nth-child(3n) { background: #fff3b0; box-shadow: 0 0 10px 3px rgba(255, 213, 77, .8); }
.bs-motes i:nth-child(4n) { width: 8px; height: 11px; border-radius: 2px; clip-path: polygon(50% 0, 100% 40%, 50% 100%, 0 40%); background: #c9a8ff; box-shadow: none; }
.bs-motes i:nth-child(1) { left: 4%; } .bs-motes i:nth-child(2) { left: 11%; animation-delay: -2s; } .bs-motes i:nth-child(3) { left: 19%; animation-delay: -5s; }
.bs-motes i:nth-child(4) { left: 26%; animation-delay: -1s; } .bs-motes i:nth-child(5) { left: 34%; animation-delay: -6s; } .bs-motes i:nth-child(6) { left: 42%; animation-delay: -3.5s; }
.bs-motes i:nth-child(7) { left: 51%; animation-delay: -7s; } .bs-motes i:nth-child(8) { left: 58%; animation-delay: -4.5s; } .bs-motes i:nth-child(9) { left: 66%; animation-delay: -0.5s; }
.bs-motes i:nth-child(10) { left: 73%; animation-delay: -8s; } .bs-motes i:nth-child(11) { left: 81%; animation-delay: -2.5s; } .bs-motes i:nth-child(12) { left: 88%; animation-delay: -6.5s; }
.bs-motes i:nth-child(13) { left: 94%; animation-delay: -4s; } .bs-motes i:nth-child(14) { left: 98%; animation-delay: -1.5s; }
@keyframes bsMote { 0% { transform: translateY(0) translateX(0); opacity: 0; } 10% { opacity: .9; } 100% { transform: translateY(-105vh) translateX(30px) rotate(200deg); opacity: 0; } }

/* topo */
#builder .topbar { padding: 8px 10px; border-radius: 18px; background: linear-gradient(180deg, rgba(36, 66, 190, .55), rgba(16, 20, 74, .8)); border: 1px solid var(--ch-line); box-shadow: var(--ch-shadow); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
#builder #btnBack { border-radius: 12px; }
#builder .bhint { color: #dfe6ff; font: 700 13px var(--body); }
#builder .bhint::before { content: '✦ '; color: var(--ch-gold); }
/* painéis de vidro */
#builder .deck-panel, #builder .collection, #builder .ch-binfo {
  border-radius: var(--ch-r); background: var(--ch-panel); border: 1px solid var(--ch-line); box-shadow: var(--ch-shadow);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
#builder .deck-panel, #builder .collection { padding: 14px; }
#builder .deck-head h2 { font: 400 17px var(--display); letter-spacing: .04em; text-transform: uppercase; text-shadow: 0 2px 0 rgba(6, 10, 40, .8); }
#builder .deck-head h2::before { content: ''; display: inline-block; width: 9px; height: 13px; margin-right: 8px; clip-path: polygon(50% 0, 100% 40%, 50% 100%, 0 40%); background: linear-gradient(180deg, #fff3b0, var(--ch-gold) 50%, var(--ch-gold-2)); filter: drop-shadow(0 0 4px rgba(255, 213, 77, .8)); }
#builder .coll-grid { scrollbar-width: thin; scrollbar-color: rgba(150, 180, 255, .4) transparent; }
#builder .coll-grid .slot .card, #builder .deck-grid .slot .card { transition: transform .2s cubic-bezier(.2, 1.4, .4, 1), box-shadow .2s, filter .2s; }
#builder .coll-grid .slot:hover .card, #builder .deck-grid .slot:hover .card { transform: translateY(-5px) scale(1.04); box-shadow: 0 0 0 2px var(--rar, #fff), 0 0 18px var(--rar, #fff); }
#builder .deck-grid .slot.sel .card { box-shadow: 0 0 0 3px var(--ch-gold), 0 0 22px rgba(255, 213, 77, .8); animation: chCardBob 1.6s ease-in-out infinite; }

/* vitrine do herói (antes era uma caixinha de texto vazia) */
#builder .ch-binfo { display: grid; grid-template-columns: auto 1fr; gap: 14px; padding: 14px; min-height: 0; color: var(--ch-text); font-size: 13px; animation: chTabIn .3s ease both; }
.bi-art { position: relative; width: 132px; align-self: stretch; min-height: 168px; border-radius: 16px; display: grid; place-items: end center; overflow: hidden;
  background: radial-gradient(circle at 50% 75%, color-mix(in srgb, var(--rar) 75%, transparent), transparent 70%), linear-gradient(180deg, #2a3a9a, #120c50);
  box-shadow: 0 0 0 1px var(--rar), 0 0 24px color-mix(in srgb, var(--rar) 55%, transparent); }
.bi-art::before { content: ''; position: absolute; left: 50%; bottom: 5%; width: 82%; height: 16%; translate: -50% 0; border-radius: 50%; background: radial-gradient(closest-side, var(--glow), transparent); animation: chGemGlow 2.6s ease-in-out infinite; }
.bi-art::after { content: ''; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 40%, rgba(255, 255, 255, .25) 50%, transparent 60%); transform: translateX(-120%); animation: chSweep 4.5s ease-in-out infinite; }
.bi-art img { position: absolute; left: 6px; right: 6px; top: 8px; bottom: 4px; width: calc(100% - 12px); height: calc(100% - 12px); object-fit: contain; object-position: center bottom; animation: chFloat 4s ease-in-out infinite; }
.bi-cost { position: absolute; left: 8px; top: 8px; width: 28px; height: 32px; display: grid; place-items: center; font: 400 16px var(--display); color: #fff; clip-path: polygon(50% 0, 100% 30%, 100% 75%, 50% 100%, 0 75%, 0 30%); background: linear-gradient(160deg, #e2ccff, #9a6bff 40%, #5a24d0); z-index: 1; }
.bi-body { display: grid; align-content: start; gap: 4px; min-width: 0; }
.bi-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.bi-rar { padding: 1px 9px; border-radius: 999px; font: 800 10px var(--body); letter-spacing: .1em; text-transform: uppercase; color: #10082a; background: var(--rar); }
.bi-type { font: 800 11px var(--body); color: var(--ch-muted); }
.bi-lock { display: inline-flex; align-items: center; gap: 3px; font: 400 12px var(--display); color: #ffe58a; padding: 1px 8px 1px 2px; border-radius: 999px; background: rgba(6, 10, 40, .6); border: 1px solid rgba(255, 213, 77, .5); }
.bi-lock .ico-gold { width: 14px; height: 14px; margin: 0; }
.bi-name { font: 400 22px var(--display); letter-spacing: .03em; line-height: 1.05; color: #fff; text-shadow: 0 2px 0 rgba(6, 10, 40, .8); }
.bi-title { font: 700 12px var(--body); color: var(--ch-gold); }
.bi-desc { margin: 2px 0 4px; font: 700 12.5px/1.45 var(--body); color: #d6ddff; }
.bi-stats { display: grid; gap: 5px; }
.bi-stat { display: grid; grid-template-columns: 74px 1fr 42px; align-items: center; gap: 8px; }
.bi-stat span { font: 800 10px var(--body); letter-spacing: .08em; text-transform: uppercase; color: var(--ch-muted); }
.bi-stat b { font: 400 13px var(--display); text-align: right; color: #fff; }
.bi-bar { height: 9px; border-radius: 999px; background: rgba(4, 6, 30, .8); border: 1px solid rgba(150, 180, 255, .2); overflow: hidden; }
.bi-bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #4a7cff, #9a6bff 60%, var(--ch-gold)); box-shadow: 0 0 10px rgba(140, 120, 255, .7); animation: biGrow .6s ease both; transform-origin: left; }
@keyframes biGrow { from { transform: scaleX(0); } }
.bi-sp { margin-top: 6px; padding: 8px 10px; border-radius: 12px; background: linear-gradient(90deg, rgba(255, 213, 77, .18), rgba(122, 60, 240, .18)); border: 1px solid rgba(255, 213, 77, .45); }
.bi-sp span { font: 400 13px var(--display); letter-spacing: .03em; color: var(--ch-gold); }
.bi-sp p { margin: 2px 0 0; font: 700 12px/1.4 var(--body); color: #e6eaff; }

/* PC: coleção ocupa a tela toda; a vitrine fica embaixo dos 6 heróis, sem espaço vazio */
@media (min-width: 1000px) {
  #app:has(#builder:not([hidden])) { max-width: 1500px; }
  body #builder.ch-builder:not([hidden]) { display: grid !important; grid-template-columns: clamp(340px, 28vw, 420px) minmax(0, 1fr) !important; grid-template-rows: auto auto minmax(0, 1fr) !important; column-gap: 18px; row-gap: 14px; padding: 14px 20px 18px; }
  #builder .topbar { grid-column: 1 / -1; grid-row: 1; }
  #builder > .deck-panel { grid-column: 1; grid-row: 2; align-self: start; }
  #builder .collection { grid-column: 2; grid-row: 2 / 4; min-height: 0; }
  #builder .ch-binfo { grid-column: 1; grid-row: 3; align-self: stretch; margin-top: 0 !important; grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; overflow: hidden; }
  #builder .ch-binfo .bi-art { width: 100%; min-height: 140px; }
  #builder .coll-grid { grid-template-columns: repeat(auto-fill, minmax(98px, 1fr)); }
}
@media (min-width: 1000px) and (max-height: 820px) {
  #builder .ch-binfo { grid-template-columns: 110px 1fr; grid-template-rows: 1fr; align-items: stretch; }
  #builder .ch-binfo .bi-art { width: 110px; min-height: 0; height: 100%; }
  #builder .ch-binfo .bi-desc, #builder .ch-binfo .bi-title { display: none; }
  #builder .ch-binfo .bi-name { font-size: 19px; }
  #builder .ch-binfo .bi-stat { grid-template-columns: 62px 1fr 36px; }
  #builder .ch-binfo .bi-sp p { font-size: 11px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
}
/* celular: vitrine compacta em uma linha */
@media (max-width: 999px) {
  #builder .ch-binfo { flex: none; grid-template-columns: 74px 1fr; gap: 10px; padding: 8px 10px; max-height: 22vh; overflow: hidden; }
  .bi-art { width: 74px; min-height: 0; height: 100%; max-height: calc(22vh - 16px); }
  .bi-cost { width: 22px; height: 26px; font-size: 13px; left: 4px; top: 4px; }
  .bi-desc, .bi-title, .bi-sp p, .bi-type { display: none; }
  .bi-name { font-size: 17px; }
  .bi-stats { grid-template-columns: 1fr 1fr; column-gap: 10px; gap: 3px 10px; }
  .bi-stat { grid-template-columns: 52px 1fr; }
  .bi-stat b { display: none; }
  .bi-stat span { font-size: 8.5px; }
  .bi-sp { margin-top: 3px; padding: 3px 8px; }
  .bi-sp span { font-size: 11px; }
  #builder .collection { min-height: 0; }
  #builder .coll-grid { padding-bottom: 18px; }
  .bs-land { height: 34vh; opacity: .7; }
}
@media (prefers-reduced-motion: reduce) {
  .bs-isle, .bs-isle2, .bs-win, .bs-gems, .bs-rays i, .bs-motes i, .bi-art::before, .bi-art::after, .bi-art img, .bi-bar i { animation: none !important; }
}

/* ───── troca de cartas: clique, botão e voo ───── */
#builder .coll-grid .slot { transition: transform .2s; }
#builder .coll-grid .slot:active .card, #builder .deck-grid .slot:active .card { transform: scale(.94); }
#builder .coll-grid .slot.picked { z-index: 3; }
#builder .coll-grid .slot.picked .card { transform: translateY(-8px) scale(1.08); box-shadow: 0 0 0 3px var(--ch-gold), 0 0 24px rgba(255, 213, 77, .85); animation: cgPick .35s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes cgPick { from { transform: scale(.9); } }
.cg-act {
  position: absolute; left: 50%; bottom: -12px; translate: -50% 0; z-index: 4; display: inline-flex; align-items: center; gap: 3px; white-space: nowrap;
  padding: 5px 14px; border-radius: 12px; cursor: pointer; font: 400 13px var(--display); letter-spacing: .05em; text-transform: uppercase; color: #3a1a00;
  background: linear-gradient(180deg, #fff3a0, var(--ch-gold) 50%, var(--ch-gold-2)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8), 0 0 0 2px #7a3a00, 0 4px 0 #6a3000, 0 0 16px rgba(255, 190, 40, .7);
  animation: cgBtnIn .3s cubic-bezier(.2, 1.8, .4, 1) both;
}
.cg-act:hover { filter: brightness(1.1); }
.cg-act.shop { color: #fff; background: linear-gradient(180deg, #9a6bff, #5a24d0); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 0 0 2px #2a0a6a, 0 4px 0 #22085a; }
.cg-act .ico-gold { width: 14px; height: 14px; margin: 0; }
@keyframes cgBtnIn { from { opacity: 0; transform: translateY(8px) scale(.6); } }
/* modo troca: o time balança e brilha esperando a escolha */
#builder .deck-grid.swapping .slot .card { animation: cgWiggle .5s ease-in-out infinite alternate; animation-delay: var(--d, 0s); box-shadow: 0 0 0 2px rgba(255, 213, 77, .9), 0 0 18px rgba(255, 213, 77, .55); cursor: pointer; }
#builder .deck-grid.swapping .slot:hover .card { transform: scale(1.08); animation-play-state: paused; }
@keyframes cgWiggle { from { rotate: -2.5deg; } to { rotate: 2.5deg; } }
#builder.swap-mode > .deck-panel { box-shadow: var(--ch-shadow), 0 0 0 2px rgba(255, 213, 77, .7), 0 0 30px rgba(255, 213, 77, .35); }
#builder.swap-mode .coll-grid .slot:not(.picked) .card { filter: brightness(.6) saturate(.7); }
#builder.swap-mode .bhint { color: var(--ch-gold); }
.ch-cancel { margin-left: auto; }
#builder .deck-grid .slot.leaving .card { opacity: 0; transform: scale(.7); transition: opacity .2s, transform .2s; }
#builder .deck-grid .slot.just-in .card { animation: cgPop .5s cubic-bezier(.2, 1.8, .4, 1); box-shadow: 0 0 0 3px var(--ch-gold), 0 0 26px rgba(255, 213, 77, .9); }
@keyframes cgPop { 0% { transform: scale(.4); opacity: 0; } 60% { transform: scale(1.15); opacity: 1; } 100% { transform: scale(1); } }
/* a carta que voa */
.fly-card { position: fixed; z-index: 80; pointer-events: none; animation: cgFly .45s cubic-bezier(.45, 0, .2, 1) forwards; }
.fly-card .card { width: 100%; height: 100%; }
.fly-card.in { filter: drop-shadow(0 0 14px rgba(255, 213, 77, .9)); }
.fly-card.out { opacity: .85; }
@keyframes cgFly {
  0% { transform: translate(0, 0) scale(1) rotate(0); }
  50% { transform: translate(calc(var(--dx) * .5), calc(var(--dy) * .5 - 60px)) scale(calc((1 + var(--s)) * .6)) rotate(-8deg); }
  100% { transform: translate(var(--dx), var(--dy)) scale(var(--s)) rotate(0); }
}
@media (prefers-reduced-motion: reduce) { .cg-act, #builder .deck-grid.swapping .slot .card, #builder .deck-grid .slot.just-in .card, #builder .coll-grid .slot.picked .card { animation: none !important; } }
