/* ============================================================
   Variables de color del quiz
   ============================================================ */
:root {
  /* --quiz-theme se define en el HTML de cada test, no aquí */
  --primary: #e60000;
  --bg: #f0f4f8;
  --card-bg: #ffffff;
  --text-main: #232323;
  --color-speak: #e60000;
  --color-ok: #27ae60;
  --color-repeat: #8e44ad;
  --color-next: var(--quiz-theme, #E0772A);
  --color-progress: #27ae60;
  --color-disabled: #bdc3c7;
}

/* ============================================================
   Tarjeta principal
   ============================================================ */
.quiz-card {
  background: var(--card-bg);
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 700px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  align-self: stretch !important;
  box-sizing: border-box !important;
  padding: 30px;
  border-radius: 14px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.10);
  text-align: center;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 25px;
  min-height: 700px;
  transition: opacity 0.4s ease;
}

/* ============================================================
   Animaciones de transición entre pantallas
   ============================================================ */
.fade-in {
  animation: fadeIn 0.6s ease-out forwards;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(15px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-out-in {
  animation: fadeOutIn 0.5s ease-in-out;
}
@keyframes fadeOutIn {
  0%   { opacity: 1; }
  50%  { opacity: 0; }
  100% { opacity: 1; }
}

.hidden {
  display: none !important;
}

.screen_content {
  width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
}

/* ============================================================
   Títulos — color rojo del quiz + tamaño controlado
   ============================================================ */
h1 {
  /*color: black;*/
  margin: 0;
}

#ui-main-title {
  font-size: 2rem;
}

#ui-result-title {
  display: none !important;
}

/* ============================================================
   Contenedor de imagen/video 16:9
   ============================================================ */
.media-container {
  position: relative;
  width: 100% !important;
  margin: 0 0 26px 0;
  padding-bottom: 56.25%;
  height: 0;
  border-radius: 10px;
  overflow: hidden;
  background: #000;
}
.media-container iframe,
.media-container img {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  border: none;
}

/* ============================================================
   Texto de la pregunta
   ============================================================ */
#question-text {
  margin: 0 0 22px 0;
  border: 1.5px solid #e8e8e8;
  border-radius: 12px;
  padding: 16px 20px;
}

#question-text p {
  font-size: 0.9rem !important;
  color: var(--text-main);
  margin-bottom: 5px;
  font-weight: normal;
}

#question-text p:first-child {
  margin: -16px -20px 16px -20px;
  padding: 10px 20px;
  background: #f5f5f5;
  border-bottom: 1.5px solid #e8e8e8;
  border-radius: 10px 10px 0 0;
  font-size: 0.95rem !important;
  color: #464646;
  font-weight: normal;
}

#question-text h2 {
  font-size: 1.1rem !important;
  color: var(--text-main);
  margin: 0 !important;
  line-height: 1.4;
}

#question-text p:last-child {
  font-size: 1.3rem !important;
  font-weight: 600;
  margin-top: 0.5rem;
  color: var(--text-main);
}

#question-text .q-translation {
  font-size: 0.9rem !important;
  font-style: italic;
  font-weight: normal;
  color: #2d8dac;
  margin: 2px 0 2px;
}

/* ============================================================
   Pantalla intro
   ============================================================ */
#ui-main-title {
  display: none !important;
}

#ui-select-lang-label {
  display: none !important;
}

.lang-selector-wrapper {
  margin: 0 0 16px 0;
}

#lang-selector {
  padding: 12px 40px 12px 16px;
  min-height: 52px;
  border-radius: 8px;
  width: 100%;
  max-width: 320px;
  border: 1px solid #ddd;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24'%3E%3Cpath fill='%23666' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 20px;
  font-size: 1rem;
  color: inherit;
  cursor: pointer;
}

.intro-box {
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 22px;
  text-align: center;
}

.intro-instructions-title {
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  color: #555;
  margin: 0 0 14px 0;
  text-align: center;
}

#ui-instructions {
  margin: 0;
  text-align: left;
}

#ui-btn-start {
  background-color: var(--color-next);
  margin-top: 0;
  margin-bottom: 20px;
  min-width: 240px;
  width: auto;
  align-self: center;
}

