:root {
  --primary-color: #5b6abf;
  --secondary-color: #9c64a6;
  --accent-color: #6a5acd;
  --light-color: #e6e6fa;
  --success-color: #4caf50;
  --error-color: #f44336;
  --text-color: #2c3e50;
  --white: #ffffff;
}

/* Estilos del Header mejorado */
.header {
  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:hover {
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.logo {
  font-size: 28px;
  font-family: "Montserrat", 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;
}

.header .navigation ul li {
  float: left;
  position: relative;
}

.header .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 .navigation ul li a:hover {
  background-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

.header .navigation ul li ul {
  position: absolute;
  right: 0;
  width: 220px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 0 0 8px 8px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
  display: none;
  overflow: hidden;
}

.header .navigation ul li ul li a {
  color: var(--text-color);
  padding: 12px 20px;
  font-size: 14px;
}

.header .navigation ul li ul li a:hover {
  background-color: var(--light-color);
  color: var(--primary-color);
}

.header .navigation ul li:hover > ul {
  display: initial;
  animation: fadeIn 0.3s ease-out;
}

#toggle,
.header label {
  display: none;
  cursor: pointer;
}

.menu {
  width: 28px;
  height: 28px;
  filter: brightness(0) invert(1);
}

@media (max-width: 950px) {
  .header label {
    display: initial;
  }

  .header {
    padding: 15px 10%;
  }

  .header .navigation {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--primary-color);
    display: none;
    border-radius: 0 0 12px 12px;
  }

  .header .navigation ul li {
    width: 100%;
  }

  .header .navigation ul li a {
    padding: 12px 20px;
  }

  .header .navigation ul li ul {
    position: relative;
    width: 100%;
    left: 0;
    background: rgba(255, 255, 255, 0.1);
  }

  .header .navigation ul li ul li a {
    padding-left: 30px;
  }

  #toggle:checked ~ .navigation {
    display: block;
    animation: slideDown 0.4s ease-out;
  }
}

/* Estilos del cuerpo y fondo */
body {
  font-family: "Poppins", sans-serif;
  background: linear-gradient(135deg, #b7f7ff, #d2bcfc, #ade5ff);
  margin: 0;
  padding: 0;
  padding-top: 80px;
  min-height: 100vh;
  color: var(--text-color);
  background-size: 400% 400%;
  animation: gradientBG 15s ease infinite;
}

/* Animación de fondo */
@keyframes gradientBG {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* Animaciones */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes bounce {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-15px);
  }
  60% {
    transform: translateY(-7px);
  }
}

/* Contenedor principal */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* Título */
h1 {
  text-align: center;
  color: white;
  margin-bottom: 30px;
  font-family: "Poppins", sans-serif;
  font-size: 2.5rem;
  font-weight: 700;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);
  position: relative;
  padding-bottom: 15px;
}

h1::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 4px;
  background: linear-gradient(
    90deg,
    var(--primary-color),
    var(--secondary-color)
  );
  border-radius: 4px;
}

/* Contenedor del juego */
.game-container {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  justify-content: center;
  margin-bottom: 30px;
}

/* Sección de imagen */
.image-section {
  flex: 1;
  min-width: 300px;
  max-width: 500px;
  animation: fadeIn 0.8s ease-out;
}

/* Sección de lista */
.list-section {
  flex: 1;
  min-width: 300px;
  max-width: 500px;
  background-color: rgba(255, 255, 255, 0.85);
  border-radius: 15px;
  padding: 25px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  animation: fadeIn 1s ease-out;
}

/* Imagen actual */
.current-image {
  text-align: center;
  background-color: rgba(255, 255, 255, 0.85);
  border-radius: 15px;
  padding: 25px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  margin-bottom: 25px;
  transition: all 0.3s ease;
}

.current-image:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.15);
}

/* Imagen del trabajo */
.job-image {
  width: 100%;
  max-width: 360px;
  height: 260px;
  object-fit: cover;
  border-radius: 12px;
  border: 3px solid var(--primary-color);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
}

.job-image:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

/* Lista de trabajos */
.jobs-list {
  list-style-type: none;
  padding: 0;
  column-count: 2;
  column-gap: 20px;
}

.jobs-list li {
  margin-bottom: 10px;
  padding: 8px 12px;
  break-inside: avoid;
  background-color: rgba(255, 255, 255, 0.6);
  border-radius: 8px;
  transition: all 0.3s ease;
  font-family: "Poppins", sans-serif;
}

.jobs-list li:hover {
  background-color: rgba(255, 255, 255, 0.9);
  transform: translateX(5px);
}

.jobs-list li span {
  font-weight: bold;
  margin-right: 10px;
  color: var(--primary-color);
  font-family: "Montserrat", sans-serif;
}

/* Sección de entrada */
.input-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 25px;
}

.input-section label {
  margin-bottom: 12px;
  font-weight: 600;
  font-size: 18px;
  color: var(--text-color);
}

