/* ===================================================================
   FDF Manager - Modo Mundial: Quiz de pelotas quietas
   Alcance visual: modal de partido Mundial 2026.
   =================================================================== */

.fdf-wc-quiz-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 11px;
  border: 1px solid #0f766e;
  border-radius: 999px;
  background: #0f766e;
  color: #ffffff;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(15, 118, 110, 0.22);
  white-space: nowrap;
  transition: transform .15s ease, opacity .15s ease, background .15s ease, border-color .15s ease;
}

.fdf-wc-quiz-toggle:hover {
  transform: translateY(-1px);
  opacity: .96;
}

.fdf-wc-quiz-toggle.is-off {
  background: #475569;
  border-color: #64748b;
  box-shadow: none;
}

.fdf-wc-quiz-toggle-wrap {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  gap: 6px;
}

#fdf-wc-quiz-modal {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  box-sizing: border-box;
  background: rgba(2, 6, 23, .78);
  backdrop-filter: blur(4px);
}

.fdf-wc-quiz-card {
  width: min(94vw, 620px);
  max-height: min(92vh, 720px);
  overflow-y: auto;
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,.22);
  background:
    radial-gradient(circle at top left, rgba(34, 197, 94, .22), transparent 34%),
    linear-gradient(180deg, #0f172a 0%, #111827 52%, #020617 100%);
  box-shadow: 0 28px 80px rgba(0,0,0,.48);
  color: #f8fafc;
}

.fdf-wc-quiz-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 22px 22px 14px;
  border-bottom: 1px solid rgba(148, 163, 184, .18);
}

.fdf-wc-quiz-kicker {
  margin: 0 0 7px;
  color: #a7f3d0;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.fdf-wc-quiz-title {
  margin: 0;
  color: #ffffff;
  font-size: clamp(20px, 3vw, 27px);
  line-height: 1.16;
  font-weight: 950;
}

.fdf-wc-quiz-subtitle {
  margin: 8px 0 0;
  color: #cbd5e1;
  font-size: 13px;
  line-height: 1.45;
}

.fdf-wc-quiz-timer {
  flex: 0 0 auto;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  color: #0f172a;
  border: 5px solid #22c55e;
  font-weight: 950;
  font-size: 22px;
  box-shadow: 0 10px 26px rgba(0,0,0,.30);
}

.fdf-wc-quiz-timer.is-warning {
  border-color: #f59e0b;
}

.fdf-wc-quiz-timer.is-danger {
  border-color: #ef4444;
  animation: fdfWcQuizPulse .7s ease-in-out infinite;
}

@keyframes fdfWcQuizPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

.fdf-wc-quiz-body {
  padding: 20px 22px 22px;
}

.fdf-wc-quiz-question {
  margin: 0 0 16px;
  padding: 16px;
  border-radius: 15px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.14);
  color: #ffffff;
  font-size: 18px;
  line-height: 1.35;
  font-weight: 850;
}

.fdf-wc-quiz-options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.fdf-wc-quiz-option {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 14px;
  border: 1px solid rgba(203, 213, 225, .28);
  border-radius: 14px;
  background: rgba(15, 23, 42, .72);
  color: #f8fafc;
  font-size: 15px;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
  transition: transform .12s ease, background .12s ease, border-color .12s ease;
}

.fdf-wc-quiz-option:hover:not(:disabled) {
  transform: translateY(-1px);
  background: rgba(30, 41, 59, .95);
  border-color: #93c5fd;
}

.fdf-wc-quiz-option:disabled {
  cursor: default;
  opacity: .86;
}

.fdf-wc-quiz-letter {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  background: rgba(255,255,255,.14);
  color: #e2e8f0;
  font-size: 13px;
  font-weight: 950;
}

.fdf-wc-quiz-option.is-correct {
  background: rgba(22, 163, 74, .30);
  border-color: #22c55e;
}

.fdf-wc-quiz-option.is-wrong {
  background: rgba(220, 38, 38, .28);
  border-color: #ef4444;
}

.fdf-wc-quiz-result {
  display: none;
  margin-top: 16px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.08);
  color: #f8fafc;
  font-size: 14px;
  line-height: 1.45;
  font-weight: 750;
}

.fdf-wc-quiz-result.is-visible {
  display: block;
}

.fdf-wc-quiz-result strong {
  display: block;
  margin-bottom: 4px;
  font-size: 16px;
  color: #ffffff;
}

.fdf-wc-quiz-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  color: #94a3b8;
  font-size: 12px;
}

.fdf-wc-quiz-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(255,255,255,.10);
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .04em;
}

@media (min-width: 600px) {
  .fdf-wc-quiz-options {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 520px) {
  #fdf-wc-quiz-modal {
    padding: 10px;
    align-items: flex-start;
  }
  .fdf-wc-quiz-card {
    border-radius: 16px;
  }
  .fdf-wc-quiz-head {
    padding: 18px 16px 12px;
  }
  .fdf-wc-quiz-body {
    padding: 16px;
  }
  .fdf-wc-quiz-timer {
    width: 52px;
    height: 52px;
    font-size: 19px;
  }
  .fdf-wc-quiz-question {
    font-size: 16px;
  }
  .fdf-wc-quiz-toggle-wrap {
    margin-left: 0;
    margin-top: 6px;
  }
}