#ui-btn-start:hover:not(:disabled) {
  background-color: var(--quiz-theme, #E0772A) !important;
  filter: brightness(0.85) !important;
  color: white !important;
}

/* ============================================================
   Campo de escritura
   ============================================================ */
#text-input-area {
  margin: 24px 0;
}

#text-answer {
  width: 100% !important;
  padding: 18px 15px !important;
  border-radius: 12px !important;
  border: 2px solid #edf2f7 !important;
  font-size: 1.1rem !important;
  font-weight: 600 !important;
  min-height: 60px !important;
  background: #fdfdfd !important;
  color: #3d3d4a !important;
  box-sizing: border-box !important;
  outline: none !important;
  box-shadow: none !important;
  text-align: center !important;
  -webkit-appearance: none !important;
  appearance: none !important;
  transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease !important;
}

#text-answer:focus {
  border-color: #edf2f7 !important;
  box-shadow: none !important;
  outline: none !important;
}

#text-answer.correct {
  border-color: #27ae60 !important;
  background: #eafaf1 !important;
  color: #27ae60 !important;
}

#text-answer.incorrect {
  border-color: #e74c3c !important;
  background: #fdf2f2 !important;
  color: #e74c3c !important;
}

#text-answer:focus::placeholder {
  color: transparent;
}

/* ============================================================
   Botones — solo layout y colores propios del quiz.
   Tipografía la gestiona Astra.
   ============================================================ */
button {
  padding: 14px 18px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  font-size: 0.82rem !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
  transition: all 0.3s ease;
}

button:disabled {
  background-color: var(--color-disabled) !important;
  cursor: not-allowed;
  opacity: 0.6;
  animation: none;
}

.btn-speak {
  background-color: #27ae60;
  color: white;
  align-self: center;
  min-width: 180px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 15px;
}

.btn-speak::before {
  content: "";
  display: inline-block;
  width: 1.2em;
  height: 1.2em;
  flex-shrink: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M12 14c1.66 0 3-1.34 3-3V5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3z'/%3E%3Cpath d='M17 11c0 2.76-2.24 5-5 5s-5-2.24-5-5H5c0 3.53 2.61 6.43 6 6.92V21h2v-3.08c3.39-.49 6-3.39 6-6.92h-2z'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.btn-speak:hover:not(:disabled):not(.listening) {
  background-color: #219a52 !important;
  color: white !important;
}

.btn-speak.listening {
  background-color: var(--color-speak);
  animation: pulse-red 2s infinite;
}

.btn-speak:disabled {
  background-color: var(--color-disabled);
  animation: none;
  box-shadow: none;
  cursor: not-allowed;
  transform: scale(0.95);
}

@keyframes pulse-red {
  0%   { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.7); }
  70%  { box-shadow: 0 0 0 20px rgba(231, 76, 60, 0); }
  100% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0); }
}

@keyframes pulse-purple {
  0%   { box-shadow: 0 0 0 0 rgba(142, 68, 173, 0.7); }
  70%  { box-shadow: 0 0 0 20px rgba(142, 68, 173, 0); }
  100% { box-shadow: 0 0 0 0 rgba(142, 68, 173, 0); }
}

@keyframes sweep-fill {
  0%   { background-position: 100% 0; }
  60%  { background-position: 0% 0; }
  61%  { background-position: 100% 0; }
  100% { background-position: 100% 0; }
}

