/* =============================================================================
   DEPLOY CONSOLE CHESS — DARK THEME STYLES
   ============================================================================= */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400;500;600;700&display=swap');

:root {
  --bg-core: #090a0f;
  --bg-panel: #11141c;
  --bg-panel-subtle: #161a24;
  --border-dim: #1e2533;
  --border-bright: #2f3a4f;
  
  --accent-green: #00ff66;
  --accent-glow: rgba(0, 255, 102, 0.25);
  --accent-dim: rgba(0, 255, 102, 0.08);

  --square-light: #262c3a;
  --square-dark: #141722;
  --square-selected: rgba(0, 255, 102, 0.22);
  --square-last-move: rgba(0, 255, 102, 0.12);
  --square-check: rgba(255, 68, 68, 0.45);

  --text-main: #e2e8f0;
  --text-muted: #8492a6;
  --text-dim: #4b5563;
  --danger-red: #ff4757;
}

* {
  box-sizing: border-box;
  font-family: 'JetBrains Mono', monospace;
}

body {
  background-color: var(--bg-core);
  color: var(--text-main);
  margin: 0;
  padding: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 50% 0%, rgba(0, 255, 102, 0.04) 0%, transparent 65%),
    linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: 100% 100%, 32px 32px, 32px 32px;
}

/* Custom scrollbars */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: var(--bg-core);
}
::-webkit-scrollbar-thumb {
  background: var(--border-bright);
  border-radius: 2px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-green);
}

/* Chessboard Grid Container */
.chess-board-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  grid-template-rows: repeat(8, minmax(0, 1fr));
  width: 100%;
  aspect-ratio: 1 / 1;
  border: 2px solid var(--border-dim);
  border-radius: 4px;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.8), 0 0 20px -5px rgba(0, 255, 102, 0.05);
  user-select: none;
  touch-action: manipulation;
}

/* Individual Board Square */
.board-square {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.12s ease;
}

.square-light {
  background-color: var(--square-light);
}

.square-dark {
  background-color: var(--square-dark);
}

/* Square States */
.square-selected {
  background-color: var(--square-selected) !important;
  box-shadow: inset 0 0 0 2px var(--accent-green);
}

.square-last-move {
  background-color: var(--square-last-move) !important;
}

.square-check {
  background-color: var(--square-check) !important;
  animation: pulse-check 1.4s infinite alternate;
}

@keyframes pulse-check {
  0% { box-shadow: inset 0 0 0 2px rgba(255, 71, 87, 0.6); }
  100% { box-shadow: inset 0 0 0 4px rgba(255, 71, 87, 1), 0 0 12px rgba(255, 71, 87, 0.6); }
}

/* Legal Move Indicators */
.move-dot {
  width: 28%;
  height: 28%;
  background-color: rgba(0, 255, 102, 0.55);
  border: 1px solid rgba(0, 255, 102, 0.8);
  border-radius: 50%;
  pointer-events: none;
  box-shadow: 0 0 8px rgba(0, 255, 102, 0.4);
  animation: dot-glow 1.5s infinite alternate;
}

@keyframes dot-glow {
  0% { transform: scale(0.9); opacity: 0.7; }
  100% { transform: scale(1.1); opacity: 1; }
}

.capture-ring {
  position: absolute;
  inset: 4px;
  border: 3px solid rgba(0, 255, 102, 0.8);
  border-radius: 4px;
  pointer-events: none;
  box-shadow: 0 0 8px rgba(0, 255, 102, 0.4);
}

/* Square Coordinates */
.coord-rank {
  position: absolute;
  top: 2px;
  left: 3px;
  font-size: 9px;
  font-weight: 600;
  line-height: 1;
  pointer-events: none;
  opacity: 0.4;
}

.coord-file {
  position: absolute;
  bottom: 2px;
  right: 3px;
  font-size: 9px;
  font-weight: 600;
  line-height: 1;
  pointer-events: none;
  opacity: 0.4;
}

/* Piece hover & animation */
.board-square:hover .chess-piece {
  transform: scale(1.05);
}

.chess-piece {
  width: 82%;
  height: 82%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s ease;
  pointer-events: none;
}

/* Modals & Backdrop Blur */
.modal-backdrop {
  background-color: rgba(5, 7, 10, 0.82);
  backdrop-filter: blur(8px);
}

.console-card {
  background-color: #11141c;
  border: 1px solid #1e2533;
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.8), 0 0 25px -5px rgba(0, 255, 102, 0.05);
}

/* Interactive NPC Difficulty Cards */
.difficulty-card {
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.difficulty-card:hover {
  transform: translateY(-2px);
}

/* Points Awarded Glowing Badge */
@keyframes points-glow {
  0% {
    box-shadow: 0 0 10px rgba(0, 255, 102, 0.4), inset 0 0 5px rgba(0, 255, 102, 0.2);
    transform: scale(0.98);
  }
  100% {
    box-shadow: 0 0 25px rgba(0, 255, 102, 0.8), inset 0 0 15px rgba(0, 255, 102, 0.4);
    transform: scale(1.02);
  }
}

.points-awarded-badge {
  animation: points-glow 1.2s infinite alternate ease-in-out;
}

/* Leaderboard Rank Badges */
.rank-gold {
  background: linear-gradient(135deg, #ffd700 0%, #b8860b 100%);
  color: #000;
  font-weight: 800;
}

.rank-silver {
  background: linear-gradient(135deg, #e2e8f0 0%, #94a3b8 100%);
  color: #000;
  font-weight: 800;
}

.rank-bronze {
  background: linear-gradient(135deg, #cd7f32 0%, #8b4513 100%);
  color: #fff;
  font-weight: 800;
}

/* Avatar Frame Styling */
.avatar-frame-container {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.avatar-frame-circle {
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.frame-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 8.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
}

.frame-swatch {
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}
.frame-swatch:hover {
  transform: translateY(-2px);
}
