/*! chessboard.js v1.0.0 */

.clearfix-7da63 {
  clear: both;
}

.board-b72b1 {
  border: 1px solid #6e533d;
  box-sizing: content-box;
}

.square-55d63 {
  float: left;
  position: relative;

  /* disable any native browser highlighting */
  -webkit-touch-callout: none;
    -webkit-user-select: none;
     -khtml-user-select: none;
       -moz-user-select: none;
        -ms-user-select: none;
            user-select: none;

  /* IMPORTANT: mobile drag fix */
  touch-action: none;
}


.white-1e1d7 {
  background-color: #f0d9b5;
  color: #b58863;
}

.black-3c85d {
  background-color: #b58863;
  color: #f0d9b5;
}

.notation-322f9 {
  cursor: default;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 14px;
  position: absolute;
}

.alpha-d2270 {
  bottom: 1px;
  right: 3px;
}

.numeric-fc462 {
  top: 2px;
  left: 2px;
}
/* =========================
   XAE Chess – Bot Controls
========================= */

.xae-chess-ai {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.xae-chess-ai label {
  font-size: 12px;
  letter-spacing: 1.2px;
  color: #d6b47c;
  opacity: 0.85;
}

/* Styled select */
.xae-select {
  background: linear-gradient(180deg, #1a1a1a, #0e0e0e);
  border: 1px solid #d6b47c;
  color: #f5e6c8;
  padding: 6px 10px;
  font-size: 13px;
  border-radius: 6px;
  outline: none;
  appearance: none;
  cursor: pointer;
  min-width: 72px;
  text-align: center;
}

/* Hover / focus glow */
.xae-select:hover,
.xae-select:focus {
  box-shadow: 0 0 8px #f0960559;
}

/* Dropdown arrow fix */
.xae-select option {
  background: #111;
  color: #fff;
}

/* Align with buttons */
#playAI {
  padding: 8px 16px;
  font-size: 12px;
  letter-spacing: 1px;
}

#aiLevel {
  text-align: center;
  font-weight: 600;
  letter-spacing: 0.8px;
}



/* =========================
   XAE Chess – Status (SAFE)
========================= */

#chessStatus {
  width: 80%;
  margin: 0 auto 16px auto;
  padding: 10px 14px;
  text-align: center;

  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.8px;

  color: #fff;
  background: linear-gradient(180deg, #1a1a1a, #0e0e0e);
  border: 1px solid #d6b47c;
  color: #f5e6c8;
  padding: 6px 10px;
  border-radius: 6px;
  box-shadow: 0 0 12px rgba(125, 214, 124, 0.12);

  background: linear-gradient(180deg, #1a1a1a, #0e0e0e);
  border: 1px solid #d6b47c;
  color: #f5e6c8;
}

/* =========================
   XAE Chess – Bot Inline
========================= */

.xae-chess-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
}

.xae-chess-ai-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 4px;
}

.bot-label {
  font-size: 11px;
  letter-spacing: 1.2px;
  color: #fff;
}

/* =========================
   XAE Chess – Checkmate Overlay (Centered)
========================= */

.chessboard-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
}


#checkmateOverlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);

  width: 100%;
  height: 100%;

  pointer-events: none;
  display: none;

  background: radial-gradient(
    circle,
    rgba(0, 0, 0, 0.55) 0%,
    rgba(0, 0, 0, 0.85) 70%
  );

  border-radius: 12px;
  z-index: 20;

  display: flex;
  align-items: center;
  justify-content: center;
}

#checkmateOverlay span {
  font-size: 42px;
  font-weight: 700;
  letter-spacing: 4px;
  text-transform: uppercase;
  text-shadow: 0 0 18px #d6b47c73;
}

#checkmateOverlay.white span {
  color: #ffffff;
}

#checkmateOverlay.black span {
  color: #000000;
  text-shadow: 0 0 18px #ffffff73;
}

.chessboard-wrapper {
  position: relative;
  display: inline-block; /* IMPORTANT */
}

/* ======================
   Board Size (PC only)
====================== */

/* Layout container */
.xae-board-shell {
  width: 100%;
  display: flex;
  justify-content: center;
  margin: 0 auto;    
}

/* =========================
   Board Size (Width Limits)
====================== */


/* −15% */
.board-size-85 {
  width: 85%;
  max-width: 1020px;
}

/* −30% */
.board-size-70 {
  width: 70%;
  max-width: 840px;
}

