:root {
  --fondo: #061033;
  --fondo2: #0b1d54;
  --azul: #2f8cff;
  --cian: #00d4ff;
  --oro: #ffcc2e;
  --texto: #ffffff;
  --texto-suave: #a9c2ff;
  --tarjeta: rgba(255, 255, 255, 0.07);
  --borde: rgba(110, 175, 255, 0.28);
  --rojo: #e8336d;
  --verde: #14b87a;
  --radio: 18px;
  --sombra: 0 10px 30px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: 'Nunito', system-ui, sans-serif;
  font-weight: 600;
  color: var(--texto);
  background:
    radial-gradient(circle at 15% 10%, rgba(47, 140, 255, 0.45), transparent 42%),
    radial-gradient(circle at 90% 85%, rgba(0, 212, 255, 0.28), transparent 45%),
    linear-gradient(160deg, var(--fondo2), var(--fondo) 60%);
  background-attachment: fixed;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
}
/* Cuadrícula tecnológica de fondo */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(110, 175, 255, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(110, 175, 255, 0.07) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at 50% 40%, #000 30%, transparent 85%);
  -webkit-mask-image: radial-gradient(circle at 50% 40%, #000 30%, transparent 85%);
  z-index: 0;
}
body > * { position: relative; z-index: 1; }

h1, h2, h3, .titulo { font-family: 'Fredoka', 'Nunito', sans-serif; margin: 0; letter-spacing: 0.3px; }
.oculto { display: none !important; }
.suave { color: var(--texto-suave); }

/* ---- Marca ---- */
.marca { display: flex; align-items: center; gap: 12px; }
.marca .buho { width: 54px; height: auto; }
.marca h1 { font-size: 30px; font-weight: 700; }
.marca h1 span { color: var(--cian); text-shadow: 0 0 18px rgba(0, 212, 255, 0.6); }

/* ---- Tarjetas y formularios ---- */
.tarjeta {
  background: var(--tarjeta);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  padding: 22px;
  box-shadow: var(--sombra);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
label { display: block; font-size: 14px; color: var(--texto-suave); margin: 0 0 6px; }
input[type='text'], input[type='password'], input[type='tel'] {
  width: 100%;
  font: inherit;
  font-size: 20px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 2px solid var(--borde);
  background: rgba(3, 10, 35, 0.6);
  color: var(--texto);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
input:focus { border-color: var(--cian); box-shadow: 0 0 0 4px rgba(0, 212, 255, 0.18); }
input.pin { text-align: center; letter-spacing: 8px; font-family: 'Fredoka', sans-serif; font-size: 30px; }

.boton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: inherit;
  font-family: 'Fredoka', 'Nunito', sans-serif;
  font-weight: 600;
  font-size: 20px;
  padding: 14px 26px;
  border: 0;
  border-radius: 14px;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(180deg, #3d9bff, #1a62e0);
  box-shadow: 0 5px 0 #0d3a96, 0 10px 24px rgba(30, 110, 255, 0.35);
  transition: transform 0.08s, box-shadow 0.08s, filter 0.2s;
  text-decoration: none;
  user-select: none;
}
.boton:hover { filter: brightness(1.08); }
.boton:active { transform: translateY(4px); box-shadow: 0 1px 0 #0d3a96; }
.boton:disabled { filter: grayscale(0.8) brightness(0.7); cursor: not-allowed; transform: none; }
.boton.oro { background: linear-gradient(180deg, #ffd84d, #f0a800); color: #3a2400; box-shadow: 0 5px 0 #a36d00, 0 10px 24px rgba(255, 190, 0, 0.35); }
.boton.verde { background: linear-gradient(180deg, #2ed396, #0d9963); box-shadow: 0 5px 0 #066640, 0 10px 24px rgba(20, 184, 122, 0.35); }
.boton.fantasma { background: transparent; border: 2px solid var(--borde); box-shadow: none; font-size: 16px; padding: 10px 18px; }
.boton.fantasma:active { transform: translateY(1px); }
.boton.ancho { width: 100%; }
.boton.grande { font-size: 26px; padding: 18px 36px; }

.error-msg { color: #ff8fb0; min-height: 22px; margin-top: 10px; font-weight: 700; }

/* ---- Búhos y animaciones ---- */
.buho .parpado { transform-box: fill-box; transform-origin: 50% 0%; transform: scaleY(0); animation: parpadeo 5s infinite; }
.buho .destello { transform-box: fill-box; transform-origin: center; animation: destello 1.8s ease-in-out infinite; }
.buho .ala { transform-box: fill-box; }
.buho .ala-izq { transform-origin: 90% 10%; }
.buho .ala-der { transform-origin: 10% 10%; }
.festejo .buho .ala-izq { animation: aleteo-izq 0.45s ease-in-out infinite alternate; }
.festejo .buho .ala-der { animation: aleteo-der 0.45s ease-in-out infinite alternate; }
.flotar { animation: flotar 3s ease-in-out infinite; }
@keyframes parpadeo { 0%, 92%, 100% { transform: scaleY(0); } 95% { transform: scaleY(1); } }
@keyframes destello { 0%, 100% { transform: scale(0.4) rotate(0deg); opacity: 0.3; } 50% { transform: scale(1.15) rotate(25deg); opacity: 1; } }
@keyframes aleteo-izq { from { transform: rotate(0deg); } to { transform: rotate(28deg); } }
@keyframes aleteo-der { from { transform: rotate(0deg); } to { transform: rotate(-28deg); } }
@keyframes flotar { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes aparecer { from { opacity: 0; transform: translateY(24px) scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes rebote { 0% { transform: scale(0.3) translateY(80px); opacity: 0; } 60% { transform: scale(1.08) translateY(-10px); opacity: 1; } 100% { transform: scale(1); } }
@keyframes pulso { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
.aparecer { animation: aparecer 0.45s ease-out both; }

.confeti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 50; }

/* ---- Opciones (colores por respuesta) ---- */
.opcion {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  border-radius: 16px;
  padding: 14px 18px;
  color: #fff;
  font-family: 'Fredoka', 'Nunito', sans-serif;
  font-weight: 600;
  text-align: left;
  border: 0;
  box-shadow: inset 0 -6px 0 rgba(0, 0, 0, 0.22), 0 8px 18px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  line-height: 1.15;
  word-break: break-word;
}
.opcion .letra {
  flex: none;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.22);
  font-size: 22px;
  font-weight: 700;
}
.opcion .icono { font-size: 15px; opacity: 0.85; margin-left: 2px; }

/* ---- Utilidades de diseño ---- */
.centrado { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 16px; }
.pila { display: flex; flex-direction: column; gap: 14px; }
.fila { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.espaciar { justify-content: space-between; }

/* Bloque de contacto (final del alumno y podio del maestro) */
.contacto { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 14px; text-align: center; }
.contacto p { margin: 0; color: #9fc3ff; font-size: 16px; }
.contacto .enlaces { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.contacto a { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 999px; border: 1px solid rgba(160, 190, 255, .35); background: rgba(3, 10, 35, .45); color: #fff; text-decoration: none; font-weight: 800; font-size: 15px; transition: background .15s, border-color .15s; }
.contacto a:hover, .contacto a:focus-visible { background: rgba(47, 140, 255, .25); border-color: var(--cian); }
.contacto svg { width: 18px; height: 18px; flex: none; }
