/* Global & hidden utility */
body, html {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  font-family: 'Orbitron', sans-serif; /* Futuristic font */
  background: linear-gradient(135deg, #0d0d1a, #1a1a3d); /* Cyberpunk gradient */
  color: #00ffcc; /* Neon cyan text */
  overflow: hidden;
}
.hidden { display: none !important; }

/* Cyberpunk background animation */
body::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('assets/cyber-bg.jpg') no-repeat center center fixed;
  background-size: cover;
  opacity: 0.2;
  z-index: -2;
  animation: glitch 5s infinite alternate;
}

/* Glitch animation for background */
@keyframes glitch {
  0%   { transform: translate(0); }
  2%   { transform: translate(-2px, 2px); }
  4%   { transform: translate(2px, -2px); }
  6%   { transform: translate(0); }
  100% { transform: translate(0); }
}

/* Full-screen screens (menu & instructions) */
.screen {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.9);
  text-shadow: 0 0 10px #00ffcc;
}
.screen h1, .screen h2 {
  margin-bottom: 1.5rem;
  font-size: 2.5rem;
  animation: neon-glow 1.5s ease-in-out infinite alternate;
}
.screen button {
  padding: 0.75rem 1.5rem;
  margin: 0.5rem;
  font-size: 1rem;
  cursor: pointer;
  background: #ff007a; /* Neon pink */
  border: 2px solid #00ffcc;
  color: #fff;
  text-transform: uppercase;
  transition: all 0.3s;
}
.screen button:hover {
  background: #00ffcc;
  color: #000;
  box-shadow: 0 0 15px #00ffcc;
}

/* Neon glow animation */
@keyframes neon-glow {
  from { text-shadow: 0 0 5px #00ffcc, 0 0 10px #00ffcc; }
  to   { text-shadow: 0 0 10px #00ffcc, 0 0 20px #00ffcc; }
}

/* Center board on the page */
#game-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 2rem;
  z-index: 0;
}

/* Button container under board */
.game-buttons {
  margin-top: 1rem;
  display: flex;
  gap: 1rem;
}

/* 8×8 grid for the board */
#chessboard {
  display: grid;
  grid-template-columns: repeat(8, 60px);
  grid-template-rows: repeat(8, 60px);
  border: 4px solid #00ffcc;
  box-shadow: 0 0 20px #00ffcc, 0 0 40px #ff007a;
  background: rgba(0, 0, 0, 0.7);
}

/* Each square */
.square {
  width: 60px;
  height: 60px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 36px;
  cursor: pointer;
  user-select: none;
  transition: background 0.2s, box-shadow 0.2s;
}

/* Light & dark squares with cyberpunk palette */
.light { background-color: #1a3c34; } /* Dark teal */
.dark  { background-color: #0d1f2d; } /* Darker blue-gray */

/* Selected highlight */
.selected {
  outline: 3px solid #ff007a;
  box-shadow: 0 0 15px #ff007a inset;
}

/* Legal‐move highlight (only in Easy mode) */
.highlight {
  background-color: rgba(255, 255, 0, 0.7);
  box-shadow: 0 0 10px #ffff00 inset;
  animation: pulse 1s infinite alternate;
}

/* Pulse animation for highlights */
@keyframes pulse {
  from { box-shadow: 0 0 10px #ffff00 inset; }
  to   { box-shadow: 0 0 20px #ffff00 inset; }
}

/* Restart & Back-to-Menu buttons */
#restartBtn,
#backMenuBtn {
  padding: 0.5rem 1rem;
  font-size: 1rem;
  cursor: pointer;
  background: #ff007a;
  border: 2px solid #00ffcc;
  color: #fff;
  text-transform: uppercase;
  transition: all 0.3s;
}
#restartBtn:hover,
#backMenuBtn:hover {
  background: #00ffcc;
  color: #000;
  box-shadow: 0 0 15px #00ffcc;
}

/* MATRIX CANVAS (behind everything) */
#matrixCanvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: -1;
  pointer-events: none;
}
