:root {
  --primary: #7c3aed;
  --primary-dark: #6d28d9;
  --primary-light: #ede9fe;
  --text: #1e1b2e;
  --text-muted: #6b6478;
  --border: #e9e5f5;
  --success: #16a34a;
  --radius: 28px;
  --radius-sm: 16px;
  --op-1: #ef4444;
  --op-2: #2563eb;
  --op-3: #f59e0b;
  --op-4: #10b981;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { height: 100%; }

body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  background: linear-gradient(160deg, #f5f3ff 0%, #ede9fe 45%, #fce7f3 100%);
  color: var(--text);
  display: flex;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  padding: max(1.25rem, env(safe-area-inset-top)) max(1.25rem, env(safe-area-inset-right)) max(1.25rem, env(safe-area-inset-bottom)) max(1.25rem, env(safe-area-inset-left));
}

.blob {
  position: fixed;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.35;
  z-index: 0;
  pointer-events: none;
}
.blob-1 { width: 280px; height: 280px; background: #a78bfa; top: -80px; left: -60px; }
.blob-2 { width: 240px; height: 240px; background: #f9a8d4; bottom: -60px; right: -60px; }

#app {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 460px;
  margin: 0 auto;
  width: 100%;
  position: relative;
  z-index: 1;
}

.card {
  background: #ffffff;
  border-radius: var(--radius);
  padding: 2rem 1.75rem;
  box-shadow: 0 20px 50px -20px rgba(124, 58, 237, 0.35);
}

section { animation: fade-in 0.35s ease; }

@keyframes fade-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.logo { font-size: 2.75rem; text-align: center; margin-bottom: 0.5rem; }

h1 { font-size: 1.7rem; text-align: center; margin: 0 0 0.35rem; font-weight: 800; }
h2 { font-size: 1.4rem; text-align: center; margin: 0 0 0.35rem; font-weight: 800; }

.subtitle {
  text-align: center;
  color: var(--text-muted);
  margin: 0 0 1.75rem;
  font-size: 0.98rem;
}

.hint {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 1rem;
}

.live-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: fit-content;
  margin: 0 auto 1.25rem;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  background: var(--primary-light);
  color: var(--primary-dark);
  font-size: 0.8rem;
  font-weight: 700;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ef4444;
  animation: pulse 1.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.7); }
}

input[type="text"] {
  display: block;
  width: 100%;
  padding: 1rem 1.1rem;
  margin: 0 0 0.85rem;
  font-size: 1.05rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: #faf9fd;
  color: var(--text);
  font-family: inherit;
}

input[type="text"]::placeholder { color: var(--text-muted); }
input[type="text"]:focus { outline: none; border-color: var(--primary); background: white; }

button {
  display: block;
  width: 100%;
  min-height: 54px;
  padding: 1rem;
  margin: 0.4rem 0;
  font-size: 1.05rem;
  font-weight: 700;
  font-family: inherit;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--primary);
  color: white;
  cursor: pointer;
  box-shadow: 0 8px 20px -8px rgba(124, 58, 237, 0.6);
  transition: transform 0.12s ease, background 0.15s ease, opacity 0.15s ease, box-shadow 0.15s ease;
}

button:active { transform: scale(0.97); background: var(--primary-dark); box-shadow: 0 4px 12px -6px rgba(124, 58, 237, 0.6); }
button:disabled { opacity: 0.45; cursor: default; box-shadow: none; }
button:disabled:active { transform: none; }

#pregunta-texto { margin-bottom: 1.25rem; }

#pregunta-imagenes {
  display: flex;
  gap: 0.6rem;
  margin: 0 0 1.25rem;
}

#pregunta-imagenes img {
  width: 50%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
}

#pregunta-opciones button {
  text-align: left;
  background: white;
  border: 2px solid var(--border);
  color: var(--text);
  box-shadow: none;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

#pregunta-opciones button .marca {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: white;
}

#pregunta-opciones button:nth-child(1) .marca { background: var(--op-1); }
#pregunta-opciones button:nth-child(2) .marca { background: var(--op-2); }
#pregunta-opciones button:nth-child(3) .marca { background: var(--op-3); }
#pregunta-opciones button:nth-child(4) .marca { background: var(--op-4); }

#pregunta-opciones button:active { border-color: var(--primary); background: var(--primary-light); }

#pregunta-opciones button.seleccionada {
  border-color: var(--primary);
  background: var(--primary-light);
}

.spinner {
  width: 44px;
  height: 44px;
  margin: 0 auto 1.5rem;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.check {
  width: 68px;
  height: 68px;
  margin: 0 auto 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.1rem;
  color: white;
  background: var(--success);
  border-radius: 50%;
  animation: pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes pop {
  from { transform: scale(0); }
  to { transform: scale(1); }
}
