:root{
  --bg-1: #667eea;
  --bg-2: #764ba2;
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 25%, #f093fb 50%, #4facfe 75%, #00f2fe 100%);
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
  color:#fff;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  min-height:100vh;
  padding-bottom:40px;
}
@keyframes gradientShift{
  0%{background-position:0% 50%}
  50%{background-position:100% 50%}
  100%{background-position:0% 50%}
}
.wrap{
  max-width:1200px;
  margin:40px auto;
  padding:24px;
}
.site-header{text-align:center;margin-bottom:30px}
.site-header h1{
  margin:0 0 8px 0;
  font-size:2.2rem;
  letter-spacing:-0.02em;
  background:linear-gradient(135deg,#ffffff,#e0e7ff);
  -webkit-background-clip:text;
  -webkit-text-fill-color:transparent;
  background-clip:text;
  font-weight:800;
}
.lead{margin:0;color:rgba(255,255,255,0.95);font-size:1rem;font-weight:500}
.grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(240px,1fr));
  gap:20px;
  margin-top:20px;
}
.card{
  border-radius:16px;
  padding:24px;
  box-shadow:0 12px 35px rgba(0,0,0,0.15);
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:14px;
  text-align:center;
  transition:transform .25s cubic-bezier(0.34,1.56,0.64,1), box-shadow .25s ease, filter .25s ease;
  cursor:pointer;
  position:relative;
  overflow:hidden;
  border:none;
}
.card::before{
  content:'';
  position:absolute;
  top:-2px;left:-2px;right:-2px;bottom:-2px;
  background:var(--card-gradient);
  border-radius:16px;
  z-index:-1;
  opacity:0;
  transition:opacity .3s ease;
}
.card:hover::before{
  opacity:0.4;
}
.card:hover{
  transform:translateY(-12px) scale(1.03);
  box-shadow:0 25px 50px rgba(0,0,0,0.22);
  filter:brightness(1.1);
}
.card > *{
  position:relative;
  z-index:1;
}
.badge{
  width:90px;height:90px;border-radius:28px;display:inline-grid;place-items:center;font-size:42px;
  box-shadow:0 10px 28px rgba(0,0,0,0.12);
  transition:transform .3s cubic-bezier(0.34,1.56,0.64,1), box-shadow .3s ease;
  background:rgba(255,255,255,0.15);
  backdrop-filter:blur(10px);
  border:2px solid rgba(255,255,255,0.3);
}
.card:hover .badge{
  transform:scale(1.2) rotate(8deg);
  box-shadow:0 15px 40px rgba(0,0,0,0.2);
}
.title{font-weight:800;font-size:1.15rem;margin:0;color:#fff}
.subtitle{font-size:0.82rem;color:rgba(255,255,255,0.85);margin:0;font-weight:500}
.icons{font-size:34px;letter-spacing:4px;filter:drop-shadow(2px 2px 4px rgba(0,0,0,0.1))}

.card-1{background:linear-gradient(135deg,#FF6B6B,#FF8E72)}
.card-2{background:linear-gradient(135deg,#4ECDC4,#44A08D)}
.card-3{background:linear-gradient(135deg,#95E1D3,#38ada9)}
.card-4{background:linear-gradient(135deg,#667eea,#764ba2)}
.card-5{background:linear-gradient(135deg,#f093fb,#f5576c)}
.card-6{background:linear-gradient(135deg,#4facfe,#00f2fe)}
.card-7{background:linear-gradient(135deg,#fa709a,#fee140)}
.card-8{background:linear-gradient(135deg,#30cfd0,#330867)}
.card-9{background:linear-gradient(135deg,#a8edea,#fed6e3)}
.card-10{background:linear-gradient(135deg,#ff9a56,#ff6a88)}

@media(max-width:768px){
  .site-header h1{font-size:1.8rem}
  .lead{font-size:0.9rem}
  .grid{grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:16px}
  .card{padding:18px;gap:10px}
  .badge{width:70px;height:70px;font-size:32px;border-radius:20px}
  .title{font-size:0.95rem}
}

/* Modal Styles */
.modal{
  display:none;
  position:fixed;
  top:0;left:0;right:0;bottom:0;
  background:rgba(0,0,0,0.5);
  z-index:1000;
  align-items:center;
  justify-content:center;
  padding:20px;
  overflow-y:auto;
}
.modal.show{display:flex}
.modal-content{
  background:#fff;
  border-radius:16px;
  max-width:700px;
  width:100%;
  margin:auto;
  padding:30px;
  box-shadow:0 20px 60px rgba(0,0,0,0.3);
  position:relative;
  max-height:90vh;
  overflow-y:auto;
  scroll-behavior:smooth;
}
.modal-close{
  position:absolute;
  top:15px;right:15px;
  background:none;
  border:none;
  font-size:28px;
  cursor:pointer;
  color:#666;
  transition:color .2s;
  padding:0;
  width:32px;
  height:32px;
  display:flex;
  align-items:center;
  justify-content:center;
}
.modal-close:hover{color:#000}
.modal-title{
  margin:0 0 24px 0;
  font-size:1.5rem;
  color:#1f2937;
  border-bottom:3px solid #667eea;
  padding-bottom:12px;
}
.question{
  border:2px solid #e5e7eb;
  border-radius:12px;
  padding:16px;
  background:#f9fafb;
  transition:border-color .2s, background .2s;
}
.question:hover{
  border-color:#667eea;
  background:#f0f4ff;
}
.question-num{
  font-weight:700;
  color:#667eea;
  font-size:0.9rem;
  margin-bottom:6px;
}
.question-text{
  font-weight:600;
  color:#1f2937;
  margin-bottom:12px;
  font-size:0.95rem;
}
.options{
  display:flex;
  flex-direction:column;
  gap:8px;
  margin-left:16px;
}
.option{
  display:flex;
  align-items:center;
  gap:8px;
  padding:8px 12px;
  border-radius:8px;
  cursor:pointer;
  transition:background .2s;
  font-size:0.9rem;
  color:#374151;
}
.option:hover{background:#e0e7ff}
.option input[type="radio"]{
  cursor:pointer;
  accent-color:#667eea;
}
/* Quiz Section */
.quiz-section{
  display:flex;
  flex-direction:column;
  gap:0;
}
.progress-bar{
  background:#e5e7eb;
  height:4px;
  border-radius:2px;
  margin-bottom:20px;
  overflow:hidden;
}
.progress-fill{
  background:linear-gradient(90deg,#667eea,#764ba2);
  height:100%;
  transition:width .3s;
}
.quiz-container{
  display:flex;
  flex-direction:column;
  gap:20px;
  margin-bottom:24px;
  flex:1;
}
.content-section{
  margin-bottom:24px;
}
.content-section h3{
  font-size:1.1rem;
  color:#1f2937;
  margin:0 0 12px 0;
  font-weight:700;
}
.chapter-content{
  background:#f9fafb;
  border-left:4px solid #667eea;
  padding:16px;
  border-radius:8px;
  line-height:1.6;
  color:#374151;
  font-size:0.95rem;
  margin-bottom:16px;
}
.chapter-content p{
  margin:0 0 10px 0;
}
.chapter-content p:last-child{
  margin-bottom:0;
}

.btn{
  padding:10px 20px;
  border:none;
  border-radius:8px;
  font-weight:600;
  cursor:pointer;
  transition:transform .2s, box-shadow .2s;
  font-size:0.95rem;
}
.btn:hover{
  transform:translateY(-2px);
  box-shadow:0 8px 16px rgba(0,0,0,0.15);
}
.btn-primary{
  background:linear-gradient(135deg,#667eea,#764ba2);
  color:#fff;
  width:100%;
}
.btn-success{
  background:linear-gradient(135deg,#10b981,#059669);
  color:#fff;
  width:100%;
  padding:12px 20px;
  font-size:1rem;
  font-weight:700;
}
.btn-success:hover{
  transform:translateY(-3px);
  box-shadow:0 12px 24px rgba(16, 185, 129, 0.3);
}
.btn-secondary{
  background:#e5e7eb;
  color:#374151;
}

/* Results Section */
.results-section{
  padding:20px 0;
}
.results-section h3{
  text-align:center;
  color:#1f2937;
  margin:0 0 24px 0;
  font-size:1.3rem;
  font-weight:700;
}
.results-container{
  display:flex;
  flex-direction:column;
  gap:16px;
  margin-bottom:24px;
}
.result-item{
  border:2px solid #e5e7eb;
  border-radius:12px;
  padding:16px;
  background:#fff;
}
.result-item.correct{
  border-color:#10b981;
  background:#f0fdf4;
  border-left:5px solid #10b981;
}
.result-item.incorrect{
  border-color:#ef4444;
  background:#fef2f2;
  border-left:5px solid #ef4444;
}
.result-question{
  font-weight:700;
  color:#1f2937;
  margin-bottom:12px;
  font-size:0.95rem;
}
.result-options{
  display:flex;
  flex-direction:column;
  gap:8px;
  margin-bottom:12px;
}
.result-option{
  padding:10px 14px;
  border-radius:8px;
  font-size:0.9rem;
  background:#f3f4f6;
  color:#374151;
  border-left:3px solid #d1d5db;
  transition:all .2s;
}
.result-option.user-answer{
  font-weight:700;
  border-left-width:4px;
}
.result-item.correct .result-option.user-answer{
  background:#10b981;
  color:#fff;
  border-color:#059669;
}
.result-item.incorrect .result-option.user-answer{
  background:#ef4444;
  color:#fff;
  border-color:#dc2626;
}
.result-item.incorrect .result-option.correct-answer{
  background:#10b981;
  color:#fff;
  font-weight:700;
  border-color:#059669;
}
.result-status{
  display:inline-block;
  padding:6px 14px;
  border-radius:20px;
  font-size:0.85rem;
  font-weight:700;
  margin-top:8px;
}
.result-status.correct{
  background:#d1fae5;
  color:#065f46;
}
.result-status.incorrect{
  background:#fee2e2;
  color:#7f1d1d;
}

@media(max-width:640px){
  .modal-content{padding:20px}
  .modal-title{font-size:1.2rem}
  .question{padding:12px}
  .question-text{font-size:0.85rem}
  .option{font-size:0.8rem;padding:6px 10px}
  .chapter-content{font-size:0.9rem;padding:12px}
}