/* −45% */
.board-size-55 {
  width: 55%;
  max-width: 660px;
}

/* Ensure the shell itself is centered */
.xae-board-shell {
  margin-left: auto;
  margin-right: auto;
  display: block;
}

/* Force the chessboard to stay centered inside the shell */
#chessBoard {
  margin-left: auto;
  margin-right: auto;
}


/* =========================
   BOARD THEMES
========================= */

#boardTheme {
  font-weight: 600;
  letter-spacing: 0.8px;
  text-align: center;
}

/* Base (default fallback) */
#chessBoard .white-1e1d7 { background-color: #1a1a1a; }
#chessBoard .black-3c85d { background-color: #111; }

/* XAE Dark (default) */
#chessBoard.xae-dark .white-1e1d7 {
  background-color: #1a1a1a !important;
}
#chessBoard.xae-dark .black-3c85d {
  background-color: #131313 !important;
}

/* XAE Gold */
#chessBoard.xae-gold .white-1e1d7 {
  background-color: #1e1b16 !important;
}
#chessBoard.xae-gold .black-3c85d {
  background-color: #14100b !important;
}

/* Classic */
#chessBoard.classic .white-1e1d7 {
  background-color: #f0d9b5 !important;
}
#chessBoard.classic .black-3c85d {
  background-color: #b58863 !important;
}

#chessBoard.classic-green .white-1e1d7 {
  background-color: #f0d9b5 !important;
}

#chessBoard.classic-green .black-3c85d {
  background-color: #61904c !important;
}

/* Optional: softer grid for green boards */
#chessBoard.classic-green .square-55d63 {
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18);
}

/* High Contrast */
#chessBoard.contrast .white-1e1d7 {
  background-color: #2a2a2a !important;
}
#chessBoard.contrast .black-3c85d {
  background-color: #111 !important;
}

/* Subtle grid (XAE accent) */
.square-55d63 {
  box-shadow: inset 0 0 0 1px rgba(214, 180, 124, 0.12);
}

/* =====================================================
   INTERACTION POLISH
===================================================== */

/* Hover glow (desktop) */
.square-55d63:hover {
  box-shadow: inset 0 0 0 2px rgba(214, 180, 124, 0.85);
}

/* Last move */
.square-55d63.last-move {
  box-shadow: inset 0 0 0 1px rgba(214, 180, 124, 0.85);
}

/* =====================================================
   FORCE CAPTURE / CHECK HIGHLIGHT (OVERRIDES ALL)
===================================================== */

/* Capture square */
.square-55d63.capture {
  box-shadow: inset 0 0 0 1px rgba(220, 80, 80, 0.9) !important;
}

/* King in check */
.square-55d63.check {
  box-shadow: inset 0 0 0 1px rgba(255, 60, 60, 0.95) !important;
}


/* =====================================================
   CAPTURE HIGHLIGHT (SAFE, NO JS)
===================================================== */

/* When destination square contains a piece AND is a legal move */
.square-55d63.highlight2-9c5d2 img {
  filter: drop-shadow(0 0 6px rgba(220, 80, 80, 0.85));
}

/* =====================================================
   PIECE LIFT / MOVE HIGHLIGHT (SAFE)
===================================================== */

/* Source square (picked-up piece) */
.square-55d63.highlight1-32417 {
  box-shadow: inset 0 0 0 1px rgba(214, 180, 124, 0.9);
}

/* Valid destination squares */
.square-55d63.highlight2-9c5d2 {
  box-shadow: inset 0 0 0 1px rgba(214, 180, 124, 0.45);
}

/* Mobile-friendly: keep highlight visible without hover */
.square-55d63.highlight2-9c5d2::after {
  content: '';
  position: absolute;
  inset: 10%;
  border-radius: 50%;
  background: rgba(214, 180, 124, 0.25);
  pointer-events: none;
}


/* =====================================================
  MOBILE CONTROLS (STACKED LIST VIEW)
===================================================== */

@media (max-width: 768px) {
  .xae-chess-actions {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  }
  .xae-chess-actions button,
  .xae-chess-actions select {
    width: 300px;
  }
}

/* =========================
   Challenge Modal
========================= */

.challenge-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 12px;
}

.challenge-actions .btn {
  min-width: 110px;
}

.challenge-waiting {
  text-align: center;
  margin-top: 12px;
}

.challenge-waiting .waiting-text {
  margin-bottom: 10px;
  font-size: 14px;
  letter-spacing: 0.6px;
  color: #f5e6c8;
}


