/* Full-screen duel arena: dusk courtyard, animated fighters, HP scrolls, ability buttons, timing ring, effects. */
body.in-fight { overflow: hidden; }
body.in-fight .dock, body.in-fight .topbar, body.in-fight .rankbar, body.in-fight .pinbar { visibility: hidden; }
.arena-full { position: fixed; inset: 0; z-index: 70; display: flex; flex-direction: column; background: linear-gradient(#10183a 0%, #3b3f86 38%, #d9625e 66%, #f6b26b 82%, #3a2a3f 82.1%, #1a1530 100%); overflow: hidden; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.arena-full::before { content: ""; position: absolute; left: 50%; top: 46%; width: min(60vw, 360px); aspect-ratio: 1; border-radius: 50%; transform: translate(-50%, -60%); background: radial-gradient(circle at 35% 30%, #ff9a73, #e0452c 60%, #b3301b); box-shadow: 0 0 80px rgba(255,150,90,.7); opacity: .85; animation: breathe 7s ease-in-out infinite; }
.arena-full::after { content: ""; position: absolute; inset: 0; background: var(--wave); background-size: 90px 45px; opacity: .6; pointer-events: none; mask-image: linear-gradient(transparent 55%, #000); -webkit-mask-image: linear-gradient(transparent 55%, #000); }

.ar-top { position: relative; z-index: 3; display: grid; grid-template-columns: 1fr auto 1fr; gap: .6rem; align-items: start; padding: max(.6rem, env(safe-area-inset-top)) .8rem .4rem; background: linear-gradient(rgba(8,12,28,.85), rgba(8,12,28,0)); }
.ar-hp { min-width: 0; color: var(--paper); text-shadow: 0 2px 0 var(--sumi); }
.ar-hp.e { text-align: right; }
.ar-name { font-family: var(--serif); font-weight: 800; font-size: 1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ar-bar { position: relative; height: 18px; margin-top: 3px; border: 3px solid var(--sumi); border-radius: 12px 14px 12px 14px; background: rgba(0,0,0,.55); overflow: hidden; box-shadow: 0 0 0 2px var(--gold); }
.ar-bar i { position: absolute; left: 0; top: 0; bottom: 0; transition: width .45s cubic-bezier(.2,.8,.2,1); }
.ar-bar .fill { background: linear-gradient(#6fe36f, #2f9a3a); z-index: 2; } .ar-bar .trail { background: #ffcf6e; z-index: 1; transition-duration: .9s; }
.ar-hp.e .ar-bar i { left: auto; right: 0; } .ar-hp.e .ar-bar .fill { background: linear-gradient(#ff7a55, #b3301b); }
.ar-num { font-size: .72rem; font-weight: 800; margin-top: 2px; }
.ar-mid { text-align: center; color: var(--paper); font-family: var(--serif); text-shadow: 0 2px 0 var(--sumi); } .ar-mid b { display: block; font-size: .8rem; } .ar-mid span { font-size: 1.8rem; font-weight: 800; color: var(--gold-2); line-height: 1; }
.ar-mid .turn { font-size: .75rem; font-family: var(--sans); }
.ar-x { position: absolute; z-index: 6; right: 8px; bottom: -44px; width: 44px; height: 44px; border-radius: 50%; border: 3px solid var(--sumi); background: rgba(10,16,38,.9); color: var(--paper); font-size: 1.5rem; cursor: pointer; display: none; }
.ar-top + .ar-x { top: calc(max(.6rem, env(safe-area-inset-top)) + 62px); bottom: auto; display: block; right: auto; left: 8px; }

.ar-stage { position: relative; z-index: 2; flex: 1; min-height: 0; display: flex; align-items: flex-end; justify-content: space-between; padding: 0 6vw 7vh; }
.ar-ground { position: absolute; left: 0; right: 0; bottom: 0; height: 24%; background: linear-gradient(rgba(26,21,48,0), rgba(26,21,48,.9)); }
.ar-fig { position: relative; z-index: 2; width: min(42vw, 280px); }
.ar-fig .sprite-wrap, .ar-fig .sprite { width: 100%; display: block; }
.ar-fig .sprite { filter: drop-shadow(0 10px 8px rgba(0,0,0,.55)); }
.ar-fig .sprite-wrap svg { width: 100%; height: auto; display: block; filter: drop-shadow(0 10px 8px rgba(0,0,0,.5)); }
.ar-fig .sprite.art { height: min(52vh, 460px); object-fit: contain; }
.ar-fig.p .sprite-wrap svg, .ar-fig.p .sprite.art { animation: idle 2.4s ease-in-out infinite; }
.ar-fig.e .sprite-wrap svg, .ar-fig.e .sprite.art { animation: idle 2.7s ease-in-out infinite .4s; }
.ar-fig.e .sprite-wrap, .ar-fig.e .sprite.art { transform: scaleX(-1); }
.ar-fig.stunned::after { content: "✦ ✦ ✦"; position: absolute; top: -6px; left: 0; right: 0; text-align: center; color: var(--gold-2); font-size: 1.2rem; letter-spacing: .3em; animation: spin1 1s linear infinite; }
@keyframes spin1 { 50% { transform: translateY(-5px); } }
.guardflash { animation: guardA .5s ease-out; } @keyframes guardA { 0% { filter: drop-shadow(0 0 0 #9fd8ff); } 40% { filter: drop-shadow(0 0 26px #9fd8ff) brightness(1.4); } 100% { filter: none; } }
.ar-hint { position: absolute; z-index: 4; left: 0; right: 0; top: 6%; text-align: center; font-family: var(--serif); font-weight: 800; font-size: 1.1rem; color: var(--paper); text-shadow: 0 2px 0 var(--sumi); opacity: 0; transition: opacity .2s; pointer-events: none; }
.ar-hint.on { opacity: 1; }

.ar-abil { position: relative; z-index: 4; display: flex; gap: .55rem; justify-content: center; flex-wrap: wrap; padding: .6rem .8rem calc(.8rem + env(safe-area-inset-bottom)); background: linear-gradient(rgba(8,12,28,0), rgba(8,12,28,.92) 30%); }
.ar-ab { position: relative; flex: 1 1 0; min-width: 84px; max-width: 150px; min-height: 84px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; padding: .35rem .3rem; cursor: pointer; color: var(--paper); font-weight: 800; border: 4px solid var(--sumi); border-radius: 16px 22px 16px 20px; background: linear-gradient(#ff6a47, var(--red-2)); box-shadow: 0 0 0 2px var(--gold), 0 6px 0 rgba(0,0,0,.55); text-shadow: 0 2px 0 rgba(0,0,0,.45); transition: transform .1s; }
.ar-ab.timing { background: linear-gradient(#4b78bf, #1d3466); } .ar-ab.guard { background: linear-gradient(#5c8f64, #2d5233); }
.ar-ab:active:not(:disabled) { transform: translateY(5px); box-shadow: 0 0 0 2px var(--gold), 0 1px 0 rgba(0,0,0,.55); }
.ar-ab:disabled { filter: grayscale(.8) brightness(.7); cursor: default; }
.ar-ab .ico { font-family: var(--serif); font-size: 1.7rem; line-height: 1; } .ar-ab b { font-size: .78rem; text-align: center; line-height: 1.1; } .ar-ab small { font-size: .62rem; opacity: .9; }
.ar-ab .cd { position: absolute; top: 4px; right: 6px; font-style: normal; background: var(--sumi); border-radius: 50%; width: 22px; height: 22px; display: grid; place-items: center; font-size: .8rem; }

.ar-ring-wrap { position: fixed; z-index: 85; width: 0; height: 0; pointer-events: none; }
.ar-ring-wrap .ringt, .ar-ring-wrap .ring { position: absolute; left: 0; top: 0; border-radius: 50%; transform: translate(-50%, -50%); }
.ar-ring-wrap .ringt { width: 84px; height: 84px; border: 5px solid var(--gold-2); box-shadow: 0 0 18px var(--gold), inset 0 0 12px rgba(255,220,120,.5); }
.ar-ring-wrap .ring { width: 84px; height: 84px; border: 6px solid #fff; box-shadow: 0 0 22px #fff; }
.ar-catch { position: fixed; inset: 0; z-index: 84; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 30vh; background: rgba(6,9,20,.35); }
.ar-catch span { color: var(--paper); font-weight: 800; font-family: var(--serif); font-size: 1.2rem; text-shadow: 0 2px 0 var(--sumi); animation: blink 0.8s infinite; }

.ar-result { position: absolute; inset: 0; z-index: 8; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .6rem; text-align: center; color: var(--paper); background: radial-gradient(circle, rgba(6,9,20,.7), rgba(6,9,20,.94)); animation: rise .4s both; padding: 1rem; }
.ar-result .big { font-family: var(--serif); font-weight: 800; font-size: clamp(4rem, 22vw, 8rem); line-height: 1; color: var(--gold-2); text-shadow: 0 6px 0 var(--sumi), 0 0 40px rgba(244,207,110,.8); animation: pop .6s both; }
.ar-result.loss .big { color: #9db0d0; text-shadow: 0 6px 0 var(--sumi); }
.ar-result .sub { font-family: var(--serif); font-size: 1.6rem; font-weight: 800; letter-spacing: .1em; } .ar-result .rate { font-weight: 700; } .ar-result .up { color: #8be08a; } .ar-result .down { color: #ff8e76; }

.vfx { position: fixed; z-index: 86; pointer-events: none; }
.vfx.slash { transform: translate(-50%, -50%) rotate(-10deg); } .vfx.slash.foe { transform: translate(-50%, -50%) scaleX(-1) rotate(-10deg); }
.vfx.slash path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw .22s ease-out forwards; } @keyframes draw { to { stroke-dashoffset: 0; } }
.vfx.slash svg { animation: fadeOut .45s forwards; } @keyframes fadeOut { 60% { opacity: 1; } to { opacity: 0; } }
.vfx.spark { width: 10px; height: 10px; border-radius: 50%; } .vfx.bullet { width: 18px; height: 6px; border-radius: 4px; background: #ffe9a0; box-shadow: 0 0 12px #ffcf6e; }
.vfx.tali { width: 22px; height: 32px; background: #f6edda; border: 2px solid var(--sumi); border-radius: 3px; box-shadow: 0 0 12px rgba(217,67,43,.8); }
.vfx.tali::after { content: "符"; display: block; text-align: center; color: var(--red); font-weight: 800; font-size: 1rem; }

/* skirmish */
.ar-top.sk { grid-template-columns: 1fr auto 1fr; } .sk-side { color: var(--paper); text-shadow: 0 2px 0 var(--sumi); min-width: 0; } .sk-side.d { text-align: right; } .sk-side.d .ar-bar i { left: auto; right: 0; }
.sk-side.d .ar-bar .fill { background: linear-gradient(#ff7a55, #b3301b); }
.sk-army { position: relative; z-index: 2; display: flex; gap: 0; align-items: flex-end; } .sk-army.a { flex-direction: row; } .sk-army.d { flex-direction: row-reverse; }
.sk-army .ar-fig.sk { width: min(16vw, 110px); margin-left: -10px; } .sk-army.d .ar-fig.sk .sprite-wrap { transform: scaleX(-1); }

@media (orientation: landscape) and (max-height: 520px) {
  .ar-fig { width: min(20vw, 150px); } .ar-fig .sprite.art { height: 36vh; }
  .ar-stage { padding-bottom: 3vh; } .ar-ab { min-height: 64px; max-width: 120px; } .ar-ab .ico { font-size: 1.3rem; } .ar-ab small { display: none; }
  .ar-abil { padding: .3rem .6rem .4rem; flex-wrap: nowrap; }
}
