:root {
  color-scheme: dark;
  --fondo: #14081f;
  --tinta: #fff4fb;
  --apagado: #f0c8e4;
  --rosa: #ff4f9a;
  --cian: #3ef0e4;
  --oro: #ffd15a;
  --violeta: #7a4dff;
  --mal: #ff8b7a;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--tinta);
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  font-size: 20px;
  line-height: 1.5;
  background: var(--fondo);
}

.fondo {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background:
    radial-gradient(900px 500px at 8% -10%, rgba(255, 79, 154, 0.45), transparent 60%),
    radial-gradient(800px 480px at 100% 0%, rgba(62, 240, 228, 0.28), transparent 55%),
    radial-gradient(700px 500px at 70% 110%, rgba(122, 77, 255, 0.45), transparent 60%),
    var(--fondo);
}

.fondo::before,
.fondo::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
  animation: flotar 14s ease-in-out infinite;
}

.fondo::before {
  width: 280px;
  height: 280px;
  left: -40px;
  top: 30%;
  background: rgba(255, 79, 154, 0.35);
}

.fondo::after {
  width: 340px;
  height: 340px;
  right: -80px;
  bottom: 8%;
  background: rgba(62, 240, 228, 0.22);
  animation-delay: -6s;
}

main {
  width: min(1080px, calc(100% - 48px));
  margin: 0 auto;
  padding: 72px 0 120px;
}

.sello {
  display: inline-block;
  margin: 0 0 18px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--rosa);
  color: #2a0616;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  animation: pulso 2.4s ease-in-out infinite;
}

h1 {
  margin: 0;
  font-size: clamp(72px, 14vw, 128px);
  line-height: 0.82;
  letter-spacing: -0.05em;
  background: linear-gradient(100deg, #fff 10%, var(--cian) 45%, var(--rosa) 80%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.bajada, .nota { color: var(--apagado); }

.bajada {
  max-width: 38rem;
  margin: 22px 0 32px;
  font-size: 24px;
}

form {
  padding: 22px;
  border-radius: 28px;
  background: rgba(28, 12, 46, 0.82);
  border: 2px solid rgba(255, 79, 154, 0.45);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
}

textarea {
  width: 100%;
  min-height: 220px;
  resize: vertical;
  border: 0;
  border-radius: 18px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--tinta);
  font: inherit;
  font-size: 22px;
  line-height: 1.45;
  outline: none;
}

textarea:focus { box-shadow: 0 0 0 3px rgba(62, 240, 228, 0.45); }

.fila {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
}

#cuenta { color: var(--apagado); font-size: 16px; }

button {
  border: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--rosa), #ff8a3d);
  color: #2a0616;
  font: inherit;
  font-size: 20px;
  font-weight: 800;
  padding: 16px 28px;
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease;
}

button:hover { transform: translateY(-2px) scale(1.03); filter: brightness(1.05); }
button:disabled { opacity: 0.6; cursor: wait; transform: none; }

#aviso { min-height: 1.4em; margin: 14px 4px 0; font-size: 20px; }
#aviso.bien { color: var(--cian); }
#aviso.mal { color: var(--mal); }

.nota { margin-top: 18px; font-size: 17px; }

.pausa {
  margin: 0;
  padding: 22px 24px;
  border-radius: 28px;
  background: rgba(28, 12, 46, 0.82);
  border: 2px solid rgba(255, 209, 90, 0.55);
  color: var(--oro);
  font-size: 22px;
  font-weight: 700;
}

.trampa {
  position: absolute;
  left: -9999px;
  height: 0;
  width: 0;
  opacity: 0;
}

.atajos {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 42px;
}

.atajos a {
  color: var(--tinta);
  text-decoration: none;
  font-size: 18px;
  font-weight: 800;
  padding: 12px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: transform 0.2s ease, background 0.2s ease;
}

.atajos a:hover {
  transform: translateY(-3px);
  background: var(--violeta);
}

section { margin-top: 72px; }

h2 {
  margin: 0 0 10px;
  font-size: clamp(40px, 6vw, 64px);
  letter-spacing: -0.04em;
}

section .bajada { margin-top: 0; font-size: 20px; }

#lista-ranking, .comandos {
  list-style: none;
  margin: 8px 0 0;
  padding: 8px;
  border-radius: 28px;
  background: rgba(28, 12, 46, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

#lista-ranking { counter-reset: puesto; }

#lista-ranking li, .comandos li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 8px;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
  animation: entrar 0.55s ease both;
}

#lista-ranking li:nth-child(1) { animation-delay: 0.05s; background: rgba(255, 209, 90, 0.16); }
#lista-ranking li:nth-child(2) { animation-delay: 0.1s; background: rgba(62, 240, 228, 0.12); }
#lista-ranking li:nth-child(3) { animation-delay: 0.15s; background: rgba(255, 79, 154, 0.14); }
#lista-ranking li:nth-child(n + 4) { animation-delay: 0.2s; }

#lista-ranking li::before {
  counter-increment: puesto;
  content: counter(puesto);
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 14px;
  background: var(--oro);
  color: #2a1600;
  font-weight: 800;
}

#lista-ranking li:nth-child(2)::before { background: var(--cian); color: #04221f; }
#lista-ranking li:nth-child(3)::before { background: var(--rosa); color: #2a0616; }
#lista-ranking li:nth-child(n + 4)::before { background: rgba(255, 255, 255, 0.12); color: var(--tinta); }
#lista-ranking li.vacio::before { content: none; width: 0; height: 0; }

#lista-ranking span { font-size: 22px; font-weight: 700; }
#lista-ranking b { color: var(--oro); font-size: 18px; }

.comandos li {
  display: block;
  color: var(--apagado);
  font-size: 20px;
}

.comandos li:hover { transform: translateX(6px); transition: transform 0.2s ease; }

code {
  color: #1a0820;
  background: var(--cian);
  border-radius: 10px;
  padding: 2px 8px;
  font-family: ui-monospace, monospace;
  font-size: 0.86em;
  font-weight: 700;
}

.grilla {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 18px;
}

article {
  padding: 22px;
  border-radius: 24px;
  background: rgba(28, 12, 46, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: transform 0.22s ease, border-color 0.22s ease;
}

article:nth-child(3n + 1) { border-top: 4px solid var(--rosa); }
article:nth-child(3n + 2) { border-top: 4px solid var(--cian); }
article:nth-child(3n) { border-top: 4px solid var(--oro); }

article:hover {
  transform: translateY(-6px) rotate(-0.4deg);
  border-color: rgba(62, 240, 228, 0.5);
}

article h3 {
  margin: 0 0 8px;
  font-size: 26px;
}

article p {
  margin: 0;
  color: var(--apagado);
  font-size: 18px;
}

article:nth-child(8),
article:nth-child(9) { grid-column: 1 / -1; }

@keyframes flotar {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-28px) scale(1.06); }
}

@keyframes pulso {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes entrar {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 720px) {
  body { font-size: 18px; }
  main { width: min(100% - 28px, 1080px); padding-top: 40px; }
  h1 { font-size: 64px; }
  .bajada { font-size: 20px; }
  .fila { align-items: stretch; flex-direction: column; }
  button { width: 100%; }
  #lista-ranking li { align-items: flex-start; flex-direction: column; }
  article:nth-child(8),
  article:nth-child(9) { grid-column: auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  html { scroll-behavior: auto; }
}
