/* ══════════════════════════════════════════
   색상 변수 (보라/바이올렛 계열)
══════════════════════════════════════════ */
.qb-page,
.qb-stage {
  --qb-accent:     #7c3aed;
  --qb-accent-mid: #8b5cf6;
  --qb-light:      #f5f3ff;
  --qb-mid:        #ede9fe;
  --qb-border:     rgba(124, 58, 237, 0.22);
  --qb-shadow:     rgba(124, 58, 237, 0.14);
}

/* ══════════════════════════════════════════
   Layout
══════════════════════════════════════════ */
.qb-page {
  display: grid;
  gap: var(--space-4);
  max-width: 560px;
  margin: 0 auto;
}

.qb-stage { padding: var(--space-5); }
.qb-stage__content { margin-top: var(--space-4); }

/* 히어로 노트 */
.qb-hero-note {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  background: var(--qb-light) !important;
  color: var(--qb-accent) !important;
}

/* ══════════════════════════════════════════
   Intro
══════════════════════════════════════════ */
.qb-intro {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.qb-intro__head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  text-align: center;
}

.qb-emoji-idle {
  font-size: 4.5rem;
  line-height: 1;
  animation: qbIdle 2s ease-in-out infinite;
}
@keyframes qbIdle {
  0%, 100% { transform: rotate(-5deg) scale(1); }
  50%       { transform: rotate(5deg) scale(1.06); }
}

.qb-intro__title {
  margin: 0;
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 900;
  letter-spacing: -0.04em;
}
.qb-intro__desc {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* 섹션 */
.qb-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.qb-section__label {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: var(--text-secondary);
}
.qb-hint {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* 카테고리 칩 */
.qb-chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.qb-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 14px;
  height: 36px;
  border-radius: 999px;
  border: 1.5px solid rgba(23, 32, 51, 0.1);
  background: #fff;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  transition: background 140ms, border-color 140ms, color 140ms, transform 100ms;
}
.qb-chip:hover {
  border-color: rgba(124, 58, 237, 0.38);
  color: var(--qb-accent);
  transform: translateY(-1px);
}
.qb-chip.is-active {
  background: var(--qb-light);
  border-color: rgba(124, 58, 237, 0.35);
  color: var(--qb-accent);
}

/* 속도 칩 */
.qb-speed-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.qb-speed-chip {
  flex: 1;
  min-width: 90px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  height: 44px;
  border-radius: 14px;
  border: 1.5px solid rgba(23, 32, 51, 0.1);
  background: #fff;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 140ms, border-color 140ms, color 140ms;
}
.qb-speed-chip:hover {
  border-color: rgba(124, 58, 237, 0.38);
  color: var(--qb-accent);
}
.qb-speed-chip.is-active {
  background: var(--qb-light);
  border-color: rgba(124, 58, 237, 0.4);
  color: var(--qb-accent);
}

/* 시작 버튼 */
.qb-start-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 58px;
  border-radius: 16px;
  border: none;
  background: linear-gradient(135deg, #a78bfa, #7c3aed);
  color: #fff;
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  cursor: pointer;
  box-shadow: 0 12px 32px rgba(124, 58, 237, 0.32);
  transition: transform 150ms, box-shadow 150ms;
  margin-top: var(--space-2);
}
.qb-start-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 40px rgba(124, 58, 237, 0.42);
}
.qb-start-btn:active { transform: scale(0.97); }

/* ══════════════════════════════════════════
   Playing
══════════════════════════════════════════ */
.qb-playing {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-5);
  padding: var(--space-3) 0;
}

/* 폭탄 영역 */
.qb-bomb-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
}

.qb-bomb-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.qb-emoji-live {
  font-size: 6.5rem;
  line-height: 1;
  filter: drop-shadow(0 8px 22px rgba(0,0,0,0.12));
  animation: qbBreath 2.2s ease-in-out infinite;
}
@keyframes qbBreath {
  0%, 100% { transform: scale(1) rotate(-1deg); }
  50%       { transform: scale(1.05) rotate(1deg); }
}

.qb-sparks {
  position: absolute;
  top: -12px;
  right: 2px;
  font-size: 1.8rem;
  animation: qbSparksWiggle 0.7s ease-in-out infinite alternate;
}
@keyframes qbSparksWiggle {
  from { transform: translateY(0) rotate(-10deg) scale(1); }
  to   { transform: translateY(-6px) rotate(12deg) scale(1.15); }
}

/* 긴박도별 흔들림 */
.qb-bomb-body.is-mild { animation: qbShakeMild 0.22s ease-in-out infinite; }
.qb-bomb-body.is-hard { animation: qbShakeHard 0.12s ease-in-out infinite; }
@keyframes qbShakeMild {
  0%, 100% { transform: translateX(0) rotate(0deg); }
  30%      { transform: translateX(-4px) rotate(-1.5deg); }
  70%      { transform: translateX(4px) rotate(1.5deg); }
}
@keyframes qbShakeHard {
  0%, 100% { transform: translateX(0) rotate(0deg); }
  20%      { transform: translateX(-6px) rotate(-2.5deg); }
  50%      { transform: translateX(6px) rotate(2.5deg); }
  80%      { transform: translateX(-5px) rotate(-1.5deg); }
}
.qb-bomb-body.is-shocked {
  animation: qbShocked 0.35s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}
