/* ---------- Radiology Quiz ---------- */

.rq-screen {
  max-width: 900px;
  margin: 0 auto;
}

/* (1) 모드 선택 */
.rq-mode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin: 24px 0;
}
.rq-mode-card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 22px 18px;
  cursor: pointer;
  text-align: center;
  transition: all .15s;
  font-family: inherit;
}
.rq-mode-card:hover {
  border-color: var(--primary);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}
.rq-mode-card:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.rq-mode-icon { font-size: 36px; margin-bottom: 8px; }
.rq-mode-card h3 {
  margin: 6px 0 8px;
  color: var(--primary);
  font-size: 17px;
}
.rq-mode-card p {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
  margin: 0 0 10px;
}
.rq-mode-meta {
  display: inline-block;
  background: var(--bg-soft);
  color: var(--text-muted);
  padding: 3px 10px;
  border-radius: 10px;
  font-size: 11.5px;
}

.rq-options {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}
.rq-opt-row {
  display: flex;
  gap: 18px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.rq-opt-row label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--text-muted);
}
.rq-opt-row select {
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
}
.rq-note {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-top: 12px;
}

/* (2) 퀴즈 진행 */
.rq-progress-bar {
  margin-bottom: 16px;
}
.rq-progress-info {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--text-muted);
}
.rq-badge {
  background: var(--primary);
  color: #fff;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}
.rq-badge.badge-dx { background: #c00; }
.rq-badge.badge-finding { background: var(--primary); }
.rq-progress-track {
  background: var(--bg-soft);
  height: 4px;
  border-radius: 4px;
  overflow: hidden;
}
#rqProgressFill {
  height: 100%;
  background: var(--primary);
  transition: width .25s ease;
  width: 0;
}

.rq-question-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  min-height: 420px;
}

.rq-image-wrap {
  background: #0a0a0a;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 320px;
}
.rq-image-wrap img {
  width: 100%;
  height: 100%;
  max-height: 70vh;
  object-fit: contain;
}
.rq-zoom-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
}
.rq-zoom-btn:hover { background: rgba(0,0,0,0.85); }

.rq-question-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
}
.rq-prompt {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 14px;
  line-height: 1.5;
}

.rq-choices {
  list-style: none;
  padding: 0;
  margin: 0 0 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.rq-choice label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-soft);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 13.5px;
  line-height: 1.45;
  transition: all .12s;
}
.rq-choice label:hover {
  border-color: var(--primary);
  background: var(--bg-card);
}
.rq-choice input { margin-top: 2px; flex: 0 0 auto; }
.rq-choice.correct label {
  background: #e7f6ec;
  border-color: #4caf50;
  color: #1b5e20;
}
.rq-choice.wrong label {
  background: #fdecea;
  border-color: #d32f2f;
  color: #b71c1c;
}
.rq-choice.missed label {
  background: #fff8e1;
  border-color: #ffb300;
  color: #855e00;
}
.rq-choice.missed label::after {
  content: ' (놓침)';
  font-size: 11px;
  color: #c87f00;
  margin-left: 4px;
}

.rq-explain {
  margin-top: 6px;
  padding: 12px;
  background: var(--bg-soft);
  border-radius: 8px;
  border-left: 4px solid var(--primary);
}
.rq-result-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 13px;
}
.rq-verdict.ok { color: #2e7d32; }
.rq-verdict.ng { color: #c62828; }
.rq-verdict.partial { color: #b27000; }
.rq-explain-text {
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--text);
}
.rq-explain-title {
  margin: 4px 0 8px;
  font-size: 15px;
  color: var(--primary);
  font-weight: 700;
}
.rq-explain-body .md-para,
.rq-explain-notes .md-para {
  padding: 8px 10px;
  font-size: 13px;
  background: #ffffff;
}
.rq-explain-notes {
  margin-top: 8px;
  padding: 8px 10px;
  background: #fffdf3;
  border-left: 3px solid #e6cf68;
  border-radius: 6px;
}
.rq-explain-notes > b {
  display: inline-block;
  font-size: 12px;
  color: #886200;
  margin-bottom: 4px;
}
.rq-explain-notes .md-para {
  background: transparent;
  border-left: none;
  padding: 0;
}
.rq-source-detail {
  margin-top: 10px;
  font-size: 12.5px;
}
.rq-source-detail summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--primary);
}
.rq-source-detail pre {
  background: #fff;
  padding: 8px;
  border-radius: 4px;
  margin-top: 6px;
  white-space: pre-wrap;
  font-family: inherit;
  font-size: 12px;
  line-height: 1.5;
}
.rq-src-meta { font-size: 11px; color: var(--text-muted); margin: 4px 0; }
.rq-src-title { font-weight: 600; margin: 4px 0; }

