.clash-recap {
  background: radial-gradient(ellipse at 48% 75%, #263453, transparent 58%),
    linear-gradient(120deg, #141f36, #131327 50%, #1b2138);
}
.clash-recap h2 { margin-block: .18rem 0; }
.clash-step, .clash-margin { color: #adc0d6; font-size: .84rem; }
.clash-margin { text-align: center; margin-block: .15rem .4rem; }
.clash-margin b { margin-inline-start: .35rem; color: #fff1bc; }
.clash-pair {
  --clash-gap: clamp(24px, 7.8vw, 76px);
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--clash-gap);
  max-width: 760px;
  padding-inline: clamp(27px, 9vw, 84px);
  isolation: isolate;
}
.clash-side { min-width: 0; }
.clash-side[data-position="left"] { --clash-direction: 1; }
.clash-side[data-position="right"] { --clash-direction: -1; }
.clash-side > .battle-entrant {
  --clash-approach: calc(var(--clash-direction) * var(--clash-gap) * .5);
  --clash-knockback: calc(-1 * var(--clash-direction) * (6px + clamp(21px, 7vw, 68px) * var(--clash-force)));
  --clash-tilt: calc(-1 * var(--clash-direction) * (2deg + 11deg * var(--clash-force)));
  animation: clash-rebound var(--clash-speed) linear var(--clash-delay) both;
  transform-origin: center 60%;
  background: #101a2c;
}
.clash-side[data-outcome="win"] > .battle-entrant {
  animation-name: clash-drive;
  border-color: #ffe1a1;
  box-shadow: 0 0 22px #f1c66a4d;
}
.clash-side[data-outcome="loss"] > .battle-entrant { animation-name: clash-knockback; }
.clash-side .battle-entrant :is(img,.card-illu) {
  height: auto;
  min-height: 0;
  aspect-ratio: 1;
  object-fit: contain;
}
.clash-side .battle-entrant strong { overflow-wrap: anywhere; font-size: clamp(.72rem, 2vw, 1rem); }
.clash-side .clash-score { color: #daf0ff; font-size: clamp(1.55rem, 5vw, 2.65rem); }
.clash-side[data-outcome="win"] .clash-score { color: #ffdd91; font-size: clamp(1.9rem, 6vw, 3.6rem); }
.clash-label { margin: .5rem 0 0; min-height: 2.35rem; color: #b8cde5; line-height: 1.2; font-size: .83rem; overflow-wrap: anywhere; }
.clash-label span { display: table; margin: .15rem auto 0; color: #ffe3a9; font-size: .72rem; font-weight: 800; }
.clash-vs, .clash-impact {
  position: absolute;
  pointer-events: none;
  inset-block-start: 41%;
  inset-inline-start: 50%;
  transform: translate(-50%, -50%);
}
.clash-vs { z-index: -1; animation: clash-vs var(--clash-speed) linear var(--clash-delay) both; font-size: clamp(1.2rem, 4vw, 2.25rem); }
.clash-impact {
  z-index: 2;
  inline-size: clamp(54px, 16vw, 144px);
  aspect-ratio: 1;
  background: radial-gradient(circle, #fff7d1 0%, #ffd274b5 18%, transparent 56%),
    conic-gradient(from 17deg, transparent 0 8%, #ffe4a4 9% 11%, transparent 12% 30%, #ffe4a4 31% 33%,
    transparent 34% 51%, #fff5ba 52% 53%, transparent 54% 72%, #ffd879 73% 75%, transparent 76%);
  border-radius: 50%;
  animation: clash-impact var(--clash-speed) linear var(--clash-delay) both;
}
@keyframes clash-drive {
  0% { transform: none; }
  15% { transform: translateX(calc(var(--clash-direction) * -7px)) rotate(calc(var(--clash-direction) * -3deg)); animation-timing-function: cubic-bezier(.6,.05,.85,.3); }
  30.1%, 33% { transform: translateX(var(--clash-approach)); }
  49% { transform: translate(calc(var(--clash-direction) * -7px),-6px) scale(1.025); animation-timing-function: cubic-bezier(.14,.8,.24,1); }
  100% { transform: translateY(-5px); }
}
@keyframes clash-knockback {
  0% { transform: none; }
  15% { transform: translateX(calc(var(--clash-direction) * -7px)) rotate(calc(var(--clash-direction) * -3deg)); animation-timing-function: cubic-bezier(.6,.05,.85,.3); }
  30.1%, 33% { transform: translateX(var(--clash-approach)); }
  50% { transform: translate(var(--clash-knockback), calc(5px + 9px * var(--clash-force))) rotate(var(--clash-tilt)) scale(calc(1 - .075 * var(--clash-force))); animation-timing-function: cubic-bezier(.08,.68,.3,1); }
  100% { transform: translateX(calc(var(--clash-knockback) * .77)) rotate(calc(var(--clash-tilt) * .55)); }
}
@keyframes clash-rebound {
  0% { transform: none; }
  15% { transform: translateX(calc(var(--clash-direction) * -7px)); animation-timing-function: cubic-bezier(.6,.05,.85,.3); }
  30.1%, 33% { transform: translateX(var(--clash-approach)); }
  54% { transform: translateX(calc(var(--clash-direction) * -7px)); animation-timing-function: cubic-bezier(.14,.8,.24,1); }
  100% { transform: none; }
}
@keyframes clash-vs { 0%, 18% { opacity: 1; } 30%, 100% { opacity: 0; } }
@keyframes clash-impact {
  0%, 29% { opacity: 0; transform: translate(-50%, -50%) scale(.32); }
  30.1% { opacity: .82; }
  51%, 100% { opacity: 0; transform: translate(-50%, -50%) scale(calc(1 + var(--clash-force) * .2)); }
}
.clash-result-name { font-weight: 800; color: #ffdf96; overflow-wrap: anywhere; }
.clash-result-name span { margin-inline-start: .45rem; color: #ffe7b5; }
.clash-scoreboard {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: clamp(.6rem, 3vw, 1.7rem);
  max-width: 630px;
  margin: 1.15rem auto;
  direction: ltr;
}
.clash-result-player {
  display: grid;
  align-content: center;
  min-width: 0;
  min-height: 6.3rem;
  padding: .65rem .35rem;
  gap: .25rem;
  border: 1px solid #38526c;
  border-radius: .8rem;
  background: linear-gradient(145deg,#1d2d46,#121b2b);
  overflow-wrap: anywhere;
}
.clash-result-player[data-winner="true"] {
  translate: 0 -.23rem;
  min-height: 7.8rem;
  border-color: #e8c179;
  background: linear-gradient(144deg,#49392a,#201e2d 65%);
  box-shadow: 0 5px 26px #d4982740;
  color: #fff2d2;
}
.clash-result-score { color: #d3edff; font: 800 clamp(1.75rem,5.6vw,2.45rem)/1 "Barlow Condensed",sans-serif; }
.clash-result-player[data-winner="true"] .clash-result-score { color: #ffdc89; font-size: clamp(2.5rem,8vw,4.4rem); }
.clash-result-status { font-size: .77rem; color: #adc0d6; }
.clash-result-player[data-winner="true"] .clash-result-status { color: #ffda91; font-weight: 800; }
.vs-row[data-winner="you"] .versus-card:first-child b,
.vs-row[data-winner="rival"] .versus-card:last-child b { color: #ffe0a0; }

.duel-stage .duel-table {
  --card-height: clamp(115px, 26vw, 224px);
  background: linear-gradient(149deg,#152333,#121b2d 57%,#161c30);
}
.duel-stage .duel-cards {
  max-width: 630px;
  margin-inline: auto;
  grid-template-columns: minmax(0,1.25fr) clamp(20px,7vw,53px) minmax(0,1fr);
  align-items: end;
}
.duel-stage .duel-cards > .duel-vs { align-self:center; }
.duel-stage .duel-side[data-side="rival"] { --card-height:clamp(96px,22vw,191px); }
.duel-stage .duel-face {
  grid-template-rows: var(--card-height) minmax(78px,auto);
  background: radial-gradient(ellipse at 50% 25%,#223b55,#102136 78%);
}
.duel-stage .duel-face > :is(img,.card-illu) {
  height: 100%;
  aspect-ratio: auto;
  object-fit: contain;
  object-position: center;
}
.duel-stage .duel-face.spinning > .draw-seal { font-size: .85rem; }
.duel-stage .duel-reel { --reel-step: calc(var(--card-height) + 78px); border:0; }
.duel-stage .duel-side[data-side="you"] .duel-face {
  border-inline-color: color-mix(in srgb,var(--rarity,var(--duel-cyan)) 48%,#28435a);
  box-shadow: 0 6px 18px #050b1478;
}
.duel-stage .duel-face[data-rarity] .tier { color: var(--rarity,#e9f2ff); }
.duel-stage .duel-tools { justify-content: flex-start; flex-wrap: wrap; gap: .45rem; direction: ltr; }
.duel-stage .duel-tools .button { direction: rtl; }
.duel-stage .duel-options { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.5rem; margin-top:.75rem; }
.duel-stage .duel-options .button { justify-content:start; min-width:0; text-align:start; gap:.4rem; overflow-wrap:anywhere; }
.duel-stage .duel-options .button[aria-pressed="true"] { border-color:#85f8e0; background:#23474a; }
.duel-stage .duel-options .button b { margin-inline-start:auto; color:#ffdf96; }
.duel-stage .duel-slot { direction:rtl; min-height:50px; }
.duel-stage .duel-slot .slot-note { display:grid; gap:.1rem; text-align:start; }
.duel-stage .duel-slot .slot-note strong { color:#9ae3cb; }
.duel-stage .duel-slot .slot-note span { color:#aec1d5; }
.duel-stage .duel-slot b { font-size:clamp(.88rem,3.8vw,1.16rem); }
.duel-stage .duel-slot-label { display:grid; align-content:center; gap:.1rem; direction:rtl; }
.duel-stage .duel-slot-label small { color:#aebcd1; white-space:nowrap; }
.duel-stage .duel-slot-label small[data-edge="1"] { color:#a3f4cf; }
.duel-stage .duel-slot-label small[data-edge="-1"] { color:#ffb9c0; }
.duel-stage .duel-face.face-reveal:not(.is-revealing),
.duel-stage .duel-face.face-reveal:not(.is-revealing) > :is(img,.card-illu) {
  animation: duel-settle 130ms cubic-bezier(.16,.8,.23,1) both;
}
.duel-stage .duel-face.face-reveal:not(.is-revealing) > .duel-description,
.duel-stage .value-reveal { animation: folio-text 100ms 130ms ease-out both; }
.duel-stage .duel-face.face-reveal.draw-highlight:not(.is-revealing) {
  animation: duel-settle 130ms cubic-bezier(.16,.8,.23,1) both, duel-flash 180ms ease-out both;
}
@keyframes duel-settle {
  from { transform:translateY(5px) scale(.987); }
  to { transform:none; }
}
@keyframes duel-flash {
  from { box-shadow:0 0 17px var(--rarity),inset 0 0 16px var(--rarity); }
  to { box-shadow:0 6px 18px #050b1478; }
}
.duel-highlights { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.5rem; margin-block:.75rem; }
.duel-highlights > div { display:grid; gap:.3rem; min-width:0; border:1px solid #3d526b; border-radius:.65rem; padding:.6rem; background:#1a283c; }
.duel-highlights small,.vs-row > span:nth-child(2) small { color:#b4c8df; }
.vs-row > span:nth-child(2) small { display:block; font-weight:400; }
@media (max-width:520px) {
  .duel-stage .duel-handle .player-thumb { display:none; }
  .duel-stage .duel-handle .arena-player > b { white-space:normal; overflow-wrap:anywhere; }
  .duel-stage .duel-description { padding:5px; }
  .duel-stage .duel-description .tier { font-size:.68rem; }
}
@media (prefers-reduced-motion: reduce) {
  .clash-recap .clash-side > .battle-entrant, .clash-vs, .clash-impact { animation: none; }
  .clash-impact { display: none; }
  .duel-stage .duel-face.face-reveal:not(.is-revealing), .duel-stage .duel-face.face-reveal:not(.is-revealing) > *, .duel-stage .value-reveal { animation:none; }
}
.clash-recap[data-reduced="true"] :is(.clash-side > .battle-entrant, .clash-vs, .clash-impact),
[data-reduced="true"] .clash-recap :is(.clash-side > .battle-entrant, .clash-vs, .clash-impact) { animation: none; }
[data-reduced="true"] .clash-impact { display: none; }

.cv-ending-clash {min-width:0;overflow:visible;text-align:start}
.cv-ending-clash-header {display:flex;justify-content:space-between;align-items:center;gap:1rem}
.cv-ending-clash-header h1 {margin:0;font-size:clamp(1.25rem,3vw,2rem)}
.cv-ending-clash-header bdi {color:#9ee3dc;font-variant-numeric:tabular-nums}
.cv-ending-clash h2#match-result-title {text-align:center;margin:.8rem 0 .4rem;font-size:clamp(2rem,6vw,3.5rem)}
.cv-ending-clash :is(.clash-result-name,.cv-deciding-rule) {text-align:center}
.cv-result-stat-tabs {display:flex;flex-wrap:wrap;gap:.35rem;margin-block:.7rem}
.cv-result-stat-tabs .button {font-size:.78rem}
.cv-ending-clash .vs-row {scroll-margin-block:9rem 1rem}
.cv-ending-clash .vs-row:focus {outline:2px solid #c6a7fa;outline-offset:2px}
.cv-result-actions {position:sticky;top:4.25rem;align-self:start;z-index:6;background:#141122f4;
  border:1px solid #4a3a68;border-radius:9px;padding:.5rem}
.cv-result-actions .toolbar {margin:0;gap:.35rem}
.cv-ending-clash .cv-result-highlights {border-block-start:1px solid #4a3a68;padding-block-start:.9rem}
.cv-ending-clash .cv-result-highlights h2 {font-size:clamp(1.2rem,2.5vw,1.5rem)}
#screen:has(>.cv-ending-clash) {display:grid;grid-template-columns:minmax(0,1fr);gap:.75rem;align-items:start}
@media(min-width:980px) {
  #screen:has(>.cv-ending-clash) {grid-template-columns:minmax(145px,175px) minmax(0,1fr)}
  .cv-result-actions .toolbar {display:grid}
}
@media(max-width:600px) {
  .cv-result-actions {top:3.45rem}
  .cv-result-actions .toolbar .button {font-size:.69rem;padding:.28rem .42rem;min-height:36px}
  .cv-ending-clash .vs-row {scroll-margin-block:8rem 1rem}
}