.btn-speak.btn-continue {
  background-image: linear-gradient(to right, #1d9450 50%, #27ae60 50%) !important;
  background-size: 200% 100% !important;
  background-position: 100% 0;
  animation: sweep-fill 3s ease-in infinite !important;
  color: white !important;
  box-shadow: none !important;
}

.btn-repeat {
  background: var(--color-repeat);
  color: white;
  min-width: 180px;
}

.btn-repeat:hover:not(:disabled) {
  background-color: #7d3c98 !important;
  color: white !important;
}

.btn-repeat:disabled {
  background-color: var(--color-repeat) !important;
  opacity: 0.35;
}

.btn-ok {
  background: var(--color-ok);
  color: white;
  min-width: 180px;
}

.btn-ok:hover:not(:disabled) {
  background-color: #219a52 !important;
  color: white !important;
}

.btn-ok:disabled {
  background-color: var(--color-ok) !important;
  opacity: 0.35;
}

.link-next {
  display: block !important;
  width: fit-content !important;
  margin-left: auto !important;
  margin-top: 4px !important;
  margin-bottom: 6px !important;
  padding: 0 !important;
  color: #999 !important;
  font-weight: 500 !important;
  font-size: 0.88rem !important;
  text-decoration: underline !important;
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  cursor: pointer;
}

.link-next:hover {
  color: #555 !important;
  background: none !important;
  text-decoration: underline !important;
  opacity: 1 !important;
}

/* ============================================================
   Área de transcripción (respuesta en modo voz)
   font-size y font-weight grandes a propósito: muestran la
   respuesta del alumno de forma clara y legible.
   position: relative es CRÍTICO para el efecto confeti.
   ============================================================ */
.transcript-area {
  border: 2px solid #edf2f7;
  padding: 10px;
  border-radius: 12px;
  margin: 10px 0 15px 0;
  width: 100% !important;
  box-sizing: border-box;
  word-break: break-word;
  overflow-wrap: break-word;
  font-size: 1.1rem !important;
  font-weight: 600;
  min-height: 40px;
  background: #fdfdfd;
  color: #3d3d4a;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease;
  position: relative;
}

/* Estados correcto / incorrecto — voz */
.transcript-area.correct  { border-color: #27ae60; background: #eafaf1; color: #27ae60; }
.transcript-area.incorrect { border-color: #e74c3c; background: #fdf2f2; color: #e74c3c; }


/* ============================================================
   Efecto confeti (modo voz, correcto)
   ============================================================ */
.effect-confetti {
  position: absolute;
  pointer-events: none;
  animation: effect-confetti-fly var(--dur) ease-out forwards;
}
@keyframes effect-confetti-fly {
  0%   { transform: translate(0,0) rotate(0deg) scale(1);                         opacity: 1; }
  100% { transform: translate(var(--tx),var(--ty)) rotate(var(--rot)) scale(.15); opacity: 0; }
}

/* ============================================================
   Efecto rayos dorados (Blocked)
   ============================================================ */
.effect-ray-particle {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  animation: ray-particle-fly var(--dur) ease-out forwards;
}
@keyframes ray-particle-fly {
  0%   { transform: translate(-50%,-50%) translate(0,0); opacity: 1; }
  100% { transform: translate(-50%,-50%) translate(var(--tx),var(--ty)); opacity: 0; }
}

/* ============================================================
   Efecto burbujas (Gaps)
   ============================================================ */
.effect-bubble {
  position: absolute;
  border-radius: 50%;
  background: rgba(52, 152, 219, 0.55);
  pointer-events: none;
  animation: bubble-float var(--dur) ease-out var(--delay, 0s) forwards;
}
@keyframes bubble-float {
  0%   { transform: translateY(0) scale(1);   opacity: 0.75; }
  100% { transform: translateY(var(--ty)) scale(0.2); opacity: 0; }
}

/* ============================================================
   Efecto letras que caen (modo voz, incorrecto)
   ============================================================ */
@keyframes letter-fall {
  0%   { transform: translateY(0)    rotate(0deg)                   translateX(0);         opacity: 1; }
  12%  { transform: translateY(-4px) rotate(calc(var(--rot) * .15)) translateX(0);         opacity: 1; }
  100% { transform: translateY(65px) rotate(var(--rot))             translateX(var(--tx)); opacity: 0; }
}

/* ============================================================
   Layout fila de botones
   ============================================================ */
.controls-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

/* btn-speak dentro de controls-row (Magic Test): color del tema, centrado, no estirar */
.controls-row .btn-speak {
  margin-bottom: 0;
  width: auto !important;
  min-width: 200px !important;
  background-color: var(--quiz-theme, #E0772A) !important;
}

.controls-row .btn-speak:hover:not(:disabled):not(.listening) {
  filter: brightness(0.85) !important;
  background-color: var(--quiz-theme, #E0772A) !important;
}

.controls-row .btn-speak.listening {
  background-color: var(--color-speak) !important;
}

/* Cuando btn-speak está dentro de controls-row, ocultarlo al desactivarse */
.controls-row .btn-speak:disabled {
  display: none;
}

/* Ocultar btn-ok desactivado dentro del controls-row */
.controls-row .btn-ok:disabled {
  display: none;
}

/* Cuando btn-speak está activo (no disabled), ocultar btn-repeat:
   cubre estados inicial, escuchando e incompleto — evita duplicados */
.controls-row .btn-speak:not(:disabled) ~ .btn-repeat {
  display: none !important;
}

/* Mientras está escuchando, ocultar btn-ok aunque esté habilitado */
.controls-row .btn-speak.listening ~ .btn-ok {
  display: none !important;
}

/* btn-repeat dentro de controls-row: color del tema con icono de micrófono */
.controls-row .btn-repeat {
  background-color: var(--quiz-theme, #E0772A) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
}

.controls-row .btn-repeat::before {
  content: "";
  display: inline-block;
  width: 1.2em;
  height: 1.2em;
  flex-shrink: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M12 14c1.66 0 3-1.34 3-3V5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3z'/%3E%3Cpath d='M17 11c0 2.76-2.24 5-5 5s-5-2.24-5-5H5c0 3.53 2.61 6.43 6 6.92V21h2v-3.08c3.39-.49 6-3.39 6-6.92h-2z'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.controls-row .btn-repeat:hover:not(:disabled) {
  filter: brightness(0.85) !important;
  background-color: var(--quiz-theme, #E0772A) !important;
}

/* ============================================================
   Pantalla resultado
   ============================================================ */
#final-level {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--primary);
  margin: 10px 0;
}

#result-stats {
  color: #94a3b8;
  margin: 5px 0;
}

#feedback-text {
  color: #555;
  margin-bottom: 10px;
}

#feedback-solution {
  color: #555;
  margin-bottom: 20px;
}

#course-link {
  display: none;
  text-decoration: none;
}

#ui-btn-course {
  width: auto;
  margin-bottom: 20px;
}

#ui-btn-restart {
  width: auto;
  align-self: center;
  margin-bottom: 30px;
  background: var(--color-next, #e67e22) !important;
  border: none !important;
  animation: none !important;
}

#ui-btn-restart:hover:not(:disabled) {
  filter: brightness(0.85) !important;
}

