/* ==========================================================================
   PoodleChess Unified Board Core (poodle-board-core.css)
   100% Authentic PoodleChess aesthetics from Analysis & Puzzles.
   Lichess-style piece selection & drag physics + Snappy 80-110ms GPU motion.
   ========================================================================== */

:root {
  --sq-light: #f0d9b5;
  --sq-dark: #b58863;
  --sq-last-move: rgba(155, 199, 0, 0.42);
  --sq-selected: rgba(224, 152, 74, 0.48);
  --sq-target-dot: rgba(0, 0, 0, 0.22);
  --sq-target-hover: rgba(79, 209, 160, 0.75);
  --sq-check: rgba(224, 87, 76, 0.65);

  --poodle-board-radius: 6px;
  --poodle-eval-width: 24px;
}
.poodle-board-host {
  position: relative;
  display: block;
  min-width: 0;
}
/* Product pages retain .puzzle-board as a stable host hook. Override its
   legacy 8-column renderer so the unified wrapper occupies the whole host. */
body .poodle-board-host.puzzle-board {
  display: block;
  grid-template-columns: none;
  grid-template-rows: none;
}

body .poodle-board-host.puzzle-board > .poodle-board-wrapper {
  align-items: stretch;
  justify-content: initial;
  cursor: default;
}



