/* ==========================================================================
   Abande replay — nestorgames warm-gray table + light-blue hex
   ========================================================================== */

.retro-match-replay--abande .retro-match-replay__board-host {
  container-type: inline-size;
  position: relative;
  width: 100%;
  aspect-ratio: 1/1;
  margin-inline: auto;
  overflow: hidden;
  background:
    radial-gradient(circle at 48% 42%, #f7f3ed 0%, #efe9e1 42%, #e6dfd5 78%, #ddd5cb 100%);
  --abande-piece-size: 8.2cqw;
  --abande-stack-rise: 1.2cqw;
}

.retro-match-replay--abande .retro-match-replay__board-stage,
.retro-match-replay--abande .retro-match-replay__grid,
.retro-match-replay--abande .retro-match-replay__axis-labels,
.retro-match-replay--abande .retro-match-replay__cells {
  position: absolute;
  inset: 0;
}

.retro-match-replay--abande .retro-match-replay__grid {
  pointer-events: none;
  z-index: 1;
}

.retro-match-replay--abande .retro-match-replay__axis-labels {
  pointer-events: none;
  z-index: 1;
}

.retro-match-replay--abande .retro-match-replay__playable-area {
  fill: #c5d6e6;
  stroke: rgba(90, 105, 120, 0.55);
  stroke-width: 0.45;
}

.retro-match-replay--abande .retro-match-replay__axis-label {
  position: absolute;
  font-family: var(--retro-sans);
  font-weight: 700;
  font-size: 1.2rem;
  line-height: 1;
  letter-spacing: 0.01em;
  color: #22190f;
  white-space: nowrap;
}

.retro-match-replay--abande .retro-match-replay__axis-label--left {
  transform: translate(calc(-100% - 5cqw), -50%);
}

.retro-match-replay--abande .retro-match-replay__axis-label--right {
  transform: translate(5cqw, -50%);
}

.retro-match-replay--abande .retro-match-replay__grid line {
  stroke: rgba(70, 82, 96, 0.55);
  stroke-width: 0.32;
}

.retro-match-replay--abande .retro-match-replay__node {
  fill: rgba(55, 65, 78, 0.45);
}

.retro-match-replay--abande .retro-match-replay__cells {
  z-index: 2;
}

.retro-match-replay--abande.is-exploring .retro-match-replay__cells {
  cursor: pointer;
}

.retro-match-replay--abande .retro-match-replay__cell {
  position: absolute;
  width: 0;
  height: 0;
  transform: translate(-50%, -50%);
}

.retro-match-replay--abande .retro-match-replay__cell::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: var(--abande-piece-size);
  height: var(--abande-piece-size);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  box-sizing: border-box;
  pointer-events: auto;
}

.retro-match-replay--abande.is-exploring .retro-match-replay__cell.is-legal::before {
  box-shadow: 0 0 0 3px  rgba(255, 214, 90, 0.98);
  background: rgba(245, 230, 160, 0.18);
}

.retro-match-replay--abande.is-exploring .retro-match-replay__cell.is-selected::before {
  box-shadow: 0 0 0 4px rgba(255, 197, 90, 0.98);
  background: rgba(255, 214, 90, 0.28);
}

