/* CYBERSTRIKE — gameplay/result/analysis, fully responsive */

@media (hover: hover) and (pointer: fine) {
  body.robo,
  body.robo * {
    cursor: none !important;
  }
}
#robo {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100000;
  width: 40px;
  height: 44px;
  pointer-events: none;
  transform: translate(-50%, -50%);
}
#robo .rb {
  animation: roboFloat 2.4s ease-in-out infinite;
  transform-origin: center;
}
@keyframes roboFloat {
  0%,
  100% {
    transform: translateY(0) rotate(0);
  }
  50% {
    transform: translateY(-3px) rotate(-3deg);
  }
}
#roboDot {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100001;
  width: 6px;
  height: 6px;
  background: var(--purple-l);
  transform: translate(-50%, -50%);
  pointer-events: none;
  box-shadow: 0 0 8px var(--purple-l);
}
body.robo-red #roboDot {
  background: var(--purple-d);
  box-shadow: 0 0 8px var(--purple-d);
}
.robo-eye {
  animation: roboBlink 3.2s infinite;
  transform-origin: center;
}
@keyframes roboBlink {
  0%,
  92%,
  100% {
    transform: scaleY(1);
  }
  95% {
    transform: scaleY(0.1);
  }
}
body.robo-hot #roboDot {
  background: var(--purple-m);
  box-shadow: 0 0 10px var(--purple-m);
}
#roboSay {
  position: fixed;
  z-index: 100000;
  pointer-events: none;
  transform: translate(16px, -40px);
  background: var(--purple-m);
  border: 2px solid var(--bnd-dark);
  color: #ffffff;
  font-family: var(--mono);
  font-size: 0.9rem;
  letter-spacing: 1px;
  padding: 5px 9px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.18s;
}
#roboSay.show {
  opacity: 1;
}
#toolTip {
  position: fixed;
  z-index: 100002;
  pointer-events: none;
  max-width: min(280px, 70vw);
  transform: translate(-50%, -100%);
  background: var(--blue-d);
  border: var(--border) solid var(--bnd-box);
  color: var(--text);
  font-family: var(--body);
  font-size: clamp(0.78rem, 1.4vw, 0.86rem);
  line-height: 1.4;
  padding: 0.6em 0.8em;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transition: opacity 0.12s;
}
#toolTip.show {
  opacity: 1;
}
#toolTip .tt-name {
  font-family: var(--head);
  font-size: 0.5rem;
  letter-spacing: 1px;
  color: #000000;
  display: block;
  margin-bottom: 5px;
}

.blk {
  position: relative;
  border: var(--border) solid var(--bnd-box);
  box-shadow:
    inset -5px -5px 0 rgba(0, 0, 0, 0.4),
    inset 5px 5px 0 rgba(255, 255, 255, 0.12);
}
.skin-default {
  background: var(--node-bg);
}
.skin-payday {
  background:
    repeating-linear-gradient(
      0deg,
      rgba(0, 0, 0, 0.18) 0 2px,
      transparent 2px 14px
    ),
    linear-gradient(180deg, var(--emerald), var(--node-bg));
}
.skin-invoice {
  background:
    repeating-linear-gradient(
      0deg,
      rgba(0, 0, 0, 0.14) 0 1px,
      transparent 1px 9px
    ),
    linear-gradient(180deg, var(--white), var(--node-bg));
}
.skin-inherit {
  background:
    radial-gradient(
      circle at 50% 42%,
      rgba(255, 255, 255, 0.35) 0 24%,
      transparent 25%
    ),
    linear-gradient(180deg, var(--red-l), var(--node-bg));
}
.skin-shortlink {
  background:
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.25) 0 2px,
      transparent 2px 12px
    ),
    linear-gradient(180deg, var(--emerald), var(--node-bg));
}
.skin-usb {
  background:
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.1) 0 3px,
      transparent 3px 10px
    ),
    linear-gradient(180deg, var(--white), var(--node-bg));
}

.hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  padding: 0.6em var(--s3);
  margin-bottom: var(--s2);
  background: linear-gradient(
    180deg,
    rgba(178, 204, 52, 0.55),
    rgba(178, 204, 52, 0.75)
  );
  border: var(--border) solid var(--bnd-box);
  box-shadow:
    inset -5px -5px 0 rgba(0, 0, 0, 0.3),
    inset 5px 5px 0 rgba(255, 255, 255, 0.06);
  flex: 0 0 auto;
  flex-wrap: wrap;
}
.hud .side-tag {
  font-family: var(--head);
  font-size: clamp(0.5rem, 1.3vw, 0.58rem);
  letter-spacing: 1px;
}
.hud .side-tag.blue {
  color: var(--amethyst);
}
.hud .side-tag.red {
  color: #000000;
}
.timer {
  text-align: center;
}
.timer .digits {
  font-family: var(--head);
  font-size: clamp(0.78rem, 1.8vw, 0.92rem);
  letter-spacing: 2px;
}
.timer .digits.low {
  color: var(--lava);
  animation: blink 0.5s steps(1) infinite;
}
@keyframes blink {
  50% {
    opacity: 0.35;
  }
}
.timer .tbar {
  width: clamp(120px, 22vw, 160px);
  height: 9px;
  margin: 5px auto 0;
  background: var(--blue-d);
  border: 2px solid var(--bnd-box);
  overflow: hidden;
}
.timer .tfill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--emerald), var(--gold));
  transition: width 1s linear;
}
.red-side .timer .tfill {
  background: linear-gradient(90deg, var(--lava), var(--gold));
}
.hud .progress {
  font-family: var(--mono);
  font-size: clamp(0.85rem, 1.6vw, 0.98rem);
  letter-spacing: 1px;
  color: var(--text-dim);
}
.hud .progress b {
  color: #000000;
  font-family: var(--head);
  font-size: clamp(0.56rem, 1.3vw, 0.66rem);
}
.play-head {
  display: flex;
  flex: 0 0 auto;
  margin-bottom: var(--s2);
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}
.play-head h1 {
  font-family: var(--head);
  font-size: clamp(0.6rem, 1.6vw, 0.72rem);
  line-height: 1.5;
  margin: 0;
}
.play-head .blue {
  color: var(--amethyst);
}
.play-head .red {
  color: #000000;
}
.play-head .howto {
  font-family: var(--mono);
  font-size: clamp(0.82rem, 1.5vw, 0.95rem);
  letter-spacing: 1px;
  color: #000000;
}

