body {
  background: linear-gradient(to right, #eef2f3, #8e9eab);
  font-family: 'Segoe UI', sans-serif;
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

header {
  width: 100%;
  background: linear-gradient(to right, #dcf4fa, #839bad);
  color: #2c3e50;
  box-shadow: 0 2px 8px rgba(44,62,80,0.08);
  padding: 2rem 0 1rem 0;
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  border-bottom-left-radius: 18px;
  border-bottom-right-radius: 18px;
}

@media (max-width: 600px) {
  header {
    padding: 1rem 0 0.5rem 0;
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
  }
}

.titulo {
  font-size: 3rem;
  font-weight: bold;
  color: #2c3e50;
}

.subtitulo {
  font-size: 1.25rem;
  color: #34495e;
}

.grid {
  display: grid;
  grid-template-columns: repeat(var(--tamanio, 10), minmax(1.8rem, 2.8rem));
  gap: 0.4rem;
  justify-content: center;
}

.cell {
  width: 2.8rem;
  height: 2.8rem;
  background-color: #ffffff;
  border: 2px solid #2980b9;
  font-weight: bold;
  font-size: 1.1rem;
  line-height: 2.8rem;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.3s;
}

.cell:hover {
  background-color: #ecf0f1;
}

.selected {
  background-color: #f1c40f !important;
}

.found {
  background-color: #2ecc71 !important;
  color: #fff;
}

@media (max-width: 600px) {
  .titulo {
    font-size: 2rem;
  }
  .subtitulo {
    font-size: 1rem;
  }
  .grid {
    grid-template-columns: repeat(10, 2rem);
    gap: 0.2rem;
  }
  .cell {
    width: 2rem;
    height: 2rem;
    font-size: 0.9rem;
    line-height: 2rem;
  }
  .container {
    padding: 0 0.5rem;
  }
}

.incorrecta {
  background-color: #e74c3c !important;
  animation: shake 0.3s;
}

@keyframes shake {
  0% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  50% { transform: translateX(3px); }
  75% { transform: translateX(-3px); }
  100% { transform: translateX(0); }
}

.encontrada-palabra {
  background: #2ecc71 !important;
  color: #fff !important;
  text-decoration: line-through;
  transition: background 0.3s, color 0.3s;
}
.no-encontrada-palabra {
  background: #fff !important;
  color: #2c3e50 !important;
  text-decoration: none;
}

/* Footer Styles */
.footer-custom {
  width: 100%;
  background: linear-gradient(to right, #8e9eab, #eef2f3);
  color: #2c3e50;
  box-shadow: 0 -2px 8px rgba(44,62,80,0.08);
  position: relative;
  bottom: 0;
  left: 0;
}

.footer-text {
  font-size: 1rem;
  letter-spacing: 1px;
  font-weight: 500;
  color: #2c3e50;
}

@media (max-width: 600px) {
  .footer-text {
    font-size: 0.9rem;
  }
}

/* Modal personalizado sin Bootstrap */
.modal-custom {
  position: fixed;
  z-index: 9999;
  left: 0; top: 0; right: 0; bottom: 0;
  background: rgba(44,62,80,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-custom[hidden] {
  display: none !important;
}
.modal-custom-dialog {
  background: none;
  border: none;
  box-shadow: none;
}
.modal-custom-content {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(44,62,80,0.18);
  padding: 2rem 1.5rem 1.5rem 1.5rem;
  min-width: 320px;
  max-width: 90vw;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
.modal-custom-header {
  margin-bottom: 1rem;
}
.modal-custom-title {
  font-size: 1.5rem;
  font-weight: bold;
  color: #2c3e50;
  text-align: center;
}
.modal-custom-body {
  margin-bottom: 1.5rem;
}
.modal-custom-footer {
  display: flex;
  justify-content: center;
}
@media (max-width: 600px) {
  .modal-custom-content {
    min-width: 90vw;
    padding: 1rem 0.5rem 1rem 0.5rem;
  }
  .modal-custom-title {
    font-size: 1.1rem;
  }
}
