:root {
  --bg:        #1a1208;
  --bg2:       #221a0a;
  --card:      #2b1f0e;
  --card2:     #352512;
  --accent:    #c9a84c;
  --accent2:   #e8c96a;
  --accent3:   #2d6a4f;
  --gold:      #c9a84c;
  --danger:    #7c3a1e;
  --text:      #f0e6c8;
  --muted:     #a8906a;
  --border:    rgba(201,168,76,0.25);
  --glow:      rgba(201,168,76,0.3);
  --radius:    14px;
  --font-head: 'Cormorant Garamond', serif;
  --font-body: 'Lora', serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}

.particles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.particle {
  position: absolute;
  border-radius: 50%;
  animation: floatUp linear infinite;
  opacity: 0;
}
@keyframes floatUp {
  0%   { transform: translateY(0) scale(1); opacity: 0; }
  10%  { opacity: 0.6; }
  90%  { opacity: 0.3; }
  100% { transform: translateY(-110vh) scale(0.3); opacity: 0; }
}


.screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s ease;
  overflow-y: auto;
}
.screen.active {
  opacity: 1;
  pointer-events: all;
}


.start-card {
  background: linear-gradient(160deg, #2b1f0e, #1a1208);
  border: 1px solid rgba(201,168,76,0.35);
  border-radius: 24px;
  padding: 48px 40px;
  box-shadow:
    0 0 0 1px rgba(201,168,76,0.08),
    inset 0 1px 0 rgba(201,168,76,0.15),   /* top edge shine */
    0 32px 80px rgba(0,0,0,0.6);
}
@keyframes cardIn {
  from { transform: translateY(40px) scale(0.97); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

.logo-ring {
  width: 90px; height: 90px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 24px;
  box-shadow: 0 0 40px var(--glow);
  animation: pulseRing 3s ease-in-out infinite;
}
@keyframes pulseRing {
  0%,100% { box-shadow: 0 0 30px var(--glow); }
  50%      { box-shadow: 0 0 60px var(--glow), 0 0 100px rgba(124,58,237,0.2); }
}
.logo-icon { font-size: 2.4rem; }

.title {
  font-family: var(--font-head);
  font-size: 2.8rem;
  font-weight: 700;
  letter-spacing: 6px;               /* wide tracking = classic */
  text-transform: uppercase;
    display: block; 
  text-align: center;
  color: var(--accent2);
  text-shadow: 0 2px 20px rgba(201,168,76,0.3);
}
.title span { -webkit-text-fill-color: unset; }  

.subtitle {
  color: var(--muted);
  margin: 10px 0 28px;
  line-height: 1.6;
  font-size: 1rem;
  text-align: center;          /* ← ADD THIS */
  width: 100%;                 /* ← ADD THIS */
}

.stats-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
  margin-bottom: 32px;
  background: var(--bg2);
  border-radius: 14px;
  padding: 16px 24px;
  border: 1px solid var(--border);
}
.stat { text-align: center; }
.stat span { display: block; font-family: var(--font-head); font-size: 1.4rem; font-weight: 700; color: var(--accent2); }
.stat small { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.divider { width: 1px; height: 32px; background: var(--border); }


.btn-primary {
  display: flex;               /* ← CHANGE from inline-flex */
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;                 /* ← ADD THIS */
  padding: 16px 36px;          /* ← ADD THIS */
  cursor: pointer;             /* ← ADD THIS */
  background: linear-gradient(180deg, #e8c96a 0%, #c9a84c 60%, #a8862e 100%);
  color: #1a1208;
  font-family: var(--font-head);
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  border-radius: 50px;
  border: none;
  box-shadow: 0 4px 20px rgba(201,168,76,0.35), inset 0 1px 0 rgba(255,255,255,0.3);
  transition: transform 0.2s, box-shadow 0.2s;
}

#gameScreen {
  justify-content: flex-start;
  padding-top: 0;
  gap: 0;
}

.game-header {
  width: 100%;
  max-width: 680px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 12px;
}

.category-badge {
  background: rgba(124,58,237,0.2);
  border: 1px solid var(--border);
  color: var(--accent2);
  border-radius: 50px;
  padding: 6px 16px;
  font-size: 0.78rem;
  font-weight: 600;
  font-family: var(--font-head);
  text-transform: uppercase;
  letter-spacing: 1.5px;
}


.progress-ring-wrap {
  position: relative;
  width: 60px; height: 60px;
}
.progress-ring { transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: rgba(255,255,255,0.08); stroke-width: 4; }
.ring-fill {
  fill: none;
  stroke: var(--accent2);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 150.8;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s linear, stroke 0.3s;
}
.ring-fill.urgent { stroke: var(--danger); }
.timer-text {
  position: absolute;
  inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
}

.score-display {
  text-align: right;
}
.score-display small {
  display: block;
  font-size: 0.7rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.score-display span {
  font-family: var(--font-head);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent3);
}


.progress-bar-wrap {
  width: 100%;
  max-width: 680px;
  padding: 0 24px;
  position: relative;
}
.progress-bar {
  height: 4px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent3));
  width: 10%;
  transition: width 0.5s cubic-bezier(.4,0,.2,1);
  box-shadow: 0 0 12px var(--glow);
}
.q-counter {
  position: absolute;
  right: 24px;
  top: -18px;
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 500;
}


.question-area {
  width: 100%;
  max-width: 680px;
  padding: 20px 24px 8px;
}
.question-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
  min-height: 100px;
  display: flex;
  align-items: center;
  box-shadow: 0 4px 30px rgba(0,0,0,0.3);
  animation: qSlideIn 0.4s ease both;
}
@keyframes qSlideIn {
  from { transform: translateX(30px); opacity: 0; }
  to   { transform: none; opacity: 1; }
}
.question-text {
  font-family: var(--font-head);
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.55;
  color: #fff;
}


