* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
}

:root {
  --primary-color: #2041ff;
  --secondary-color: #6ea3ff;
  --accent-color: #ffffff;
  --light-color: #aff3ff;
  --text-color: #000000;
  --white: #ffffff;
  --error-color: #fe615c;
  --success-color: #66cc99;
  --card-bg: rgba(255, 255, 255, 0.9);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* Header styles */
.header-menu {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  padding: 0 10%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-bottom: 2px solid #fff;
  transition: all 0.3s ease;
}

.header-menu:hover {
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.logo {
  font-size: 28px;
  font-family: "Poppins", sans-serif;
  font-weight: 700;
  color: var(--white);
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
  letter-spacing: 1px;
}

.navigation ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
}

.header-menu .navigation ul li {
  position: relative;
}

.header-menu .navigation ul li a {
  font-family: "Poppins", sans-serif;
  font-size: 16px;
  font-weight: 500;
  color: var(--white);
  text-decoration: none;
  padding: 22px 20px;
  display: block;
  transition: all 0.3s ease;
}

.header-menu .navigation ul li a:hover {
  background-color: rgba(255, 255, 255, 0.733);
  transform: translateY(-2px);
  color: var(--primary-color);
}

#toggle,
.header-menu label {
  display: none;
  cursor: pointer;
}

.menu {
  width: 28px;
  height: 28px;
  filter: brightness(0) invert(1);
}

@media (max-width: 950px) {
  .header-menu label {
    display: initial;
  }

  .header-menu {
    padding: 15px 10%;
  }

  .header-menu .navigation {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--primary-color);
    display: none;
    border-radius: 0 0 12px 12px;
  }

  .header-menu .navigation ul {
    flex-direction: column;
  }

  .header-menu .navigation ul li {
    width: 100%;
  }

  .header-menu .navigation ul li a {
    padding: 12px 20px;
  }

  #toggle:checked ~ .navigation {
    display: block;
    animation: slideDown 0.4s ease-out;
  }
}

/* Body styles */
body {
  font-family: "Poppins", sans-serif;
  background: linear-gradient(135deg, hsl(215, 100%, 86%), #3b97ff, #5c9bee);
  margin: 0;
  padding: 0;
  padding-top: 80px;
  min-height: 100vh;
  color: var(--text-color);
  background-size: 400% 400%;
  animation: gradientBG 15s ease infinite;
}

@keyframes gradientBG {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Game styles */
.game-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px;
}

.container {
  background-color: rgba(255, 255, 255, 0.9);
  padding: 30px;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  margin-bottom: 30px;
  border: 3px solid var(--primary-color);
}

h1 {
  font-family: "Poppins", sans-serif;
  color: var(--primary-color);
  text-align: center;
  margin-bottom: 20px;
  font-size: 2.5rem;
  text-transform: uppercase;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
  background-color: var(--white);
  padding: 15px;
  border-radius: 10px;
  display: inline-block;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

#crossword {
  display: grid;
  grid-template-columns: repeat(15, 35px);
  grid-template-rows: repeat(15, 35px);
  gap: 2px;
  margin: 20px auto;
  justify-content: center;
  background-color: var(--white);
  padding: 20px;
  border-radius: 10px;
  box-shadow: var(--shadow);
  border: 2px solid var(--primary-color);
}

.cell-container {
  width: 35px;
  height: 35px;
  position: relative;
}

.cell {
  width: 100%;
  height: 100%;
  text-align: center;
  font-size: 18px;
  font-weight: bold;
  border: 1px solid var(--primary-color);
  background-color: var(--white);
  box-sizing: border-box;
  position: relative;
  text-transform: uppercase;
  border-radius: 5px;
  transition: all 0.2s ease;
}

.cell:focus {
  outline: none;
  background-color: #e6f7ff;
  border: 2px solid var(--secondary-color);
  transform: scale(1.05);
}

.clue-number {
  position: absolute;
  top: 1px;
  left: 2px;
  font-size: 9px;
  color: var(--primary-color);
  font-weight: bold;
}

.cell.highlight {
  background-color: #e3f2fd;
}

.cell.disabled {
  background-color: #f5f5f5;
  border: 1px solid #ddd;
}

#clues {
  display: flex;
  justify-content: space-around;
  margin-top: 20px;
  flex-wrap: wrap;
  background-color: var(--white);
  padding: 20px;
  border-radius: 10px;
  box-shadow: var(--shadow);
  border: 2px solid var(--primary-color);
}