.battle-layout {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(300px, 46%) 1fr;
  gap: var(--s3);
}
@media (max-width: 900px) {
  .battle-layout {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(220px, 38%) 1fr;
  }
}
.net-col {
  min-height: 0;
  min-width: 0;
  display: flex;
}
.netdiagram {
  position: relative;
  flex: 1;
  min-height: 0;
  background: var(--blue-d);
  border: var(--border) solid var(--bnd-box);
  box-shadow: inset 4px 4px 0 rgba(0, 0, 0, 0.45);
  overflow: hidden;
}
.netdiagram .nd-title {
  position: absolute;
  top: 8px;
  left: 0;
  right: 0;
  text-align: center;
  z-index: 4;
  font-family: var(--head);
  font-size: clamp(0.42rem, 1vw, 0.5rem);
  letter-spacing: 1px;
  color: var(--text-dim);
  pointer-events: none;
}
.net-links line.flow {
  stroke-dasharray: 6 7;
  animation: flowdash 1.1s linear infinite;
}
@keyframes flowdash {
  to {
    stroke-dashoffset: -26;
  }
}
.net-node {
  position: absolute;
  transform: translate(-50%, -50%);
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: clamp(64px, 11vmin, 112px);
  cursor: pointer;
}
.net-node .nn-cube {
  position: relative;
  width: clamp(36px, 6vmin, 58px);
  height: clamp(34px, 5.6vmin, 54px);
  display: grid;
  place-items: center;
  font-size: clamp(16px, 3vmin, 25px);
}
.net-node .nn-lbl {
  margin-top: 4px;
  font-family: var(--mono);
  font-size: clamp(0.6rem, 1.5vmin, 0.88rem);
  line-height: 1.05;
  text-align: center;
  color: #000000;
  max-width: 100%;
}
.net-node .nn-status {
  font-family: var(--mono);
  font-size: clamp(0.54rem, 1.3vmin, 0.78rem);
  line-height: 1.05;
  text-align: center;
  color: var(--text-dim);
  max-width: clamp(80px, 14vmin, 120px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  height: 0;
  opacity: 0;
  transition: 0.15s;
}
.net-node.set .nn-status {
  height: auto;
  opacity: 1;
  margin-top: 2px;
}
.net-node .nn-badge {
  position: absolute;
  top: -10px;
  right: -8px;
  font-size: 14px;
  line-height: 1;
  opacity: 0;
  transform: scale(0.4);
  transition: 0.18s;
}
.net-node .nn-badge .ibug {
  width: 1em;
  height: 1em;
  vertical-align: 0;
}
.net-node.set .nn-badge {
  opacity: 1;
  transform: scale(1);
}
.net-node.jewel .nn-cube {
  box-shadow:
    0 0 14px rgba(255, 255, 255, 0.5),
    inset -3px -3px 0 rgba(0, 0, 0, 0.35),
    inset 3px 3px 0 rgba(255, 255, 255, 0.12);
  border-color: var(--gold);
}
.net-node.attacker {
  cursor: default;
}
.net-node.attacker .nn-cube {
  background: var(--red-d);
  border: var(--border) solid var(--white);
  box-shadow: inset -3px -3px 0 rgba(0, 0, 0, 0.4);
}
.net-node.set.blue-set .nn-cube {
  box-shadow:
    0 0 0 3px var(--amethyst),
    inset -3px -3px 0 rgba(0, 0, 0, 0.35);
}
.net-node.set.blue-set .nn-status {
  color: var(--emerald-hl);
}
.net-node.set.red-set .nn-cube {
  box-shadow:
    0 0 0 3px var(--white),
    inset -3px -3px 0 rgba(0, 0, 0, 0.35);
}
.net-node.set.red-set .nn-status {
  color: #000000;
}
.net-node.drophover .nn-cube {
  transform: scale(1.15);
  box-shadow:
    0 0 0 3px var(--gold),
    0 0 18px rgba(255, 255, 255, 0.6);
}
.net-node.active .nn-cube {
  box-shadow: 0 0 0 3px var(--bnd);
}
.nn-cube .shield-fx {
  position: absolute;
  inset: -8px;
  border: var(--border) solid var(--emerald);
  opacity: 0;
  z-index: 6;
  pointer-events: none;
}
.nn-cube .shield-fx.go {
  animation: shieldGo 0.55s ease;
}
@keyframes shieldGo {
  0% {
    opacity: 0;
    transform: scale(0.5);
  }
  35% {
    opacity: 1;
    transform: scale(1.05);
    box-shadow: 0 0 20px var(--emerald);
  }
  100% {
    opacity: 0;
    transform: scale(1.2);
  }
}
.nn-cube .dmg-fx {
  position: absolute;
  inset: -6px;
  z-index: 6;
  opacity: 0;
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  pointer-events: none;
}
.nn-cube .dmg-fx.go {
  animation: dmgGo 0.5s ease;
}
@keyframes dmgGo {
  0% {
    opacity: 0;
    transform: scale(0.5) rotate(-10deg);
  }
  25% {
    opacity: 1;
    transform: scale(1.15) rotate(6deg);
    filter: drop-shadow(0 0 10px var(--lava));
  }
  100% {
    opacity: 0;
  }
}
.nn-cube.pop {
  animation: nnPop 0.4s ease;
}
@keyframes nnPop {
  40% {
    transform: scale(1.14);
  }
}
.nd-packet {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  z-index: 5;
  pointer-events: none;
}
.nd-packet.blue {
  background: var(--amethyst);
  box-shadow: 0 0 10px var(--amethyst);
}
.nd-packet.red {
  background: var(--white);
  box-shadow: 0 0 10px var(--white);
}
.tools-col {
  min-height: 0;
  overflow-y: auto;
  padding-right: 6px;
  display: flex;
  flex-direction: column;
}
.tools-col::-webkit-scrollbar {
  width: 12px;
}
.tools-col::-webkit-scrollbar-track {
  background: var(--blue-d);
  border: 2px solid var(--bnd);
}
.tools-col::-webkit-scrollbar-thumb {
  background: var(--stone);
  border: 2px solid var(--bnd);
}
.tools-col::-webkit-scrollbar-thumb:hover {
  background: var(--stone-lt);
}
.tool-sec {
  padding: var(--s2) var(--s3);
  margin-bottom: var(--s2);
  background: linear-gradient(
    180deg,
    rgba(178, 204, 52, 0.35),
    rgba(178, 204, 52, 0.55)
  );
  border: var(--border) solid var(--bnd-box);
  box-shadow:
    inset -4px -4px 0 rgba(0, 0, 0, 0.3),
    inset 4px 4px 0 rgba(255, 255, 255, 0.05);
  scroll-margin-top: 6px;
}
.tool-sec.done {
  border-color: var(--amethyst);
}
.red-side .tool-sec.done {
  border-color: var(--white);
}
.tool-sec.flash {
  animation: secFlash 0.8s ease;
}
@keyframes secFlash {
  0%,
  100% {
    box-shadow: inset -4px -4px 0 rgba(0, 0, 0, 0.3);
  }
  40% {
    box-shadow:
      0 0 0 3px var(--gold),
      inset -4px -4px 0 rgba(0, 0, 0, 0.3);
  }
}
.ts-hd {
  display: flex;
  align-items: center;
  gap: var(--s2);
  margin-bottom: var(--s2);
}
.ts-cube {
  width: clamp(32px, 4.6vmin, 38px);
  height: clamp(30px, 4.4vmin, 36px);
  display: grid;
  place-items: center;
  font-size: clamp(16px, 2.4vmin, 19px);
  flex: 0 0 auto;
}
.ts-name {
  font-family: var(--head);
  font-size: clamp(0.52rem, 1.3vw, 0.6rem);
  letter-spacing: 0.5px;
}
.ts-sub {
  font-family: var(--mono);
  font-size: clamp(0.76rem, 1.4vw, 0.82rem);
  color: var(--text-dim);
  letter-spacing: 1px;
}
.ts-flag {
  margin-left: auto;
  font-family: var(--head);
  font-size: clamp(0.4rem, 1vw, 0.44rem);
  color: #000000;
  padding: 0.5em 0.7em;
  border: 2px solid var(--bnd-box);
  background: rgba(255, 255, 255, 0.08);
}
.tool-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--s2);
}
.tool-card {
  position: relative;
  padding: 0.7em;
  background: var(--blue-d);
  border: var(--border) solid var(--bnd-box);
  box-shadow:
    inset -3px -3px 0 rgba(0, 0, 0, 0.3),
    inset 3px 3px 0 rgba(255, 255, 255, 0.05);
  cursor: grab;
  user-select: none;
  transition:
    transform 0.08s,
    box-shadow 0.15s,
    opacity 0.15s;
  display: flex;
  align-items: center;
  min-height: clamp(46px, 7vh, 58px);
}
.tool-card:active {
  cursor: grabbing;
}
.tool-card .tn {
  font-weight: 700;
  font-size: clamp(0.8rem, 1.5vw, 0.9rem);
  line-height: 1.25;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #000000;
}
.tool-card .pick {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 18px;
  height: 18px;
  border: var(--border) solid var(--line);
  display: grid;
  place-items: center;
  font-size: 0.62rem;
  opacity: 0;
}
.tool-card.blue-tool:hover {
  box-shadow:
    0 0 0 2px var(--amethyst),
    inset -3px -3px 0 rgba(0, 0, 0, 0.3);
  transform: translateY(-2px);
}
.tool-card.red-tool:hover {
  box-shadow:
    0 0 0 2px var(--lava),
    inset -3px -3px 0 rgba(0, 0, 0, 0.3);
  transform: translateY(-2px);
}
.tool-card.blue-tool.sel {
  border-color: var(--amethyst);
  background: var(--blue-d);
  box-shadow:
    0 0 0 2px var(--amethyst),
    inset -3px -3px 0 rgba(0, 0, 0, 0.3);
}
.tool-card.red-tool.sel {
  border-color: var(--white);
  background: var(--red-d);
  box-shadow:
    0 0 0 2px var(--white),
    inset -3px -3px 0 rgba(0, 0, 0, 0.3);
}
.tool-card.sel .pick {
  opacity: 1;
}
.tool-card.blue-tool.sel .pick {
  background: var(--amethyst);
  border-color: var(--amethyst);
  color: var(--white);
}
.tool-card.red-tool.sel .pick {
  background: var(--white);
  border-color: var(--white);
  color: var(--red-d);
}
.tool-card.dragging {
  opacity: 0.4;
}
.submit-row {
  flex: 0 0 auto;
  text-align: center;
  margin-top: var(--s2);
}
.submit-row .warnmsg {
  font-family: var(--mono);
  font-size: clamp(0.82rem, 1.5vw, 0.95rem);
  letter-spacing: 1px;
  color: var(--text-dim);
  margin-top: 6px;
}

