#cq-root .cq-bot { position: relative; }
#cq-root .cq-bot::before { content: ''; position:absolute; left: -10px; top: 10px; width: 0; height: 0; border-top: 8px solid transparent; border-bottom: 8px solid transparent; border-right: 10px solid rgba(0,0,0,0.06); }
#cq-root .cq-bot { background:#f8fafc; border:1px solid rgba(0,0,0,0.06); border-radius:10px; padding:10px 12px; display:inline-block; }

@keyframes cqPulse { 0%{opacity:.5} 50%{opacity:1} 100%{opacity:.5} }
#cq-root .cq-dualbar { position:relative; display:grid; grid-template-columns: 1fr 40px 1fr; align-items:center; gap:8px; margin:6px 0 2px; }
#cq-root .cq-dualbar .center { width:40px; height:18px; border-radius:999px; background:linear-gradient(135deg, #7c4dff, #00d1ff); box-shadow:0 2px 10px rgba(0,0,0,0.08); }
#cq-root .cq-dualbar span.left, #cq-root .cq-dualbar span.right { display:block; height:10px; background:rgba(0,0,0,0.08); border-radius:999px; overflow:hidden; }
#cq-root .cq-dualbar span.left > i { display:block; height:100%; width:0%; background:linear-gradient(90deg, #10b981, #34d399); transition:width .25s ease; }
#cq-root .cq-dualbar span.right > i { display:block; height:100%; width:0%; background:linear-gradient(90deg, #ef4444, #f97316); transform-origin:right; transition:width .25s ease; float:right; }

#cq-root .cq-pop { position:absolute; margin-left:6px; font-size:12px; font-weight:800; opacity:0; transform:translateY(4px); transition:opacity .2s ease, transform .2s ease; }
#cq-root .cq-pop.show { opacity:1; transform:translateY(-8px); }
#cq-root .cq-score { position:relative; }
#cq-root .cq-score .me + .cq-pop { color:#059669; }
#cq-root .cq-score .bot + .cq-pop { color:#ef4444; }

#cq-root .cq-answer { will-change: transform, background, border-color; }
#cq-root .cq-answer:active { transform: scale(0.99); }
#cq-root .cq-answer:hover { filter: saturate(1.05); }

#cq-root .cq-card { background: radial-gradient(800px 380px at 100% -10%, rgba(124,77,255,0.10), transparent 60%), radial-gradient(800px 380px at -10% 110%, rgba(0,209,255,0.10), transparent 60%), #ffffff; }
/* Creative Quizzes Frontend Styles */
:root {
  --bg: #0f1226;
  --bg-soft: #171a36;
  --card: #1d2147;
  --text: #e7e9ff;
  --muted: #a6abff;
  --accent: #7c4dff;
  --accent-2: #00d1ff;
  --good: #27c93f;
  --bad: #ff5555;
}
#cq-root * { box-sizing: border-box; }

#cq-root .cq-app {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
}

#cq-root .cq-card {
  width: min(840px, 95vw);
  background: #ffffff;
  color: #111827;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.08);
  overflow: hidden;
}

#cq-root .cq-header {
  padding: 18px 22px;
  background: linear-gradient(90deg, rgba(124,77,255,0.08), rgba(0,209,255,0.06));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
#cq-root .cq-title { font-size: 20px; font-weight: 700; letter-spacing: 0.2px; }
#cq-root .cq-sub { font-size: 13px; opacity: 0.85; }

/* Versus header strip */
#cq-root .cq-versus { display:flex; align-items:center; gap:10px; }
#cq-root .cq-avatar { width:56px; height:56px; border-radius:50%; overflow:hidden; display:inline-flex; align-items:center; justify-content:center; background:#eef2ff; border:1px solid rgba(0,0,0,0.05); position:relative; }
#cq-root .cq-avatar.me { background:#e3f6ff; }
#cq-root .cq-avatar.bot.thinking::after { content:''; position:absolute; inset:-3px; border-radius:inherit; box-shadow:0 0 0 3px rgba(124,77,255,0.25), 0 0 18px rgba(124,77,255,0.35); animation:cqPulse 1.2s ease-in-out infinite; }
#cq-root .cq-avatar img { width:100%; height:100%; object-fit:cover; display:block; }
#cq-root .cq-vs { width:28px; height:28px; opacity:0.85; }
#cq-root .cq-name { font-size:13px; color:#4b5563; }