.options-grid {
  width: 100%;
  max-width: 680px;
  padding: 8px 24px 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.option-btn {
  background: var(--card2);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
  animation: optIn 0.4s ease both;
  position: relative;
  overflow: hidden;
}
.option-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 60%, rgba(124,58,237,0.08));
  opacity: 0;
  transition: opacity 0.2s;
}
.option-btn:hover:not(:disabled)::before { opacity: 1; }
.option-btn:hover:not(:disabled) {
  border-color: var(--accent2);
  transform: translateY(-2px);
  background: rgba(124,58,237,0.12);
}
@keyframes optIn {
  from { transform: translateY(16px); opacity: 0; }
  to   { transform: none; opacity: 1; }
}
.option-btn:nth-child(1) { animation-delay: 0.05s; }
.option-btn:nth-child(2) { animation-delay: 0.10s; }
.option-btn:nth-child(3) { animation-delay: 0.15s; }
.option-btn:nth-child(4) { animation-delay: 0.20s; }

.option-letter {
  width: 28px; height: 28px;
  background: rgba(255,255,255,0.06);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--accent2);
  flex-shrink: 0;
  transition: background 0.2s;
}

.option-btn.correct {
  background: rgba(6,214,160,0.15) !important;
  border-color: var(--accent3) !important;
  color: var(--accent3) !important;
}
.option-btn.correct .option-letter {
  background: var(--accent3);
  color: #000;
}
.option-btn.wrong {
  background: rgba(239,68,68,0.12) !important;
  border-color: var(--danger) !important;
  color: var(--danger) !important;
}
.option-btn.wrong .option-letter {
  background: var(--danger);
  color: #fff;
}
.option-btn:disabled { cursor: default; }


.streak-bar {
  width: 100%;
  max-width: 680px;
  padding: 0 24px;
  min-height: 28px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--gold);
  font-weight: 600;
  font-family: var(--font-head);
}


.result-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 44px 36px 36px;
  max-width: 440px;
  width: 100%;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 80px rgba(124,58,237,0.15), 0 24px 64px rgba(0,0,0,0.5);
  animation: cardIn 0.7s cubic-bezier(.22,1,.36,1) both;
}
.result-card::before {
  content: '';
  position: absolute;
  top: -100px; left: 50%;
  transform: translateX(-50%);
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(124,58,237,0.2), transparent 70%);
  pointer-events: none;
}