/* Board Outer Shell (Board + Optional Eval bar) */
.poodle-board-wrapper {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 12px;
  width: 100%;
  max-width: 100%;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

/* Blindfold Mode */
.poodle-board-wrapper.is-blindfold .poodle-piece:not(.piece-ghost) {
  opacity: 0 !important;
  pointer-events: auto;
}

/* Vertical Eval Bar */
.poodle-eval-bar {
  width: var(--poodle-eval-width);
  border-radius: 4px;
  background: #1e1e1e;
  border: 1px solid rgba(255, 255, 255, 0.12);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  flex-shrink: 0;
}
.poodle-eval-fill {
  width: 100%;
  height: 50%;
  background: #ffffff;
  transition: height 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
.poodle-eval-score {
  position: absolute;
  top: 6px;
  left: 0;
  right: 0;
  text-align: center;
  font-family: 'JetBrains Mono', 'IBM Plex Mono', monospace;
  font-size: 9px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
  pointer-events: none;
}
.poodle-eval-bar.black-lead .poodle-eval-score {
  top: auto;
  bottom: 6px;
  color: #000;
  text-shadow: none;
}

/* Main Board Stage */
.poodle-board-stage {
  position: relative;
  flex: 1;
  aspect-ratio: 1 / 1;
  border-radius: var(--poodle-board-radius);
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

/* 64 Grid Squares Container */
.poodle-board-grid {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(8, 1fr);
}

.poodle-sq {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
  transition: background-color 0.12s ease;
}
.poodle-sq.light { background-color: var(--sq-light); }
.poodle-sq.dark { background-color: var(--sq-dark); }
.poodle-sq.is-interactive { cursor: pointer; }

/* Last move highlight: Authentic blend overlay preserving light/dark square base */
.poodle-sq.is-last-move {
  background-image: linear-gradient(var(--sq-last-move, rgba(155, 199, 0, 0.41)), var(--sq-last-move, rgba(155, 199, 0, 0.41))) !important;
}

/* Selected square highlight: Authentic blend overlay preserving light/dark square base */
.poodle-sq.is-selected {
  background-image: linear-gradient(var(--sq-selected, rgba(20, 85, 30, 0.5)), var(--sq-selected, rgba(20, 85, 30, 0.5))) !important;
  box-shadow: var(--sq-selected-shadow, none);
}

.poodle-sq.is-check {
  background: radial-gradient(circle, var(--sq-check) 40%, transparent 85%) !important;
}
.poodle-sq.is-hint-ring::after {
  content: "";
  position: absolute;
  inset: 10%;
  border: 3px solid #e0984a;
  border-radius: 50%;
  animation: poodleHintPulse 1s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: 20;
}
@keyframes poodleHintPulse {
  from { transform: scale(0.88); opacity: 0.5; }
  to { transform: scale(1.06); opacity: 1; }
}

/* Scored square wash from Analysis */
.poodle-sq.scored::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--badge-wash-color, #1ec97d);
  opacity: 0;
  animation: squareWash .5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  pointer-events: none;
  z-index: 2;
}
@keyframes squareWash {
  0%   { opacity: 0; }
  28%  { opacity: 0.24; }
  100% { opacity: 0.09; }
}

/* Target dots for legal moves (Lichess & Chess.com style) */
.poodle-sq.is-target:not(.is-capture)::before {
  content: "";
  position: absolute;
  width: 28%;
  height: 28%;
  border-radius: 50%;
  background: var(--sq-target-dot);
  z-index: 10;
  pointer-events: none;
  transition: transform 0.12s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.12s ease;
}
.poodle-sq.is-target:not(.is-capture):hover::before {
  background: var(--sq-target-hover);
  transform: scale(1.25);
}
.poodle-sq.is-target.is-capture::before {
  content: "";
  position: absolute;
  inset: 4px;
  background: transparent;
  border: 4px solid rgba(0, 0, 0, 0.22);
  border-radius: 50%;
  z-index: 10;
  pointer-events: none;
  transition: transform 0.12s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.12s ease;
}
.poodle-sq.is-target.is-capture:hover::before {
  border-color: var(--sq-target-hover);
  background: rgba(79, 209, 160, 0.14);
}

/* Auto-Contrast Coordinates (Chess.com style) */
.poodle-coord {
  position: absolute;
  font-family: 'IBM Plex Mono', 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  pointer-events: none;
  line-height: 1;
}
.poodle-coord.rank {
  top: 3px;
  left: 4px;
}
.poodle-coord.file {
  bottom: 3px;
  right: 4px;
}
.poodle-sq.light .poodle-coord { color: var(--sq-dark); }
.poodle-sq.dark .poodle-coord { color: var(--sq-light); }

/* Pieces — Exactly matching PoodleChess SVG assets */
.poodle-piece {
  position: absolute;
  inset: 0;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  background-position: center;
  pointer-events: none;
  z-index: 5;
  will-change: transform;
  transition: transform 0.12s cubic-bezier(0.16, 1, 0.3, 1), filter 0.12s ease;
}
.poodle-piece.interactive {
  pointer-events: auto;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-drag: none;
}
.poodle-piece.interactive:active {
  cursor: grabbing;
}

/* Lichess-style Piece Selection Float Animation */
.poodle-sq.is-selected .poodle-piece.interactive {
  transform: translateY(-3px) scale(1.06);
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.38));
  z-index: 12;
}

/* Drag Origin Ghosting */
.poodle-piece.poodle-drag-origin {
  opacity: 0 !important;
}

