/* RatCTF Attack Views — player styles. Dark, self-contained, matches the OSCP views. */
.av {
  --av-bg: #0d1520; --av-card: #111c29; --av-line: #1f2d3d; --av-text: #e6edf3;
  --av-muted: #8b9bb0; --av-accent: #22c55e;
  background: var(--av-card); border: 1px solid var(--av-line); border-radius: 14px;
  padding: 18px 20px 16px; color: var(--av-text); outline: none; margin: 18px 0;
  font-family: inherit;
}
.av:focus-visible { box-shadow: 0 0 0 2px var(--av-accent); }
.av-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.av-title { margin: 0; font-size: 1.05rem; font-weight: 700; }
.av-hint { color: var(--av-muted); font-size: .8rem; }

.av-stage {
  position: relative; display: grid; gap: 34px 46px;
  grid-template-columns: repeat(var(--av-cols, 4), minmax(0, 1fr));
  grid-template-rows: repeat(var(--av-rows, 2), auto);
  padding: 8px 6px 18px;
}
.av-links { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; color: #33465c; overflow: visible; }
.av-link { stroke: #33465c; stroke-width: 1.6; stroke-dasharray: 5 5; transition: stroke .5s, color .5s; }
.av-link.is-lit { stroke: var(--av-accent); stroke-dasharray: none; color: var(--av-accent); }

.av-node {
  position: relative; z-index: 1; min-height: 58px; padding: 12px 12px 12px 14px;
  background: var(--av-bg); color: var(--av-text); border: 1.5px solid var(--c); border-radius: 10px;
  font: inherit; font-weight: 600; font-size: .86rem; text-align: center; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .35s ease, box-shadow .35s ease, opacity .35s ease, background .35s ease;
}
.av-node:hover { transform: translateY(-2px); }
.av-num {
  position: absolute; top: -10px; left: -10px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--c); color: #071018; font-size: .72rem; font-weight: 800;
  display: grid; place-items: center;
}
.av-node.is-active {
  background: color-mix(in srgb, var(--c) 16%, var(--av-bg));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 35%, transparent), 0 0 26px color-mix(in srgb, var(--c) 45%, transparent);
  transform: scale(1.04);
}
.av-node.is-active::after {
  content: ""; position: absolute; inset: -6px; border-radius: 13px; border: 2px solid var(--c);
  animation: av-pulse 1.6s ease-out infinite; pointer-events: none;
}
.av-node.is-done { opacity: .55; }
.av-node.is-done .av-num::after { content: "\2713"; position: absolute; inset: 0; display: grid; place-items: center; background: var(--c); border-radius: 50%; }

.av-panel { min-height: 132px; padding: 4px 4px 10px; }
.av-kicker { color: var(--av-muted); font-size: .72rem; letter-spacing: .12em; font-weight: 700; }
.av-step-title { margin: 4px 0 8px; font-size: 1rem; }
.av-points { margin: 0; padding-left: 18px; color: #c9d4e0; font-size: .88rem; line-height: 1.55; }
.av-in .av-points li { opacity: 0; animation: av-rise .45s ease forwards; }
.av-in .av-step-title { animation: av-rise .35s ease; }

.av-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 0 10px; }
.av-btn {
  background: #17212e; color: var(--av-text); border: 1px solid var(--av-line); border-radius: 8px;
  padding: 7px 12px; font: inherit; font-size: .82rem; font-weight: 600; cursor: pointer;
}
.av-btn:hover:not(:disabled) { border-color: var(--av-accent); }
.av-btn:disabled { opacity: .4; cursor: default; }
.av-play { background: var(--av-accent); color: #04130a; border-color: var(--av-accent); min-width: 88px; }
.av-play.is-on { background: #17212e; color: var(--av-accent); }
.av-bar { flex: 1 1 140px; height: 4px; background: #1f2d3d; border-radius: 4px; overflow: hidden; }
.av-fill { height: 100%; width: 0; background: linear-gradient(90deg, #22c55e, #f0c000); transition: width .12s linear; }
.av-speed { color: var(--av-muted); font-size: .8rem; display: flex; align-items: center; gap: 6px; }
.av-speed select { background: #17212e; color: var(--av-text); border: 1px solid var(--av-line); border-radius: 6px; padding: 4px 6px; }

.av-chips { display: flex; flex-wrap: wrap; gap: 6px; border-top: 1px solid var(--av-line); padding-top: 10px; }
.av-chip {
  background: transparent; color: var(--av-muted); border: 1px solid var(--av-line); border-radius: 6px;
  padding: 4px 8px; font: inherit; font-size: .72rem; cursor: pointer; font-family: ui-monospace, Menlo, Consolas, monospace;
}
.av-chip.is-active { color: var(--av-text); border-color: var(--av-accent); background: rgba(34,197,94,.08); }
.av-foot { margin: 12px 0 0; color: var(--av-muted); font-size: .75rem; text-align: center; }

@keyframes av-pulse { from { opacity: .9; transform: scale(1); } to { opacity: 0; transform: scale(1.08); } }
@keyframes av-rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

@media (max-width: 720px) {
  .av-stage { grid-template-columns: 1fr 1fr !important; grid-template-rows: none !important; gap: 22px 18px; }
  .av-node { grid-column: auto !important; grid-row: auto !important; }
  .av-links { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .av-node, .av-node.is-active { transition: none; transform: none; }
  .av-node.is-active::after, .av-in .av-points li, .av-in .av-step-title { animation: none; opacity: 1; }
}
