:root{
  --bg: #f0f4f8;
  --card: #ffffff;
  --muted: #6b7280;
  --accent: #7c3aed;
  --accent2: #06b6d4;
  --success: #10b981;
  --danger: #ef4444;
  --text: #111827;
  --option-bg: #f9fafb;
  --option-hover: #e5e7eb;
}

/* reset and base styles */
*{box-sizing:border-box;margin:0;padding:0}
html, body{height:100%;}
body{
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial;
  background: var(--bg);
  color: var(--text);
  padding: 20px;
}

/* cards */
.card{
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  background: var(--card);
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.08);
}

/* buttons */
.btn{
  display:inline-block;
  border:0;
  padding:10px 18px;
  border-radius:12px;
  font-weight:700;
  cursor:pointer;
  transition: all .2s ease;
}
.btn.ghost{
  background:transparent;
  border:1px solid rgba(0,0,0,0.1);
  color: var(--muted);
}
.btn.primary{
  background: linear-gradient(90deg,var(--accent),var(--accent2));
  color:white;
  box-shadow:0 5px 15px rgba(124,58,237,0.2);
}
.btn.success{
  background: var(--success);
  color: white;
}
.btn:hover{
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

/* --------------------------
   Welcome Page */
.page-welcome .welcome-wrap{
  display:grid;
  grid-template-columns:1fr 360px;
  gap:20px;
  align-items:start;
}
.brand{
  font-size:2.5rem;
  color: var(--accent);
  margin-bottom:10px;
}
.subtitle{
  color: var(--muted);
  margin-bottom:20px;
  font-size:1.1rem;
}
.field{
  margin:14px 0;
}
.field span{
  display:block;
  color: var(--muted);
  margin-bottom:6px;
  font-weight:600;
}
.field input{
  width:100%;
  padding:14px;
  border-radius:12px;
  border:1px solid #d1d5db;
  font-size:16px;
}
.actions{margin-top:14px;}
.about{
  margin-top:20px;
  color: var(--muted);
  font-size:14px;
}

/* --------------------------
   Quiz Page */
.quiz-wrap{
  max-width:980px;
}
.quiz-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:12px;
}
.player{
  color: var(--muted);
  font-weight:600;
}
.progress-info{
  font-weight:700;
  color: var(--text);
}
.progress-track{
  height:10px;
  background: #e5e7eb;
  border-radius:999px;
  overflow:hidden;
  margin:12px 0;
}
.progress-fill{
  height:100%;
  width:0%;
  background: linear-gradient(90deg,var(--accent),var(--accent2));
  transition: width .25s ease;
}
.question-area{
  margin-top:12px;
}
.question-area h2{
  font-size:1.3rem;
  margin-bottom:14px;
}
.options-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
  gap:12px;
}
.option{
  background: var(--option-bg);
  padding:14px;
  border-radius:12px;
  border:1px solid rgba(0,0,0,0.08);
  cursor:pointer;
  box-shadow:0 5px 12px rgba(0,0,0,0.05);
  transition: all .2s ease;
}
.option:hover{
  background: var(--option-hover);
  transform: translateY(-2px);
}
.option.selected{
  border:2px solid var(--accent);
  background: linear-gradient(180deg,#fdf7ff,#fff);
}

/* quiz footer */
.quiz-footer{
  margin-top:14px;
}
.nav{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
}
.nav-right{
  display:flex;
  align-items:center;
  gap:12px;
}
.answered{
  color: var(--muted);
  font-weight:600;
}

/* --------------------------
   Results Page */
.results-wrap{
  text-align:center;
}
.score-block{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:8px;
  margin:14px 0;
}
.score-big{
  font-size:2.2rem;
  font-weight:900;
  color: var(--accent);
}
.score-pct{
  color: var(--muted);
  font-weight:700;
}
.results-actions{
  display:flex;
  justify-content:center;
  gap:12px;
  margin-bottom:18px;
}
.review-grid{
  display:grid;
  grid-template-columns:1fr;
  gap:12px;
  text-align:left;
  margin-top:12px;
}
.review-item{
  padding:12px;
  border-radius:10px;
  background: var(--card);
  border:1px solid rgba(0,0,0,0.08);
}
.review-item.correct{
  border-left:6px solid var(--success);
}
.review-item.incorrect{
  border-left:6px solid var(--danger);
}
.review-question{
  font-weight:700;
  margin-bottom:6px;
}
.review-options{
  display:flex;
  flex-direction:column;
  gap:6px;
}
.review-option{
  padding:8px;
  border-radius:8px;
  border:1px solid #e5e7eb;
}
.review-option.correct{
  background: rgba(16,185,129,0.1);
  border-color: rgba(16,185,129,0.2);
}
.review-option.selected{
  background: rgba(239,68,68,0.1);
  border-color: rgba(239,68,68,0.2);
}

/* --------------------------
   Responsive */
@media (max-width:1000px){
  .page-welcome .welcome-wrap{grid-template-columns:1fr;}
  .options-grid{grid-template-columns:1fr;}
}
