:root {
  --font-family: "Nunito", sans-serif;
  --transition-speed: 0.3s;

  --light-bg: #f5f5f5;
  --light-text: #1a1a1a;
  --light-tile-bg: #ffffff;
  --light-tile-border: #d3d6da;
  --light-correct: #6aaa64;
  --light-present: #c9b458;
  --light-absent: #787c7e;

  --dark-bg: #121213;
  --dark-text: #e2e2e2;
  --dark-tile-bg: #1e1e1f;
  --dark-tile-border: #3a3a3c;
  --dark-correct: #538d4e;
  --dark-present: #b59f3b;
  --dark-absent: #3a3a3c;

  --tile-size: 45px;
  --tile-gap: 10px;
}

body {
  margin: 0;
  font-family: var(--font-family);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(120deg, #ece9e6, #ffffff);
  color: var(--light-text);
  transition: background var(--transition-speed), color var(--transition-speed);
}

.dark-mode body {
  background: linear-gradient(120deg, #121213, #1c1c1d);
  color: var(--dark-text);
}

.game-container {
  max-width: 500px;
  width: 90%;
  padding: 20px;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  transition: transform var(--transition-speed);
}

.dark-mode .game-container {
  background: rgba(30, 30, 31, 0.8);
}

.game-container:hover {
  transform: scale(1.02);
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.header h1 {
  font-size: 2rem;
  margin: 0;
  font-weight: 900;
  color: var(--light-correct);
}

.dark-mode .header h1 {
  color: var(--dark-correct);
}

#reset-btn {
  background: var(--light-absent);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1rem;
  transition: background var(--transition-speed);
}

.light-mode #reset-btn:hover {
  background: var(--light-present);
}

.dark-mode #reset-btn:hover {
  background: var(--dark-present);
}

.info-section {
  margin-bottom: 20px;
  font-size: 1rem;
  line-height: 1.6;
  background: rgba(255, 255, 255, 0.8);
  padding: 20px;
  border-radius: 15px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.dark-mode .info-section {
  background: rgba(30, 30, 31, 0.6);
}

.board-container {
  display: flex;
  justify-content: center;
}

.board {
  display: grid;
  grid-template-columns: repeat(5, var(--tile-size));
  grid-template-rows: repeat(6, var(--tile-size));
  gap: var(--tile-gap);
}

.tile {
  border: 2px solid var(--light-tile-border);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.6rem;
  font-weight: bold;
  text-transform: uppercase;
  background: var(--light-tile-bg);
  transition: background-color var(--transition-speed),
    border-color var(--transition-speed), transform 0.1s;
}

.dark-mode .tile {
  border: 2px solid var(--dark-tile-border);
  background: var(--dark-tile-bg);
}

.tile.correct {
  background: var(--light-correct);
  border-color: var(--light-correct);
}

.dark-mode .tile.correct {
  background: var(--dark-correct);
  border-color: var(--dark-correct);
}

.tile.present {
  background: var(--light-present);
  border-color: var(--light-present);
}

.dark-mode .tile.present {
  background: var(--dark-present);
  border-color: var(--dark-present);
}

.tile.absent {
  background: var(--light-absent);
  border-color: var(--light-absent);
}

.dark-mode .tile.absent {
  background: var(--dark-absent);
  border-color: var(--dark-absent);
}

.theme-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  user-select: none;
}

.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 25px;
}

.switch input {
  display: none;
}

.slider {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--light-tile-border);
  border-radius: 25px;
  cursor: pointer;
  transition: background var(--transition-speed);
}

.slider:before {
  content: "\2600";
  position: absolute;
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 0.8rem;
  transition: transform var(--transition-speed), content var(--transition-speed);
}

input:checked + .slider {
  background: var(--light-correct);
}

input:checked + .slider:before {
  content: "\1F319";
  transform: translateX(25px);
}

footer {
  margin-top: 20px;
  text-align: center;
  font-size: 0.9rem;
  color: #777;
}

@media (max-width: 1200px) {
  .header h1 {
    font-size: 1.5rem;
  }

  #reset-btn {
    padding: 8px 15px;
    font-size: 0.8rem;
  }

  .info-section {
    font-size: 0.9rem;
  }
}
