/* Squad vs squad duel: opponent on top, you at the bottom, tactic cards. */
.arena-full.sq { flex-direction: column; justify-content: space-between; padding: max(.5rem, env(safe-area-inset-top)) .6rem calc(.6rem + env(safe-area-inset-bottom)); gap: .3rem; }
.sq-side { position: relative; z-index: 3; }
.sq-info { display: flex; align-items: center; gap: .6rem; color: #fff; text-shadow: 0 2px 0 #0a1236; flex-wrap: wrap; } .sq-info b { font-family: var(--serif); font-size: 1rem; }
.sq-info .sq-bar { flex: 1; min-width: 120px; } .sq-info small { font-weight: 800; font-size: .72rem; }
.sq-info.b { flex-direction: row-reverse; }
.sq-bar { position: relative; height: 16px; border: 3px solid #0a1236; border-radius: 12px; background: rgba(0,0,0,.55); overflow: hidden; box-shadow: 0 0 0 2px #ffd34d; }
.sq-bar i { position: absolute; left: 0; top: 0; bottom: 0; transition: width .5s cubic-bezier(.2,.8,.2,1); } .sq-bar .fill { background: linear-gradient(#35e0ff, #2f6bff); z-index: 2; } .sq-bar .trail { background: #ffd34d; z-index: 1; transition-duration: 1s; }
.sq-bar.b .fill { background: linear-gradient(#ff7a55, #c8321b); }
.sq-army { display: flex; align-items: flex-end; gap: .6rem; margin-top: .3rem; }
.sq-side.b .sq-army { flex-direction: row-reverse; }
.sq-leader { width: min(34vw, 190px); flex: 0 0 auto; } .sq-leader svg { width: 100%; height: auto; display: block; filter: drop-shadow(0 8px 6px rgba(0,0,0,.5)); animation: idle 2.6s ease-in-out infinite; } .sq-leader.artimg { height: min(28vh, 260px); object-fit: contain; width: auto; filter: drop-shadow(0 8px 6px rgba(0,0,0,.5)); }
.sq-side.b .sq-leader svg { transform: scaleX(-1); animation: none; } .sq-info.b { padding-right: 48px; }
.sq-troops { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.sq-group { background: rgba(8,16,60,.55); border: 2px solid rgba(160,190,255,.45); border-radius: 10px; padding: .2rem .4rem; color: #fff; }
.sq-group small { font-weight: 800; font-size: .66rem; }
.sq-icons { display: flex; gap: 3px; flex-wrap: wrap; }
.sd { font-style: normal; width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; font-family: var(--serif); font-size: .8rem; font-weight: 800; color: #fff; border: 2px solid #0a1236; box-shadow: 0 2px 0 rgba(0,0,0,.45); transition: opacity .4s, transform .4s; }
.sd.dead { opacity: .12; transform: scale(.5) rotate(40deg); }
.sq-mid { position: relative; z-index: 4; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; min-height: 80px; color: #fff; text-shadow: 0 2px 0 #0a1236; }
.sq-round { font-family: var(--serif); font-weight: 800; font-size: .95rem; background: rgba(8,16,60,.7); border: 2px solid #ffd34d; border-radius: 99px; padding: .1rem .8rem; }
.sq-reveal { display: flex; align-items: center; gap: .8rem; margin: .5rem 0; }
.rv { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 74px; height: 74px; border-radius: 16px; font-family: var(--serif); font-size: 2.4rem; font-weight: 800; background: linear-gradient(var(--c), #0a1236); border: 4px solid #0a1236; box-shadow: 0 0 0 2px #ffd34d, 0 0 20px var(--c); position: relative; }
.rv small { position: absolute; bottom: -22px; font-family: var(--sans); font-size: .7rem; white-space: nowrap; } .sq-reveal .vs { font-family: var(--serif); font-size: 1.6rem; color: #ffd34d; }
.sq-edge { font-family: var(--serif); font-weight: 800; font-size: 1.5rem; min-height: 1.6em; margin-top: 1rem; } .sq-edge.a { color: #7dff9a; } .sq-edge.b { color: #ff8b7a; }
.sq-cards { position: relative; z-index: 4; display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; }
.sq-card { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 96px; padding: .3rem .2rem; cursor: pointer; color: #fff; font-weight: 800; border: 4px solid #0a1236; border-radius: 16px 22px 16px 20px; background: linear-gradient(var(--c), #0a1236 140%); box-shadow: 0 0 0 2px #ffd34d, 0 6px 0 rgba(0,0,0,.55); text-shadow: 0 2px 0 rgba(0,0,0,.5); transition: transform .1s; }
.sq-card .g { font-family: var(--serif); font-size: 2rem; line-height: 1; } .sq-card b { font-size: .8rem; text-transform: capitalize; } .sq-card small { font-size: .62rem; opacity: .9; text-transform: capitalize; }
.sq-card .bst { position: absolute; top: -9px; right: -4px; font-style: normal; font-size: .58rem; background: #ffd34d; color: #2a1200; border-radius: 8px; padding: 0 .35rem; border: 2px solid #0a1236; text-transform: capitalize; }
.sq-card:active:not(:disabled) { transform: translateY(5px); } .sq-card:disabled { filter: grayscale(.8) brightness(.7); cursor: default; }
.sq-x { top: auto; bottom: auto; right: 8px; position: absolute; display: block; }
@media (orientation: landscape) and (max-height: 520px) {
  .arena-full.sq { display: grid; grid-template-columns: 1fr 1.1fr; grid-template-rows: 1fr 1fr; grid-template-areas: "foe mid" "me cards"; align-items: stretch; }
  .sq-side.b { grid-area: foe; } .sq-side.a { grid-area: me; } .sq-mid { grid-area: mid; } .sq-cards { grid-area: cards; align-self: end; } .sq-card { min-height: 70px; } .sq-leader { width: 60px; } .sq-group small { display: none; }
}

/* squad duel tactic effects */
.vfx.arrow { width: 4px; height: 30px; border-radius: 2px; background: linear-gradient(#fff, #8a5a2a); box-shadow: 0 0 6px #ffe9a0; }
.vfx.arrow::before { content: ""; position: absolute; top: -6px; left: -3px; border: 5px solid transparent; border-bottom: 9px solid #e8edf3; border-top: 0; }
.vfx.shield { width: 220px; height: 220px; border-radius: 50%; border: 8px solid #7ad7ff; background: radial-gradient(circle, rgba(122,215,255,.35), rgba(122,215,255,0) 70%); box-shadow: 0 0 30px #7ad7ff; }
.vfx.clashflash { width: 120px; height: 120px; border-radius: 50%; background: radial-gradient(circle, #fff, rgba(255,211,77,.8) 40%, rgba(255,90,40,0) 70%); }

/* tactic inputs */
.ar-meter { position: absolute; right: 12%; top: 18%; width: 46px; height: 55vh; border: 4px solid #0a1236; border-radius: 24px; background: rgba(0,0,0,.6); overflow: hidden; box-shadow: 0 0 0 3px #ffd34d; }
.ar-meter .zone { position: absolute; left: 0; right: 0; bottom: 82%; height: 14%; background: rgba(80,255,120,.55); border-top: 2px solid #7dff9a; border-bottom: 2px solid #7dff9a; }
.ar-meter .fillm { position: absolute; left: 0; right: 0; bottom: 0; height: 0; background: linear-gradient(#ffd34d, #ff5a3c); }
.ar-catch.swipe { cursor: crosshair; } .ar-trail { position: fixed; height: 8px; border-radius: 6px; transform-origin: 0 50%; background: linear-gradient(90deg, rgba(255,255,255,0), #fff 60%, #c9a7ff); box-shadow: 0 0 14px #c9a7ff; pointer-events: none; }
.sq-hist { display: flex; align-items: center; gap: 4px; width: 100%; justify-content: flex-end; } .sq-hist small { font-size: .62rem; margin-right: 4px; opacity: .85; }
.hchip { font-style: normal; width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center; font-family: var(--serif); font-weight: 800; font-size: .85rem; color: #fff; background: var(--c); border: 2px solid #0a1236; }

.sq-power { display: flex; align-items: center; gap: .6rem; margin: .3rem 0; font-weight: 800; color: #fff; text-shadow: 0 2px 0 #0a1236; }
.sq-power .pa { color: #7ad7ff; } .sq-power .pb { color: #ff9a85; }
.sq-power .pl { padding: .05rem .6rem; border-radius: 99px; font-size: .72rem; border: 2px solid #0a1236; }
.sq-power .pl.fav { background: #35c46a; } .sq-power .pl.even { background: #e0a21f; color: #2a1200; text-shadow: none; } .sq-power .pl.under { background: #d1321b; }

/* top-down swarm battlefield behind the duel UI */
.sq-swarm { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }
.arena-full.sq .sq-troops { display: none; }
.arena-full.sq .sq-side, .arena-full.sq .sq-mid, .arena-full.sq .sq-cards { position: relative; z-index: 3; }

/* ===== full top-down battlefield layout (bf) ===== */
.arena-full.sq.bf { display: block; padding: 0; background: radial-gradient(ellipse at 50% 45%, #6b7390, #3a4058 70%, #232739); }
.arena-full.sq.bf::before, .arena-full.sq.bf::after { display: none; }
.sq-vsbar { position: absolute; z-index: 6; left: 0; right: 0; top: 0; display: flex; align-items: center; justify-content: space-between; gap: .4rem; padding: max(.4rem, env(safe-area-inset-top)) .6rem .5rem; background: linear-gradient(rgba(6,10,40,.85), rgba(6,10,40,0)); }
.vsc { display: flex; align-items: center; gap: .5rem; padding: .15rem .8rem .15rem .15rem; border-radius: 99px; background: rgba(8,16,60,.85); border: 3px solid #0a1236; box-shadow: 0 0 0 2px #e0a21f; max-width: 42%; min-width: 0; color: #fff; }
.vsc.b { flex-direction: row-reverse; padding: .15rem .15rem .15rem .8rem; text-align: right; }
.vsp { width: 46px; height: 46px; border-radius: 50%; overflow: hidden; border: 3px solid #0a1236; background: #274; display: grid; place-items: center; font-family: var(--serif); font-weight: 800; flex: 0 0 auto; } .vsp img { width: 100%; height: 100%; object-fit: cover; }
.vsc.a .vsp { box-shadow: 0 0 0 2px #35b6ff; } .vsc.b .vsp { box-shadow: 0 0 0 2px #ff5a3c; }
.vsn { min-width: 0; line-height: 1.1; } .vsn small { display: block; font-size: .65rem; opacity: .85; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .vsn .pw { font-family: var(--serif); font-size: 1.15rem; text-shadow: 0 2px 0 #0a1236; }
.vsc.a .pw { color: #7ad7ff; } .vsc.b .pw { color: #ff9a85; }
.vstxt { font-style: normal; font-family: var(--serif); font-weight: 800; font-size: 1.9rem; color: #ffe27a; text-shadow: 0 3px 0 #7a1d12, 0 0 16px #ff7a3c; transform: skewX(-8deg); display: inline-block; }
.arena-full.sq.bf .sq-side { position: absolute; left: 0; right: 0; z-index: 3; } .arena-full.sq.bf .sq-side.b { top: 11%; } .arena-full.sq.bf .sq-side.a { bottom: 21%; }
.arena-full.sq.bf .sq-army { justify-content: center; margin: 0; } .arena-full.sq.bf .sq-leader.artimg { height: min(19vh, 170px); } .arena-full.sq.bf .sq-leader svg { width: 90px; }
.arena-full.sq.bf .sq-info { position: absolute; left: 6%; right: 6%; bottom: -6px; transform: translateY(100%); justify-content: center; font-size: .75rem; }
.arena-full.sq.bf .sq-side.b .sq-info { bottom: auto; top: -26px; transform: none; }
.arena-full.sq.bf .sq-info > b { display: none; } .arena-full.sq.bf .sq-info .sq-bar { max-width: 150px; min-width: 110px; height: 12px; flex: 0 0 auto; }
.arena-full.sq.bf .sq-mid { position: absolute; z-index: 4; left: 0; right: 0; top: 44%; transform: translateY(-50%); min-height: 0; }
.arena-full.sq.bf .sq-cards { position: absolute; z-index: 5; left: 0; right: 0; bottom: 0; padding: .4rem .6rem calc(.5rem + env(safe-area-inset-bottom)); background: linear-gradient(rgba(6,10,40,0), rgba(6,10,40,.9) 28%); }
.arena-full.sq.bf .sq-x { top: auto; bottom: 108px; right: 8px; left: auto; width: 40px; height: 40px; z-index: 7; }
.sq-spd { position: absolute; z-index: 7; right: 8px; bottom: 156px; width: 44px; height: 44px; border-radius: 12px; border: 3px solid #0a1236; background: linear-gradient(#ffb24a, #e0761a); color: #2a1200; font-weight: 800; cursor: pointer; box-shadow: 0 0 0 2px #fff5d6, 0 3px 0 rgba(0,0,0,.5); }
.sq-spd.on { background: linear-gradient(#7dff9a, #2fa060); }
.arena-full.sq.bf .sq-hist { display: none; }

.arena-full.sq.bf .sq-side.a .sq-info { bottom: auto; top: -24px; transform: none; }
.arena-full.sq.bf .sq-side.a { bottom: 24%; }

/* heroes are small leaders inside the armies */
.arena-full.sq.bf .sq-leader.artimg { height: min(11vh, 96px); }
.arena-full.sq.bf .sq-leader svg { width: 54px; }
.arena-full.sq.bf .sq-side.b { top: 17%; }
.arena-full.sq.bf .sq-side.a { bottom: 27%; }
.arena-full.sq.bf .sq-side.b .sq-info { top: -34px; }
.arena-full.sq.bf .sq-side.a .sq-info { top: -30px; }

/* opponent banner on top, your banner at the bottom: no left and right */
.arena-full.sq.bf .sq-vsbar { justify-content: center; }
.arena-full.sq.bf .vsc.b { flex-direction: row; padding: .15rem .9rem .15rem .15rem; text-align: left; max-width: 80%; }
.sq-mebar { position: absolute; z-index: 6; left: 0; right: 0; bottom: 118px; display: flex; justify-content: center; pointer-events: none; }
.arena-full.sq.bf .sq-mebar .vsc { max-width: 80%; }
.arena-full.sq.bf .sq-side.a { bottom: 31%; }
.arena-full.sq.bf .sq-mid .vstxt { font-size: 1.6rem; }

.arena-full.sq.bf .sq-leader.artimg.framed { height: min(17vh, 150px); margin: -2.5vh 0; }