.trophy-wrap {
  position: relative;
  width: 100px; height: 100px;
  margin: 0 auto 20px;
}
.trophy-glow {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle, var(--gold), transparent 70%);
  opacity: 0.5;
  animation: trophyGlow 2s ease-in-out infinite;
}
@keyframes trophyGlow {
  0%,100% { transform: scale(1); opacity: 0.4; }
  50%      { transform: scale(1.3); opacity: 0.8; }
}
.trophy-icon {
  position: relative;
  font-size: 4rem;
  animation: trophyBounce 0.8s cubic-bezier(.22,1,.36,1) 0.3s both;
}
@keyframes trophyBounce {
  from { transform: scale(0) rotate(-15deg); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

.result-title {
  font-family: var(--font-head);
  font-size: 2rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 20px;
  animation: fadeUp 0.5s ease 0.4s both;
}

.result-score-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
  animation: fadeUp 0.5s ease 0.5s both;
}
.result-score-circle {
  width: 100px; height: 100px;
  border-radius: 50%;
  border: 4px solid var(--accent2);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  box-shadow: 0 0 30px var(--glow);
  background: var(--card2);
}
.result-score-num {
  font-family: var(--font-head);
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--accent2);
}
.result-score-circle small {
  font-size: 0.75rem;
  color: var(--muted);
}

.result-msg {
  color: var(--muted);
  margin-bottom: 24px;
  font-size: 0.95rem;
  animation: fadeUp 0.5s ease 0.6s both;
}

.result-stats {
  display: flex;
  gap: 8px;
  margin-bottom: 28px;
  animation: fadeUp 0.5s ease 0.65s both;
}
.rs {
  flex: 1;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 8px;
  text-align: center;
}
.rs span {
  display: block;
  font-family: var(--font-head);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent2);
}
.rs small {
  font-size: 0.65rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.result-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: fadeUp 0.5s ease 0.75s both;
}
@keyframes fadeUp {
  from { transform: translateY(16px); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

/* ── CONFETTI ── */
.confetti-area {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.confetti-piece {
  position: absolute;
  width: 10px; height: 10px;
  border-radius: 2px;
  animation: confettiFall linear both;
}
@keyframes confettiFall {
  0%   { transform: translateY(-20px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(500px) rotate(720deg); opacity: 0; }
}


#reviewScreen {
  justify-content: flex-start;
  padding-top: 20px;
  overflow-y: auto;
}
.review-header {
  width: 100%;
  max-width: 680px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  padding: 0 4px;
}
.review-header h2 {
  font-family: var(--font-head);
  font-size: 1.3rem;
  font-weight: 700;
}
.back-btn {
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 16px;
  color: var(--accent2);
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s;
}
.back-btn:hover { background: rgba(124,58,237,0.15); }

.review-list {
  width: 100%;
  max-width: 680px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-bottom: 40px;
}
.review-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px;
  animation: fadeUp 0.4s ease both;
}
.review-item.was-correct { border-color: rgba(6,214,160,0.35); }
.review-item.was-wrong   { border-color: rgba(239,68,68,0.3); }
.review-qnum {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 6px;
}
.logo-icon {
  width: 60px;
  height: 60px;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.5));
}

.review-q {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.95rem;
  color: #fff;
  margin-bottom: 10px;
}
.review-answers { display: flex; gap: 10px; flex-wrap: wrap; }
.review-tag {
  padding: 5px 14px;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 500;
}
.review-tag.correct-ans {
  background: rgba(6,214,160,0.15);
  border: 1px solid var(--accent3);
  color: var(--accent3);
}
.review-tag.your-wrong {
  background: rgba(239,68,68,0.12);
  border: 1px solid var(--danger);
  color: var(--danger);
}

/* ── FEEDBACK FLASH ── */
.feedback-flash {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.5);
  font-size: 3.5rem;
  opacity: 0;
  pointer-events: none;
  z-index: 999;
  transition: none;
}
.feedback-flash.show {
  animation: flashPop 0.6s cubic-bezier(.22,1,.36,1) both;
}
@keyframes flashPop {
  0%   { transform: translate(-50%,-50%) scale(0.5); opacity: 0; }
  40%  { transform: translate(-50%,-50%) scale(1.3); opacity: 1; }
  100% { transform: translate(-50%,-50%) scale(1); opacity: 0; }
}


.score-pop {
  position: fixed;
  top: 40%;
  right: 30px;
  font-family: var(--font-head);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--accent3);
  pointer-events: none;
  animation: scorePop 0.8s ease both;
  z-index: 999;
}
@keyframes scorePop {
  0%   { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(-60px); opacity: 0; }
}

@media (max-width: 520px) {
  .options-grid { grid-template-columns: 1fr; }
  .start-card, .result-card { padding: 32px 24px; }
  .question-text { font-size: 1rem; }
  .title { font-size: 2rem; }
  .result-stats { flex-wrap: wrap; }
  .rs { min-width: calc(50% - 4px); }
}