#restart-hint {
  color: #444 !important;
  font-size: 17px !important;
  cursor: pointer;
  animation: pulso-hint 3s ease-in-out infinite;
}
@keyframes pulso-hint {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.15); }
}

/* ============================================================
   Barra de progreso
   ============================================================ */
.progress-section {
  margin-top: auto;
  padding-top: 10px;
  width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  font-weight: bold;
  color: #94a3b8;
  margin-bottom: 8px;
  width: 100% !important;
}

.progress-container {
  width: 100% !important;
  height: 12px;
  background: #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--color-progress);
  width: 0%;
  transition: width 0.6s cubic-bezier(0.1, 0.7, 0.1, 1);
}

/* ============================================================
   Botón play de la intro (círculo rojo con triángulo)
   ============================================================ */
#intro-play-btn {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 80px; height: 80px;
  background: var(--color-speak);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  animation: pulse-red 4s infinite;
  z-index: 10;
}

#intro-play-btn:hover {
  transform: translate(-50%, -50%) scale(1.1);
  transition: transform 0.2s ease;
}

#intro-play-btn::before {
  content: "";
  display: block;
  width: 0; height: 0;
  border-top: 20px solid transparent;
  border-bottom: 20px solid transparent;
  border-left: 35px solid white;
  margin-left: 5px;
}

/* ============================================================
   Área de ayuda — "Ver respuesta"
   ============================================================ */
#hint-area {
  text-align: center;
  margin: 10px 0 4px;
}

#hint-link {
  font-size: 0.85rem;
  color: #999;
  text-decoration: underline;
  cursor: pointer;
}

#hint-link:hover {
  color: #666;
}