/* V1.2: respuesta visual inmediata y menor costo de render sobre el motor en vivo */
#fdf-wc-quiz-modal {
  backdrop-filter: none;
}

.fdf-wc-quiz-option.is-selected {
  border-color: #facc15;
  box-shadow: 0 0 0 2px rgba(250, 204, 21, .25) inset;
}

.fdf-wc-quiz-result.is-processing {
  background: rgba(59, 130, 246, .16);
  border-color: rgba(147, 197, 253, .45);
}

/* V1.3: toggle siempre visible y menor costo durante partido en vivo */
.fdf-wc-quiz-toggle-wrap.is-floating {
  position: absolute;
  right: 18px;
  top: 112px;
  z-index: 1000008;
  margin: 0;
}
#modal-match-backdrop .fdf-wc-quiz-toggle-wrap.is-floating {
  position: absolute;
}
.fdf-wc-quiz-toggle {
  min-height: 34px;
  will-change: auto;
}
body.fdf-wc-quiz-active .fdf-wc-quiz-toggle-wrap {
  opacity: .35;
  pointer-events: none;
}
#fdf-wc-quiz-modal {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  background: rgba(2, 6, 23, .72) !important;
}
.fdf-wc-quiz-card {
  contain: layout style paint;
}
.fdf-wc-quiz-option,
.fdf-wc-quiz-result,
.fdf-wc-quiz-timer {
  transition-duration: .06s !important;
}
.tv-live-badge.is-finalized {
  background: rgba(71,85,105,.88) !important;
  border-color: rgba(148,163,184,.6) !important;
}
.tv-live-badge.is-finalized i {
  background: #94a3b8 !important;
  box-shadow: none !important;
  animation: none !important;
}
#substitution-modal.fdf-sub-modal-quiz-optimized,
#substitution-modal.fdf-sub-modal-quiz-optimized #fdf-sub-pitch {
  contain: layout style paint;
}
@media (max-width: 760px) {
  .fdf-wc-quiz-toggle-wrap.is-floating {
    right: 10px;
    top: 92px;
  }
  .fdf-wc-quiz-toggle {
    font-size: 11px;
    padding: 7px 9px;
  }
}


/* V1.4: botón fijo y persistente dentro del motor del Mundial */
.fdf-wc-quiz-toggle-wrap.is-body-floating {
  position: fixed !important;
  right: 22px !important;
  bottom: 96px !important;
  z-index: 1000001 !important;
  display: inline-flex !important;
  pointer-events: auto !important;
}
.fdf-wc-quiz-toggle-wrap.is-body-floating .fdf-wc-quiz-toggle {
  box-shadow: 0 12px 28px rgba(0,0,0,.32), inset 0 1px 0 rgba(255,255,255,.16) !important;
}
body.fdf-wc-quiz-active .fdf-wc-quiz-toggle-wrap.is-body-floating {
  display: none !important;
}

/* V1.6: columna derecha de comentarios: Cambios arriba, Quiz centrado debajo */
body.fdf-wc-quiz-toggle-mounted #modal-match-backdrop .modal-match.fdf-match-tv-v3 .fdf-floating-sub-btn,
body.fdf-wc-quiz-toggle-mounted #modal-match-backdrop .modal-match.fdf-match-tv-v5 .fdf-floating-sub-btn,
body.fdf-wc-quiz-toggle-mounted #modal-match-backdrop .modal-match .fdf-floating-sub-btn,
body.fdf-wc-quiz-toggle-mounted .fdf-floating-sub-btn {
  bottom: 92px !important;
}
.fdf-wc-quiz-toggle-wrap.is-body-floating {
  right: 22px !important;
  bottom: 24px !important;
}
.fdf-wc-quiz-toggle-wrap.is-body-floating .fdf-wc-quiz-toggle {
  min-width: 182px;
  min-height: 42px;
  border-radius: 16px;
}
@media (max-width: 900px) {
  body.fdf-wc-quiz-toggle-mounted #modal-match-backdrop .modal-match .fdf-floating-sub-btn,
  body.fdf-wc-quiz-toggle-mounted .fdf-floating-sub-btn {
    bottom: 78px !important;
  }
  .fdf-wc-quiz-toggle-wrap.is-body-floating {
    right: 14px !important;
    bottom: 18px !important;
  }
  .fdf-wc-quiz-toggle-wrap.is-body-floating .fdf-wc-quiz-toggle {
    min-width: 148px;
  }
}


