/* ================================================================
   Trivia — opciones como botones-tarjeta, barra de tiempo que se
   calienta, revelado con color + icono + micro-animación y marcador
   de la carrera con los dos jugadores.
   Se carga DESPUÉS de style.css.
   ================================================================ */

#screen-game { gap: 14px; }

/* ---- marcador de la carrera ---- */

#screen-game .vs-bar {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: stretch;
  gap: 8px;
  font-size: 0.92rem;
}

#screen-game .vs-bar .player-you,
#screen-game .vs-bar .player-opp {
  padding: 8px 10px;
  border-radius: 14px;
  font-weight: 800;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
}

#screen-game .vs-bar .player-you {
  text-align: left;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.26), rgba(251, 191, 36, 0.08));
  box-shadow: inset 0 0 0 1px rgba(251, 191, 36, 0.5), 0 2px 6px rgba(0, 0, 0, 0.22);
}

#screen-game .vs-bar .player-opp {
  text-align: right;
  background: linear-gradient(225deg, rgba(56, 189, 248, 0.26), rgba(56, 189, 248, 0.08));
  box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.5), 0 2px 6px rgba(0, 0, 0, 0.22);
}

#screen-game .vs {
  align-self: center;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #86efac;
}

/* ---- cabecera ---- */

.tv-num {
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: #86efac;
}

.tv-cat {
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: linear-gradient(180deg, rgba(251, 191, 36, 0.28), rgba(251, 191, 36, 0.10));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
  border-color: rgba(251, 191, 36, 0.55);
  max-width: 62%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---- barra de tiempo ----
   El ancho lo sigue animando trivia.js con una transition; acá va la
   "temperatura": el mismo tiempo de la pregunta, de menta a rojo. */

.tv-timer {
  height: 10px;
  background: rgba(0, 0, 0, 0.4);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.45);
}

.tv-timer-fill {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0) 60%), #4ade80;
  box-shadow: 0 0 10px rgba(74, 222, 128, 0.5);
}

@keyframes tv-heat {
  0%   { background-color: #4ade80; box-shadow: 0 0 10px rgba(74, 222, 128, 0.5); }
  55%  { background-color: #fbbf24; box-shadow: 0 0 10px rgba(251, 191, 36, 0.55); }
  82%  { background-color: #f97316; box-shadow: 0 0 12px rgba(249, 115, 22, 0.6); }
  100% { background-color: #ef4444; box-shadow: 0 0 16px rgba(239, 68, 68, 0.8); }
}

/* ---- pregunta ---- */

.tv-question {
  border-radius: 18px;
  font-size: clamp(1.02rem, 4.4vw, 1.2rem);
  line-height: 1.35;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(134, 239, 172, 0.10), rgba(0, 0, 0, 0) 70%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.30), rgba(0, 0, 0, 0.18));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.10),
    0 6px 16px rgba(0, 0, 0, 0.25);
  animation: tv-q-in 0.32s cubic-bezier(0.2, 0.8, 0.3, 1) both;
}

@keyframes tv-q-in {
  0%   { opacity: 0; transform: translateY(-8px) scale(0.98); }
  100% { opacity: 1; transform: none; }
}

/* ---- opciones ---- */

.tv-options { counter-reset: tv-opt; gap: 9px; }

.tv-opt {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 44px 13px 12px;
  border: none;
  border-radius: 14px;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(0, 0, 0, 0.26));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    inset 0 0 0 1px rgba(255, 255, 255, 0.10),
    0 3px 0 rgba(0, 0, 0, 0.30),
    0 5px 12px rgba(0, 0, 0, 0.22);
  transition: transform 0.09s ease, box-shadow 0.09s ease, background 0.2s ease;
  will-change: transform;
  animation: tv-opt-in 0.3s cubic-bezier(0.2, 0.8, 0.3, 1) both;
}

/* entrada escalonada de las cuatro tarjetas */
.tv-opt:nth-child(1) { animation-delay: 0.05s; }
.tv-opt:nth-child(2) { animation-delay: 0.11s; }
.tv-opt:nth-child(3) { animation-delay: 0.17s; }
.tv-opt:nth-child(4) { animation-delay: 0.23s; }