#hint-text {
  padding: 10px 16px;
  color: #2e7d6e;
  font-size: 1.05rem;
  font-weight: 600;
  /*margin-top: 10px;
  background: #f0f9f4;
  border: 1px solid #b2dfdb;
  border-radius: 8px;*/
}

/* Aviso de respuesta incompleta — dentro del área de transcripción */
#incomplete-msg {
  font-size: 0.82rem;
  color: #e74c3c;
  font-weight: 600;
  text-align: center;
  margin: 0 0 15px 0;
}

/* Botón Repetir saltando — avisa al alumno sin modal */
@keyframes btn-bounce {
  0%, 100% { transform: translateY(0); }
  30%       { transform: translateY(-9px); }
  65%       { transform: translateY(-4px); }
}

.btn-repeat.bounce {
  animation: btn-bounce 0.7s ease-out infinite;
}

/* ============================================================
   Modal de errores del micrófono
   ============================================================ */
#modal-overlay {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

#modal-box {
  background: white;
  border-radius: 14px;
  padding: 30px;
  max-width: 420px;
  width: 90%;
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: center;
}

#modal-title {
  font-size: 1.3rem;
  color: #111111;
  font-weight: 800;
  margin: 0;
}

#modal-message {
  color: var(--text-main);
  margin: 0;
}

.modal-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 10px;
}

#modal-btn-ok {
  order: -1;
  background-color: var(--color-next) !important;
  color: white !important;
}

#modal-btn-ok:hover:not(:disabled) {
  filter: brightness(0.85) !important;
}

#modal-btn-write {
  background-color: #0D0C1D !important;
  color: white !important;
}

#modal-btn-write:hover:not(:disabled) {
  background-color: #232040 !important;
  color: white !important;
}

/* ============================================================
   Responsive móvil
   ============================================================ */
@media (max-width: 550px) {
  .quiz-card {
    padding: 20px 16px;
    min-height: 0;
  }
  .controls-row {
    flex-direction: row;
  }
  .controls-row .btn-repeat,
  .controls-row .btn-ok {
    flex: 1;
    min-width: 0;
    font-size: 0.9rem;
    padding: 12px 8px;
  }
  .btn-speak {
    width: 100%;
    min-width: auto;
  }
  .controls-row .btn-speak {
    width: 100% !important;
  }
  /* Magic question card: cuadrado perfecto en móvil para eliminar márgenes laterales */
  #screen-question .media-container {
    padding-bottom: 100%;
  }
  /* Result card: más alto en móvil para que quepa el óvalo + textos */
  #result-media { padding-bottom: 75% !important; }
}

/* ============================================================
   Magic Question Card — tarjeta de pregunta HTML
   ============================================================ */