.rq-actions {
  margin-top: auto;
  padding-top: 14px;
  display: flex;
  gap: 8px;
}
.rq-actions button {
  flex: 1;
  padding: 10px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover { background: #163a5e; }
.btn-primary:disabled { background: #bcc6d0; cursor: not-allowed; }
.btn-secondary {
  background: var(--bg-soft);
  color: var(--text);
  border: 1px solid var(--border) !important;
  flex: 0 0 100px;
}

/* (3) 결과 */
.rq-result-hero {
  text-align: center;
  padding: 32px 0 24px;
}
.rq-result-emoji { font-size: 72px; line-height: 1; }
.rq-result-hero h2 {
  font-size: 42px;
  color: var(--primary);
  margin: 8px 0 4px;
}
.rq-result-hero .lead {
  font-size: 15px;
  color: var(--text-muted);
}
.rq-result-meta {
  margin-top: 12px;
  color: var(--text-muted);
  font-size: 13px;
}

.rq-result-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 18px 0;
}
.rq-result-actions button {
  padding: 11px 18px;
  border-radius: 8px;
  border: none;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.rq-wrong-notes {
  margin-top: 28px;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.rq-wrong-notes h3 {
  margin: 0 0 12px;
  font-size: 16px;
  color: var(--primary);
}
.rq-wrong-item {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 14px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}
.rq-wrong-item:first-of-type { border-top: none; }
.rq-wrong-item img {
  width: 140px;
  height: 105px;
  object-fit: cover;
  border-radius: 6px;
  background: #0a0a0a;
}
.rq-wrong-meta { font-size: 11px; color: var(--text-muted); margin: 0; }
.rq-wrong-title { font-weight: 600; margin: 4px 0; font-size: 13.5px; }
.rq-wrong-ans { font-size: 13px; margin: 4px 0; }
.rq-wrong-item details { margin-top: 4px; }
.rq-wrong-item summary {
  font-size: 11.5px;
  color: var(--primary);
  cursor: pointer;
}
.rq-wrong-item pre {
  font-family: inherit;
  font-size: 12px;
  white-space: pre-wrap;
  background: var(--bg-soft);
  padding: 8px;
  border-radius: 4px;
  margin-top: 4px;
  line-height: 1.5;
}

/* 확대 모달 */
.rq-zoom-modal[hidden] { display: none !important; }
.rq-zoom-modal {
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.rq-zoom-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.92);
  cursor: zoom-out;
}
.rq-zoom-modal img {
  position: relative;
  max-width: 96vw;
  max-height: 94vh;
  object-fit: contain;
  z-index: 1;
}
.rq-zoom-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(0,0,0,0.55);
  color: #fff;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  z-index: 2;
}

/* 모바일 */
@media (max-width: 800px) {
  .rq-question-card {
    grid-template-columns: 1fr;
  }
  .rq-image-wrap { min-height: 240px; max-height: 45vh; }
  .rq-image-wrap img { max-height: 45vh; }
  .rq-question-body { padding: 14px; }
  .rq-wrong-item {
    grid-template-columns: 90px 1fr;
  }
  .rq-wrong-item img { width: 90px; height: 70px; }
}
