/* ── 퀘스트 창 · 졸업장 · 알림 (quest.html 과 3D 캠퍼스가 함께 써요) ──
   색: 마자 보라 + 투머스(툼) 골드 */
:root {
  --q-card: #141022; --q-line: rgba(255, 255, 255, 0.09);
  --q-purple: #8b5cf6; --q-purple-soft: #c4b5fd;
  --q-gold: #ffd978; --q-green: #34d399; --q-red: #f87171; --q-muted: #a09fb5;
}
.q-overlay { position: fixed; inset: 0; z-index: 90; background: rgba(4, 2, 9, 0.82); backdrop-filter: blur(6px); display: none; overflow-y: auto; -webkit-overflow-scrolling: touch;
  font-family: "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", system-ui, sans-serif; color: #f4f3fa; line-height: 1.7; }
.q-overlay.show { display: block; }
.q-sheet { position: relative; max-width: 720px; margin: 28px auto; background: #110d1f; border: 1px solid rgba(255, 217, 120, 0.25); border-radius: 22px; padding: 28px 26px 30px; text-align: left; }
.q-sheet * { box-sizing: border-box; }
.q-x { position: absolute; top: 14px; right: 14px; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--q-line); background: transparent; color: #fff; font-size: 18px; cursor: pointer; font-family: inherit; }
.q-sheet .q-lvno { font-size: 12.5px; font-weight: 800; letter-spacing: 0.2em; color: var(--q-gold); }
.q-sheet h2 { font-size: clamp(24px, 4vw, 32px); margin: 6px 0 4px; line-height: 1.3; padding-right: 40px; }
.q-sheet .q-tagline { color: var(--q-muted); font-size: 15px; margin: 0; }
.q-part { margin-top: 28px; }
.q-part > h4 { font-size: 13px; letter-spacing: 0.18em; color: var(--q-purple-soft); margin: 0 0 12px; }
.q-prog { float: right; letter-spacing: 0; color: var(--q-gold); font-weight: 800; }
.q-brief { display: grid; gap: 10px; }
.q-bcard { display: none; position: relative; background: var(--q-card); border: 1px solid var(--q-line); border-radius: 14px; padding: 14px 16px; }
.q-bcard.show { display: block; animation: q-in 0.35s ease; }
.q-bcard.current { border-color: rgba(255, 217, 120, 0.55); box-shadow: 0 0 0 4px rgba(255, 217, 120, 0.08); }
.q-bcard.read { opacity: 0.72; }
.q-bcard.read::after { content: "✓"; position: absolute; top: 12px; right: 14px; color: var(--q-green); font-weight: 900; }
.q-bno { font-size: 11px; letter-spacing: 0.16em; color: var(--q-muted); }
.q-bcard b { display: block; font-size: 15px; margin: 2px 0; color: #fff; }
.q-bcard p { font-size: 14.5px; color: #cfcde0; margin: 0; }
.q-read { display: none; margin-top: 12px; padding: 10px 18px; border-radius: 99px; border: none; cursor: pointer; font-family: inherit; font-weight: 800; font-size: 14px; color: #1a1100; background: linear-gradient(90deg, var(--q-gold), #ffb938); }
.q-bcard.current .q-read { display: inline-block; }
.q-read:disabled { opacity: 0.45; cursor: wait; }
@keyframes q-in { from { opacity: 0; transform: translateY(8px); } }
.q-gated:not(.open) { display: none; }
.q-toollink { display: none; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.q-toollink.open { display: flex; }
.q-toollink a { text-decoration: none; font-weight: 800; font-size: 14px; padding: 10px 16px; border-radius: 99px; background: rgba(139, 92, 246, 0.25); border: 1px solid rgba(196, 181, 253, 0.5); color: #fff; }
.q-toollink a:hover { background: rgba(139, 92, 246, 0.5); }
.q-mission { display: flex; gap: 12px; align-items: flex-start; background: var(--q-card); border: 1px solid var(--q-line); border-radius: 12px; padding: 12px 14px; margin-bottom: 8px; cursor: pointer; font-size: 14.5px; }
.q-mission input { width: 20px; height: 20px; margin: 3px 0 0; accent-color: var(--q-gold); flex-shrink: 0; }
.q-mission:has(input:checked) { border-color: rgba(52, 211, 153, 0.5); background: rgba(52, 211, 153, 0.07); }
.q-q { background: var(--q-card); border: 1px solid var(--q-line); border-radius: 14px; padding: 14px 16px; margin-bottom: 10px; }
.q-q.bad { border-color: rgba(248, 113, 113, 0.7); }
.q-q.good { border-color: rgba(52, 211, 153, 0.6); }
.q-q .q-qt { font-weight: 700; font-size: 15px; margin-bottom: 8px; }
.q-q label { display: flex; gap: 10px; padding: 7px 4px; font-size: 14.5px; cursor: pointer; border-radius: 8px; }
.q-q label:hover { background: rgba(255, 255, 255, 0.04); }
.q-q input { accent-color: var(--q-purple); margin: 5px 0 0; }
.q-q .q-why { display: none; margin-top: 8px; font-size: 13.5px; color: var(--q-muted); }
.q-q.bad .q-why, .q-q.good .q-why { display: block; }
.q-q.bad .q-why::before { content: "다시 생각해 봐요 · "; color: var(--q-red); font-weight: 700; }
.q-q.good .q-why::before { content: "정답 · "; color: var(--q-green); font-weight: 700; }
.q-clear-row { margin-top: 26px; text-align: center; }
.q-clear-btn { padding: 15px 36px; border-radius: 99px; border: none; font-weight: 900; font-size: 17px; cursor: pointer; color: #1a1100; background: linear-gradient(90deg, var(--q-gold), #ffb938); font-family: inherit; }
.q-clear-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.q-clear-hint { font-size: 13px; color: var(--q-muted); margin-top: 8px; min-height: 20px; }
.q-cleared-note { text-align: center; color: var(--q-green); font-weight: 800; margin-top: 24px; }
.q-lock-note { text-align: center; color: var(--q-muted); margin-top: 24px; font-size: 14px; }
.q-ghost { padding: 12px 24px; border-radius: 99px; border: 1.5px solid var(--q-purple); background: transparent; color: var(--q-purple-soft); font-weight: 800; cursor: pointer; margin: 6px; text-decoration: none; display: inline-block; font-size: 14.5px; font-family: inherit; }
.q-ghost:hover { background: rgba(139, 92, 246, 0.2); }

/* 알림(토스트) */
.q-toast { position: fixed; left: 50%; bottom: 36px; transform: translate(-50%, 30px); opacity: 0; z-index: 95; pointer-events: none;
  background: linear-gradient(90deg, var(--q-purple), #b78bff); color: #fff; font-weight: 900; padding: 14px 26px; border-radius: 99px; box-shadow: 0 12px 40px rgba(139, 92, 246, 0.6); transition: all 0.4s; text-align: center;
  font-family: "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif; max-width: calc(100vw - 32px); }
.q-toast.show { opacity: 1; transform: translate(-50%, 0); }
.q-toast small { display: block; font-weight: 600; opacity: 0.9; }

/* 졸업장 */
.q-cert { border: 3px double var(--q-gold); border-radius: 18px; padding: 34px 22px; text-align: center; background: radial-gradient(circle at 50% 0, rgba(255, 217, 120, 0.14), transparent 60%), #120d22; margin-top: 22px; }
.q-cert img { width: 70px; border-radius: 16px; }
.q-cert .q-ct { font-size: 12px; letter-spacing: 0.3em; color: var(--q-gold); margin-top: 12px; }
.q-cert h3 { font-size: clamp(26px, 5vw, 38px); margin: 8px 0 18px; }
.q-cert .q-nm { font-size: clamp(26px, 6vw, 42px); font-weight: 900; color: var(--q-gold); border-bottom: 1px solid rgba(255, 217, 120, 0.5); display: inline-block; min-width: 200px; padding: 0 12px 4px; margin-bottom: 18px; }
.q-cert p { color: #d8d5ea; font-size: 15px; max-width: 480px; margin: 0 auto 8px; }
.q-cert .q-sign { margin-top: 20px; font-size: 13px; color: var(--q-muted); }
.q-name-in { width: 100%; max-width: 320px; padding: 12px 16px; border-radius: 12px; border: 1px solid rgba(255, 217, 120, 0.5); background: #0b0814; color: #fff; font-size: 16px; text-align: center; font-family: inherit; }

@media print {
  body > *:not(#qGradOverlay) { display: none !important; }
  #qGradOverlay { position: static !important; background: #fff !important; display: block !important; }
  #qGradOverlay .q-sheet { border: none; background: #fff; margin: 0; padding: 0; max-width: none; }
  .q-no-print { display: none !important; }
  .q-cert { background: #fff !important; color: #111; border-color: #b8860b; }
  .q-cert .q-nm, .q-cert .q-ct { color: #8a6400; }
  .q-cert h3, .q-cert p, .q-cert .q-sign { color: #111; }
}
@media (max-width: 720px) {
  .q-sheet { margin: 0; border-radius: 0; min-height: 100vh; padding: 56px 18px 36px; border-left: none; border-right: none; }
  .q-x { top: 10px; right: 10px; }
}