.retro-match-replay--abande .retro-match-replay__stack {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.retro-match-replay--abande .retro-match-replay__reserve {
  position: absolute;
  z-index: 3;
  width: var(--abande-piece-size);
  height: var(--abande-piece-size);
  pointer-events: auto;
  cursor: help;
}

.retro-match-replay--abande .retro-match-replay__reserve--b {
  top: 3.5%;
  left: 3.5%;
}

.retro-match-replay--abande .retro-match-replay__reserve--w {
  right: 3.5%;
  bottom: 3.5%;
}

.retro-match-replay--abande .retro-match-replay__score-ring {
  position: absolute;
  z-index: 3;
  width: var(--abande-piece-size);
  height: var(--abande-piece-size);
  border-radius: 50%;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  cursor: help;
  background: transparent;
}

.retro-match-replay--abande .retro-match-replay__score-ring--b {
  top: calc(3.5% + var(--abande-piece-size) + 1.4%);
  left: 3.5%;
}

.retro-match-replay--abande .retro-match-replay__score-ring--w {
  right: 3.5%;
  bottom: calc(3.5% + var(--abande-piece-size) + 1.4%);
}

.retro-match-replay--abande .retro-match-replay__score-ring-count {
  font-family: var(--retro-sans);
  font-weight: 700;
  font-size: 5.5cqw;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: #3a3228;
}

.retro-match-replay--abande .retro-match-replay__piece {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--abande-piece-size);
  height: var(--abande-piece-size);
  transform: translate(-50%, calc(-50% - (var(--abande-stack-z, 0) * var(--abande-stack-rise))));
  border-radius: 50%;
  box-sizing: border-box;
  border: 2px solid #1a1a1a;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.22) inset,
    0 0.16rem 0.4rem rgba(20, 16, 8, 0.28);
  z-index: calc(1 + var(--abande-stack-z, 0));
}

/* Cream / ivory — nestorgames light discs */
.retro-match-replay--abande .retro-match-replay__piece--w {
  background: linear-gradient(165deg, #fff8ea 0%, #f0e2c4 48%, #dcc9a0 100%);
  border-color: #3a3228;
}

/* Dark walnut / near-black — nestorgames dark discs */
.retro-match-replay--abande .retro-match-replay__piece--b {
  background: linear-gradient(165deg, #3a322c 0%, #1c1612 55%, #0e0b09 100%);
  border: none;
}

.retro-match-replay--abande .retro-match-replay__piece.retro-match-replay__piece--stock {
  left: 50%;
  top: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.retro-match-replay--abande .retro-match-replay__stock-count {
  font-family: var(--retro-sans);
  font-weight: 700;
  font-size: 4cqw;
  line-height: 1;
}

.retro-match-replay--abande .retro-match-replay__piece--w .retro-match-replay__stock-count {
  color: #3a3228;
}

.retro-match-replay--abande .retro-match-replay__piece--b .retro-match-replay__stock-count {
  color: #f3ece2;
}

.retro-match-replay--abande .retro-match-replay__stack--flying {
  --fly-ms: 420ms;
  --fly-arc: 18px;
  --fly-lift: 0px;
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  pointer-events: none;
  z-index: 40;
  transform: translate(-50%, calc(-50% + var(--fly-lift)));
  transition:
    left var(--fly-ms) ease-in-out,
    top var(--fly-ms) ease-in-out,
    opacity var(--fly-ms) ease-in-out,
    transform var(--fly-ms) ease-in-out;
}

.retro-match-replay--abande .retro-match-replay__stack--flying.is-flying {
  animation: retro-abande-fly var(--fly-ms) ease-in-out;
}

.retro-match-replay--abande .retro-match-replay__stack--flying.is-placing {
  animation: none;
}

.retro-match-replay--abande .retro-match-replay__stack--flying .retro-match-replay__piece {
  /* Keep stack rise relative to flyer origin while in flight. */
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.22) inset,
    0 0.22rem 0.55rem rgba(20, 16, 8, 0.35);
}

@keyframes retro-abande-fly {
  0%,
  100% {
    --fly-lift: 0px;
  }
  50% {
    --fly-lift: calc(-1 * var(--fly-arc));
  }
}

@media (prefers-reduced-motion: reduce) {
  .retro-match-replay--abande .retro-match-replay__stack--flying {
    transition: none;
    animation: none;
  }
}

@media (max-width: 720px) {
  .retro-match-replay--abande .retro-match-replay__board-host {
    --abande-piece-size: 9.2cqw;
  }

  .retro-match-replay--abande .retro-match-replay__axis-label {
    font-size: 0.8rem;
  }

  .retro-match-replay--abande .retro-match-replay__piece--w {
    border: 1px solid #1a1a1a;
  }

  .retro-match-replay--abande .retro-match-replay__piece--b {
    border: none;
  }
}
