/**
 * Kniteforce Online - Chess & Checkers Board Styles
 */

.board-match-view {
  display: flex;
  height: calc(100vh - 60px);
  gap: 24px;
  padding: 16px;
  overflow: hidden;
}

/* Left/Center Game Stage */
.board-game-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  background: radial-gradient(circle at center, #131520 0%, #07080c 100%);
  border-radius: 20px;
  border: 1px solid var(--border-color);
  padding: 14px;
  box-shadow: inset 0 0 60px rgba(0,0,0,0.8);
}

.match-turn-header {
  margin-bottom: 14px;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* ---------------- CHESS GRID ---------------- */
.chess-grid-wrapper {
  position: relative;
  border: 4px solid #2b2d3d;
  border-radius: 10px;
  box-shadow: 0 15px 40px rgba(0,0,0,0.8), 0 0 20px rgba(0, 255, 255, 0.15);
  overflow: hidden;
}

.chess-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(36px, 68px));
  grid-template-rows: repeat(8, minmax(36px, 68px));
}

.chess-sq {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.sq-light {
  background-color: #242738;
}

.sq-dark {
  background-color: #12141e;
}

.sq-selected {
  background-color: rgba(0, 255, 255, 0.4) !important;
}

.sq-check {
  background-color: rgba(255, 0, 85, 0.5) !important;
  animation: pulse-check 1s infinite alternate;
}

@keyframes pulse-check {
  from { box-shadow: inset 0 0 10px #ff0055; }
  to { box-shadow: inset 0 0 25px #ff0055; }
}

.chess-piece {
  font-size: clamp(26px, 5vw, 48px);
  line-height: 1;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.8));
  transition: transform 0.15s ease;
}

.chess-sq:hover .chess-piece {
  transform: scale(1.1);
}

.piece-w {
  color: #ffffff;
  text-shadow: 0 0 10px rgba(0, 255, 255, 0.8), 0 0 20px rgba(0, 255, 255, 0.4);
}

.piece-b {
  color: #ff007f;
  text-shadow: 0 0 10px rgba(255, 0, 127, 0.8), 0 0 20px rgba(255, 0, 127, 0.4);
}

/* Legal Move Dots & Capture Rings */
.chess-legal-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(0, 255, 255, 0.6);
  box-shadow: 0 0 10px var(--neon-cyan);
  pointer-events: none;
}

.chess-capture-ring {
  width: 80%;
  height: 80%;
  border-radius: 50%;
  border: 3px dashed var(--neon-pink);
  box-shadow: 0 0 10px var(--neon-pink);
  position: absolute;
  pointer-events: none;
}

/* ---------------- CHECKERS GRID ---------------- */
.checkers-grid-wrapper {
  position: relative;
  border: 4px solid #2b2d3d;
  border-radius: 10px;
  box-shadow: 0 15px 40px rgba(0,0,0,0.8), 0 0 20px rgba(255, 0, 127, 0.15);
  overflow: hidden;
}

.checkers-grid {
  display: grid;
  width: min(70vw, 560px);
  height: min(70vw, 560px);
}

.checkers-sq {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.sq-unplayable {
  background-color: #242738;
}

.sq-playable {
  background-color: #0f1017;
  cursor: pointer;
}

.checkers-piece {
  width: 75%;
  height: 75%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 12px rgba(0,0,0,0.7), inset 0 2px 4px rgba(255,255,255,0.4);
  font-size: 18px;
  transition: transform 0.15s ease;
}

.checkers-sq:hover .checkers-piece {
  transform: scale(1.1);
}

.checkers-piece.piece-w {
  background: radial-gradient(circle at 35% 35%, #00ffff, #0088cc);
  border: 2px solid #ffffff;
  box-shadow: 0 0 15px rgba(0, 255, 255, 0.6);
}

.checkers-piece.piece-b {
  background: radial-gradient(circle at 35% 35%, #ff007f, #99004c);
  border: 2px solid #ffffff;
  box-shadow: 0 0 15px rgba(255, 0, 127, 0.6);
}

.checkers-target-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--neon-yellow);
  box-shadow: 0 0 12px var(--neon-yellow);
  pointer-events: none;
}

/* ---------------- SIDE PANEL & NOTATION ---------------- */
.match-side-panel {
  width: 320px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.clock-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  justify-content: space-around;
  align-items: center;
}

.clock-box {
  text-align: center;
}

.clock-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.clock-digits {
  font-size: 26px;
  font-weight: 900;
  font-family: monospace;
  color: var(--neon-cyan);
}

.clock-digits.black-clock {
  color: var(--neon-pink);
}

.move-ledger-card {
  flex: 1;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 180px;
}

.move-ledger-title {
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.move-ledger-feed {
  flex: 1;
  overflow-y: auto;
  font-family: monospace;
  font-size: 13px;
  line-height: 1.6;
  color: #c0c3d4;
  padding-right: 6px;
}

.move-entry {
  display: inline-block;
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 6px;
  border-radius: 4px;
  margin: 2px 4px;
}

/* Pawn Promotion Modal */
.promotion-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

.promotion-card {
  background: var(--bg-surface);
  border: 2px solid var(--neon-cyan);
  border-radius: 16px;
  padding: 24px;
  text-align: center;
  box-shadow: 0 0 30px rgba(0, 255, 255, 0.3);
}

.promotion-title {
  font-size: 16px;
  font-weight: 900;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.promotion-pieces-row {
  display: flex;
  gap: 16px;
}

.promotion-btn {
  font-size: 38px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 10px 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.promotion-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--neon-cyan);
  transform: scale(1.15);
}