@keyframes tv-opt-in {
  0%   { opacity: 0; transform: translateY(10px); }
  100% { opacity: 1; transform: none; }
}

/* chapita A/B/C/D — sale del contador CSS, sin tocar el JS */
.tv-opt::before {
  counter-increment: tv-opt;
  content: counter(tv-opt, upper-alpha);
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 900;
  color: #052e16;
  background: linear-gradient(180deg, #bbf7d0, #86efac);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.18);
  transition: background 0.2s ease, color 0.2s ease;
}

@media (hover: hover) {
  .tv-opt:not(:disabled):hover {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(0, 0, 0, 0.22));
    transform: translateY(-1px);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.2),
      inset 0 0 0 1px rgba(134, 239, 172, 0.35),
      0 4px 0 rgba(0, 0, 0, 0.30),
      0 8px 16px rgba(0, 0, 0, 0.26);
  }
}

.tv-opt:not(:disabled):active {
  transform: translateY(3px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 0 0 1px rgba(255, 255, 255, 0.1),
    0 0 0 rgba(0, 0, 0, 0.3),
    0 1px 4px rgba(0, 0, 0, 0.25);
}

/* icono de estado a la derecha (además del color) */
.tv-opt::after {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.15rem;
  font-weight: 900;
  line-height: 1;
}

.tv-opt.picked {
  background: linear-gradient(180deg, rgba(251, 191, 36, 0.28), rgba(180, 83, 9, 0.18));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    inset 0 0 0 2px rgba(251, 191, 36, 0.8),
    0 0 16px rgba(251, 191, 36, 0.25);
  color: #fef3c7;
}

.tv-opt.picked::before { background: linear-gradient(180deg, #fde68a, #f59e0b); color: #451a03; }
.tv-opt.picked::after { content: '•'; color: #fbbf24; }

.tv-opt.correct {
  background: linear-gradient(180deg, rgba(74, 222, 128, 0.32), rgba(21, 128, 61, 0.28));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    inset 0 0 0 2px #4ade80,
    0 0 22px rgba(74, 222, 128, 0.35);
  color: #f0fdf4;
  animation: tv-correct 0.62s cubic-bezier(0.3, 0.8, 0.3, 1) 2;
}

.tv-opt.correct::before { background: linear-gradient(180deg, #86efac, #22c55e); color: #052e16; }
.tv-opt.correct::after { content: '✓'; color: #bbf7d0; }

@keyframes tv-correct {
  0%, 100% { transform: scale(1); }
  40%      { transform: scale(1.035); }
}

.tv-opt.wrong {
  background: linear-gradient(180deg, rgba(248, 113, 113, 0.26), rgba(153, 27, 27, 0.24));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    inset 0 0 0 2px #f87171;
  color: #fee2e2;
  animation: tv-wrong 0.42s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

.tv-opt.wrong::before { background: linear-gradient(180deg, #fecaca, #ef4444); color: #450a0a; }
.tv-opt.wrong::after { content: '✕'; color: #fecaca; }

@keyframes tv-wrong {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-6px); }
  40%, 60% { transform: translateX(6px); }
  0%, 100% { transform: translateX(0); }
}

/* las que no eran ni la elegida ni la correcta se apagan */
.tv-opt:disabled:not(.correct):not(.wrong):not(.picked) {
  opacity: 0.45;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.24);
}

#tv-status {
  min-height: 22px;
  text-align: center;
  font-weight: 700;
  font-size: 0.95rem;
}

@media (max-width: 360px) {
  .tv-opt { padding: 12px 38px 12px 10px; gap: 9px; font-size: 0.95rem; }
  .tv-opt::before { width: 23px; height: 23px; font-size: 0.76rem; }
}

@media (prefers-reduced-motion: reduce) {
  .tv-question, .tv-opt, .tv-opt.correct, .tv-opt.wrong { animation: none; }
  .tv-timer-fill { animation: none !important; }
}
