/* Colores y tipografía */
:root {
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  color: #654568;
  background: #fff0f6;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  padding: 40px 20px;
  background:
    radial-gradient(circle at 15% 20%, #ffe0ef 0, transparent 35%),
    radial-gradient(circle at 85% 80%, #e5deff 0, transparent 35%),
    #fff5fa;
}

/* Tarjeta principal */
main {
  position: relative;
  max-width: 620px;
  margin: auto;
  padding: 36px;
  background: #fffafd;
  border: 3px solid #ffd0e5;
  border-radius: 28px;
  box-shadow: 0 12px 0 #f5d5e6, 0 20px 40px #94638518;
}

main::before {
  content: "✦";
  position: absolute;
  top: -22px;
  right: 24px;
  color: #a889d5;
  font-size: 44px;
}

/* Título y explicación */
h1 {
  margin-top: 0;
  color: #ad426f;
  font-size: clamp(26px, 5vw, 36px);
  text-align: center;
}

p {
  line-height: 1.7;
}

label {
  display: block;
  margin-top: 24px;
  margin-bottom: 8px;
  font-weight: bold;
  color: #8c4877;
}

/* Campo para escribir */
input {
  width: 100%;
  padding: 16px;
  border: 2px solid #e7bddc;
  border-radius: 16px;
  background: white;
  color: #654568;
  font-family: inherit;
  font-size: 18px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input::placeholder {
  color: #947b96;
}

input:focus {
  outline: 3px solid #a889d5;
  outline-offset: 3px;
  border-color: #c77cac;
  box-shadow: 0 0 0 6px #fce3f1;
}

/* Contador y progreso */
#contador,
#progreso {
  display: inline-block;
  margin: 12px 6px 4px 0;
  padding: 6px 12px;
  background: #f1eaff;
  border-radius: 20px;
  color: #70528e;
  font-size: 14px;
  font-weight: bold;
}

/* Tarjetas de reglas */
#lista-reglas {
  list-style: none;
  padding: 0;
  margin-top: 24px;
}

#lista-reglas li {
  margin-bottom: 12px;
  padding: 16px;
  border: 2px solid;
  border-radius: 16px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  animation: aparecer 0.25s ease-out;
}

.correcta {
  background: #eaf9ef;
  border-color: #a5d9b6;
  color: #326646;
}

.incorrecta {
  background: #fff0f4;
  border-color: #f0b5ca;
  color: #93415d;
}

/* Mensaje de victoria */
#mensaje {
  color: #80519b;
  font-weight: bold;
  text-align: center;
}

#mensaje:not(:empty) {
  padding: 18px;
  background: #f2eaff;
  border: 2px dashed #c3a6df;
  border-radius: 16px;
}

/* Botón */
button {
  display: block;
  margin: 20px auto 0;
  padding: 13px 28px;
  border: 2px solid #a94573;
  border-radius: 18px;
  background: #ffd1e5;
  color: #783153;
  box-shadow: 0 5px 0 #c7779e;
  font-family: inherit;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

button:hover {
  background: #ffc0db;
  transform: translateY(-2px);
  box-shadow: 0 7px 0 #c7779e;
}

button:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 #c7779e;
}

button:focus-visible {
  outline: 3px solid #9573bc;
  outline-offset: 5px;
}

/* Aparición suave de las reglas */
@keyframes aparecer {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Adaptación al móvil */
@media (max-width: 480px) {
  body {
    padding: 24px 12px;
  }

  main {
    padding: 24px 18px;
    border-radius: 22px;
  }

  input {
    font-size: 16px;
  }
}

/* Respeta la preferencia de reducir animaciones */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}