:root {
  --bg: #0a0e16;
  --bg-soft: #0f1522;
  --surface: #141c2b;
  --surface-2: #1b2537;
  --border: #263349;
  --border-soft: #1d2739;
  --text: #e8eefb;
  --muted: #90a2c0;
  --muted-dim: #64748b;
  --accent: #6ea8fe;
  --accent-dim: #3b6cb8;
  --swap: #fbbf24;
  --swap-deep: #b45309;
  --win: #4ade80;
  --loss: #f87171;
  --sq-light: #ccd6e5;
  --sq-dark: #62779a;
  --radius: 14px;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  background:
    radial-gradient(1100px 700px at 78% -12%, rgba(110, 168, 254, 0.12), transparent 62%),
    radial-gradient(900px 620px at 12% 108%, rgba(251, 191, 36, 0.09), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* `display` in the rules below would otherwise beat the UA's [hidden] rule. */
[hidden] { display: none !important; }

/* ----------------------------------------------------------- controls -- */

.btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  padding: 11px 18px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.08s;
}
.btn:hover { background: #223049; border-color: #35476a; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn.primary {
  background: linear-gradient(180deg, #6ea8fe, #4a86e8);
  border-color: #5b93e6;
  color: #06111f;
}
.btn.primary:hover { background: linear-gradient(180deg, #85b6ff, #5a92ee); }

.btn.ghost { background: transparent; }
.btn.ghost:hover { background: rgba(255, 255, 255, 0.05); }
.btn.danger { color: #fca5a5; border-color: #45283a; }
.btn.danger:hover { background: #2c1a26; border-color: #6b3247; }
.btn.small { padding: 7px 12px; font-size: 13px; }

.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.field label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.field label output { color: var(--swap); font-variant-numeric: tabular-nums; }

input[type="text"] {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font: inherit;
  padding: 11px 13px;
  width: 100%;
}
input[type="text"]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(110, 168, 254, 0.16); }
#code { text-transform: uppercase; letter-spacing: 0.28em; font-family: "JetBrains Mono", ui-monospace, monospace; font-weight: 600; }

input[type="range"] {
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--swap-deep), var(--swap));
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--swap);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}
input[type="range"]::-moz-range-thumb {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--swap);
  cursor: pointer;
}

.hint { color: var(--muted-dim); font-size: 12.5px; margin: 0; font-weight: 500; letter-spacing: normal; text-transform: none; }
.error { color: #fca5a5; background: rgba(248, 113, 113, 0.1); border: 1px solid rgba(248, 113, 113, 0.28); padding: 9px 12px; border-radius: 9px; font-size: 13.5px; margin: 12px 0 0; }

/* -------------------------------------------------------------- lobby -- */

#lobby {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 32px 20px 56px;
}

.lobby-card {
  width: min(860px, 100%);
  background: linear-gradient(180deg, rgba(20, 28, 43, 0.94), rgba(15, 21, 34, 0.94));
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 40px;
  box-shadow: var(--shadow);
}

.brand { text-align: center; margin-bottom: 30px; }
.brand-mark { font-size: 46px; line-height: 1; letter-spacing: -0.12em; }
.brand-mark .mark-w { color: #fff; text-shadow: 0 2px 10px rgba(110, 168, 254, 0.5); }
.brand-mark .mark-b { color: var(--swap); text-shadow: 0 2px 10px rgba(251, 191, 36, 0.4); }
.brand-mark.small { font-size: 22px; }

.brand h1 {
  font-size: 38px;
  font-weight: 800;
  letter-spacing: -0.028em;
  margin: 10px 0 8px;
  background: linear-gradient(100deg, #fff 18%, var(--swap) 92%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.tagline { color: var(--muted); max-width: 56ch; margin: 0 auto; }

.lobby-actions {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 26px;
  align-items: start;
  margin-top: 26px;
}
.lobby-panel {
  background: rgba(10, 14, 22, 0.55);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 20px;
}
.lobby-panel h2 { font-size: 14px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); margin: 0 0 16px; }
.lobby-panel .btn { width: 100%; }

.divider { display: grid; place-items: center; align-self: stretch; position: relative; color: var(--muted-dim); font-size: 12px; }
.divider::before { content: ""; position: absolute; inset: 0 50% 0 50%; border-left: 1px solid var(--border-soft); }
.divider span { position: relative; background: var(--surface); padding: 6px 4px; border-radius: 6px; }

.rules { margin-top: 26px; border-top: 1px solid var(--border-soft); padding-top: 18px; }
.rules summary { cursor: pointer; color: var(--muted); font-weight: 600; font-size: 14px; }
.rules summary:hover { color: var(--text); }
.rules ul { color: var(--muted); font-size: 14px; margin: 14px 0 0; padding-left: 20px; }
.rules li { margin-bottom: 9px; }
.rules strong { color: var(--swap); }
.rules em { color: var(--text); font-style: italic; }

/* ------------------------------------------------------------ topbar --- */

#game { min-height: 100%; display: flex; flex-direction: column; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-soft);
  background: rgba(10, 14, 22, 0.7);
  backdrop-filter: blur(10px);
}
.topbar-left { display: flex; align-items: center; gap: 10px; letter-spacing: -0.01em; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
#room-code { font-family: "JetBrains Mono", monospace; letter-spacing: 0.16em; color: var(--swap); font-weight: 600; }

.conn { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); }
.conn[data-state="online"] { color: var(--win); border-color: rgba(74, 222, 128, 0.3); background: rgba(74, 222, 128, 0.08); }
.conn[data-state="offline"] { color: var(--loss); border-color: rgba(248, 113, 113, 0.3); background: rgba(248, 113, 113, 0.08); }

/* ------------------------------------------------------------ layout --- */

.layout {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 26px;
  padding: 22px;
  max-width: 1240px;
  width: 100%;
  margin: 0 auto;
  align-items: start;
}

.board-area { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.board-wrap {
  position: relative;
  width: min(72vh, 100%);
  aspect-ratio: 1;
}

/* ------------------------------------------------------------- board --- */

.board {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(8, 1fr);
  width: 100%;
  height: 100%;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.06);
  transition: rotate 0.75s cubic-bezier(0.62, 0.02, 0.34, 1);
  rotate: 0deg;
}
.board.flipped { rotate: 180deg; }

/* Pull the board in while it turns so the corners stay off the chrome. */
.board.swapping { animation: board-dip 0.75s cubic-bezier(0.62, 0.02, 0.34, 1); }
@keyframes board-dip {
  0%, 100% { scale: 1; }
  45% { scale: 0.72; }
}

.square {
  position: relative;
  display: grid;
  place-items: center;
  user-select: none;
}
.square.light { background: var(--sq-light); }
.square.dark { background: var(--sq-dark); }

.coord {
  position: absolute;
  font-size: clamp(8px, 1.1vh, 11px);
  font-weight: 700;
  opacity: 0.55;
  transition: rotate 0.75s cubic-bezier(0.62, 0.02, 0.34, 1);
}
.coord.rank { top: 3px; left: 4px; }
.coord.file { bottom: 2px; right: 5px; }
.square.light .coord { color: var(--sq-dark); }
.square.dark .coord { color: var(--sq-light); }
.board.flipped .coord { rotate: 180deg; }

.piece {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font-size: clamp(22px, 6.2vh, 58px);
  line-height: 1;
  transition: rotate 0.75s cubic-bezier(0.62, 0.02, 0.34, 1);
  pointer-events: none;
}
.board.flipped .piece { rotate: 180deg; }
.board.interactive .piece { cursor: grab; }

.piece.white {
  color: #fdfdfd;
  -webkit-text-stroke: 1.6px #10151f;
  paint-order: stroke fill;
  text-shadow: 0 3px 5px rgba(0, 0, 0, 0.42);
}
.piece.black {
  color: #171d29;
  -webkit-text-stroke: 1.2px #05080e;
  paint-order: stroke fill;
  text-shadow: 0 3px 5px rgba(0, 0, 0, 0.3);
}
.piece.dragging { opacity: 0.28; }

.piece.ghost {
  position: fixed;
  z-index: 999;
  transform: translate(-50%, -50%);
  pointer-events: none;
  filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.55));
  transition: none;
}