.mq-card {
  position: absolute;
  inset: 0;
  background: #0D0C1D;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px 22px;
  box-sizing: border-box;
}
.mq-bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.mq-overlay {
  position: absolute;
  inset: 0;
  background: rgba(13, 12, 29, 0.85);
}
.mq-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 100%;
  max-width: 520px;
  text-align: center;
}
.mq-mic {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--quiz-theme, #E0772A);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
  margin: 10px 0 14px;
  animation: mq-breathe 2.4s ease-in-out infinite;
}
.mq-mic::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1.5px solid var(--quiz-theme, #E0772A);
  animation: mq-ring 2.4s ease-in-out infinite;
}
@keyframes mq-breathe {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.08); }
}
@keyframes mq-ring {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50%       { opacity: 0.9; transform: scale(1.2); }
}
.mq-instruction {
  font-size: clamp(0.58rem, 1.9vw, 0.72rem);
  font-weight: 700;
  color: #d8d8f0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0;
  line-height: 1.35;
}
.mq-divider {
  width: 55%;
  height: 1px;
  background: #333355;
  margin: 2px 0;
}
.mq-main-q {
  font-size: clamp(1rem, 4vw, 1.45rem);
  font-weight: 700;
  color: #FFE566;
  margin: 0 !important;
  line-height: 1.25;
  word-break: break-word;
  overflow-wrap: break-word;
}
.mq-main-q .mq-verb { color: #fff; }
.mq-blanco { color: #fff; }
.mq-gris { color: #aaa; font-size: 0.82em; font-weight: 400; }
.mq-translation, .mq-trans {
  font-size: clamp(0.75rem, 2.8vw, 0.95rem);
  font-style: italic;
  color: #90CAF9;
  margin: 0 !important;
  line-height: 1.4;
}
.mq-hint {
  font-size: clamp(0.95rem, 3.5vw, 1.25rem);
  font-weight: 400;
  color: #f6b278;
  margin: 3px 0 0 !important;
  line-height: 1.3;
  word-break: break-word;
  overflow-wrap: break-word;
}

/* ============================================================
   Magic Result Card — pantalla de resultado HTML
   ============================================================ */
.mr-card {
  position: absolute;
  inset: 0;
  background: #0D0C1D;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px;
  box-sizing: border-box;
  text-align: center;
}
.mr-star {
  position: absolute;
  background: #FCD34D;
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
  animation: mr-twinkle ease-in-out infinite;
  pointer-events: none;
}
@keyframes mr-twinkle {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.05; }
}
.mr-badge {
  width: clamp(110px, 28vw, 165px);
  aspect-ratio: 1.8 / 1;
  background: var(--quiz-theme, #E0772A);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  animation: mr-breathe 6s ease-in-out infinite, mr-glow-white 5s ease-in-out infinite;
}
@keyframes mr-breathe {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.05); }
}
@keyframes mr-glow-white {
  0%, 100% { box-shadow: 0 0 8px 0 rgba(255, 255, 255, 0.1); }
  50%       { box-shadow: 0 0 22px 6px rgba(255, 255, 255, 0.3); }
}
.mr-card--solid .mr-badge {
  animation: mr-breathe 4s ease-in-out infinite, mr-glow-gold 3s ease-in-out infinite;
}
@keyframes mr-glow-gold {
  0%, 100% { box-shadow: 0 0 10px 2px rgba(252, 211, 77, 0.25); }
  50%       { box-shadow: 0 0 32px 12px rgba(252, 211, 77, 0.6); }
}
.mr-card--basic .mr-badge {
  animation: mr-breathe 9s ease-in-out infinite, mr-glow-white 7s ease-in-out infinite;
}
.mr-percent-num {
  font-size: clamp(1.3rem, 4vw, 2.2rem);
  font-weight: 700;
  color: white;
  line-height: 1;
}
.mr-title {
  font-size: clamp(0.85rem, 2.8vw, 1.3rem);
  font-weight: 500;
  color: white;
  letter-spacing: 0.1em;
  margin: 0;
  position: relative;
  z-index: 1;
}
.mr-subtitle {
  font-size: clamp(0.68rem, 2vw, 0.85rem);
  color: #b8b8b8;
  margin: 0;
  position: relative;
  z-index: 1;
}
.mr-callout {
  font-family: Georgia, 'Palatino Linotype', serif;
  font-style: italic;
  font-weight: 700;
  font-size: clamp(0.78rem, 2.4vw, 1.1rem);
  color: #FCD34D;
  margin: 0;
  position: relative;
  z-index: 1;
}

/* Cuando el resultado es tipo "cover", el contenedor suelta la proporción fija
   y deja que .mr-card crezca con su contenido (evita que se corte en móvil).
   Usamos #result-media para tener más especificidad que la regla
   #result-media { padding-bottom: 75% !important } del bloque responsive. */
#result-media.mr-cover-mode {
  height: auto !important;
  padding-bottom: 0 !important;
  overflow: visible;
  background: transparent !important;
}
#result-media.mr-cover-mode .mr-card {
  position: relative;
  inset: auto;
  width: 100%;
  min-height: 260px;
}

/* Etiqueta de instrucción encima de cada pregunta */
.q-label,
#question-text p.q-label {
  display: block !important;
  font-size: 0.7em !important;
  color: #666 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.04em !important;
  font-weight: 600 !important;
  margin: 0 0 4px 0 !important;
  padding: 0 !important;
  background: none !important;
  border: none !important;
  border-radius: 0 !important;
}
