/* =========================================================================
   TRIVIA! — Sistema de diseño "Aurora Glass"
   Glassmorphism refinado + gradientes oscuros + micro-interacciones.
   ========================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Luckiest+Guy&family=Poppins:wght@400;500;600;700;800;900&display=swap');

:root {
  /* Marca / acentos */
  --magenta: #ff2d95;
  --violet:  #7b2ff7;
  --cyan:    #00e5ff;
  --gold:    #ffd400;

  /* Marca Conekta */
  --conekta-navy: #00407a;
  --conekta-orange: #f47c20;
  --conekta-red: #e2231a;
  --wa-green: #25d366;

  /* Respuestas */
  --red:    #ff3355;
  --blue:   #2483ff;
  --yellow: #ffb000;
  --green:  #15c26b;

  /* Superficies */
  --glass:        rgba(255, 255, 255, 0.07);
  --glass-strong: rgba(255, 255, 255, 0.12);
  --glass-border: rgba(255, 255, 255, 0.18);
  --ink:          #f4f0ff;
  --ink-dim:      rgba(244, 240, 255, 0.65);

  --radius: 20px;
  --shadow: 0 20px 60px -15px rgba(0, 0, 0, 0.6);
  --ring:   0 0 0 1px var(--glass-border) inset;

  --grad-brand: linear-gradient(135deg, var(--magenta), var(--violet) 55%, var(--cyan));
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: 'Poppins', system-ui, sans-serif;
  color: var(--ink);
  background: #0c0420;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  position: relative;
}

/* ---------- Fondo aurora animado ---------------------------------------- */
.aurora {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(60% 80% at 50% -10%, #2a0d63 0, transparent 60%),
    radial-gradient(50% 60% at 100% 100%, #1a0a3e 0, transparent 60%),
    linear-gradient(160deg, #14062e, #0a0318 70%);
  overflow: hidden;
}
.aurora span {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.55;
  mix-blend-mode: screen;
  animation: drift 18s ease-in-out infinite;
}
.aurora span:nth-child(1) {
  width: 46vmax; height: 46vmax; left: -10vmax; top: -12vmax;
  background: var(--magenta); animation-delay: -2s;
}
.aurora span:nth-child(2) {
  width: 42vmax; height: 42vmax; right: -12vmax; top: 18vmax;
  background: var(--violet); animation-delay: -7s;
}
.aurora span:nth-child(3) {
  width: 38vmax; height: 38vmax; left: 25vmax; bottom: -16vmax;
  background: var(--cyan); animation-delay: -12s; opacity: 0.4;
}
@keyframes drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(6vmax, 4vmax) scale(1.12); }
  66%      { transform: translate(-5vmax, -3vmax) scale(0.95); }
}
/* Textura de ruido sutil para profundidad */
.aurora::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.04;
  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.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

@media (prefers-reduced-motion: reduce) {
  .aurora span { animation: none; }
}

/* ---------- Layout ------------------------------------------------------ */
.center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 18px;
  text-align: center;
  width: 100%;
}

/* ---------- Logo -------------------------------------------------------- */
.logo {
  font-family: 'Luckiest Guy', cursive;
  font-size: clamp(3rem, 11vw, 6rem);
  /* line-height holgado + padding evita que el background-clip:text corte los
     topes de las letras y del emoji (se veían "mochos" por arriba). */
  line-height: 1.28;
  padding-top: 0.12em;
  letter-spacing: 1px;
  background: var(--grad-brand);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 8px 24px rgba(255, 45, 149, 0.35));
  animation: shimmer 6s linear infinite;
  margin-bottom: 6px;
}
.logo span { -webkit-text-fill-color: var(--gold); color: var(--gold); }
@keyframes shimmer { to { background-position: 200% center; } }

.tagline {
  color: var(--ink-dim);
  font-weight: 500;
  letter-spacing: 0.5px;
  margin-bottom: 30px;
  font-size: clamp(0.95rem, 2.6vw, 1.15rem);
}