.square.last-from::before,
.square.last-to::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(251, 191, 36, 0.34);
}
.square.selected::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(110, 168, 254, 0.45);
  box-shadow: inset 0 0 0 3px rgba(110, 168, 254, 0.85);
}
.square.move-target::after {
  content: "";
  position: absolute;
  width: 30%;
  height: 30%;
  border-radius: 50%;
  background: rgba(10, 16, 28, 0.34);
  z-index: 1;
}
.square.capture-target::after {
  content: "";
  position: absolute;
  inset: 6%;
  border-radius: 50%;
  border: 5px solid rgba(10, 16, 28, 0.34);
  z-index: 1;
}
.square.in-check::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(248, 113, 113, 0.95) 12%, rgba(248, 113, 113, 0.35) 46%, transparent 72%);
}

/* ------------------------------------------------------ player strips -- */

.player-strip { width: min(72vh, 100%); }
.chip {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border-radius: 11px;
  border: 1px solid var(--border-soft);
  background: var(--surface);
  transition: border-color 0.35s, background 0.35s, box-shadow 0.35s, transform 0.35s;
}
.chip.empty { color: var(--muted-dim); justify-content: center; font-style: italic; }
.chip-piece { font-size: 20px; line-height: 1; }
.chip.as-white .chip-piece { color: #fff; -webkit-text-stroke: 1px #10151f; paint-order: stroke fill; }
.chip.as-black .chip-piece { color: #1b2231; -webkit-text-stroke: 1px #000; paint-order: stroke fill; }
.chip-name { font-weight: 600; flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-name em { color: var(--muted-dim); font-weight: 500; font-style: normal; }
.chip-color {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
}
.chip.as-white .chip-color { background: #e9eefa; color: #10151f; }
.chip.as-black .chip-color { background: #1b2231; color: #b9c6dd; border: 1px solid #333f57; }
/* Captured pieces sit between the name and the colour badge, stacked the way
   a chess site stacks them: overlapping within a type, a gap between types. */
.chip-captures {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  overflow: hidden;
  line-height: 1;
}
.cap {
  font-size: 21px;
  line-height: 1;
  margin-left: -4px;
  flex: none;
}
.cap:first-child { margin-left: 0; }
.cap.cap-break { margin-left: 5px; }
/* Each colour is outlined in the opposite tone, so both stay legible against
   the dark chip -- an unoutlined black piece all but disappears here. */
.cap.white { color: #f2f6fd; -webkit-text-stroke: 1px #0d1320; paint-order: stroke fill; }
.cap.black { color: #141d2c; -webkit-text-stroke: 1px #8095b4; paint-order: stroke fill; }
.chip-lead {
  flex: none;
  margin-left: 7px;
  font-size: 12px;
  font-weight: 700;
  color: var(--swap);
  font-variant-numeric: tabular-nums;
}

/* Whose turn it is: a lit border, a breathing glow, and a slow sheen. */
.chip.active {
  border-color: var(--accent);
  background: linear-gradient(90deg, rgba(110, 168, 254, 0.16), rgba(110, 168, 254, 0.05) 45%, var(--surface));
  transform: translateY(-1px);
  animation: chip-glow 2.4s ease-in-out infinite;
}
.chip.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--accent), #a3c9ff);
  box-shadow: 0 0 12px rgba(110, 168, 254, 0.85);
}
.chip.active::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(100deg, transparent 22%, rgba(160, 200, 255, 0.13) 47%, transparent 72%);
  background-size: 260% 100%;
  animation: chip-sheen 3.4s linear infinite;
}
@keyframes chip-glow {
  0%, 100% { box-shadow: 0 0 0 1px rgba(110, 168, 254, 0.4), 0 0 16px rgba(110, 168, 254, 0.14); }
  50% { box-shadow: 0 0 0 1px rgba(110, 168, 254, 0.8), 0 0 32px rgba(110, 168, 254, 0.32); }
}
@keyframes chip-sheen {
  from { background-position: 170% 0; }
  to { background-position: -70% 0; }
}
.chip.offline { opacity: 0.55; }
.chip-flag { font-size: 11px; color: var(--loss); font-weight: 600; }

/* -------------------------------------------------------- swap flash --- */

.swap-flash {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 20;
  pointer-events: none;
  border-radius: 10px;
  overflow: hidden;
}
.swap-flash.run { animation: swap-veil 1.6s ease-out forwards; }
.swap-flash-inner {
  text-align: center;
  transform: scale(0.6);
  opacity: 0;
}
.swap-flash.run .swap-flash-inner { animation: swap-pop 1.6s cubic-bezier(0.2, 1.5, 0.4, 1) forwards; }
.swap-word {
  display: block;
  font-size: clamp(38px, 9vh, 84px);
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #fff;
  text-shadow: 0 0 26px rgba(251, 191, 36, 0.95), 0 4px 16px rgba(0, 0, 0, 0.75);
}
.swap-detail {
  display: block;
  margin-top: 6px;
  font-size: clamp(13px, 2.2vh, 18px);
  font-weight: 600;
  color: #ffe9b3;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}
@keyframes swap-veil {
  0% { background: rgba(251, 191, 36, 0); }
  14% { background: rgba(251, 191, 36, 0.5); }
  55% { background: rgba(10, 14, 22, 0.5); }
  100% { background: rgba(10, 14, 22, 0); }
}
@keyframes swap-pop {
  0% { transform: scale(0.55) rotate(-6deg); opacity: 0; }
  18% { transform: scale(1.08) rotate(2deg); opacity: 1; }
  30% { transform: scale(1) rotate(0deg); opacity: 1; }
  76% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.06); opacity: 0; }
}

/* ----------------------------------------------------------- overlay --- */

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(6, 9, 15, 0.82);
  backdrop-filter: blur(4px);
  border-radius: 10px;
  z-index: 30;
}
.overlay-card { text-align: center; padding: 26px; max-width: 340px; }
.overlay-card h2 { font-size: 34px; font-weight: 800; margin: 0 0 8px; letter-spacing: -0.02em; }
.overlay-card h2.win { color: var(--win); }
.overlay-card h2.loss { color: var(--loss); }
.overlay-card h2.draw { color: var(--muted); }
.overlay-card p { color: var(--muted); margin: 0 0 20px; }
.overlay-actions { display: flex; gap: 10px; justify-content: center; }
#rematch-status { margin-top: 14px; min-height: 18px; color: var(--swap); }

/* ------------------------------------------------------------- panel --- */

.panel {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: sticky;
  top: 22px;
}

.turn-banner {
  padding: 12px 14px;
  border-radius: 10px;
  font-weight: 700;
  text-align: center;
  border: 1px solid var(--border);
  background: var(--surface-2);
  transition: background 0.3s, color 0.3s, border-color 0.3s;
}
.turn-banner.yours { background: rgba(110, 168, 254, 0.14); border-color: rgba(110, 168, 254, 0.5); color: #cfe1ff; }
.turn-banner.theirs { color: var(--muted); }
.turn-banner.idle { color: var(--muted-dim); font-weight: 600; }

.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat {
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: 9px 10px;
  text-align: center;
}
.stat-label { display: block; font-size: 9.5px; letter-spacing: 0.05em; white-space: nowrap; text-transform: uppercase; color: var(--muted-dim); font-weight: 700; }
.stat-value { display: block; font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 2px; }
#stat-swaps { color: var(--swap); }

.moves-head { display: flex; justify-content: space-between; align-items: center; }
.moves-head h2 { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 0; }
.toggle { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted-dim); cursor: pointer; user-select: none; }
.toggle input { accent-color: var(--accent); cursor: pointer; }

.moves {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  max-height: min(46vh, 380px);
  min-height: 120px;
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  scrollbar-width: thin;
}
.move {
  display: grid;
  grid-template-columns: 26px 20px 1fr auto;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  font-size: 13.5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}
.move-no { color: var(--muted-dim); font-size: 11px; font-variant-numeric: tabular-nums; }
.move-piece { font-size: 14px; }
.move.by-white .move-piece { color: #fff; -webkit-text-stroke: 0.8px #10151f; paint-order: stroke fill; }
.move.by-black .move-piece { color: #29344a; -webkit-text-stroke: 0.8px #000; paint-order: stroke fill; }
.move-san { font-family: "JetBrains Mono", monospace; font-weight: 600; }
.move-by { color: var(--muted-dim); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 84px; }

.swap-marker {
  display: flex;
  justify-content: center;
  padding: 4px 8px;
  background: linear-gradient(90deg, transparent, rgba(251, 191, 36, 0.16), transparent);
}
.swap-marker span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--swap);
}

.panel-actions { display: flex; gap: 8px; }
.panel-actions .btn { flex: 1; }

/* --------------------------------------------------------- promotion -- */

.promotion {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(6, 9, 15, 0.7);
  backdrop-filter: blur(3px);
  z-index: 100;
}
.promo-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  box-shadow: var(--shadow);
}
.promo-card h3 { margin: 0 0 14px; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.promo-options { display: flex; gap: 8px; margin-bottom: 14px; }
.promo-option {
  width: 64px;
  height: 64px;
  font-size: 40px;
  line-height: 1;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--sq-light);
  cursor: pointer;
  transition: transform 0.12s, border-color 0.12s;
}
.promo-option:hover { transform: translateY(-3px); border-color: var(--accent); }
.promo-option.white { color: #fdfdfd; -webkit-text-stroke: 1.6px #10151f; paint-order: stroke fill; }
.promo-option.black { color: #171d29; -webkit-text-stroke: 1.2px #05080e; paint-order: stroke fill; }

/* ------------------------------------------------------------- toast --- */

.toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: var(--shadow);
  z-index: 200;
}

/* -------------------------------------------------------- responsive -- */

@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; padding: 14px; }
  .panel { position: static; }
  .board-wrap, .player-strip { width: min(94vw, 560px); }
  .moves { max-height: 220px; }
}

@media (max-width: 720px) {
  .lobby-card { padding: 26px 20px; }
  .lobby-actions { grid-template-columns: 1fr; gap: 14px; }
  .divider::before { inset: 50% 0 50% 0; border-left: none; border-top: 1px solid var(--border-soft); }
  .brand h1 { font-size: 30px; }
}

@media (prefers-reduced-motion: reduce) {
  .board, .piece, .coord { transition-duration: 0.01ms; }
  .board.swapping { animation: none; }
  .chip.active { animation: none; box-shadow: 0 0 0 1px rgba(110, 168, 254, 0.7), 0 0 22px rgba(110, 168, 254, 0.2); }
  .chip.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--accent), #a3c9ff);
  box-shadow: 0 0 12px rgba(110, 168, 254, 0.85);
}
.chip.active::after { animation: none; background: none; }
  .swap-flash.run, .swap-flash.run .swap-flash-inner { animation-duration: 0.9s; }
}