.input-section input {
  width: 100px;
  padding: 12px;
  font-size: 20px;
  text-align: center;
  text-transform: uppercase;
  border: 2px solid var(--primary-color);
  border-radius: 8px;
  font-family: "Montserrat", sans-serif;
  font-weight: 600;
  color: var(--primary-color);
  transition: all 0.3s ease;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.input-section input:focus {
  outline: none;
  border-color: var(--secondary-color);
  box-shadow: 0 0 0 3px rgba(91, 106, 191, 0.3);
  transform: scale(1.05);
}

.input-section button {
  margin-top: 20px;
  padding: 12px 30px;
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  color: white;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(91, 106, 191, 0.3);
  position: relative;
  overflow: hidden;
}

.input-section button:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 15px rgba(91, 106, 191, 0.4);
  animation: pulse 1s infinite;
}

.input-section button:active {
  transform: translateY(1px);
}

.input-section button::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  background: rgba(255, 255, 255, 0.5);
  opacity: 0;
  border-radius: 100%;
  transform: scale(1, 1) translate(-50%);
  transform-origin: 50% 50%;
}

.input-section button:focus:not(:active)::after {
  animation: ripple 1s ease-out;
}

@keyframes ripple {
  0% {
    transform: scale(0, 0);
    opacity: 1;
  }
  100% {
    transform: scale(20, 20);
    opacity: 0;
  }
}

/* Feedback */
.feedback {
  text-align: center;
  font-size: 18px;
  margin: 20px 0;
  min-height: 27px;
  padding: 15px;
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.correct-feedback {
  color: var(--success-color);
  background-color: rgba(76, 175, 80, 0.1);
  border: 1px solid rgba(76, 175, 80, 0.3);
  animation: bounce 0.5s;
}

.incorrect-feedback {
  color: var(--error-color);
  background-color: rgba(244, 67, 54, 0.1);
  border: 1px solid rgba(244, 67, 54, 0.3);
}

/* Contenedor de puntuación */
.score-container {
  text-align: center;
  margin: 25px 0;
  font-size: 22px;
  font-weight: 600;
  color: var(--text-color);
  background-color: rgba(255, 255, 255, 0.7);
  padding: 15px;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  max-width: 300px;
  margin-left: auto;
  margin-right: auto;
}

/* Botón de reinicio */
.restart-btn {
  padding: 14px 32px;
  background: linear-gradient(
    135deg,
    var(--secondary-color),
    var(--accent-color)
  );
  color: white;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  display: block;
  margin: 0 auto;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(156, 100, 166, 0.3);
  position: relative;
  overflow: hidden;
}

.restart-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 18px rgba(156, 100, 166, 0.4);
  animation: pulse 1s infinite;
}

.restart-btn:active {
  transform: translateY(1px);
}

/* Modal de felicitaciones */
.congrats-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 2000;
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.5s ease-out;
}

.modal-content {
  background: linear-gradient(135deg, var(--white), var(--light-color));
  padding: 40px;
  border-radius: 20px;
  text-align: center;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
  transform: scale(0.9);
  animation: scaleUp 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  position: relative;
  overflow: hidden;
}

@keyframes scaleUp {
  to {
    transform: scale(1);
  }
}

.modal-content::before {
  content: "";
  position: absolute;
  top: -10px;
  left: -10px;
  right: -10px;
  bottom: -10px;
  background: linear-gradient(
    45deg,
    var(--primary-color),
    var(--secondary-color),
    var(--accent-color)
  );
  z-index: -1;
  filter: blur(20px);
  opacity: 0.7;
}

.modal-content h2 {
  font-family: "Poppins", sans-serif;
  color: var(--primary-color);
  font-size: 2rem;
  margin-bottom: 20px;
}

.modal-content p {
  font-size: 1.2rem;
  margin-bottom: 30px;
  color: var(--text-color);
}

.modal-btn {
  padding: 12px 30px;
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  color: white;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(91, 106, 191, 0.3);
}

.modal-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 15px rgba(91, 106, 191, 0.4);
}

/* Estilos responsivos */
@media (max-width: 768px) {
  .game-container {
    flex-direction: column;
  }

  .jobs-list {
    column-count: 1;
  }

  .job-image {
    height: 220px;
  }

  h1 {
    font-size: 2rem;
  }

  .header .navigation ul li a {
    padding: 15px 20px;
  }

  .modal-content {
    padding: 30px 20px;
  }

  .modal-content h2 {
    font-size: 1.5rem;
  }

  .modal-content p {
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .logo {
    font-size: 22px;
  }

  .header {
    padding: 12px 5%;
  }

  .job-image {
    height: 180px;
  }

  .input-section input {
    width: 80px;
    font-size: 18px;
  }

  .input-section button,
  .restart-btn {
    padding: 12px 25px;
  }
}
