/* ─── Gamex: Archon varX (js/gamex_archon_varx.js) ─────────────────── */
.av-pick[hidden], .av-play[hidden] { display: none; }
/* The selected piece's stats: always one line tall, so the board never jumps. */
.av-sel {
  min-height: 1.6em;
  margin: 0 0 8px;
  font-family: var(--sans);
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-dim);
}
.av-sel strong { color: var(--gold-lt); font-weight: 600; }
.av-sel-glyph { margin-right: 6px; }
.av-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 11rem;
  gap: 14px;
  align-items: start;
}
.av-board {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  grid-template-rows: repeat(9, minmax(0, 1fr));
  width: min(100%, 36rem);
  aspect-ratio: 1;
  border: 2px solid var(--gold-dim);
  border-radius: 4px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  user-select: none;
}
.av-sq {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 0;
  border: 0;
  cursor: default;
  transition: background-color 0.6s ease;
}
.av-sq.is-pick, .av-sq.is-target, .av-sq.is-attack { cursor: pointer; }
.av-sq:focus-visible { outline: 2px solid var(--gold-lt); outline-offset: -2px; z-index: 1; }
.av-sq.is-last { box-shadow: inset 0 0 0 2px rgba(212, 160, 23, 0.6); }
.av-sq.is-sel { box-shadow: inset 0 0 0 3px var(--gold-lt); }
/* Power points: a pulsing red ring under whatever stands there. */
.av-sq.is-pp::before {
  content: "";
  position: absolute;
  inset: 12%;
  border: 2px solid #e0302a;
  border-radius: 50%;
  animation: av-pulse 1.6s ease-in-out infinite;
  pointer-events: none;
}
@keyframes av-pulse { 50% { opacity: 0.25; } }
@media (prefers-reduced-motion: reduce) { .av-sq.is-pp::before { animation: none; } }
.av-sq.is-target::after,
.av-sq.is-attack::after {
  content: "";
  position: absolute;
  width: 28%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(255, 215, 0, 0.75);
  pointer-events: none;
}
.av-sq.is-attack::after {
  width: 86%;
  background: none;
  border: 3px solid #ff4d3d;
}
.av-coord {
  position: absolute;
  font-family: var(--sans);
  font-size: 0.55rem;
  line-height: 1;
  pointer-events: none;
}
.av-sq.is-dim .av-coord { color: rgba(255, 255, 255, 0.5); }
.av-sq.is-bright .av-coord { color: rgba(0, 0, 0, 0.5); }
.av-coord--row { top: 2px; left: 2px; }
.av-coord--col { bottom: 2px; right: 3px; }

.av-piece {
  position: relative;
  width: 78%;
  aspect-ratio: 1;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(0.8rem, 3.4vw, 1.45rem);
  line-height: 1;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.55);
}
.av-piece.is-light { background: radial-gradient(circle at 35% 30%, #ffe27a, #b8860b 75%); border: 2px solid #fff3b0; }
.av-piece.is-dark  { background: radial-gradient(circle at 35% 30%, #b07cff, #3b1466 75%); border: 2px solid #d7b8ff; }
.av-piece.is-jailed { outline: 3px dashed #cfcfcf; outline-offset: -1px; filter: grayscale(0.6); }
.av-sq.is-pick .av-piece { box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.55), 0 3px 6px rgba(0, 0, 0, 0.55); }
.av-hp {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: -3px;
  height: 4px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 2px;
  overflow: hidden;
}
.av-hp > span { display: block; height: 100%; background: #4cd964; transition: width 0.3s ease; }
.av-wound {
  position: absolute;
  right: -4px;
  bottom: -4px;
  font-family: var(--sans);
  font-size: 0.55rem;
  background: #7a1010;
  color: #fff;
  border-radius: 6px;
  padding: 0 3px;
}

.av-side { display: flex; flex-direction: column; gap: 14px; }
.av-side > div { display: flex; flex-direction: column; gap: 6px; }
.av-side-title {
  font-family: var(--sans);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
}
.av-side-note { font-size: 0.85rem; color: var(--text-dim); }
.av-swatches { display: flex; gap: 3px; }
.av-swatch { width: 20px; height: 14px; border: 1px solid var(--gold-dim); border-radius: 2px; }
.av-swatch.is-now { outline: 2px solid var(--gold-lt); outline-offset: 1px; }
.av-spell { padding: 4px 8px; font-size: 0.85rem; text-align: left; }
.av-log {
  margin: 10px 0 0;
  padding-left: 1.2rem;
  font-size: 0.85rem;
  color: var(--text-dim);
}

/* The duel overlay. */
.av-duel {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.7);
}
.av-duel[hidden] { display: none; }
.av-duel-box {
  width: min(100%, 34rem);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  background: var(--parchment);
  border: 1px solid var(--gold-dim);
  border-radius: 6px;
  box-shadow: var(--shadow);
}
.av-duel-title { margin: 0; font-family: var(--sans); color: var(--gold); }
.av-duel-fighters { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; }
.av-fighter { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.av-fighter-glyph { font-size: 2rem; }
.av-fighter.is-light .av-fighter-name { color: #ffe27a; }
.av-fighter.is-dark .av-fighter-name { color: #d7b8ff; }
.av-fighter.is-neutral .av-fighter-name { color: #9fd3ff; }
.av-hp--big { position: static; width: 100%; height: 8px; }
.av-duel-hp { font-family: var(--sans); font-size: 0.8rem; }
.av-vs { font-family: var(--sans); color: var(--text-dim); }
.av-duel-log {
  margin: 0;
  padding-left: 1.2rem;
  overflow-y: auto;
  min-height: 6rem;
  font-size: 0.85rem;
  color: var(--text-dim);
}
.av-duel-log .is-hit { color: var(--text); }
.av-duel-log .av-duel-end { color: var(--gold-lt); font-weight: 600; list-style: none; }

@media (max-width: 640px) {
  .av-layout { grid-template-columns: minmax(0, 1fr); }
  .av-side { flex-direction: row; flex-wrap: wrap; }
  .av-side > div { flex: 1 1 9rem; }
}
