/* ---------------------------------
   Global Reset & Base Styles
----------------------------------*/
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  background: url('https://images.unsplash.com/photo-1502671507588-04ff77eae3fe') no-repeat center center fixed;
  background-size: cover;
  color: #fff;
  overflow-x: hidden;
  transition: background 0.5s, color 0.5s;
}
.container {
  max-width: 500px;
  margin: 20px auto;
  background: rgba(0, 0, 0, 0.75);
  padding: 1rem;
  border-radius: 10px;
  text-align: center;
}

/* ---------------------------------
   Header & Navigation
----------------------------------*/
.header {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(0,0,0,0.85);
  padding: 1rem;
  flex-wrap: wrap;
}
.header-logo {
  width: 50px;
}
.site-logo {
  width: 100%;
  border-radius: 50%;
}
.nav-content {
  flex: 1;
  text-align: left;
}
.nav-content h1 {
  font-size: 1.8rem;
  margin-bottom: 0.25rem;
}
.tagline {
  font-size: 1.1rem;
  color: #ccc;
  font-style: italic;
}
.main-nav ul {
  list-style: none;
  display: flex;
  gap: 1rem;
}
.main-nav a {
  text-decoration: none;
  color: #fff;
  transition: color 0.3s;
}
.main-nav a:hover,
.main-nav a.active {
  color: #00ffcc;
}

/* Theme Toggle Button Container (right aligned) */
.theme-container {
  width: 100%;
  text-align: right;
  margin-top: 0.5rem;
}
.theme-toggle {
  background: linear-gradient(135deg, #007bff, #6c757d);
  color: #fff;
  border: none;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.3s, box-shadow 0.3s;
}
.theme-toggle:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

/* ---------------------------------
   Home Screen Styles
----------------------------------*/
.screen {
  margin-top: 1rem;
}
.input-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 1rem;
}
.player-inputs input {
  width: 90%;
  padding: 10px;
  margin: 0 auto;
  border: none;
  border-radius: 5px;
  font-size: 1rem;
}
.mode-selection, .side-selection {
  margin: 0.8rem 0;
  font-size: 1rem;
  display: flex;
  justify-content: center;
  gap: 10px;
}
.mode-label, .side-label {
  padding: 8px 12px;
  border: 2px solid #fff;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.3s;
}
.mode-label:hover, .side-label:hover {
  background: rgba(255, 255, 255, 0.2);
}
.start-btn {
  padding: 10px 20px;
  font-size: 1.1rem;
  border: none;
  border-radius: 5px;
  background-color: #28a745;
  color: #fff;
  cursor: pointer;
  transition: background 0.3s;
  margin-top: 1rem;
}
.start-btn:hover {
  background-color: #1e7e34;
}

/* ---------------------------------
   Chess Game Screen Styles
----------------------------------*/
.game-info {
  margin-bottom: 1rem;
  font-size: 1.2rem;
  padding: 8px;
  border: 2px solid #444;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.6);
}
.turn-display {
  font-weight: bold;
  border: 3px solid #000;
  padding: 4px;
  margin-bottom: 4px;
  border-radius: 4px;
}
.scoreboard {
  margin-top: 8px;
  display: flex;
  justify-content: space-around;
  font-size: 0.9rem;
}
.scoreboard div {
  padding: 4px;
  border: 1px solid #fff;
  border-radius: 4px;
  transition: transform 0.3s;
}
.scoreboard div.animate {
  transform: scale(1.1);
}
.game-message {
  margin-top: 0.5rem;
  font-size: 1rem;
  animation: fadeIn 0.5s ease-out;
}
.board {
  display: grid;
  grid-template-columns: repeat(8, 60px);
  grid-template-rows: repeat(8, 60px);
  gap: 0;
  margin: 0 auto 1rem;
  border: 2px solid #333;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5);
  perspective: 800px;
}
.cell {
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  transform-style: preserve-3d;
}
.cell.light {
  background-color: #f0d9b5;
}
.cell.dark {
  background-color: #b58863;
}
.cell.selected {
  outline: 3px solid #00ff00;
}
.cell.legal {
  outline: 3px solid #00ffff;
}
.controls {
  margin-top: 1rem;
}
.control-btn {
  padding: 10px 20px;
  font-size: 1.1rem;
  background-color: #007bff;
  border: none;
  border-radius: 5px;
  color: #fff;
  cursor: pointer;
  transition: background 0.3s, transform 0.3s;
  margin: 0.5rem;
}
.control-btn:hover {
  background-color: #0056b3;
  transform: scale(1.05);
}

/* Footer */
.footer {
  margin-top: 2rem;
  padding: 1rem;
  background: rgba(0,0,0,0.85);
  font-size: 0.9rem;
  text-align: center;
}
.footer .credit {
  font-style: italic;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ---------------------------------
   Responsive Design
----------------------------------*/
@media (max-width: 600px) {
  .board {
    grid-template-columns: repeat(8, 40px);
    grid-template-rows: repeat(8, 40px);
  }
  .cell {
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
  }
  .container {
    width: 95%;
  }
}
