:root {
  --bg-1: #050816;
  --bg-2: #020617;
  --accent: #ffdd00;
  --accent-soft: #facc15;
  --text-main: #f9fafb;
  --text-muted: #9ca3af;
  --card-bg: rgba(15, 23, 42, 0.9);
  --border-soft: rgba(148, 163, 184, 0.2);
  --error: #f97373;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  height: 100%;
}

/* Huella invisible para demostrar copia si hace falta */
html::after {
  content: "ofertasia-fingerprint-8271";
  position: fixed;
  bottom: 0;
  right: 0;
  opacity: 0;
  pointer-events: none;
  font-size: 0;
}

body {
  min-height: 100vh;
  font-family: "Poppins", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #1e293b 0, var(--bg-1) 45%, var(--bg-2) 100%);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(0.75rem, 2vw, 1.5rem);
  position: relative;
  overflow-x: hidden; /* sólo bloqueo scroll horizontal */
  user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
}

/* Canvas de partículas interactivo */
#bg-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  width: 100%;
  height: 100%;
  display: block;
}

.glow-orb {
  position: fixed;
  width: min(420px, 70vw);
  height: min(420px, 70vw);
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, rgba(250, 204, 21, 0.32), transparent 70%);
  filter: blur(6px);
  top: -80px;
  right: -150px;
  z-index: 0;
  opacity: 0.7;
}

.wrapper {
  position: relative;
  z-index: 5;
  width: 100%;
  max-width: 880px;
}

.card {
  background: var(--card-bg);
  border-radius: clamp(1.1rem, 2vw, 1.75rem);
  border: 1px solid var(--border-soft);
  box-shadow:
    0 24px 70px rgba(15, 23, 42, 0.9),
    0 0 0 1px rgba(15, 23, 42, 0.4);
  padding: clamp(1.5rem, 3vw, 2.4rem);
  backdrop-filter: blur(18px);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.8rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.5);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-soft);
  margin-bottom: 1.2rem;
  white-space: nowrap;
}

.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  box-shadow: 0 0 0 6px rgba(250, 204, 21, 0.35);
  flex-shrink: 0;
}

h1 {
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.1;
  margin-bottom: 0.65rem;
  font-weight: 700;
}

.highlight {
  background: linear-gradient(90deg, var(--accent), #f97316);
  -webkit-background-clip: text;
  color: transparent;
}

.subtitle {
  font-size: clamp(0.9rem, 1.1vw, 1rem);
  color: var(--text-muted);
  margin-bottom: 1.8rem;
  max-width: 34rem;
}

/* Countdown */

.countdown {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.8rem;
}

.time-block {
  padding: 0.9rem 0.7rem;
  border-radius: 1.1rem;
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: radial-gradient(circle at top, rgba(15, 23, 42, 0.95), rgba(15, 23, 42, 0.9));
  text-align: center;
}

.time-value {
  font-size: clamp(1.4rem, 2.2vw, 1.9rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 0.25rem;
}

.time-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text-muted);
}

/* Progreso */

.progress-wrapper {
  margin-bottom: 1.6rem;
}

.progress-label {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.4rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.progress-bar {
  position: relative;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.9);
  overflow: hidden;
  border: 1px solid rgba(30, 64, 175, 0.6);
}

.progress-inner {
  position: absolute;
  inset: 0;
  transform-origin: left;
  transform: scaleX(0.15);
  background: linear-gradient(90deg, var(--accent-soft), #f97316);
  box-shadow: 0 0 18px rgba(250, 204, 21, 0.6);
  transition: transform 0.4s ease-out;
}

/* CTA */

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
}

.btn-primary {
  border: none;
  outline: none;
  cursor: pointer;
  padding: 0.7rem 1.4rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: linear-gradient(135deg, var(--accent), #f97316);
  color: #111827;
  box-shadow:
    0 12px 30px rgba(248, 250, 252, 0.18),
    0 0 0 1px rgba(250, 204, 21, 0.7);
  transition:
    transform 0.18s ease-out,
    box-shadow 0.18s ease-out,
    filter 0.18s ease-out;
  white-space: nowrap;
}

.btn-primary span {
  font-size: 1rem;
}

.btn-primary:hover {
  transform: translateY(-1px) scale(1.01);
  filter: brightness(1.03);
  box-shadow:
    0 16px 40px rgba(248, 250, 252, 0.25),
    0 0 0 1px rgba(250, 250, 250, 0.8);
}

.btn-primary:active {
  transform: translateY(0) scale(0.99);
  box-shadow:
    0 8px 18px rgba(15, 23, 42, 0.7),
    0 0 0 1px rgba(250, 204, 21, 0.7);
}

.hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  max-width: 18rem;
}

.status-message {
  margin-top: 0.75rem;
  font-size: 0.86rem;
  color: var(--accent-soft);
  display: none;
}

.status-message.error {
  color: var(--error);
}

/* Tablets / móviles vertical */

@media (max-width: 768px) {
  body {
    align-items: flex-start;
    padding: 1rem;
  }

  .wrapper {
    max-width: 100%;
  }

  .card {
    padding: 1.4rem 1.2rem;
  }

  .countdown {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
  }

  .cta-row {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-primary {
    justify-content: center;
    width: 100%;
  }

  .hint {
    max-width: 100%;
  }

  .glow-orb {
    opacity: 0.4;
    top: -120px;
    right: -120px;
  }
}

/* Móviles pequeños */

@media (max-width: 480px) {
  body {
    padding: 0.8rem;
  }

  .card {
    padding: 1.1rem 0.9rem;
    border-radius: 1rem;
  }

  .badge {
    font-size: 0.62rem;
  }

  h1 {
    font-size: 1.6rem;
  }

  .subtitle {
    font-size: 0.82rem;
    margin-bottom: 1.4rem;
  }

  .countdown {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem;
  }

  .time-block {
    padding: 0.7rem 0.4rem;
  }

  .time-value {
    font-size: 1.25rem;
  }

  .time-label {
    font-size: 0.64rem;
  }
}

/* Landscape bajo */

@media (max-height: 500px) and (min-width: 640px) {
  body {
    align-items: flex-start;
    padding-top: 1rem;
    padding-bottom: 1rem;
  }

  .card {
    padding: 1.2rem 1.4rem;
  }

  .subtitle {
    margin-bottom: 1.2rem;
  }

  .countdown {
    margin-bottom: 1.2rem;
  }
}

/* Pantallas grandes (2K / 4K / ultrawide) */

@media (min-width: 1440px) {
  body {
    padding: 2rem;
  }

  .wrapper {
    max-width: 960px;
  }

  .card {
    padding: 2.4rem 2.6rem;
  }
}
