:root {
  --fondo: #0d1424;
  --fondo-2: #131d33;
  --tarjeta: #18233c;
  --borde: rgba(255, 255, 255, 0.09);
  --texto: #eef1f8;
  --suave: #a9b3c9;
  --dorado: #e5b85c;
  --dorado-fuerte: #f2c96e;
  --rojo: #b8322f;
  --radio: 18px;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--texto);
  background: var(--fondo);
  line-height: 1.5;
  overflow-x: hidden;
}

h1,
h2,
h3,
p {
  margin: 0;
}

/* ---------- portada ---------- */
.hero {
  position: relative;
  min-height: min(88vh, 760px);
  display: grid;
  align-items: end;
  overflow: hidden;
  isolation: isolate;
}

.hero-foto {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  z-index: -2;
}

.hero-velo {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(13, 20, 36, 0.15) 0%, rgba(13, 20, 36, 0.35) 45%, var(--fondo) 100%),
    radial-gradient(ellipse at 50% 100%, rgba(184, 50, 47, 0.25), transparent 60%);
}

.hero-texto {
  width: min(100% - 32px, 1080px);
  margin: 0 auto;
  padding: 0 0 56px;
  display: grid;
  justify-items: start;
  gap: 10px;
}

.eyebrow {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--dorado);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
}

.hero h1 {
  font-family: var(--serif);
  font-weight: 800;
  font-size: clamp(2.4rem, 7vw, 4.8rem);
  line-height: 1;
  letter-spacing: -0.02em;
  text-shadow: 0 6px 28px rgba(0, 0, 0, 0.55);
  text-wrap: balance;
}

.subtitulo {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.15rem, 2.6vw, 1.6rem);
  color: #fff;
  opacity: 0.92;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.6);
  margin-bottom: 14px;
}

/* ---------- botones ---------- */
.boton {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 12px 22px;
  font: 700 0.95rem/1 var(--sans);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  transition: background-color 0.15s ease, transform 0.15s ease, opacity 0.15s ease;
}
.boton:active:not(:disabled) {
  transform: translateY(1px);
}
.boton:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.boton:focus-visible {
  outline: 2px solid var(--dorado-fuerte);
  outline-offset: 3px;
}
.dorado {
  background: var(--dorado);
  color: #1c1406;
}
.dorado:hover:not(:disabled) {
  background: var(--dorado-fuerte);
}
.fantasma {
  background: transparent;
  color: var(--texto);
  border-color: rgba(255, 255, 255, 0.25);
}
.fantasma:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.07);
}
.texto {
  background: none;
  color: var(--suave);
  padding-inline: 10px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.texto:hover:not(:disabled) {
  color: var(--texto);
}

/* ---------- bloques ---------- */
main {
  width: min(100% - 32px, 1080px);
  margin: 0 auto;
}

.bloque {
  padding: 48px 0 8px;
}

.bloque-cabeza {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 24px;
  margin-bottom: 20px;
}

.bloque h2 {
  font-family: var(--serif);
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 800;
}

.nota {
  color: var(--suave);
  font-size: 0.92rem;
}

.familias {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
}

.familia {
  background: var(--tarjeta);
  border: 1px solid var(--borde);
  border-top: 4px solid var(--color);
  border-radius: var(--radio);
  padding: 18px 18px 16px;
}

.familia h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.familia ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.familia li {
  font-size: 0.9rem;
  padding: 4px 11px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--color) 22%, transparent);
  border: 1px solid color-mix(in srgb, var(--color) 55%, transparent);
}

.reglas {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  color: var(--suave);
  font-size: 0.9rem;
}
.reglas li::before {
  content: "✦ ";
  color: var(--dorado);
}

/* ---------- sorteo ---------- */
.sorteo-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 32px;
  align-items: center;
  background: linear-gradient(160deg, var(--fondo-2), #101a2e);
  border: 1px solid var(--borde);
  border-radius: 24px;
  padding: 32px;
}

.ruleta-caja {
  position: relative;
  width: min(100%, 440px);
  aspect-ratio: 1;
  margin: 0 auto;
}

.ruleta {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 18px 30px rgba(0, 0, 0, 0.45));
}

#ruleta-giro {
  transform-origin: 0 0;
  transition-property: transform;
  transition-timing-function: cubic-bezier(0.12, 0.72, 0.06, 1);
}