.clues-column {
  width: 45%;
  min-width: 300px;
  text-align: left;
  padding: 10px;
  margin-bottom: 10px;
}

.clues-column h2 {
  color: var(--primary-color);
  border-bottom: 2px solid var(--light-color);
  padding-bottom: 10px;
  margin-bottom: 15px;
  font-size: 1.3rem;
}

.clues-column p {
  font-size: 16px;
  margin: 10px 0;
  color: var(--text-color);
  padding-left: 10px;
  border-left: 3px solid var(--secondary-color);
}

.button-container {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin: 30px 0;
}

button {
  padding: 12px 25px;
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  color: white;
  border: none;
  cursor: pointer;
  border-radius: 30px;
  font-size: 1rem;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

button:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

button:active {
  transform: translateY(1px);
}

#check-answers {
  background: linear-gradient(135deg, var(--success-color), #44b984);
}

#reset-crossword {
  background: linear-gradient(135deg, #ff5252, #ff7675);
}

#result {
  margin-top: 15px;
  font-size: 18px;
  color: var(--white);
  background-color: var(--primary-color);
  padding: 15px;
  border-radius: 10px;
  display: inline-block;
  box-shadow: var(--shadow);
  text-align: center;
  width: 100%;
  font-weight: 600;
}

/* Progress bar styles */
.progress-container {
  background-color: var(--white);
  border-radius: 10px;
  padding: 20px;
  margin-top: 20px;
  box-shadow: var(--shadow);
  border: 2px solid var(--primary-color);
}

.progress-container h3 {
  color: var(--primary-color);
  margin-top: 0;
  margin-bottom: 15px;
  font-size: 1.2rem;
  text-align: center;
}

.progress-bar {
  width: 100%;
  height: 25px;
  background-color: #f0f0f0;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(
    90deg,
    var(--secondary-color),
    var(--primary-color)
  );
  border-radius: 12px;
  transition: width 0.5s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  font-size: 14px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Celebration styles */
.congratulations-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

.congratulations-box {
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  padding: 40px;
  border-radius: 15px;
  text-align: center;
  max-width: 500px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  transform: scale(0.8);
  transition: transform 0.5s ease;
}

.congratulations-box h2 {
  color: var(--white);
  font-size: 2rem;
  margin-bottom: 20px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.congratulations-box p {
  color: var(--white);
  font-size: 1.2rem;
  margin-bottom: 30px;
}

.congratulations-box button {
  background-color: var(--white);
  color: var(--primary-color);
  border: none;
  padding: 12px 30px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.congratulations-box button:hover {
  transform: scale(1.05);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.show-congratulations {
  opacity: 1;
  pointer-events: auto;
}

.show-congratulations .congratulations-box {
  transform: scale(1);
}

/* Confetti animation */
@keyframes fall {
  to {
    transform: translateY(100vh) rotate(360deg);
  }
}

.confetti {
  position: fixed;
  top: -10px;
  width: 10px;
  height: 10px;
  background-color: #f00;
  border-radius: 50%;
  animation: fall 3s linear forwards;
  z-index: 1000;
  pointer-events: none;
}

@media (max-width: 768px) {
  #crossword {
    grid-template-columns: repeat(15, 25px);
    grid-template-rows: repeat(15, 25px);
    padding: 10px;
  }

  .cell-container {
    width: 25px;
    height: 25px;
  }

  .cell {
    font-size: 14px;
  }

  .clue-number {
    font-size: 7px;
  }

  .clues-column {
    width: 100%;
    margin: 10px 0;
  }

  h1 {
    font-size: 1.8em;
    padding: 10px;
  }

  .container {
    padding: 15px;
  }

  .progress-bar {
    height: 20px;
  }
}