/* result */
.result-shell {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
}
.arena {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--blue-d);
  border: var(--border) solid var(--bnd-dark);
  box-shadow: inset 5px 5px 0 rgba(0, 0, 0, 0.45);
  overflow: hidden;
  padding: var(--s3);
}
.arena-title {
  flex: 0 0 auto;
  font-family: var(--head);
  font-size: clamp(0.6rem, 1.6vw, 0.72rem);
  text-align: center;
  margin: 0 0 var(--s2);
  letter-spacing: 1px;
}
.arena-mid {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
}
.battlepath {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 4px;
  overflow-x: auto;
  padding-bottom: var(--s2);
}
.bp-seg {
  display: flex;
  align-items: center;
  gap: 4px;
}
.bp-link {
  width: clamp(12px, 3vw, 20px);
  height: 4px;
  background: repeating-linear-gradient(
    90deg,
    var(--stone-lt) 0 4px,
    transparent 4px 8px
  );
  margin-bottom: clamp(30px, 6vh, 44px);
}
.bp-link.breached {
  background: repeating-linear-gradient(
    90deg,
    var(--lava) 0 4px,
    transparent 4px 8px
  );
}
.bp-link.bypassed {
  background: repeating-linear-gradient(
    90deg,
    var(--gold) 0 4px,
    transparent 4px 8px
  );
}
.bpn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: clamp(72px, 13vw, 96px);
}
.bp-cube {
  width: clamp(48px, 8vmin, 64px);
  height: clamp(46px, 7.5vmin, 60px);
  display: grid;
  place-items: center;
  font-size: clamp(20px, 4vmin, 25px);
  transition: box-shadow 0.2s;
}
.bp-cube.jewel {
  box-shadow:
    0 0 18px rgba(255, 255, 255, 0.5),
    inset -5px -5px 0 rgba(0, 0, 0, 0.4),
    inset 5px 5px 0 rgba(255, 255, 255, 0.12);
  border-color: var(--gold);
}
.bp-cube.active {
  box-shadow:
    0 0 22px var(--gold),
    inset -5px -5px 0 rgba(0, 0, 0, 0.4);
  animation: activePulse 0.8s ease-in-out infinite;
}
@keyframes activePulse {
  50% {
    box-shadow:
      0 0 34px var(--gold),
      inset -5px -5px 0 rgba(0, 0, 0, 0.4);
  }
}
.bp-cube.held {
  box-shadow:
    0 0 20px var(--emerald),
    inset -5px -5px 0 rgba(0, 0, 0, 0.4);
  border-color: var(--emerald);
}
.bp-cube.broken {
  border-color: var(--lava);
}
.bp-cube.bypassed {
  box-shadow:
    0 0 18px var(--gold),
    inset -5px -5px 0 rgba(0, 0, 0, 0.4);
  border-color: var(--gold);
}
.bp-name {
  font-family: var(--mono);
  font-size: clamp(0.74rem, 1.4vw, 0.82rem);
  color: var(--text-dim);
  text-align: center;
  line-height: 1.15;
  max-width: clamp(72px, 13vw, 96px);
}
.bp-cube .shield-ov {
  position: absolute;
  inset: -8px;
  border: var(--border) solid var(--emerald);
  opacity: 0;
}
.bp-cube.held .shield-ov {
  animation: shieldPop 0.4s ease forwards;
}
@keyframes shieldPop {
  from {
    opacity: 0;
    transform: scale(0.6);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
.bp-cube .shield-ico,
.bp-cube .break-ico,
.bp-cube .bypass-ico {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%) scale(0);
  font-size: 1rem;
}
.bp-cube.held .shield-ico {
  animation: icoPop 0.3s 0.1s ease forwards;
}
.bp-cube.broken .break-ico {
  animation: icoPop 0.3s ease forwards;
}
.bp-cube.bypassed .bypass-ico {
  animation: icoPop 0.3s ease forwards;
}
@keyframes icoPop {
  to {
    transform: translateX(-50%) scale(1);
  }
}
.bp-cube .cracks {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  z-index: 3;
}
.bp-cube.cracking .cracks {
  opacity: 0.9;
}
.bp-cube .cracks svg {
  width: 100%;
  height: 100%;
}
.bp-cube.shake {
  animation: cubeShake 0.4s;
}
@keyframes cubeShake {
  0%,
  100% {
    transform: translate(0, 0);
  }
  20% {
    transform: translate(-3px, 2px);
  }
  60% {
    transform: translate(3px, -2px);
  }
}
.bp-cube.breaking {
  animation: cubeBreak 0.5s ease forwards;
}
@keyframes cubeBreak {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.12);
  }
  100% {
    transform: scale(0.2);
    opacity: 0;
  }
}
.raider {
  position: absolute;
  bottom: clamp(46px, 7.5vmin, 64px);
  left: 0;
  font-size: clamp(20px, 4vmin, 26px);
  z-index: 6;
  transition: left 0.6s cubic-bezier(0.5, 0.1, 0.5, 1);
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.5));
}
.hearts {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: var(--s2);
  font-family: var(--mono);
  font-size: 1rem;
  letter-spacing: 1px;
  color: var(--text-dim);
  flex-wrap: wrap;
}
.heart {
  font-size: 1.2rem;
  transition:
    transform 0.2s,
    opacity 0.2s;
}
.heart.gone {
  animation: heartBreak 0.4s ease forwards;
}
@keyframes heartBreak {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.4) rotate(-12deg);
  }
  100% {
    transform: scale(0.2);
    opacity: 0.25;
  }
}
.clash-stage {
  flex: 1 1 auto;
  min-height: clamp(96px, 14vh, 140px);
  display: grid;
  place-items: center;
}
.versus {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: var(--s3);
  align-items: center;
  width: 100%;
  max-width: min(660px, 94vw);
  opacity: 0;
}
.versus.show {
  animation: vsIn 0.3s ease forwards;
}
@keyframes vsIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.vs-card {
  padding: var(--s3);
  border: var(--border) solid var(--bnd-box);
  text-align: center;
}
.vs-card.def {
  background: var(--blue-d);
}
.vs-card.atk {
  background: var(--red-d);
}
.vs-card .who {
  font-family: var(--head);
  font-size: clamp(0.44rem, 1.2vw, 0.5rem);
  letter-spacing: 1px;
  margin-bottom: 8px;
}
.vs-card.def .who {
  color: var(--amethyst);
}
.vs-card.atk .who {
  color: var(--white);
}
.vs-card .tool-nm {
  font-size: clamp(0.85rem, 1.7vw, 0.98rem);
  font-weight: 700;
  line-height: 1.3;
}
.vs-card .tool-rt {
  font-family: var(--mono);
  font-size: clamp(0.85rem, 1.6vw, 1rem);
  margin-top: 6px;
  letter-spacing: 1px;
}
.vs-mid {
  font-family: var(--head);
  font-size: clamp(0.7rem, 1.6vw, 0.85rem);
  color: #000000;
}
.clash-verdict {
  flex: 0 0 auto;
  text-align: center;
  margin-top: var(--s2);
  min-height: clamp(38px, 7vh, 50px);
}
.clash-verdict .cv-head {
  font-family: var(--head);
  font-size: clamp(0.6rem, 1.5vw, 0.72rem);
  letter-spacing: 1px;
}
.clash-verdict .cv-reason {
  font-family: var(--body);
  font-size: clamp(0.8rem, 1.5vw, 0.9rem);
  color: var(--text-dim);
  margin-top: 5px;
  max-width: min(640px, 92vw);
  margin-left: auto;
  margin-right: auto;
  line-height: 1.4;
}
.clash-verdict .cv-pts {
  display: block;
  margin-top: 5px;
  font-family: var(--mono);
  font-size: clamp(0.78rem, 1.4vw, 0.9rem);
  color: var(--text-dim);
  letter-spacing: 1px;
}
.clash-verdict.secured .cv-head,
.clash-verdict.held .cv-head {
  color: var(--emerald);
}
.clash-verdict.breached .cv-head {
  color: var(--lava);
}
.clash-verdict.at_risk .cv-head {
  color: var(--gold);
}
.fx-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 8;
}
.particle {
  position: absolute;
  width: 8px;
  height: 8px;
  image-rendering: pixelated;
}
.skipbtn {
  flex: 0 0 auto;
  align-self: center;
  margin-top: var(--s2);
}
#resultSummary {
  flex: 1;
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 0;
  text-align: center;
  overflow-y: auto;
}
#resultSummary.show {
  display: flex;
}
.result-banner {
  margin: 0 0 var(--s2);
}
.result-banner .rb-icon {
  font-size: clamp(2rem, 5vw, 2.6rem);
}
.result-banner h2 {
  font-family: var(--head);
  font-size: clamp(0.72rem, 2.2vw, 1.05rem);
  line-height: 1.6;
  margin: var(--s2) 0 0;
  max-width: min(840px, 94vw);
}
.result-banner.blue h2 {
  color: var(--emerald);
}
.result-banner.red h2 {
  color: var(--lava);
}
.result-banner.draw h2 {
  color: var(--gold);
}
.win-line {
  font-family: var(--head);
  font-size: clamp(0.7rem, 2vw, 1rem);
  margin-top: var(--s2);
}
.win-line.blue {
  color: var(--emerald);
}
.win-line.red {
  color: var(--lava);
}
.win-line.draw {
  color: var(--gold);
}
.why {
  max-width: min(760px, 94vw);
  margin: var(--s2) auto 0;
  padding: var(--s2) var(--s3);
  border-left: 5px solid var(--bnd);
  background: rgba(11, 45, 113, 0.12);
  text-align: left;
  line-height: 1.55;
  font-size: clamp(0.84rem, 1.6vw, 0.96rem);
}
.duel {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: var(--s3);
  align-items: center;
  margin: var(--s3) 0 var(--s2);
  width: 100%;
  max-width: min(560px, 94vw);
}
@media (max-width: 520px) {
  .duel {
    grid-template-columns: 1fr;
  }
}
.duel .side {
  padding: var(--s3);
  text-align: center;
  border: var(--border) solid var(--bnd-box);
}
.duel .side.blue {
  background: var(--blue-d);
}
.duel .side.red {
  background: var(--red-d);
}
.duel .side .nm {
  font-family: var(--head);
  font-size: clamp(0.5rem, 1.3vw, 0.56rem);
  letter-spacing: 1px;
}
.duel .side.blue .nm {
  color: var(--amethyst);
}
.duel .side.red .nm {
  color: var(--white);
}
.duel .side .sc {
  font-family: var(--head);
  font-size: clamp(1.3rem, 3.4vw, 1.6rem);
  margin-top: 8px;
}
.duel .orb {
  font-family: var(--head);
  font-size: clamp(0.65rem, 1.6vw, 0.75rem);
  color: #000000;
}
.foot {
  margin-top: var(--s3);
  display: flex;
  gap: var(--s3);
  justify-content: center;
  flex-wrap: wrap;
}

