/* ═══════════════════════════════════════════
   QUESTION RENDERER — Universal Styles
   Used by all game modes for all question types
   ═══════════════════════════════════════════ */

/* ── Question Text ── */
.qr-question-text {
  font-size: clamp(1rem, 3vw, 1.4rem);
  font-weight: 700;
  color: #e0e8f0;
  text-align: center;
  margin-bottom: 1.25rem;
  line-height: 1.6;
  padding: 0.75rem 1rem;
  background: rgba(0, 240, 255, 0.03);
  border: 1px solid rgba(0, 240, 255, 0.1);
  border-radius: 1rem;
}

/* ── MC Choices ── */
.qr-choices-mc {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  max-width: 600px;
  margin: 0 auto;
}
@media (max-width: 500px) {
  .qr-choices-mc { grid-template-columns: 1fr; }
}

.qr-choice-btn {
  padding: 14px 16px;
  border: 2px solid transparent;
  border-radius: 12px;
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  transition: all 0.25s;
  min-height: 48px;
  touch-action: manipulation;
  text-align: center;
  opacity: 0;
  transform: translateX(-30px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.qr-choice-btn:nth-child(2), .qr-choice-btn:nth-child(4) {
  transform: translateX(30px);
}
.qr-choice-btn.qr-visible {
  opacity: 1;
  transform: translateX(0);
  transition: opacity 0.3s ease, transform 0.3s ease, background 0.2s, border-color 0.2s;
}
.qr-choice-btn:hover:not(.qr-correct):not(.qr-wrong) {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}
.qr-choice-btn.qr-correct {
  background: linear-gradient(135deg, #22c55e, #16a34a) !important;
  border-color: #22c55e !important;
  box-shadow: 0 0 25px rgba(34, 197, 94, 0.5) !important;
  transform: scale(1.05) !important;
  opacity: 1 !important;
}
.qr-choice-btn.qr-wrong {
  background: linear-gradient(135deg, #ef4444, #dc2626) !important;
  border-color: #ef4444 !important;
  opacity: 0.8 !important;
  transform: none !important;
}

/* ── True/False ── */
.qr-choices-tf {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  max-width: 400px;
  margin: 0 auto;
}
.qr-choice-tf {
  padding: 20px;
  font-family: 'Orbitron', sans-serif;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  border: 3px solid transparent;
}
.qr-tf-true {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  border-color: rgba(34, 197, 94, 0.4);
}
.qr-tf-false {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  border-color: rgba(239, 68, 68, 0.4);
}
.qr-tf-true:hover { box-shadow: 0 0 25px rgba(34, 197, 94, 0.4); }
.qr-tf-false:hover { box-shadow: 0 0 25px rgba(239, 68, 68, 0.4); }

/* ── Image MC ── */
.qr-image-wrap {
  text-align: center;
  margin-bottom: 1rem;
}
.qr-question-image {
  max-width: 100%;
  max-height: 250px;
  border-radius: 1rem;
  border: 2px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
  object-fit: contain;
}

/* ── Drag Order ── */
.qr-drag-instructions {
  text-align: center;
  color: #94a3b8;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}
.qr-drag-list {
  max-width: 500px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.qr-drag-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(168, 85, 247, 0.2);
  border-radius: 10px;
  cursor: grab;
  transition: all 0.2s;
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  color: #e2e8f0;
  user-select: none;
  -webkit-user-select: none;
}
.qr-drag-item:hover {
  border-color: rgba(168, 85, 247, 0.5);
  background: rgba(168, 85, 247, 0.08);
}
.qr-drag-item.qr-dragging {
  opacity: 0.5;
  border-color: #a855f7;
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.3);
}
.qr-drag-handle {
  color: #64748b;
  font-size: 1.1rem;
  cursor: grab;
  flex-shrink: 0;
}
.qr-drag-num {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  color: #a855f7;
  min-width: 22px;
  text-align: center;
  flex-shrink: 0;
}
.qr-drag-text { flex: 1; }

.qr-drag-item.qr-drag-correct {
  border-color: #22c55e;
  background: rgba(34, 197, 94, 0.1);
}
.qr-drag-item.qr-drag-correct .qr-drag-num { color: #22c55e; }

.qr-drag-item.qr-drag-wrong {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
}
.qr-drag-item.qr-drag-wrong .qr-drag-num { color: #ef4444; }

.qr-submit-btn {
  display: block;
  margin: 1rem auto 0;
  padding: 12px 32px;
  background: linear-gradient(135deg, #a855f7, #7c3aed);
  color: #fff;
  border: none;
  border-radius: 50px;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 16px rgba(168, 85, 247, 0.3);
}
.qr-submit-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(168, 85, 247, 0.5);
}
.qr-submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ── Matching ── */
.qr-match-instructions {
  text-align: center;
  color: #94a3b8;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}
.qr-match-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  max-width: 550px;
  margin: 0 auto;
}
@media (max-width: 450px) {
  .qr-match-grid { grid-template-columns: 1fr; gap: 0.75rem; }
}
.qr-match-col {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.qr-match-item {
  padding: 12px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Outfit', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
  user-select: none;
}
.qr-match-item-left {
  background: rgba(59, 130, 246, 0.1);
  border: 2px solid rgba(59, 130, 246, 0.25);
  color: #93c5fd;
}
.qr-match-item-left:hover:not(.qr-match-done) {
  border-color: rgba(59, 130, 246, 0.6);
  background: rgba(59, 130, 246, 0.15);
}
.qr-match-item-left.qr-match-selected {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.2);
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.3);
  transform: scale(1.05);
}
.qr-match-item-right {
  background: rgba(168, 85, 247, 0.1);
  border: 2px solid rgba(168, 85, 247, 0.25);
  color: #c4b5fd;
}
.qr-match-item-right:hover:not(.qr-match-done) {
  border-color: rgba(168, 85, 247, 0.6);
  background: rgba(168, 85, 247, 0.15);
}
.qr-match-item.qr-match-done {
  pointer-events: none;
  opacity: 0.5;
}
.qr-match-item.qr-match-correct-pair {
  border-color: #22c55e !important;
  background: rgba(34, 197, 94, 0.12) !important;
  color: #86efac !important;
  opacity: 1 !important;
}
.qr-match-item.qr-match-wrong-flash {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.15);
  animation: qrMatchShake 0.4s ease;
}

@keyframes qrMatchShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}
