/**
 * trivia.css — Estilos de la página pública de la trivia (app/trivia/index.php).
 * Carga después de modulos.css; extraído del <style> inline de esa página.
 */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
/* El fondo, la tipografía y el color los aporta .m-body (modulos.css). */
body::after {
  content: ''; position: fixed; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.68' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  opacity: 0.22; mix-blend-mode: overlay; pointer-events: none; z-index: 0;
}
#stars-canvas { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
#confetti-canvas { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 50; display: none; }
.page { position: relative; z-index: 1; max-width: 600px; margin: 0 auto; padding: 0 1rem calc(2.5rem + env(safe-area-inset-bottom, 0px)); }

/* ── Hero ── */
.hero-top { padding: clamp(24px, 4.5vh, 44px) 28px clamp(18px, 3vh, 28px); flex-shrink: 0; }
.brand-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 20px; flex-wrap: wrap;
}
.brand-strip { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.brand-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 30px; padding: 4px 7px;
  border-radius: 10px; background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.14);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}
.brand-badge img { display: block; width: auto; filter: brightness(0) invert(1); }
.brand-badge-unam img { height: 18px; opacity: .8; }
.brand-badge-doae img { height: 15px; opacity: .62; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .6rem; font-weight: 700; letter-spacing: .22em; text-transform: uppercase;
  color: rgba(255,255,255,.45); margin-bottom: 20px;
}
.eyebrow-dot {
  width: 24px; height: 24px; border-radius: 8px;
  background: rgba(35,192,209,.2); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
}
.eyebrow-dot svg { width: 13px; height: 13px; stroke: rgba(255,255,255,.8); }
.h-hero {
  font-size: clamp(2.6rem, 10.8vmin, 5rem); font-weight: 800; line-height: 0.88;
  letter-spacing: -.045em; color: #fff; margin-bottom: 10px;
}
.h-hero span { color: rgba(124,116,255,.55); }
.hero-sub { font-size: .6rem; font-weight: 700; color: rgba(255,255,255,.32); letter-spacing: .18em; text-transform: uppercase; line-height: 1.6; }

@media (max-height: 760px) {
  .hero-top { padding-top: 20px; padding-bottom: 16px; }
  .h-hero { font-size: clamp(2.2rem, 8.5vmin, 3.5rem); margin-bottom: 6px; }
  .brand-row { margin-bottom: 14px; }
  .progress-bar-wrap { margin-top: 16px; }
}