/* =====================================================
      XAE Chess – PLAYER
===================================================== */

.player-modal {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);

  width: 100%;
  height: 100%;

  display: flex;
  align-items: center;
  justify-content: center;

  background: radial-gradient(
    circle,
    rgba(0, 0, 0, 0.55) 0%,
    rgba(0, 0, 0, 0.85) 70%
  );

  border-radius: 12px;
  z-index: 20;
}



.player-modal-box {
  background: #111;
  border: 1px solid #d6b47c;
  padding: 24px;
  border-radius: 10px;
  text-align: center;
  width: 320px;
}

.player-modal input {
  width: 100%;
  padding: 10px;
  margin: 14px 0;
  background: #0e0e0e;
  border: 1px solid #333;
  color: #fff;
}

.hidden {
  display: none;
}

.chessboard-center {
  display: flex;
  justify-content: center;
  margin-top: 100%
}

/* =========================
   XAE Chess – Player Strip
========================= */

.xae-player-strip {
  width: 60%;
  margin: 0 auto 16px auto;
  padding: 10px 14px;
  text-align: center;

  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.8px;

  color: #fff;
  background: linear-gradient(180deg, #1a1a1a, #0e0e0e);
  border: 1px solid #d6b47c;
  color: #f5e6c8;
  padding: 6px 10px;
  border-radius: 6px;
  box-shadow: 0 0 12px rgba(125, 214, 124, 0.12);

  background: linear-gradient(180deg, #1a1a1a, #0e0e0e);
  border: 1px solid #d6b47c;
  color: #f5e6c8;
}

.xae-player-strip {
  position: relative;
}

/* =========================
   XAE Chess – Player Strip - Change Name Gear Icon
========================= */

.xae-player-gear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 25px;
  line-height: 1;
  padding: 4px;
  color: #d6b47c;
  fill: #d6b47c;

  -webkit-appearance: none;
  appearance: none;
}

.xae-player-gear svg {
  display: block;
  color: #d6b47c;
}

.xae-player-gear:hover svg {
  color: #f5e6c8;
}

.xae-player-gear:active svg {
  color: #f5e6c8;
}


@media (max-width: 768px) {
  .xae-player-gear {
    color: #d6b47c !important;
    fill: #d6b47c !important;
    opacity: 1;
  }
}

/* =========================
   XAE Chess – Player List
========================= */

.xae-player-list {
  width: 80%;
  max-width: 400px;
  margin: 24px auto 0;
  padding: 0;
  border: 1px solid #d6b47c;
  border-radius: 8px;
  background: linear-gradient(180deg, #1a1a1a, #0e0e0e);
  color: #f5e6c8;
}

.xae-player-list-title {
  padding: 8px 12px;
  border-bottom: 1px solid #d6b47c;
  font-weight: 600;
  letter-spacing: 1px;
  text-align: center;
}

.xae-player-row {
  padding: 10px 12px;
  border-top: 1px solid rgba(214,180,124,0.25);
  cursor: pointer;
  text-align: left;
}

.xae-player-row:hover {
  background: rgba(214,180,124,0.08);
}

.xae-player-meta {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}

.xae-player-status.online {
  color: #7dd67c;
}

.xae-player-status.offline {
  color: #d67c7c;
}

.xae-player-history {
  display: none;
  padding-top: 8px;
  font-size: 12px;
  opacity: 0.9;
}

.xae-player-row.expanded .xae-player-history {
  display: block;
}

/* =========================
   Board Scale Controls (PC)
========================= */

.xae-board-scale-controls {
  position: absolute;
  top: -49px;
  right: 5px;

  display: flex;
  gap: 8px;
}

/* Buttons */
.xae-board-scale-controls button {
  width: 34px;
  height: 34px;

  background: linear-gradient(180deg, #1a1a1a, #0e0e0e);
  border: 1px solid #d6b47c;
  border-radius: 6px;

  color: #d6b47c;
  font-size: 20px;
  font-weight: 600;

  cursor: pointer;
}

.xae-board-scale-controls button:hover {
  color: #f5e6c8;
  border-color: #f5e6c8;
}

/* Hide entirely on mobile */
@media (max-width: 768px) {
  .xae-board-scale-controls {
    display: none;
  }
}




/* =========================
   Resign Button
========================= */

.danger-btn {
  border-color: #d67c7c;
  color: #d67c7c;
}

.danger-btn:hover {
  color: #f2bcbc;
  border-color: #f2bcbc;
}