/* Base Chess Pieces (Crisp Colin Burnett Vector Staunton) */
.poodle-piece.wk, .piece.wk, .piece.wK, .piece.w-k, .poodle-piece.wK { background-image: var(--piece-wk, url('/pieces/wK.svg')); }
.poodle-piece.wq, .piece.wq, .piece.wQ, .piece.w-q, .poodle-piece.wQ { background-image: var(--piece-wq, url('/pieces/wQ.svg')); }
.poodle-piece.wr, .piece.wr, .piece.wR, .piece.w-r, .poodle-piece.wR { background-image: var(--piece-wr, url('/pieces/wR.svg')); }
.poodle-piece.wb, .piece.wb, .piece.wB, .piece.w-b, .poodle-piece.wB { background-image: var(--piece-wb, url('/pieces/wB.svg')); }
.poodle-piece.wn, .piece.wn, .piece.wN, .piece.w-n, .poodle-piece.wN { background-image: var(--piece-wn, url('/pieces/wN.svg')); }
.poodle-piece.wp, .piece.wp, .piece.wP, .piece.w-p, .poodle-piece.wP { background-image: var(--piece-wp, url('/pieces/wP.svg')); }
.poodle-piece.bk, .piece.bk, .piece.bK, .piece.b-k, .poodle-piece.bK { background-image: var(--piece-bk, url('/pieces/bK.svg')); }
.poodle-piece.bq, .piece.bq, .piece.bQ, .piece.b-q, .poodle-piece.bQ { background-image: var(--piece-bq, url('/pieces/bQ.svg')); }
.poodle-piece.br, .piece.br, .piece.bR, .piece.b-r, .poodle-piece.bR { background-image: var(--piece-br, url('/pieces/bR.svg')); }
.poodle-piece.bb, .piece.bb, .piece.bB, .piece.b-b, .poodle-piece.bB { background-image: var(--piece-bb, url('/pieces/bB.svg')); }
.poodle-piece.bn, .piece.bn, .piece.bN, .piece.b-n, .poodle-piece.bN { background-image: var(--piece-bn, url('/pieces/bN.svg')); }
.poodle-piece.bp, .piece.bp, .piece.bP, .piece.b-p, .poodle-piece.bP { background-image: var(--piece-bp, url('/pieces/bP.svg')); }

/* FAST, SNAPPY PIECE TRAVEL (80-110ms) */
.poodle-piece.piece-travel {
  transform: translate3d(calc(var(--dx, 0) * 100%), calc(var(--dy, 0) * 100%), 0);
  transition: transform var(--move-duration, 0.09s) cubic-bezier(0.15, 0.9, 0.25, 1);
  z-index: 15;
}
.poodle-piece.piece-travel.is-moving {
  transform: translate3d(0, 0, 0);
}

/* LICHESS-STYLE CAPTURE DISINTEGRATION ANIMATION */
.poodle-piece.piece-ghost {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 18;
  animation: lichessCaptureGhost 0.22s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes lichessCaptureGhost {
  0% {
    opacity: 0.95;
    transform: scale(1) rotate(0deg);
    filter: brightness(1.2) drop-shadow(0 2px 4px rgba(224, 87, 76, 0.4));
  }
  100% {
    opacity: 0;
    transform: scale(0.65) rotate(-6deg);
    filter: brightness(0.7) blur(1px);
  }
}

/* DRAGGING GHOST (Lichess floating piece) */
.poodle-drag-ghost {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  opacity: 0;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 8px 16px rgba(0,0,0,0.32));
  background-size: 100% 100%;
  background-repeat: no-repeat;
  transition: none;
  will-change: left, top;
}
.poodle-drag-ghost.is-active {
  opacity: 1;
}
.poodle-drag-ghost.wk, .poodle-drag-ghost.wK { background-image: url('/pieces/wK.svg'); }
.poodle-drag-ghost.wq, .poodle-drag-ghost.wQ { background-image: url('/pieces/wQ.svg'); }
.poodle-drag-ghost.wr, .poodle-drag-ghost.wR { background-image: url('/pieces/wR.svg'); }
.poodle-drag-ghost.wb, .poodle-drag-ghost.wB { background-image: url('/pieces/wB.svg'); }
.poodle-drag-ghost.wn, .poodle-drag-ghost.wN { background-image: url('/pieces/wN.svg'); }
.poodle-drag-ghost.wp, .poodle-drag-ghost.wP { background-image: url('/pieces/wP.svg'); }
.poodle-drag-ghost.bk, .poodle-drag-ghost.bK { background-image: url('/pieces/bK.svg'); }
.poodle-drag-ghost.bq, .poodle-drag-ghost.bQ { background-image: url('/pieces/bQ.svg'); }
.poodle-drag-ghost.br, .poodle-drag-ghost.bR { background-image: url('/pieces/bR.svg'); }
.poodle-drag-ghost.bb, .poodle-drag-ghost.bB { background-image: url('/pieces/bB.svg'); }
.poodle-drag-ghost.bn, .poodle-drag-ghost.bN { background-image: url('/pieces/bN.svg'); }
.poodle-drag-ghost.bp, .poodle-drag-ghost.bP { background-image: url('/pieces/bP.svg'); }