#cq-root .cq-body { padding: 22px; display: grid; gap: 18px; }

#cq-root .cq-rows { display: grid; gap: 14px; }

#cq-root .cq-hero {
  text-align: center;
  padding: 24px 10px 6px;
}
#cq-root .cq-hero { background:
  radial-gradient(700px 300px at 10% -10%, rgba(124,77,255,0.08), transparent 60%),
  radial-gradient(700px 300px at 110% 110%, rgba(0,209,255,0.08), transparent 60%);
  border-radius: 12px; }
#cq-root .cq-hero-title { font-size: 30px; margin: 12px 0 6px; font-weight: 900; letter-spacing: .2px; }
#cq-root .cq-hero-sub { color: #6b7280; margin: 0 auto; max-width: 60ch; font-size: 15px; }
#cq-root .cq-hero-vs { display:flex; align-items:center; justify-content:center; gap:18px; margin-bottom: 6px; }
#cq-root .cq-hero-vs .cq-res-avatar { width: 120px; height: 120px; }
#cq-root .cq-btn.cq-btn-start {
  /* Bigger, bolder start button while keeping gradient colors from .cq-btn */
  padding: 16px 44px 16px 48px; /* extra left space for icon */
  font-size: 1.3rem; /* ~21px */
  border-radius: 12px;
  margin: 20px 0; /* space above & below */
  display: inline-block;
  position: relative;
  overflow: hidden;
  box-shadow: 0 6px 12px rgba(0,0,0,0.15);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter .12s ease;
}

#cq-root .cq-btn.cq-btn-start::before {
  content: "🔥";
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.2rem;
}

#cq-root .cq-btn.cq-btn-start:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

#cq-root .cq-btn.cq-btn-start:active {
  transform: translateY(0);
  box-shadow: 0 3px 6px rgba(0,0,0,0.10);
}

#cq-root .cq-start {
  display: flex; gap: 12px; justify-content: center; align-items: center; flex-wrap: wrap; margin-top: 14px;
}

#cq-root .cq-btn {
  --btn-bg: var(--accent);
  --btn-bg2: var(--accent-2);
  background: linear-gradient(135deg, var(--btn-bg), var(--btn-bg2));
  color: #fff; border: 0; padding: 12px 18px; border-radius: 10px; cursor: pointer;
  font-weight: 700; letter-spacing: 0.3px; box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  transition: transform .12s ease, filter .12s ease;
}
#cq-root .cq-btn:hover { transform: translateY(-1px); filter: brightness(1.05); }
#cq-root .cq-btn:active { transform: translateY(1px) scale(0.99); }
#cq-root .cq-btn.secondary { --btn-bg: #3b3f71; --btn-bg2: #2a2e5a; }

#cq-root .cq-switch { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #6b7280; }

#cq-root .cq-bar {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center;
}
#cq-root .cq-score {
  display: flex; gap: 8px; align-items: center; font-weight: 700;
}
#cq-root .cq-score .me { color: #059669; }
#cq-root .cq-score .bot { color: #ef4444; }
#cq-root .cq-rounds { font-size: 12px; color: #6b7280; }

#cq-root .cq-timer {
  height: 10px; border-radius: 999px; background: rgba(0,0,0,0.08); overflow: hidden; position: relative;
}
#cq-root .cq-timer > i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transform-origin: left; transform: scaleX(1); transition: transform .2s linear; }

#cq-root .cq-question {
  background: #f8fafc; border: 1px solid rgba(0,0,0,0.06); border-radius: 12px; padding: 16px; font-size: 18px;
}

#cq-root .cq-answers { display: grid; gap: 12px; }
#cq-root .cq-answer {
  background: #ffffff; border: 1px solid rgba(0,0,0,0.08); border-radius: 12px; padding: 12px 14px; cursor: pointer; display: flex; gap: 12px; align-items: center;
  transition: transform .08s ease, background .15s ease, border-color .15s ease;
}
#cq-root .cq-answer:hover { transform: translateY(-1px); }
#cq-root .cq-answer.correct { background: rgba(39,201,63,0.15); border-color: rgba(39,201,63,0.4); }
#cq-root .cq-answer.wrong { background: rgba(255,85,85,0.15); border-color: rgba(255,85,85,0.4); }

