/* ------------------------------------------------------------------
   Global tweaks
-------------------------------------------------------------------*/

/* Fill viewport without scrolling */
html, body {
  height: 100%;
  overflow: hidden;
}

/* Light gradient background + modern font */
body {
  background: linear-gradient(180deg, #f8f9fa, #e9ecef);
  color: #343a40;
  font-family: 'Poppins', 'Helvetica Neue', Arial, sans-serif;
}



/* Difficulty badge colors */
#diffBadge {
  background-color: #0d6efd !important; /* bootstrap primary */
  color: #fff;
}

#puzzleBadge {
  background-color: #6f42c1 !important; /* purple */
  color: #fff;
  font-size: 1.2rem;
  padding: 0.4rem 0.75rem;
}

#failedCountBadge {
  background-color: #fd7e14 !important; /* orange */
  color: #000;
}

#repeatBadge {
  background-color: #6c757d !important; /* secondary */
  color: #fff;
}

/* ------------------------------------------------------------------
   Chess board container
-------------------------------------------------------------------*/

#board {
  /* shadow for a subtle “floating” look */
  border-radius: 0;                     /* keep square outline */
  overflow: hidden;                     /* clip pieces at the edges */
  box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.25);
  border: none !important;              /* remove default chessboard border */
}

/* child div used by chessboard.js also carries a border */
#board > div { border: none !important; }

#boardContainer {
  position: relative;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  border: 12px solid transparent;
  border-radius: 1.25rem;
  box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.25);
  transition: border-color 0.3s ease;
}

#boardContainer.outline-white { border-color: #ffffff; }
#boardContainer.outline-black { border-color: #000000; }


/* ------------------------------------------------------------------
   Move highlight overlay
-------------------------------------------------------------------*/

.highlight-gold {
  background-color: rgba(13, 110, 253, 0.4) !important; /* blue overlay */
}

/* ------------------------------------------------------------------
   Navbar tweaks
-------------------------------------------------------------------*/
.navbar-brand {
  font-weight: 600;
  letter-spacing: 0.3px;
}

.navbar-text a {
  text-decoration: none;
}

.navbar-text a:hover {
  text-decoration: underline;
}

/* ------------------------------------------------------------------
   Difficulty‑selector buttons
-------------------------------------------------------------------*/
#diffDown, #diffUp {
  width: 2.5rem;
  padding: 0 0.25rem;
}

/* ------------------------------------------------------------------
   Board feedback: red shake (error) & green glow (success)
-------------------------------------------------------------------*/

/* Shake animation */
@keyframes bp-shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX( 6px); }
}

.board-error {
  animation: bp-shake 0.4s ease-in-out;
  box-shadow: 0 0 12px 2px rgba(255, 0, 0, 0.6) !important;
}

/* Generic shake helper */
.shake {
  animation: bp-shake 0.4s ease-in-out;
}

/* Green glow for success */
.board-success {
  box-shadow: 0 0 16px 3px rgba(0, 255, 120, 0.75) !important;
}

/* ------------------------------------------------------------------
   Top header strip
-------------------------------------------------------------------*/
.page-top {
  background-color: #ffffff;
  color: #343a40;
  min-height: 4.5rem;
}

/* Light brown Lichess login button */
.btn-lichess {
  background-color: #f0b44c;
  border-color: #f0b44c;
  color: #000;
}
.btn-lichess:hover {
  background-color: #e7a83e;
  border-color: #e7a83e;
  color: #000;
}

/* ------------------------------------------------------------------
   Promotion selection overlay
-------------------------------------------------------------------*/
.promotion-box {
  display: none;
  position: absolute;
  z-index: 20;
  background: #fff;
  border: 1px solid #666;
  padding: 2px;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}

.promotion-box img {
  width: 45px;
  height: 45px;
  cursor: pointer;
  margin: 0 2px;
}

/* ------------------------------------------------------------------
   Sound control
-------------------------------------------------------------------*/
#soundControl {
  position: relative;
}

#volumeSlider {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  padding: 0;
  z-index: 30;
}

#soundControl:hover #volumeSlider,
#volumeSlider:hover {
  display: block;
}