@keyframes qbShocked {
  0%   { transform: scale(1); }
  15%  { transform: scale(1.18) rotate(-4deg); }
  30%  { transform: scale(0.92) rotate(3deg); }
  50%  { transform: scale(1.12) rotate(-2deg); }
  70%  { transform: scale(0.96) rotate(2deg); }
  100% { transform: scale(1) rotate(0deg); }
}

/* 정답 카운터 */
.qb-correct-counter {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--qb-accent);
  background: var(--qb-light);
  border: 1.5px solid var(--qb-border);
  padding: 4px 14px;
  border-radius: 999px;
}

/* 카오스 배지 */
.qb-chaos-badge {
  margin: -6px 0 0;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--qb-accent);
  letter-spacing: 0.02em;
  animation: qbHintPulse 1.4s ease-in-out infinite;
}

/* ── 문제 카드 ── */
.qb-card {
  width: 100%;
  border-radius: var(--radius-md);
  background: linear-gradient(160deg, #faf8ff, #f3efff);
  border: 2px solid var(--qb-border);
  box-shadow: 0 8px 24px var(--qb-shadow);
  overflow: hidden;
}

/* 문제 영역 */
.qb-answer-wrap {
  padding: var(--space-5) var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.qb-q-text {
  margin: 0;
  font-size: clamp(1rem, 3.5vw, 1.2rem);
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.55;
  letter-spacing: -0.02em;
  text-align: center;
}

/* 4지선다 보기 */
.qb-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.qb-option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1.5px solid rgba(23, 32, 51, 0.08);
  background: #fff;
  text-align: left;
  cursor: pointer;
  transition: background 120ms, border-color 120ms, transform 100ms;
}
.qb-option:hover {
  background: var(--qb-light);
  border-color: rgba(124, 58, 237, 0.3);
  transform: translateX(2px);
}
.qb-option:active { transform: scale(0.98); }

.qb-option__num {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--qb-mid);
  color: var(--qb-accent);
  font-size: 0.8rem;
  font-weight: 800;
}
.qb-option__text {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
}

/* ── 피드백 (정답/오답) ── */
.qb-feedback {
  align-items: center;
  text-align: center;
  animation: qbFeedbackIn 280ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes qbFeedbackIn {
  from { opacity: 0; transform: scale(0.88); }
  to   { opacity: 1; transform: scale(1); }
}

.qb-feedback__icon {
  font-size: 3.5rem;
  line-height: 1;
}
.qb-feedback__msg {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 900;
  letter-spacing: -0.03em;
}
.qb-feedback__sub {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.qb-feedback--correct .qb-feedback__msg { color: #16a34a; }
.qb-feedback--wrong   .qb-feedback__msg { color: #dc2626; }

/* 넘기기 버튼 */
.qb-pass-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 28px;
  height: 48px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #a78bfa, #7c3aed);
  color: #fff;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(124, 58, 237, 0.34);
  transition: transform 140ms, box-shadow 140ms;
  animation: qbPassPulse 1.2s ease-in-out infinite;
}
.qb-pass-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(124, 58, 237, 0.45);
}
.qb-pass-btn:active { transform: scale(0.97); }
@keyframes qbPassPulse {
  0%, 100% { box-shadow: 0 6px 18px rgba(124, 58, 237, 0.34); }
  50%       { box-shadow: 0 6px 26px rgba(124, 58, 237, 0.56); }
}

/* 그만두기 버튼 */
.qb-quit-btn {
  display: inline-flex;
  align-items: center;
  padding: 0 20px;
  height: 40px;
  border-radius: 999px;
  border: 1.5px solid rgba(23, 32, 51, 0.12);
  background: transparent;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 140ms, color 140ms;
}
.qb-quit-btn:hover { background: rgba(0,0,0,0.04); color: var(--text-secondary); }

@keyframes qbHintPulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.45; }
}

/* ══════════════════════════════════════════
   Exploded
══════════════════════════════════════════ */
.qb-exploded {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-5) 0;
  animation: qbExplodeIn 500ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes qbExplodeIn {
  from { opacity: 0; transform: scale(0.6); }
  to   { opacity: 1; transform: scale(1); }
}

.qb-exploded__boom {
  font-size: 7rem;
  line-height: 1;
  animation: qbBoomShake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}
@keyframes qbBoomShake {
  10%, 90%       { transform: translate3d(-4px, 0, 0); }
  20%, 80%       { transform: translate3d(8px, 0, 0); }
  30%, 50%, 70%  { transform: translate3d(-12px, 0, 0); }
  40%, 60%       { transform: translate3d(12px, 0, 0); }
}

.qb-exploded__title {
  margin: 0;
  font-size: clamp(2rem, 8vw, 3.2rem);
  font-weight: 900;
  letter-spacing: 0.12em;
  background: linear-gradient(135deg, #a78bfa, #6d28d9);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.qb-exploded__sub {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.6;
}
.qb-exploded__info {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: 999px;
  background: var(--qb-light);
  border: 1.5px solid var(--qb-border);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--qb-accent);
}
.qb-exploded__actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  width: 100%;
  margin-top: var(--space-2);
}
.qb-restart-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 54px;
  border-radius: 14px;
  border: none;
  background: linear-gradient(135deg, #a78bfa, #7c3aed);
  color: #fff;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.30);
  transition: transform 150ms;
}
.qb-restart-btn:hover { transform: translateY(-2px); }
.qb-change-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 48px;
  border-radius: 14px;
  border: 1.5px solid rgba(23, 32, 51, 0.12);
  background: transparent;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 140ms;
}
.qb-change-btn:hover { background: rgba(0,0,0,0.04); }
