/* ============================================================
   QUIZ-SPIEL 🎮  (quiz-game.css)
   ============================================================ */
#qgOverlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(15,10,40,.85);
  display: flex; align-items: center; justify-content: center;
  padding: 12px;
  backdrop-filter: blur(6px);
  animation: qgFadeIn .25s ease;
}
@keyframes qgFadeIn { from{opacity:0} to{opacity:1} }

/* ── SELECTION BOX ── */
.qg-select-box {
  position: relative;
  background: #fff; border-radius: 24px;
  padding: 32px 28px 24px;
  max-width: 420px; width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  text-align: center;
  animation: qgSlideUp .3s ease;
}
@keyframes qgSlideUp { from{transform:translateY(30px);opacity:0} to{transform:translateY(0);opacity:1} }
.qg-close-btn {
  position: absolute; top: 14px; right: 16px;
  background: #f1f5f9; border: none; border-radius: 50%;
  width: 32px; height: 32px; font-size: 15px; cursor: pointer; color: #64748b;
}
.qg-logo { font-size: 3rem; margin-bottom: 4px; }
.qg-select-title { font-size: 1.6rem; font-weight: 900; color: #1e1b4b; margin: 0 0 4px; }
.qg-select-sub { color: #64748b; font-size: .88rem; margin-bottom: 20px; }
.qg-subj-row { display: flex; gap: 12px; justify-content: center; margin-bottom: 18px; }
.qg-subj-btn {
  flex: 1; padding: 12px 0; border-radius: 14px; border: 2.5px solid #e2e8f0;
  font-size: 1rem; font-weight: 800; cursor: pointer; background: #f8fafc;
  color: #475569; transition: all .18s; font-family: inherit;
}
.qg-subj-btn.active, .qg-subj-btn:hover {
  border-color: #7C3AED; background: #7C3AED; color: #fff;
  transform: translateY(-2px); box-shadow: 0 4px 14px rgba(124,58,237,.3);
}
.qg-grade-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 20px;
}
.qg-grade-btn {
  padding: 9px 0; border-radius: 10px; border: 2px solid #e2e8f0;
  font-size: .88rem; font-weight: 700; cursor: pointer; background: #f8fafc;
  color: #475569; transition: all .18s; font-family: inherit;
}
.qg-grade-btn.active, .qg-grade-btn:hover {
  border-color: #7C3AED; background: #ede9fe; color: #5b21b6;
}
.qg-start-btn {
  width: 100%; padding: 14px; border-radius: 14px; border: none;
  background: linear-gradient(135deg,#7C3AED,#A855F7);
  color: #fff; font-size: 1.08rem; font-weight: 900; cursor: pointer;
  font-family: inherit; transition: all .18s; margin-bottom: 12px;
}
.qg-start-btn:hover:not(:disabled) {
  transform: translateY(-2px); box-shadow: 0 6px 20px rgba(124,58,237,.4);
}
.qg-start-btn:disabled { opacity: .4; cursor: not-allowed; }
.qg-rules { font-size: .75rem; color: #94a3b8; }

/* ── GAME BOX ── */
.qg-game-box {
  background: #fff; border-radius: 24px;
  padding: 0 0 24px;
  max-width: 520px; width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  overflow: hidden;
  animation: qgSlideUp .3s ease;
  max-height: 96vh; overflow-y: auto;
}
.qg-header {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 16px; background: linear-gradient(135deg,#7C3AED,#A855F7);
  color: #fff; position: sticky; top: 0; z-index: 2;
}
.qg-hdr-back {
  background: rgba(255,255,255,.2); border: none; border-radius: 50%;
  width: 30px; height: 30px; color: #fff; cursor: pointer; font-size: 15px; flex-shrink: 0;
}
.qg-hdr-subj { font-weight: 800; font-size: .92rem; flex: 1; }
.qg-hdr-right { display: flex; gap: 8px; align-items: center; font-size: .85rem; }
.qg-lives { letter-spacing: 2px; }
.qg-streak { background: rgba(255,255,255,.2); border-radius: 20px; padding: 2px 8px; }
.qg-score-disp { font-weight: 800; background: rgba(255,255,255,.2); border-radius: 20px; padding: 2px 8px; }
@keyframes qgBump { 0%{transform:scale(1)} 50%{transform:scale(1.3)} 100%{transform:scale(1)} }
.qg-score-bump { animation: qgBump .35s ease; }

/* ── TIMER ── */
.qg-timer-wrap {
  position: relative; width: 72px; height: 72px;
  margin: 18px auto 8px; flex-shrink: 0;
}
.qg-timer-svg { width: 72px; height: 72px; }
.qg-timer-text {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; font-weight: 900; color: #334155;
}
#qgTimerRing { transition: stroke-dashoffset .9s linear, stroke .3s; }

/* ── PROGRESS ── */
.qg-progress-wrap { padding: 0 20px 8px; }
.qg-q-counter { text-align: center; font-size: .78rem; color: #94a3b8; font-weight: 700; margin-bottom: 6px; }
.qg-bar-bg { background: #f1f5f9; border-radius: 99px; height: 6px; }
.qg-bar-fill { background: linear-gradient(90deg,#7C3AED,#A855F7); height: 6px; border-radius: 99px; transition: width .4s ease; }

/* ── QUESTION ── */
.qg-question {
  margin: 14px 20px 16px;
  font-size: 1.05rem; font-weight: 700; color: #1e1b4b;
  line-height: 1.5; min-height: 52px; text-align: center;
}

/* ── OPTIONS ── */
.qg-options { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; padding: 0 20px; }
.qg-opt {
  padding: 13px 10px; border-radius: 12px; border: 2.5px solid #e2e8f0;
  background: #f8fafc; font-size: .88rem; font-weight: 700;
  cursor: pointer; transition: all .18s; font-family: inherit; color: #334155;
  text-align: left; line-height: 1.4;
}
.qg-opt:hover:not(:disabled) {
  border-color: #7C3AED; background: #ede9fe; color: #5b21b6; transform: translateY(-2px);
}
.qg-opt.qg-correct { border-color: #059669 !important; background: #d1fae5 !important; color: #065f46 !important; animation: qgCorrectPop .4s ease; }
.qg-opt.qg-wrong   { border-color: #DC2626 !important; background: #fee2e2 !important; color: #991b1b !important; animation: qgWrongShake .4s ease; }
.qg-opt.qg-opt-hidden { opacity: .2; pointer-events: none; }
.qg-opt:disabled { cursor: not-allowed; }
@keyframes qgCorrectPop { 0%{transform:scale(1)} 30%{transform:scale(1.06)} 100%{transform:scale(1)} }
@keyframes qgWrongShake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-6px)} 75%{transform:translateX(6px)} }

/* ── POWER-UPS ── */
.qg-powerups { display: flex; gap: 10px; padding: 10px 20px 0; justify-content: center; }
.qg-pu-btn {
  padding: 7px 16px; border-radius: 20px; border: 2px solid #7C3AED;
  background: #ede9fe; color: #5b21b6; font-size: .8rem; font-weight: 800;
  cursor: pointer; font-family: inherit; transition: all .18s;
}
.qg-pu-btn:hover:not(:disabled) { background: #7C3AED; color: #fff; }
.qg-pu-btn.qg-pu-used, .qg-pu-btn:disabled { opacity: .35; cursor: not-allowed; border-color: #cbd5e1; background: #f1f5f9; color: #94a3b8; }

/* ── HINT ── */
.qg-hint-wrap { margin: 10px 20px 0; padding: 8px 12px; background: #fffbeb; border-radius: 10px; border: 1.5px solid #fde68a; }
.qg-hint-text { font-size: .82rem; color: #92400e; font-weight: 600; }

/* ── FEEDBACK ── */
.qg-feedback { margin: 10px 20px 0; padding: 10px 14px; border-radius: 12px; font-size: .88rem; font-weight: 700; }
.qg-fb-ok  { background: #d1fae5; color: #065f46; border: 1.5px solid #6ee7b7; }
.qg-fb-err { background: #fee2e2; color: #991b1b; border: 1.5px solid #fca5a5; }

/* ── NEXT BUTTON ── */
.qg-next-btn {
  display: block; width: calc(100% - 40px); margin: 14px 20px 0;
  padding: 13px; border-radius: 14px; border: none;
  background: linear-gradient(135deg,#7C3AED,#A855F7);
  color: #fff; font-size: 1rem; font-weight: 800; cursor: pointer; font-family: inherit;
  transition: all .18s;
}
.qg-next-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(124,58,237,.35); }

/* ── RESULT BOX ── */
.qg-result-box {
  background: #fff; border-radius: 24px; padding: 32px 24px 28px;
  max-width: 420px; width: 100%; text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  animation: qgSlideUp .35s ease; position: relative;
}
.qg-result-emoji { font-size: 4rem; margin-bottom: 8px; }
.qg-result-title { font-size: 1.6rem; font-weight: 900; color: #1e1b4b; margin-bottom: 4px; }
.qg-result-score { font-size: 2rem; font-weight: 900; color: #7C3AED; margin: 10px 0 4px; }
.qg-result-sub { color: #64748b; font-size: .9rem; margin-bottom: 12px; }
.qg-new-record { background: linear-gradient(135deg,#FBBF24,#F59E0B); color: #fff; border-radius: 20px; padding: 5px 14px; font-weight: 800; font-size: .88rem; display: inline-block; margin-bottom: 10px; }
.qg-hs-info { color: #94a3b8; font-size: .82rem; margin-bottom: 10px; }
.qg-result-stats { display: flex; gap: 20px; justify-content: center; margin: 12px 0 16px; }
.qg-stat-item { text-align: center; }
.qg-stat-big { display: block; font-size: 1.6rem; font-weight: 900; color: #7C3AED; }
.qg-stat-lbl { font-size: .72rem; color: #94a3b8; font-weight: 700; }
.qg-result-btns { display: flex; flex-direction: column; gap: 8px; }
.qg-rbtn {
  width: 100%; padding: 12px; border-radius: 12px; border: 2px solid #e2e8f0;
  background: #f8fafc; font-size: .92rem; font-weight: 700; cursor: pointer;
  font-family: inherit; color: #475569; transition: all .18s;
}
.qg-rbtn:hover { border-color: #7C3AED; background: #ede9fe; color: #5b21b6; }
.qg-rbtn-primary { background: linear-gradient(135deg,#7C3AED,#A855F7) !important; color: #fff !important; border-color: transparent !important; }
.qg-rbtn-primary:hover { transform: translateY(-2px); box-shadow: 0 5px 16px rgba(124,58,237,.35); }

/* ── CONFETTI ── */
.qg-confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 10000; }
.qg-particle {
  position: absolute; top: -10px; width: 10px; height: 10px; border-radius: 2px;
  animation: qgFall linear both;
}
@keyframes qgFall { to { transform: translateY(110vh) rotate(720deg); opacity: 0; } }

/* ── HOME PAGE BANNER ── */
.qg-home-banner {
  margin: 0 0 28px;
  background: linear-gradient(135deg,#7C3AED,#A855F7,#EC4899);
  border-radius: 20px; padding: 22px 28px;
  display: flex; align-items: center; gap: 18px; cursor: pointer;
  transition: transform .18s, box-shadow .18s;
  box-shadow: 0 6px 24px rgba(124,58,237,.25);
  border: none; width: 100%; text-align: left; font-family: inherit;
}
.qg-home-banner:hover { transform: translateY(-3px); box-shadow: 0 10px 32px rgba(124,58,237,.35); }
.qg-home-banner-icon { font-size: 3rem; flex-shrink: 0; }
.qg-home-banner-text { flex: 1; }
.qg-home-banner-title { font-size: 1.3rem; font-weight: 900; color: #fff; margin-bottom: 4px; }
.qg-home-banner-sub { font-size: .85rem; color: rgba(255,255,255,.82); }
.qg-home-banner-arrow { font-size: 1.6rem; color: rgba(255,255,255,.7); flex-shrink: 0; }

@media (max-width: 480px) {
  .qg-options { grid-template-columns: 1fr; }
  .qg-game-box, .qg-select-box { border-radius: 16px; }
  .qg-home-banner { padding: 16px 18px; gap: 12px; }
  .qg-home-banner-icon { font-size: 2.2rem; }
}