/* ── Progress bar ── */
.progress-bar-wrap { margin-top: 24px; }
.progress-label { font-size: .58rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.3); margin-bottom: 8px; display: flex; justify-content: space-between; }
.progress-track { height: 6px; background: rgba(255,255,255,.1); border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, #3476f5, #7c48e2); transition: width .5s cubic-bezier(.22,1,.36,1); }

/* ── Bottom card ── */
.bottom-card {
  margin-top: auto;
  background: rgba(255,255,255,.08);
  border-top: 1px solid rgba(255,255,255,.12);
  border-radius: 32px 32px 0 0;
  padding: 28px 24px calc(28px + env(safe-area-inset-bottom, 0px));
  backdrop-filter: blur(28px); -webkit-backdrop-filter: blur(28px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  min-height: 0;
}
.card-label { font-size: .7rem; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; color: rgba(255,255,255,.35); margin-bottom: 14px; }
.evento-name { font-size: 1.1rem; font-weight: 800; color: #fff; margin-bottom: 4px; line-height: 1.2; }
.evento-sub { font-size: .72rem; color: rgba(255,255,255,.4); margin-bottom: 20px; }

/* ── Form ── */
.field-label { display: block; font-size: .62rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: rgba(255,255,255,.4); margin-bottom: 8px; }
.field {
  width: 100%; background: rgba(255,255,255,.08); border: 1.5px solid rgba(255,255,255,.15);
  border-radius: 16px; padding: 16px 18px;
  font-size: 1.15rem; font-weight: 700; letter-spacing: .06em; color: #fff; font-family: inherit;
  outline: none; transition: border-color .15s, background .15s; -webkit-appearance: none;
}
.field::placeholder { color: rgba(255,255,255,.22); font-weight: 500; letter-spacing: 0; }
.field:focus { border-color: rgba(35,192,209,.7); background: rgba(255,255,255,.12); }
.field-hint { font-size: .67rem; color: rgba(255,255,255,.28); margin-top: 6px; }

.btn {
  width: 100%; background: linear-gradient(135deg, #1450b8, #4a22a0); border: 1px solid transparent;
  border-radius: 16px; padding: 16px; color: #fff;
  font-size: .92rem; font-weight: 800; letter-spacing: .02em; font-family: inherit; cursor: pointer;
  transition: filter .15s, transform .1s; margin-top: 20px;
  box-shadow: 0 8px 24px rgba(74,34,160,.35), inset 0 1px 0 rgba(255,255,255,.16);
}
.btn:hover  { filter: brightness(1.07); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: none; }

/* ── Alerts ── */
.alert { border-radius: 14px; padding: 12px 14px; font-size: .78rem; line-height: 1.4; margin-bottom: 16px; }
.alert-err  { background: rgba(239,68,68,.15);  border: 1px solid rgba(239,68,68,.28);  color: #fca5a5; }
.alert-ok   { background: rgba(34,197,94,.12);  border: 1px solid rgba(34,197,94,.22);  color: #86efac; }
.alert-warn { background: rgba(251,191,36,.12); border: 1px solid rgba(251,191,36,.22); color: #fde68a; }
.alert-info { background: rgba(148,104,219,.12); border: 1px solid rgba(148,104,219,.25); color: #c4aff7; }

/* ── Pregunta card ── */
.question-card { animation: card-in .4s cubic-bezier(.22,1,.36,1) both; }
@keyframes card-in { from { opacity:0; transform: translateY(18px) scale(.97); } to { opacity:1; transform:none; } }
.q-number { font-size: .58rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: rgba(255,255,255,.3); margin-bottom: 10px; }
.q-text { font-size: 1.05rem; font-weight: 700; color: #fff; line-height: 1.45; margin-bottom: 18px; }

.opciones { display: flex; flex-direction: column; gap: 8px; }
.opcion {
  display: flex; align-items: center; gap: 12px;
  background: rgba(255,255,255,.07); border: 1.5px solid rgba(255,255,255,.13);
  border-radius: 14px; padding: 13px 16px;
  cursor: pointer; font-size: .88rem; font-weight: 600; color: rgba(255,255,255,.85);
  transition: background .15s, border-color .15s, transform .1s;
  -webkit-tap-highlight-color: transparent; user-select: none;
}
.opcion:hover { background: rgba(255,255,255,.13); border-color: rgba(255,255,255,.3); }
.opcion:active { transform: scale(.98); }
.opcion.selected { background: rgba(148,104,219,.22); border-color: rgba(148,104,219,.65); color: #fff; }
.opcion.correct  { background: rgba(34,197,94,.18); border-color: rgba(34,197,94,.5);  color: #86efac; }
.opcion.wrong    { background: rgba(239,68,68,.15);  border-color: rgba(239,68,68,.35); color: #fca5a5; opacity:.8; }
.opcion.disabled { pointer-events: none; }
.opcion-letra {
  width: 26px; height: 26px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: .7rem; font-weight: 800; letter-spacing: 0;
  background: rgba(255,255,255,.1); color: rgba(255,255,255,.5);
  transition: background .15s, color .15s;
}
.opcion.selected .opcion-letra { background: rgba(148,104,219,.45); color: #fff; }
.opcion.correct  .opcion-letra { background: rgba(34,197,94,.3);  color: #86efac; }
.opcion.wrong    .opcion-letra { background: rgba(239,68,68,.3);   color: #fca5a5; }

/* ── Resultado ── */
.result-icon { font-size: 2.8rem; text-align: center; margin-bottom: 10px; }
.result-title { font-size: 1.2rem; font-weight: 800; color: #fff; text-align: center; margin-bottom: 6px; }
.result-sub   { font-size: .83rem; color: rgba(255,255,255,.5); text-align: center; line-height: 1.6; }
.correctas-badge {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 14px;
  background: rgba(35,192,209,.1); border: 1px solid rgba(35,192,209,.25);
  border-radius: 10px; padding: 8px 14px;
  font-size: .82rem; font-weight: 700; color: #fff;
}
.correctas-badge b { color: #23C0D1; font-size: 1rem; }

/* ── Selector de trivia (varias en vivo a la vez) ── */
.ev-sel { display: flex; flex-direction: column; gap: 8px; margin: 10px 0 16px; }
.ev-opt { display: flex; align-items: flex-start; gap: 10px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14); border-radius: 14px; padding: 12px 14px; cursor: pointer; transition: background .15s, border-color .15s; }
.ev-opt:hover { background: rgba(255,255,255,.09); }
.ev-opt:has(input:checked) { background: rgba(35,192,209,.12); border-color: rgba(35,192,209,.5); }
.ev-opt input { margin-top: 3px; accent-color: #23C0D1; flex-shrink: 0; }
.ev-opt-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ev-opt-name { font-size: .92rem; font-weight: 800; color: #fff; line-height: 1.25; }
.ev-opt-meta { font-size: .7rem; color: rgba(255,255,255,.55); line-height: 1.45; }

/* ── Vidas (corazones = reintentos) ── */
.vidas-row { display: flex; align-items: center; justify-content: flex-end; gap: 4px; margin-top: 8px; }
.vidas-label { font-size: .58rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.32); margin-right: 5px; }
.heart { width: 15px; height: 15px; color: #fb7185; filter: drop-shadow(0 0 6px rgba(251,113,133,.45)); transition: transform .3s, color .3s, filter .3s; flex-shrink: 0; }
.heart.off { color: rgba(255,255,255,.16); filter: none; }
.heart.lost { animation: heart-lost .7s ease forwards; }
.heart.lg { width: 22px; height: 22px; }
@keyframes heart-lost { 0% { transform: scale(1); color: #fb7185; } 35% { transform: scale(1.45) rotate(-8deg); } 100% { transform: scale(1); color: rgba(255,255,255,.16); filter: none; } }
.vidas-badge {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 12px;
  background: rgba(251,113,133,.1); border: 1px solid rgba(251,113,133,.28);
  border-radius: 10px; padding: 8px 14px; font-size: .8rem; font-weight: 700; color: #fff;
}
.vidas-badge .hearts { display: inline-flex; gap: 3px; }
.vidas-badge.agotadas { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.14); color: rgba(255,255,255,.6); }

/* ── Winner ── */
.win-card {
  background: rgba(242,234,19,.07); border: 1px solid rgba(242,234,19,.25);
  border-radius: 20px; padding: 24px 20px; text-align: center;
}
.win-icon  { display: flex; justify-content: center; align-items: center; margin-bottom: 10px; }
.win-icon svg { width: 42px; height: 42px; stroke-width: 1.7; }
.win-title { font-size: 1.2rem; font-weight: 800; color: #fff; margin-bottom: 6px; }
.win-sub   { font-size: .82rem; color: rgba(255,255,255,.55); line-height: 1.6; }

@keyframes spin { to { transform: rotate(360deg); } }
.spinner { display: inline-block; width: 15px; height: 15px; border: 2.5px solid rgba(255,255,255,.3); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; vertical-align: middle; margin-right: 6px; }
.footer-note { font-size: .62rem; color: rgba(255,255,255,.2); text-align: center; line-height: 1.5; margin-top: 20px; }

/* Pantallas */
.screen { display: none; }
.screen.active { display: block; }