/* ---- ANALYSIS (winners + node cards + team leaderboard) ---- */
.an-shell {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.an-hd {
  flex: 0 0 auto;
  text-align: center;
  margin-bottom: var(--s2);
}
.an-hd h2 {
  font-family: var(--head);
  font-size: clamp(0.68rem, 1.9vw, 0.82rem);
  margin: 0 0 4px;
  color: #000000;
}
.an-hd .win {
  font-family: var(--head);
  font-size: clamp(0.6rem, 1.6vw, 0.74rem);
}
.an-hd .win.blue {
  color: var(--emerald);
}
.an-hd .win.red {
  color: var(--lava);
}
.an-hd .win.draw {
  color: var(--gold);
}
.an-hd .an-verdict {
  display: inline-block;
  font-family: var(--head);
  font-size: clamp(0.52rem, 1.4vw, 0.62rem);
  letter-spacing: 2px;
  padding: 0.45em 0.8em;
  border: var(--border) solid var(--bnd-box);
  margin: 0 0 6px;
}
.an-hd .an-verdict.v-fully-defended {
  color: #000000;
  background: var(--blue-d);
}
.an-hd .an-verdict.v-contained {
  color: var(--gold);
  background: var(--blue-d);
}
.an-hd .an-verdict.v-compromised {
  color: var(--white);
  background: var(--red-d);
}
.an-mid {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s3);
}
.an-left {
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.an-h {
  font-family: var(--head);
  font-size: clamp(0.46rem, 1.2vw, 0.52rem);
  color: var(--text-dim);
  letter-spacing: 1px;
  margin: 0 0 var(--s2);
}
.an-hint {
  font-family: var(--mono);
  font-size: clamp(0.8rem, 1.5vw, 0.92rem);
  color: var(--text-dim);
  margin: 0 0 var(--s2);
}
.an-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: var(--s2);
  min-height: 0;
}
.an-card {
  border: var(--border) solid var(--bnd-box);
  background: var(--blue-d);
  padding: var(--s2);
  cursor: pointer;
  text-align: center;
  transition:
    transform 0.08s,
    box-shadow 0.15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.an-card:hover {
  transform: translateY(-3px);
}
.an-card .ac-ico {
  font-size: clamp(20px, 3.4vmin, 26px);
}
.an-card .ac-name {
  font-family: var(--mono);
  font-size: clamp(0.78rem, 1.4vw, 0.88rem);
  line-height: 1.1;
  color: #000000;
}
.an-card .ac-pill {
  font-family: var(--head);
  font-size: clamp(0.4rem, 1vw, 0.46rem);
  letter-spacing: 1px;
  padding: 0.4em 0.5em;
  border: 2px solid var(--bnd-box);
}
.an-card.breached {
  border-color: var(--lava);
}
.an-card.breached .ac-pill {
  color: var(--white);
  background: var(--red-d);
}
.an-card.secured {
  border-color: var(--emerald);
}
.an-card.secured .ac-pill {
  color: #000000;
  background: var(--blue-d);
}
.an-card.held {
  border-color: var(--emerald-hl, var(--emerald));
}
.an-card.held .ac-pill {
  color: #000000;
  background: var(--blue-d);
}
.an-card.at_risk {
  border-color: var(--gold);
}
.an-card.at_risk .ac-pill {
  color: var(--gold);
  background: var(--blue-d);
}
.an-card .ac-tap {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-dim);
}
/* expanded detail panel below cards */
.an-detail {
  margin-top: var(--s2);
  border: var(--border) solid var(--bnd-box);
  background: var(--blue-d);
  padding: var(--s3);
  min-height: clamp(120px, 20vh, 180px);
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.an-detail.empty {
  border-color: var(--bnd-box);
  border-style: dashed;
  color: var(--text-dim);
  text-align: center;
  font-family: var(--mono);
  font-size: clamp(0.85rem, 1.6vw, 0.98rem);
}
.an-detail .ad-hd {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.an-detail .ad-ico {
  font-size: clamp(22px, 3.6vmin, 28px);
}
.an-detail .ad-node {
  font-family: var(--head);
  font-size: clamp(0.58rem, 1.5vw, 0.7rem);
}
.an-detail .ad-win {
  margin-left: auto;
  font-family: var(--head);
  font-size: clamp(0.5rem, 1.3vw, 0.58rem);
  letter-spacing: 1px;
  padding: 0.45em 0.6em;
  border: 2px solid var(--bnd-box);
}
.an-detail.breached .ad-win {
  color: var(--white);
  background: var(--red-d);
}
.an-detail.secured .ad-win,
.an-detail.held .ad-win {
  color: #000000;
  background: var(--blue-d);
}
.an-detail.at_risk .ad-win {
  color: var(--gold);
  background: var(--blue-d);
}
.an-detail .ad-plays {
  margin-top: var(--s2);
  font-size: clamp(0.82rem, 1.5vw, 0.92rem);
  line-height: 1.5;
  color: #000000;
}
.an-detail .ad-plays .ln {
  margin-bottom: 3px;
}
.an-detail .ad-pts {
  font-family: var(--mono);
  color: #000000;
  letter-spacing: 1px;
}
.an-detail .ad-reason {
  margin-top: var(--s2);
  font-size: clamp(0.84rem, 1.6vw, 0.96rem);
  line-height: 1.55;
  color: #000000;
  border-left: 4px solid var(--bnd);
  padding-left: var(--s2);
}
.an-detail .ad-why {
  margin-top: var(--s2);
  font-size: clamp(0.8rem, 1.5vw, 0.9rem);
  line-height: 1.5;
  color: #000000;
  border-left: 4px solid var(--bnd);
  padding-left: var(--s2);
}
.an-detail .ad-why b {
  color: #000000;
  font-family: var(--head);
  font-size: clamp(0.42rem, 1vw, 0.48rem);
  letter-spacing: 1px;
}
.ok-yes {
  color: var(--emerald);
  font-weight: 700;
}
.ok-no {
  color: var(--lava);
  font-weight: 700;
}
/* right: team leaderboard */
.an-right {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: var(--s2);
}
.bd {
  flex: 1 1 auto;
  border: var(--border) solid var(--bnd-box);
  background: var(--blue-d);
  padding: var(--s3);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.bd h4 {
  font-family: var(--head);
  font-size: clamp(0.5rem, 1.3vw, 0.58rem);
  letter-spacing: 1px;
  color: #000000;
  margin: 0 0 var(--s2);
}
.bd-side {
  margin-bottom: var(--s2);
  padding-left: var(--s2);
  border-left: 4px solid var(--stone);
}
.bd-side:last-child {
  margin-bottom: 0;
}
.bd-side.blue {
  border-left-color: var(--amethyst);
}
.bd-side.red {
  border-left-color: var(--lava);
}
.bd-hd {
  font-family: var(--head);
  font-size: clamp(0.44rem, 1.1vw, 0.5rem);
  letter-spacing: 1px;
  margin-bottom: 5px;
  display: flex;
  justify-content: space-between;
  gap: var(--s2);
}
.bd-side.blue .bd-hd {
  color: var(--amethyst);
}
.bd-side.red .bd-hd {
  color: var(--lava);
}
.bd-row {
  display: flex;
  justify-content: space-between;
  gap: var(--s2);
  font-family: var(--mono);
  font-size: clamp(0.82rem, 1.5vw, 0.94rem);
  color: #000000;
  letter-spacing: 1px;
}
.bd-row b {
  color: #000000;
}
.bd-row.neg b {
  color: var(--lava);
}
.lb {
  border: var(--border) solid var(--bnd-box);
  background: var(--blue-d);
  padding: var(--s3);
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}
.lb::-webkit-scrollbar {
  width: 10px;
}
.lb::-webkit-scrollbar-track {
  background: var(--blue-d);
}
.lb::-webkit-scrollbar-thumb {
  background: var(--stone);
  border: 2px solid var(--bnd);
}
.lb h4 {
  font-family: var(--head);
  font-size: clamp(0.5rem, 1.3vw, 0.58rem);
  letter-spacing: 1px;
  color: #000000;
  margin: 0 0 var(--s3);
}
.lb-row {
  display: flex;
  align-items: center;
  gap: var(--s2);
  padding: 0.55em 0;
  border-bottom: 2px solid var(--line);
}
.lb-row .rk {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  font-family: var(--head);
  font-size: 0.52rem;
  background: var(--stone-dk);
  border: 2px solid var(--bnd-box);
  flex: 0 0 auto;
}
.lb-row .rk.gold {
  background: linear-gradient(180deg, var(--gold), var(--blue-l));
  color: var(--blue-d);
}
.lb-row .tm {
  flex: 1;
}
.lb-row .tm .tnum {
  font-family: var(--head);
  font-size: clamp(0.55rem, 1.3vw, 0.64rem);
}
.lb-row .tm .trole {
  font-family: var(--mono);
  font-size: clamp(0.78rem, 1.4vw, 0.88rem);
  letter-spacing: 1px;
}
.lb-row .tm .trole.blue {
  color: var(--amethyst);
}
.lb-row .tm .trole.red {
  color: var(--lava);
}
.lb-row .sc {
  font-family: var(--head);
  font-size: clamp(0.6rem, 1.5vw, 0.72rem);
  color: #000000;
}
.an-foot {
  flex: 0 0 auto;
  text-align: center;
  margin-top: var(--s2);
}