/* ---------- Tarjeta glass ----------------------------------------------- */
.card {
  position: relative;
  background: var(--glass);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  border-radius: var(--radius);
  padding: 32px 28px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow), var(--ring);
  animation: rise 0.6s cubic-bezier(0.2, 0.9, 0.3, 1) both;
}
/* Borde con gradiente */
.card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.5px;
  background: linear-gradient(140deg, rgba(255,255,255,0.5), rgba(255,255,255,0.05) 40%, rgba(123,47,247,0.5));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}

.field-label {
  display: block;
  text-align: left;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--ink-dim);
  margin: 0 4px 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

input, select {
  width: 100%;
  padding: 16px 18px;
  font-family: inherit;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink);
  background: rgba(0, 0, 0, 0.25);
  border: 1.5px solid var(--glass-border);
  border-radius: 14px;
  margin-bottom: 14px;
  text-align: center;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
input::placeholder { color: rgba(244,240,255,0.4); font-weight: 600; }
input:focus, select:focus {
  border-color: var(--magenta);
  background: rgba(0, 0, 0, 0.35);
  box-shadow: 0 0 0 4px rgba(255, 45, 149, 0.18);
}
select option { background: #1a0a3e; color: #fff; }

/* PIN: tracking ancho estilo código */
#pin { letter-spacing: 0.35em; font-size: 1.5rem; }

/* ---------- Botones ----------------------------------------------------- */
button { cursor: pointer; font-family: inherit; border: none; font-weight: 800; }

.btn {
  width: 100%;
  padding: 16px 20px;
  font-size: 1.15rem;
  border-radius: 14px;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid var(--glass-border);
  letter-spacing: 0.5px;
  transition: transform 0.12s, box-shadow 0.2s, filter 0.2s;
  position: relative;
  overflow: hidden;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.btn-primary {
  background: var(--grad-brand);
  background-size: 180% auto;
  box-shadow: 0 12px 30px -8px rgba(255, 45, 149, 0.6);
}
.btn-primary:hover { background-position: right center; box-shadow: 0 16px 40px -8px rgba(123, 47, 247, 0.7); }

.btn-gold { background: linear-gradient(135deg, #ffe259, var(--gold)); color: #3a2a00; box-shadow: 0 12px 30px -8px rgba(255, 212, 0, 0.5); }
.btn-ghost { background: rgba(255,255,255,0.08); }

/* Brillo que cruza el botón */
.btn-primary::after, .btn-gold::after {
  content: '';
  position: absolute;
  top: 0; left: -75%;
  width: 50%; height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,0.45), transparent);
  transform: skewX(-20deg);
  transition: left 0.6s;
}
.btn-primary:hover::after, .btn-gold:hover::after { left: 130%; }

.error {
  color: #ff6b8a;
  font-weight: 700;
  min-height: 22px;
  margin-bottom: 10px;
  font-size: 0.95rem;
}

.links { margin-top: 26px; color: var(--ink-dim); font-weight: 500; }
.links a { color: var(--gold); font-weight: 700; text-decoration: none; }
.links a:hover { text-decoration: underline; }

.hint { color: var(--ink-dim); margin-top: 18px; font-weight: 500; }
.waiting { font-size: 1.25rem; font-weight: 600; color: var(--ink-dim); }

/* ---------- PIN del host ------------------------------------------------ */
.pin-box {
  position: relative;
  background: var(--glass-strong);
  backdrop-filter: blur(18px);
  border-radius: 22px;
  padding: 18px 44px;
  display: inline-block;
  margin: 12px 0 26px;
  box-shadow: var(--shadow), var(--ring);
  animation: rise 0.6s both;
}
.pin-box small {
  display: block;
  font-size: 0.85rem;
  color: var(--ink-dim);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 3px;
  margin-bottom: 4px;
}
.pin-box .pin {
  font-family: 'Luckiest Guy', cursive;
  font-size: clamp(3rem, 11vw, 5rem);
  letter-spacing: 0.12em;
  background: var(--grad-brand);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---------- Lobby ------------------------------------------------------- */
.count-badge {
  background: var(--glass-strong);
  border: 1px solid var(--glass-border);
  padding: 8px 20px;
  border-radius: 999px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
}
.count-badge::before {
  content: '';
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(21, 194, 107, 0.7);
  animation: pulse-dot 1.6s infinite;
}
@keyframes pulse-dot {
  0%   { box-shadow: 0 0 0 0 rgba(21, 194, 107, 0.6); }
  70%  { box-shadow: 0 0 0 10px rgba(21, 194, 107, 0); }
  100% { box-shadow: 0 0 0 0 rgba(21, 194, 107, 0); }
}

.players {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  max-width: 920px;
  max-height: 42vh;
  overflow-y: auto;
  padding: 4px;
  margin: 0 auto 26px;
}
.player-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--glass-strong);
  border: 1px solid var(--glass-border);
  padding: 7px 16px 7px 7px;
  border-radius: 999px;
  font-weight: 700;
  box-shadow: var(--shadow);
  animation: pop 0.4s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}
@keyframes pop { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.95rem;
  font-weight: 800;
  color: #fff;
  flex: 0 0 auto;
}

/* ---------- Pregunta ---------------------------------------------------- */
.stage { width: 100%; max-width: 960px; margin: 0 auto; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}
.qcounter {
  background: var(--glass-strong);
  border: 1px solid var(--glass-border);
  padding: 10px 18px;
  border-radius: 12px;
  font-weight: 700;
}

/* Anillo de tiempo SVG */
.timer-ring { position: relative; width: 78px; height: 78px; flex: 0 0 auto; }
.timer-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.timer-ring .ring-bg { fill: none; stroke: rgba(255,255,255,0.12); stroke-width: 8; }
.timer-ring .ring-fg {
  fill: none;
  stroke: url(#timerGrad);
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset linear;
}
.timer-ring .timer-num {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 1.7rem;
  font-weight: 900;
}
.timer-ring.low .timer-num { color: var(--red); animation: tick 1s infinite; }
@keyframes tick { 50% { transform: scale(1.18); } }

.question-text {
  font-size: clamp(1.5rem, 4.2vw, 2.6rem);
  font-weight: 800;
  line-height: 1.25;
  background: var(--glass);
  backdrop-filter: blur(18px);
  border: 1px solid var(--glass-border);
  padding: 28px 24px;
  border-radius: var(--radius);
  margin-bottom: 22px;
  box-shadow: var(--shadow);
  animation: rise 0.5s both;
}

.answers-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.answer {
  position: relative;
  min-height: 92px;
  border-radius: 16px;
  color: #fff;
  font-size: 1.3rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 22px;
  text-align: left;
  overflow: hidden;
  box-shadow: 0 10px 24px -10px rgba(0,0,0,0.7), inset 0 1px 0 rgba(255,255,255,0.25);
  animation: rise 0.5s both;
  transition: transform 0.12s, filter 0.2s, opacity 0.3s;
}
.answer:nth-child(2) { animation-delay: 0.05s; }
.answer:nth-child(3) { animation-delay: 0.1s; }
.answer:nth-child(4) { animation-delay: 0.15s; }
.answer .shape { font-size: 1.7rem; filter: drop-shadow(0 2px 3px rgba(0,0,0,0.35)); }
.answer .txt { z-index: 1; }
.answer.dim { opacity: 0.3; filter: grayscale(0.4); }
.answer.correct { animation: correctPulse 0.7s ease; }
.answer.correct::before {
  content: '✓';
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 3rem;
  color: rgba(255,255,255,0.9);
  z-index: 2;
}
@keyframes correctPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,255,255,0.9), 0 10px 24px -10px rgba(0,0,0,0.7); }
  50%      { box-shadow: 0 0 0 6px rgba(255,255,255,0.85), 0 10px 30px -8px rgba(0,0,0,0.7); }
}
/* Barra de distribución (host) */
.answer .dist-bar {
  position: absolute;
  left: 0; bottom: 0;
  height: 6px;
  width: 0;
  background: rgba(255,255,255,0.85);
  transition: width 0.8s cubic-bezier(0.2,0.9,0.3,1);
}
.answer .pct { margin-left: auto; font-weight: 900; z-index: 1; }