.gajo path {
  stroke: rgba(13, 20, 36, 0.55);
  stroke-width: 1.5;
  transition: opacity 0.4s ease;
}
.gajo path.par {
  filter: brightness(1.12);
}
.gajo text {
  fill: #fff;
  font-family: var(--sans);
  font-weight: 700;
  pointer-events: none;
}
.gajo.tomado path {
  opacity: 0.28;
}
.gajo.tomado text {
  opacity: 0.45;
}
.aro {
  fill: none;
  stroke: var(--dorado);
  stroke-width: 6;
}

.puntero {
  position: absolute;
  top: -6px;
  left: 50%;
  translate: -50% 0;
  width: 0;
  height: 0;
  border-left: 16px solid transparent;
  border-right: 16px solid transparent;
  border-top: 30px solid var(--dorado-fuerte);
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.5));
  z-index: 2;
}

.centro {
  position: absolute;
  inset: 50% auto auto 50%;
  translate: -50% -50%;
  width: 18%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--fondo);
  border: 4px solid var(--dorado);
  display: grid;
  place-items: center;
  font-size: clamp(1.1rem, 4vw, 1.7rem);
}

.panel {
  display: grid;
  gap: 6px;
  text-align: center;
  justify-items: center;
}

.panel-etiqueta {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--dorado);
}

.panel-nombre {
  font-family: var(--serif);
  font-weight: 800;
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.panel-resultado {
  min-height: 3em;
  font-size: 1.1rem;
  color: var(--suave);
}
.panel-resultado strong {
  color: var(--dorado-fuerte);
  font-family: var(--serif);
  font-size: 1.5rem;
  display: block;
}

.progreso {
  width: min(100%, 280px);
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
  margin-top: 6px;
}
.progreso span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--dorado);
  transition: width 0.4s ease;
}

.acciones {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 14px;
}

.resultados {
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 10px;
  counter-reset: par;
}

.resultado {
  counter-increment: par;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas: "n da" "n flecha" "n recibe";
  column-gap: 14px;
  background: var(--tarjeta);
  border: 1px solid var(--borde);
  border-radius: 14px;
  padding: 12px 16px;
}
.resultado::before {
  content: counter(par);
  grid-area: n;
  align-self: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  font-weight: 700;
  background: rgba(229, 184, 92, 0.15);
  color: var(--dorado);
}
.resultado .da {
  grid-area: da;
  font-weight: 700;
}
.resultado .flecha {
  grid-area: flecha;
  font-size: 0.8rem;
  color: var(--suave);
}
.resultado .recibe {
  grid-area: recibe;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--dorado-fuerte);
}

.entra {
  animation: entra 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
@keyframes entra {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
}

/* ---------- diálogo ---------- */
.confirmar {
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  background: var(--tarjeta);
  color: var(--texto);
  padding: 24px;
  width: min(100% - 32px, 420px);
}
.confirmar::backdrop {
  background: rgba(5, 8, 16, 0.7);
}
.confirmar h3 {
  font-family: var(--serif);
  font-size: 1.3rem;
  margin-bottom: 8px;
}
.confirmar p {
  color: var(--suave);
}
.confirmar .acciones {
  justify-content: flex-end;
  margin-top: 20px;
}

/* ---------- pie ---------- */
.pie {
  margin-top: 64px;
  padding: 28px 16px;
  text-align: center;
  color: var(--suave);
  font-size: 0.9rem;
  border-top: 1px solid var(--borde);
}

.cssoftware {
  display: block;
  padding: 12px 16px;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: #1c1406;
  background: var(--dorado);
  text-decoration: none;
}
.cssoftware:hover {
  background: var(--dorado-fuerte);
}

/* ---------- responsive ---------- */
@media (max-width: 760px) {
  .sorteo-grid {
    grid-template-columns: 1fr;
    padding: 20px 16px 24px;
    gap: 20px;
  }
  .hero {
    min-height: 72vh;
  }
  .hero-texto {
    padding-bottom: 36px;
  }
  .acciones .boton {
    flex: 1 1 140px;
  }
  .acciones .texto {
    flex-basis: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .entra {
    animation-name: aparece;
  }
  @keyframes aparece {
    from {
      opacity: 0;
    }
  }
}