#cq-root .cq-bot { font-size: 13px; color: #6b7280; min-height: 18px; }

#cq-root .cq-result {
  text-align: center; padding: 20px 10px; display: grid; gap: 12px;
}
#cq-root .cq-result .big { font-size: 28px; font-weight: 800; }
#cq-root .cq-confetti { pointer-events: none; position: absolute; inset: 0; }

/* Result screen modern styling */
#cq-root .cq-res-card { 
  width:min(860px, 96%);
  margin: 2px auto 4px;
  background: radial-gradient(1000px 600px at 10% -20%, rgba(124,77,255,0.08), transparent 60%), radial-gradient(900px 540px at 110% 120%, rgba(0,209,255,0.08), transparent 60%), #ffffff;
  border:1px solid rgba(0,0,0,0.08);
  border-radius:16px;
  box-shadow: 0 18px 50px rgba(0,0,0,0.10);
  padding:10px 16px;
  display:grid; gap:14px; justify-items:center;
}
#cq-root .cq-res-card.enter { animation: cqEnter .55s ease both; }
@keyframes cqEnter { from { opacity:0; transform: translateY(12px) scale(0.98);} to { opacity:1; transform: translateY(0) scale(1);} }
@keyframes cqShake { 10%, 90% { transform: translateX(-1px);} 20%, 80% { transform: translateX(2px);} 30%, 50%, 70% { transform: translateX(-4px);} 40%, 60% { transform: translateX(4px);} }

#cq-root .cq-res-title { font-size: 28px; font-weight: 900; letter-spacing: 0.2px; }
#cq-root .cq-res-card.win .cq-res-title { color:#059669; }
#cq-root .cq-res-card.lose .cq-res-title { color:#ef4444; }

#cq-root .cq-res-versus { display:flex; align-items:center; gap:18px; }
#cq-root .cq-res-avatar { width:110px; height:110px; border-radius:50%; overflow:hidden; display:inline-flex; align-items:center; justify-content:center; background:#f3f4f6; border:2px solid rgba(0,0,0,0.06); position:relative; }
#cq-root .cq-res-avatar img { width:100%; height:100%; object-fit:cover; display:block; }
#cq-root .cq-res-avatar.winner::after { content:''; position:absolute; inset:-4px; border-radius:inherit; box-shadow:0 0 0 4px rgba(16,185,129,0.35), 0 0 22px rgba(16,185,129,0.45); }
#cq-root .cq-res-card.lose .cq-res-avatar.winner::after { box-shadow:0 0 0 4px rgba(239,68,68,0.35), 0 0 22px rgba(239,68,68,0.45); }
#cq-root .cq-res-vs { width:48px; height:48px; display:inline-grid; place-items:center; border-radius:50%; background:linear-gradient(135deg,#7c4dff,#00d1ff); color:#fff; font-weight:900; letter-spacing:0.5px; box-shadow:0 8px 24px rgba(124,77,255,0.25); }

#cq-root .cq-res-score { font-size:18px; font-weight:800; }
#cq-root .cq-res-score.good { color:#059669; }
#cq-root .cq-res-score.bad { color:#ef4444; }
#cq-root .cq-res-card.lose .cq-res-score { animation: cqShake .45s ease; }

#cq-root .cq-res-stats { display:grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap:10px; width:min(620px, 92%); margin-top:4px; }
#cq-root .cq-res-stats > div { background:#f8fafc; border:1px solid rgba(0,0,0,0.06); border-radius:12px; padding:10px 12px; display:grid; gap:2px; }
#cq-root .cq-res-stats b { font-size:12px; color:#6b7280; font-weight:800; text-transform: uppercase; letter-spacing: .3px; }
#cq-root .cq-res-stats span { font-size:18px; font-weight:900; color:#111827; }

#cq-root .cq-res-actions { display:flex; gap:10px; justify-content:center; margin-top:6px; flex-wrap:wrap; }

/* Page switch animations */
#cq-root .cq-view { opacity: 0; transform: translateY(8px); transition: opacity .2s ease, transform .2s ease; display: none; }
#cq-root .cq-view.active { display: block; opacity: 1; transform: translateY(0); }
/* No global light/dark body overrides to respect theme */