.a-red    { background: linear-gradient(135deg, #ff5c77, var(--red)); }
.a-blue   { background: linear-gradient(135deg, #4aa0ff, var(--blue)); }
.a-yellow { background: linear-gradient(135deg, #ffce4d, var(--yellow)); color: #4a3500; }
.a-green  { background: linear-gradient(135deg, #4fe39b, var(--green)); }

/* Botones del jugador (sin texto, gigantes) */
.player-answers { gap: 14px; }
.player-answers .answer { justify-content: center; min-height: clamp(110px, 26vw, 150px); cursor: pointer; }
.player-answers .answer:hover { transform: translateY(-3px) scale(1.02); }
.player-answers .answer:active { transform: scale(0.97); }
.player-answers .answer .shape { font-size: clamp(2.2rem, 9vw, 3.2rem); }

/* ---------- Resultado del jugador --------------------------------------- */
.result-banner {
  font-family: 'Luckiest Guy', cursive;
  font-size: clamp(2.2rem, 8vw, 3.6rem);
  letter-spacing: 1px;
  padding: 34px 24px;
  border-radius: var(--radius);
  margin-bottom: 18px;
  box-shadow: var(--shadow);
  animation: rise 0.5s both;
}
.result-correct { background: linear-gradient(135deg, #4fe39b, var(--green)); }
.result-wrong   { background: linear-gradient(135deg, #ff5c77, var(--red)); }
.big-score { font-size: 2.6rem; font-weight: 900; }
.streak {
  display: inline-block;
  margin-top: 12px;
  background: rgba(255,212,0,0.18);
  border: 1px solid rgba(255,212,0,0.4);
  color: var(--gold);
  padding: 6px 16px;
  border-radius: 999px;
  font-weight: 800;
}

/* ---------- Marcador / podio -------------------------------------------- */
.section-title {
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-bottom: 14px;
}
.leaderboard { max-width: 620px; width: 100%; margin: 0 auto; }
.leaderboard.scroll { max-height: 46vh; overflow-y: auto; padding-right: 4px; }
.lb-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--glass-strong);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 13px 18px;
  margin-bottom: 11px;
  font-size: 1.2rem;
  font-weight: 700;
  box-shadow: var(--shadow);
  animation: slidein 0.5s cubic-bezier(0.2,0.9,0.3,1) both;
}
.lb-row:nth-child(2){animation-delay:.06s}
.lb-row:nth-child(3){animation-delay:.12s}
.lb-row:nth-child(4){animation-delay:.18s}
.lb-row:nth-child(5){animation-delay:.24s}
@keyframes slidein { from { transform: translateX(-26px); opacity: 0; } to { transform: none; opacity: 1; } }
.lb-rank {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: rgba(0,0,0,0.3);
  font-weight: 900;
  flex: 0 0 auto;
}
.lb-row:nth-child(1) .lb-rank { background: linear-gradient(135deg,#ffe259,var(--gold)); color:#3a2a00; }
.lb-name { flex: 1; text-align: left; }
.lb-score { color: var(--gold); font-weight: 900; }

/* Podio */
.podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 16px;
  margin: 34px 0 26px;
}
.podium-col { text-align: center; animation: rise 0.7s both; }
.podium-2 { animation-delay: 0.1s; }
.podium-3 { animation-delay: 0.2s; }
.podium-bar {
  background: var(--glass-strong);
  border: 1px solid var(--glass-border);
  border-radius: 16px 16px 0 0;
  padding: 18px 12px;
  width: clamp(96px, 26vw, 140px);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  box-shadow: var(--shadow);
}
.podium-1 .podium-bar { height: 210px; background: linear-gradient(180deg, rgba(255,212,0,0.35), rgba(255,212,0,0.08)); border-color: rgba(255,212,0,0.5); }
.podium-2 .podium-bar { height: 158px; }
.podium-3 .podium-bar { height: 120px; }
.podium-medal { font-size: 2.4rem; margin-bottom: 8px; }
.podium-name { font-weight: 800; font-size: 1.1rem; margin-bottom: 4px; }
.podium-score { color: var(--gold); font-weight: 900; }

/* ---------- Barra de exportación CSV (host) ----------------------------- */
.export-bar {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  max-width: 620px;
  margin: 22px auto 0;
}
.export-bar .btn { width: auto; flex: 1; min-width: 200px; font-size: 1rem; padding: 13px 18px; }

/* ---------- Spinner ----------------------------------------------------- */
.spinner {
  width: 54px; height: 54px;
  border: 5px solid rgba(255,255,255,0.18);
  border-top-color: var(--magenta);
  border-right-color: var(--violet);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  margin: 26px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Control de sonido (volumen + silencio) ---------------------- */
.sound-ctl {
  position: fixed;
  top: 16px; right: 16px;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px 6px 12px;
  border-radius: 999px;
  background: var(--glass-strong);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}
.sound-vol {
  -webkit-appearance: none; appearance: none;
  width: 0; opacity: 0;
  height: 6px;
  margin: 0; padding: 0;
  border: none; border-radius: 3px;
  background: rgba(255, 255, 255, 0.25);
  accent-color: var(--magenta);
  cursor: pointer;
  transition: width 0.25s, opacity 0.25s;
}
.sound-ctl:hover .sound-vol,
.sound-ctl:focus-within .sound-vol { width: 88px; opacity: 1; }
.sound-vol::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--magenta); cursor: pointer;
  box-shadow: 0 0 0 3px rgba(255, 45, 149, 0.25);
}
.sound-vol::-moz-range-thumb {
  width: 16px; height: 16px; border: none; border-radius: 50%;
  background: var(--magenta);
}
.sound-toggle {
  width: 44px; height: 44px;
  border-radius: 50%;
  font-size: 1.25rem;
  line-height: 1;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--glass-border);
  transition: transform 0.15s, filter 0.2s;
  flex: 0 0 auto;
}
.sound-toggle:hover { transform: scale(1.08); }
.sound-toggle:active { transform: scale(0.94); }
.sound-toggle.muted { filter: grayscale(1); opacity: 0.7; }
/* En pantallas táctiles mostramos siempre el deslizador. */
@media (hover: none) {
  .sound-ctl .sound-vol { width: 80px; opacity: 1; }
}
/* En móvil el control de volumen va ABAJO-derecha para no encimar el logo. */
@media (max-width: 680px) {
  .sound-ctl { top: auto; bottom: 14px; right: 14px; }
}

/* ---------- Marca del patrocinador (Conekta) ---------------------------- */
.brand-badge {
  position: fixed;
  left: 16px; top: 16px;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--glass-strong);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
  text-decoration: none;
}
.brand-label {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--ink-dim);
  white-space: nowrap;
}
/* Chip blanco para que el logo (azul/naranja) tenga contraste. */
.brand-chip {
  display: inline-flex;
  align-items: center;
  background: #fff;
  border-radius: 8px;
  padding: 5px 9px;
  box-shadow: 0 4px 14px -4px rgba(0, 0, 0, 0.5);
}
.brand-badge .brand-chip img { height: 18px; display: block; }
.brand-lockup {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  text-decoration: none;
  opacity: 0.97;
}
.brand-lockup .brand-chip { padding: 8px 14px; border-radius: 10px; }
.brand-lockup img { display: block; }
@media (max-width: 480px) {
  .brand-badge .brand-label { display: none; } /* en móvil, solo el logo */
}

/* ---------- Consentimiento de teléfono ---------------------------------- */
.consent {
  font-size: 0.78rem;
  color: var(--ink-dim);
  text-align: left;
  margin: -6px 4px 16px;
  line-height: 1.35;
}

/* ---------- Tarjeta del ganador (host) + WhatsApp ----------------------- */
.winner-card {
  max-width: 520px;
  margin: 8px auto 4px;
  padding: 20px 22px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(255, 212, 0, 0.18), rgba(255, 124, 32, 0.12));
  border: 1px solid rgba(255, 212, 0, 0.5);
  box-shadow: var(--shadow);
  animation: rise 0.6s both;
}
.winner-title { font-weight: 800; font-size: 1.25rem; margin-bottom: 6px; }
.winner-phone { font-size: 1.4rem; font-weight: 900; letter-spacing: 1px; margin-bottom: 14px; }
.wa-btn {
  background: var(--wa-green) !important;
  color: #06351f !important;
  box-shadow: 0 12px 28px -8px rgba(37, 211, 102, 0.55);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: auto; padding-left: 26px; padding-right: 26px;
}
.wa-btn::before { content: '✆'; font-size: 1.2rem; }

/* Teléfono como enlace de WhatsApp en la lista de contactos */
.lb-phone {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--wa-green);
  text-decoration: none;
  white-space: nowrap;
  background: rgba(37, 211, 102, 0.12);
  border: 1px solid rgba(37, 211, 102, 0.3);
  padding: 4px 10px;
  border-radius: 8px;
}
.lb-phone.muted { color: var(--ink-dim); background: none; border: none; }
.lb-phone:hover { background: rgba(37, 211, 102, 0.22); }

/* ---------- Selector de avatar (emoji) ---------------------------------- */
.emoji-picker {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
  margin-bottom: 16px;
}
.emoji-opt {
  aspect-ratio: 1;
  font-size: 1.2rem;
  line-height: 1;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.25);
  border: 1.5px solid transparent;
  transition: transform 0.12s, border-color 0.15s, background 0.15s;
}
.emoji-opt:hover { transform: scale(1.12); background: rgba(255, 255, 255, 0.1); }
.emoji-opt.sel {
  border-color: var(--magenta);
  background: rgba(255, 45, 149, 0.2);
  box-shadow: 0 0 0 3px rgba(255, 45, 149, 0.18);
}

/* ---------- Editor de cuestionarios ------------------------------------- */
.q-block {
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 16px;
}
.q-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.q-num { font-weight: 800; letter-spacing: 0.5px; }
.q-del {
  width: 30px; height: 30px; border-radius: 8px;
  background: rgba(255, 51, 85, 0.2);
  border: 1px solid rgba(255, 51, 85, 0.4);
  color: #ff6b8a; font-size: 0.9rem;
}
.q-del:hover { background: rgba(255, 51, 85, 0.35); }
.q-block .q-text { text-align: left; margin-bottom: 12px; }
.a-list { display: grid; gap: 8px; }
.a-row {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 10px; border-radius: 10px;
  border-left: 5px solid rgba(255, 255, 255, 0.4);
}
.a-row.a-red    { border-left-color: var(--red); }
.a-row.a-blue   { border-left-color: var(--blue); }
.a-row.a-yellow { border-left-color: var(--yellow); }
.a-row.a-green  { border-left-color: var(--green); }
.a-row input[type=radio] { width: 20px; height: 20px; accent-color: var(--green); flex: 0 0 auto; margin: 0; }
.a-row .a-shape { font-size: 1.1rem; flex: 0 0 auto; opacity: 0.8; }
.a-row .a-text {
  flex: 1; margin: 0; padding: 10px 12px;
  font-size: 1rem; text-align: left;
}
.q-foot { display: flex; align-items: center; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.q-foot .q-time { width: 90px; margin: 0; padding: 8px; }

/* ---------- Confetti canvas --------------------------------------------- */
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 50; }

.hidden { display: none !important; }

@media (max-width: 540px) {
  .answers-grid { grid-template-columns: 1fr; }
  .player-answers { grid-template-columns: 1fr 1fr; }
}