/* V1.6 refinamiento de ubicación: columna fija a la derecha de la caja de comentarios */
body.fdf-wc-quiz-toggle-mounted #modal-match-backdrop .modal-match.fdf-match-tv-v3 .fdf-floating-sub-btn,
body.fdf-wc-quiz-toggle-mounted #modal-match-backdrop .modal-match.fdf-match-tv-v5 .fdf-floating-sub-btn,
body.fdf-wc-quiz-toggle-mounted #modal-match-backdrop .modal-match .fdf-floating-sub-btn,
body.fdf-wc-quiz-toggle-mounted .fdf-floating-sub-btn {
  right: 22px !important;
  bottom: 92px !important;
  min-width: 182px !important;
  justify-content: center !important;
}
.fdf-wc-quiz-toggle-wrap.is-body-floating {
  right: 22px !important;
  bottom: 30px !important;
  width: 182px !important;
  justify-content: center !important;
}
.fdf-wc-quiz-toggle-wrap.is-body-floating .fdf-wc-quiz-toggle {
  width: 100% !important;
  justify-content: center !important;
  text-align: center !important;
}
#modal-match-backdrop .modal-match.fdf-match-tv-v3 #mm-comentarios,
#modal-match-backdrop .modal-match.fdf-match-tv-v5 #mm-comentarios,
#modal-match-backdrop .modal-match #mm-comentarios {
  padding-right: min(246px, 30vw) !important;
}
@media (max-width: 900px) {
  body.fdf-wc-quiz-toggle-mounted #modal-match-backdrop .modal-match .fdf-floating-sub-btn,
  body.fdf-wc-quiz-toggle-mounted .fdf-floating-sub-btn {
    right: 14px !important;
    bottom: 78px !important;
    min-width: 148px !important;
  }
  .fdf-wc-quiz-toggle-wrap.is-body-floating {
    right: 14px !important;
    bottom: 22px !important;
    width: 148px !important;
  }
}

/* V1.7: columna real dentro del modal, a la derecha de la caja de comentarios */
#modal-match-backdrop .modal-match {
  position: relative !important;
}
#modal-match-backdrop .modal-match #fdf-wc-match-actions-column.fdf-wc-match-actions-column {
  position: absolute !important;
  right: 20px !important;
  bottom: 30px !important;
  width: 184px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  justify-content: flex-end !important;
  gap: 10px !important;
  z-index: 120 !important;
  pointer-events: auto !important;
}
#modal-match-backdrop .modal-match #fdf-wc-match-actions-column .fdf-floating-sub-btn {
  position: static !important;
  right: auto !important;
  bottom: auto !important;
  width: 100% !important;
  min-width: 0 !important;
  justify-content: center !important;
  margin: 0 !important;
  z-index: auto !important;
}
#modal-match-backdrop .modal-match #fdf-wc-match-actions-column .fdf-wc-quiz-toggle-wrap.is-actions-column {
  position: static !important;
  right: auto !important;
  bottom: auto !important;
  width: 100% !important;
  margin: 0 !important;
  display: flex !important;
  justify-content: center !important;
  z-index: auto !important;
}
#modal-match-backdrop .modal-match #fdf-wc-match-actions-column .fdf-wc-quiz-toggle {
  width: 100% !important;
  min-width: 0 !important;
  min-height: 40px !important;
  border-radius: 16px !important;
  text-align: center !important;
  justify-content: center !important;
  padding: 10px 12px !important;
  white-space: normal !important;
  line-height: 1.12 !important;
}
#modal-match-backdrop .modal-match #fdf-wc-match-actions-column .fdf-wc-quiz-toggle-wrap.is-body-floating {
  position: static !important;
}
body.fdf-wc-quiz-active #modal-match-backdrop .modal-match #fdf-wc-match-actions-column .fdf-wc-quiz-toggle-wrap {
  display: none !important;
}
#modal-match-backdrop .modal-match #mm-comentarios {
  padding-right: min(250px, 30vw) !important;
}
@media (max-width: 900px) {
  #modal-match-backdrop .modal-match #fdf-wc-match-actions-column.fdf-wc-match-actions-column {
    right: 14px !important;
    bottom: 22px !important;
    width: 150px !important;
  }
  #modal-match-backdrop .modal-match #mm-comentarios {
    padding-right: 12px !important;
  }
}

/* V1.9: Match Experience persistente dentro del único resumen del partido */
#match-summary-modal .fdf-exp-summary-block[data-fdf-wc-exp-v19],
#match-summary-modal .fdf-exp-summary-block {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  position: relative !important;
  transform: none !important;
  contain: none !important;
}
#match-summary-modal .fdf-match-summary-dialog {
  scroll-behavior: auto !important;
}
#fdf-wc-quiz-modal.is-closing,
#fdf-wc-quiz-modal[data-fdf-quiz-closing] {
  pointer-events: none !important;
}


/* V1.10: cierre manual del modal Quiz */
.fdf-wc-quiz-tools{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:8px;
  flex:0 0 auto;
}
.fdf-wc-quiz-close{
  width:34px;
  height:34px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.28);
  background:rgba(15,23,42,.78);
  color:#fff;
  font-size:24px;
  line-height:1;
  font-weight:900;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow:0 8px 22px rgba(0,0,0,.28);
}
.fdf-wc-quiz-close:hover{
  background:rgba(239,68,68,.90);
  border-color:rgba(248,113,113,.92);
}