/* SVG ARROWS & CIRCLES OVERLAY */
.poodle-arrows-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 25;
  overflow: hidden;
}
.poodle-arrow-path {
  fill-opacity: 0.74;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.42));
  transition: fill-opacity 0.15s ease;
}
.poodle-arrow-path:hover {
  fill-opacity: 0.92;
}

.poodle-circle {
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}

/* HIGH-VOLTAGE EMOTIONAL LASER & X-RAY ENERGY BEAMS */
.poodle-xray-ray {
  stroke-linecap: round;
  stroke-dasharray: 14 10;
  animation: xrayStreamFlow 0.45s linear infinite;
  filter: drop-shadow(0 0 6px rgba(15, 199, 221, 0.8));
}
.poodle-xray-halo {
  stroke-linecap: round;
  opacity: 0.45;
  animation: xrayAuraPulse 0.85s ease-in-out infinite alternate;
}
@keyframes xrayStreamFlow {
  to { stroke-dashoffset: -48; }
}
@keyframes xrayAuraPulse {
  0% { opacity: 0.28; stroke-width: 12px; }
  100% { opacity: 0.75; stroke-width: 18px; }
}

.poodle-threat-ray {
  stroke-linecap: round;
  stroke-dasharray: 12 8;
  animation: threatStreamFlow 0.35s linear infinite;
  filter: drop-shadow(0 0 8px rgba(224, 87, 76, 0.9));
}
.poodle-threat-halo {
  stroke-linecap: round;
  opacity: 0.55;
  animation: threatAuraPulse 0.7s ease-in-out infinite alternate;
}
@keyframes threatStreamFlow {
  to { stroke-dashoffset: -40; }
}
@keyframes threatAuraPulse {
  0% { opacity: 0.35; stroke-width: 14px; }
  100% { opacity: 0.88; stroke-width: 22px; }
}

.poodle-laser-core {
  pointer-events: none;
  animation: laserCoreShimmer 0.35s ease-in-out infinite alternate;
}
@keyframes laserCoreShimmer {
  0% { opacity: 0.7; }
  100% { opacity: 1; }
}

.poodle-laser-orb {
  animation: laserOrbPulse 0.75s ease-in-out infinite alternate;
}
@keyframes laserOrbPulse {
  0% { transform: scale(0.85); opacity: 0.8; }
  100% { transform: scale(1.2); opacity: 1; }
}

.poodle-laser-spark {
  animation: laserSparkPulse 0.6s cubic-bezier(0.18, 0.9, 0.32, 1.25) infinite alternate;
}
@keyframes laserSparkPulse {
  0% { transform: scale(0.8); opacity: 0.7; }
  100% { transform: scale(1.35); opacity: 1; }
}

/* CELEBRATION CONFETTI CANVAS */
.poodle-confetti-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 90;
  border-radius: inherit;
}

/* INTERACTIVE CORNER RESIZER (Chess.com style) */
.poodle-board-resizer {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 16px;
  height: 16px;
  cursor: nwse-resize;
  z-index: 40;
  opacity: 0.4;
  transition: opacity 0.15s ease;
  background: linear-gradient(135deg, transparent 50%, rgba(255, 255, 255, 0.6) 50%, transparent 65%, rgba(255, 255, 255, 0.6) 65%, transparent 80%, rgba(255, 255, 255, 0.6) 80%);
}
.poodle-board-resizer:hover {
  opacity: 0.9;
}

/* MOVE BADGES (Brilliant, Best, Great, Book, Blunder, Inaccuracy, Mistake) */
.poodle-move-badge {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 30;
  box-shadow: 0 2px 5px rgba(0,0,0,0.55);
  border: 1.5px solid #fff;
  animation: badgePop 0.28s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
  pointer-events: none;
}
.poodle-move-badge svg {
  width: 11px;
  height: 11px;
}
@keyframes badgePop {
  0% { transform: scale(0) rotate(-15deg); opacity: 0; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.poodle-move-badge.brilliant  { background: #0fc7dd; color: #fff; }
.poodle-move-badge.great      { background: #2f8ef2; color: #fff; }
.poodle-move-badge.best       { background: #1ec97d; color: #fff; }
.poodle-move-badge.excellent  { background: #1ec97d; color: #fff; }
.poodle-move-badge.good       { background: #1ec97d; color: #fff; }
.poodle-move-badge.inaccuracy { background: #e0984a; color: #fff; }
.poodle-move-badge.mistake    { background: #e0754c; color: #fff; }
.poodle-move-badge.miss       { background: #f23a2c; color: #fff; }
.poodle-move-badge.blunder    { background: #e0574c; color: #fff; }
.poodle-move-badge.book       { background: #a88865; color: #fff; }
.poodle-move-badge.forced     { background: #8a8f9c; color: #fff; }

/* BRILLIANT SPARKLE RING (Contained strictly within square) */
.poodle-move-badge.spark::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  border: 1.5px solid #0fc7dd;
  animation: sparkPulse 1.2s ease-out infinite;
}
@keyframes sparkPulse {
  0% { transform: scale(0.95); opacity: 0.9; }
  100% { transform: scale(1.35); opacity: 0; }
}

/* BOARD FRAME FEEDBACK ANIMATIONS (Solved / Failed / Storm) */
.board-frame.is-solved,
.poodle-board-wrapper.is-solved {
  animation: boardSolvedGlow 1.2s cubic-bezier(0.2, 0.9, 0.3, 1);
}
@keyframes boardSolvedGlow {
  0% { box-shadow: 0 0 0 0 rgba(30, 201, 125, 0.8); }
  50% { box-shadow: 0 0 28px 8px rgba(30, 201, 125, 0.6); }
  100% { box-shadow: 0 0 0 0 rgba(30, 201, 125, 0); }
}

.board-frame.is-failed,
.poodle-board-wrapper.is-failed {
  animation: boardFailedShake 0.48s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}
@keyframes boardFailedShake {
  10%, 90% { transform: translate3d(-1px, 0, 0); box-shadow: 0 0 16px rgba(224, 87, 76, 0.6); }
  20%, 80% { transform: translate3d(1.5px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-2px, 0, 0); }
  40%, 60% { transform: translate3d(2px, 0, 0); }
  100% { transform: translate3d(0, 0, 0); }
}

/* HINT PULSE */
.poodle-sq.is-hint {
  animation: hintPulse 1.2s ease-in-out infinite alternate;
}
@keyframes hintPulse {
  0% { box-shadow: inset 0 0 0 3px #1ec97d; }
  100% { box-shadow: inset 0 0 16px 4px #1ec97d; }
}

/* ==========================================================================
   LICHESS & CHESS.COM AUTHENTIC PROMOTION CHOOSER
   ========================================================================== */

.poodle-promotion-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.48);
  backdrop-filter: blur(3px);
  z-index: 95;
  border-radius: inherit;
  animation: promoBackdropFade 0.14s ease-out forwards;
}
@keyframes promoBackdropFade {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

.poodle-promotion-dialog {
  position: absolute;
  z-index: 100 !important;
  width: 12.5%;
  height: 50%;
  background: rgba(21, 26, 35, 0.96);
  backdrop-filter: blur(12px);
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(15, 199, 221, 0.35);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: promoColSlide 0.18s cubic-bezier(0.18, 0.9, 0.32, 1.25) forwards;
  pointer-events: auto !important;
}
@keyframes promoColSlide {
  0% { transform: scale(0.85); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.poodle-promotion-option {
  position: relative;
  width: 100%;
  height: 25%;
  cursor: pointer !important;
  pointer-events: auto !important;
  background-size: 84% 84%;
  background-position: center;
  background-repeat: no-repeat;
  transition: transform 0.12s cubic-bezier(0.2, 0.9, 0.3, 1), background-color 0.12s ease;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 105 !important;
}
.poodle-promotion-option.poodle-piece {
  pointer-events: auto !important;
}
.poodle-promotion-option:last-child {
  border-bottom: none;
}
.poodle-promotion-option:hover {
  background-color: rgba(15, 199, 221, 0.28);
  transform: scale(1.1);
  z-index: 110 !important;
  box-shadow: inset 0 0 0 1.5px rgba(15, 199, 221, 0.6), 0 4px 12px rgba(0, 0, 0, 0.4);
}
.poodle-promotion-option:active {
  transform: scale(0.96);
}

/* ==========================================================================
   7 MODERN & ERGONOMIC BOARD THEMES (Base Square Colors)
   ========================================================================== */

/* 1. Classic Wood (Default Lichess Wood) */
.poodle-board-stage,
.poodle-board-stage.theme-classic {
  --sq-light: #f0d9b5;
  --sq-dark: #b58863;
}

/* 2. Tournament Green (FIDE / Chess.com Green - Maximum Eye Comfort) */
.poodle-board-stage.theme-green,
.poodle-board-stage.theme-tournament-green {
  --sq-light: #eeeed2;
  --sq-dark: #769656;
}

/* 3. Tournament Blue (Official Olympiad / FIDE Blue) */
.poodle-board-stage.theme-tournament,
.poodle-board-stage.theme-tournament-blue {
  --sq-light: #eae9d2;
  --sq-dark: #4b7399;
}

/* 4. Nordic Slate / Ocean (Modern Scandinavian Blue-Grey) */
.poodle-board-stage.theme-nordic,
.poodle-board-stage.theme-ocean {
  --sq-light: #dee3e6;
  --sq-dark: #8ca2ad;
}

/* 5. Midnight Dark (OLED / Night Mode) */
.poodle-board-stage.theme-midnight {
  --sq-light: #707e94;
  --sq-dark: #323d4f;
  --sq-target-dot: rgba(255, 255, 255, 0.35);
}

/* 6. Warm Walnut (Rich Premium Wood Texture) */
.poodle-board-stage.theme-walnut,
.poodle-board-stage.theme-wood {
  --sq-light: #e3c086;
  --sq-dark: #b88b4a;
}

/* 7. Sand Canvas / Marble (Soft Neutral Studio Grey) */
.poodle-board-stage.theme-canvas,
.poodle-board-stage.theme-marble {
  --sq-light: #ececec;
  --sq-dark: #b0b0b0;
}

/* 8. Pine Forest (Deep Mountain Pine) */
.poodle-board-stage.theme-pine,
.poodle-board-stage.theme-forest {
  --sq-light: #dce5d5;
  --sq-dark: #4e6d4c;
}

/* 9. Royal Amethyst (Modern Lavender / Purple) */
.poodle-board-stage.theme-lavender,
.poodle-board-stage.theme-amethyst {
  --sq-light: #e8e1f0;
  --sq-dark: #7b6299;
}

/* 10. Glacier Ice (Arctic Frost Blue) */
.poodle-board-stage.theme-glacier,
.poodle-board-stage.theme-ice {
  --sq-light: #e6f2f7;
  --sq-dark: #6891a6;
}

/* 11. Autumn Maple (Warm Honey Amber) */
.poodle-board-stage.theme-maple,
.poodle-board-stage.theme-autumn {
  --sq-light: #f7e8c8;
  --sq-dark: #b37338;
}

/* COORDINATES VISIBILITY TOGGLES */
.poodle-board-stage.coords-out .poodle-coord {
  display: none;
}

/* PUZZLE SOLVED & STORM STATUS GLOWS */
.board-frame.is-solved,
.poodle-board-wrapper.is-solved {
  animation: boardSolvedGlow 1.4s ease-out;
}
@keyframes boardSolvedGlow {
  0% { box-shadow: 0 0 0 0 rgba(30, 201, 125, 0.7); }
  50% { box-shadow: 0 0 28px 6px rgba(30, 201, 125, 0.55); }
  100% { box-shadow: 0 0 0 0 rgba(30, 201, 125, 0); }
}

.is-storm-correct {
  animation: stormCorrectFlash 0.35s ease-out;
}
@keyframes stormCorrectFlash {
  0% { outline: 4px solid #1ec97d; }
  100% { outline: 4px solid transparent; }
}

.is-storm-wrong {
  animation: stormWrongFlash 0.35s ease-out;
}
@keyframes stormWrongFlash {
  0% { outline: 4px solid #e0574c; }
  100% { outline: 4px solid transparent; }
}

/* ==========================================================================
   HIGHLIGHT & SELECTION OVERLAYS
   ========================================================================== */

/* 1. Lichess Standard (Olive-Lime Move + Forest Green Select) */
.poodle-board-stage.hl-lichess,
.poodle-board-stage.hl-emerald {
  --sq-last-move: rgba(155, 199, 0, 0.41);
  --sq-selected: rgba(20, 85, 30, 0.5);
  --sq-selected-shadow: none;
  --sq-target-dot: rgba(20, 85, 30, 0.38);
  --sq-target-hover: rgba(20, 85, 30, 0.7);
}

/* 2. Chess.com Modern (Sunny Yellow Move + Warm Amber Select) */
.poodle-board-stage.hl-chesscom,
.poodle-board-stage.hl-warm {
  --sq-last-move: rgba(247, 247, 105, 0.5);
  --sq-selected: rgba(247, 247, 105, 0.7);
  --sq-selected-shadow: none;
  --sq-target-dot: rgba(0, 0, 0, 0.16);
  --sq-target-hover: rgba(247, 247, 105, 0.85);
}

/* 3. Signature Poodle Cyan (Electric Brilliant Neon) */
.poodle-board-stage.hl-cyan {
  --sq-last-move: rgba(15, 199, 221, 0.28);
  --sq-selected: rgba(15, 199, 221, 0.42);
  --sq-selected-shadow: inset 0 0 12px rgba(15, 199, 221, 0.45);
  --sq-target-dot: rgba(15, 199, 221, 0.45);
  --sq-target-hover: rgba(15, 199, 221, 0.9);
}
.poodle-board-stage.hl-cyan .poodle-sq.is-target.is-capture::before {
  border-color: rgba(15, 199, 221, 0.75);
  box-shadow: 0 0 8px rgba(15, 199, 221, 0.45);
}

/* 4. Minimalist Corner Targets */
.poodle-board-stage.hl-minimal {
  --sq-selected: transparent;
  --sq-last-move: transparent;
  --sq-target-dot: rgba(0, 0, 0, 0.25);
  --sq-target-hover: rgba(0, 0, 0, 0.6);
}
.poodle-board-stage.hl-minimal .poodle-sq.is-selected::after {
  content: '';
  position: absolute;
  inset: 3px;
  border: 2px dashed rgba(224, 152, 74, 0.85);
  border-radius: 4px;
  pointer-events: none;
  z-index: 6;
}
.poodle-board-stage.hl-minimal .poodle-sq.is-last-move {
  background-image: none !important;
  box-shadow: inset 0 0 0 2px rgba(170, 195, 60, 0.65) !important;
}
.poodle-board-stage.hl-minimal .poodle-sq.is-target:not(.is-capture)::before {
  width: 16%;
  height: 16%;
}
