* { margin: 0; padding: 0; box-sizing: border-box; font-family: "Roboto", Arial, sans-serif; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; width: 100%; overflow: hidden; background: #f1f3f6;}

.topbar { background: #fff; padding: 10px 12px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #e0e0e0; position: fixed; top: 0; width: 100%; z-index: 100; box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
.left { display: flex; gap: 8px; align-items: center; }
.test-name {font-weight: 800; font-size:24px; white-space: nowrap; overflow:hidden; text-overflow: ellipsis;}
.palette-btn { background: #667eea; color: #fff; border: none; padding: 6px 12px; border-radius: 6px; font-weight: 700; font-size: 14px; cursor: pointer; }
.timer { background: #667eea; color: #fff; padding: 6px 12px; border-radius: 20px; font-weight: 700; font-size: 14px; }
.timer.warning { background: #f44336; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: 0.4; } }

.progress-container { height: 5px; background: #e0e0e0; position: fixed; top: 50px; width: 100%; z-index: 100; }
.progress-bar { height: 5px; width: 0%; background: #4CAF50; transition: width 0.4s; }

.main { padding-top: 56px; padding-bottom: 70px; height: 100vh; overflow-y: auto; background: #fff; }
.quiz-area { padding: 16px; }

.q-header { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.q-no { background: #e91e63; color: #fff; border-radius: 50%; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; }
.tag { background:lime; color:black; padding: 3px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; display: none; }
.tag.show { display: inline-block;}

.question { font-size: 20px; font-weight:800; line-height: 1.6; margin-bottom:20px; color: #212121; }

.options { list-style: none;}
.option { display: flex; align-items: center; gap: 10px; background: #fff; border: 1.5px solid #ddd; border-radius: 10px; padding: 14px;width: ; margin-bottom: 10px; cursor: pointer; transition: all 0.2s ease; font-size: 20px; }
.option:active { background: #f5f5f5; transform: scale(0.98); }
.option .num { font-weight: 800; color: black; min-width: 20px; }
.option .icon { margin-left: auto; font-size: 20px; display: none; font-weight: 700; }
.option.correct { background: #e8f5e9; border-color: #4CAF50; border-width: 2px; }
.option.correct .icon { color: #4CAF50; display: block; }
.option.wrong { background: #ffebee; border-color: #f44336; border-width: 2px; }
.option.wrong .icon { color: #f44336; display: block; }
.option.fade { opacity: 0.4; }
.option.disabled { pointer-events: none; }

.solution-box { margin-top: 16px; padding: 14px; background: #f9f9ff; border-left: 4px solid #667eea; border-radius: 8px; display: none;font-weight: 700; }
.explanation { line-height: 1.6; font-size: 20px; }

.sidebar { position: fixed; top: 0; right: -100%; width: 90%; height: 100%; background: #fff; z-index: 200; transition: right 0.3s ease; box-shadow: -2px 0 10px rgba(0,0,0,0.2); padding: 15px; overflow-y: auto; }
.sidebar.open { right: 0; }
.overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 199; display: none; }
.overlay.show { display: block; }
.sidebar h3 { margin-bottom: 12px; font-size: 16px; }

.palette { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.q-palette-btn { width: 100%; aspect-ratio: 1; border: 1.5px solid #ccc; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-weight: 600; cursor: pointer; background:#fff; font-size: 14px; }
.q-palette-btn.answered { background: #4CAF50; color: #fff; border-color: #4CAF50; }
.q-palette-btn.wrong-answered { background: #f44336; color: #fff; border-color: #f44336; }
.q-palette-btn.skipped { background: #9e9e9e; color: #fff; border-color: #9e9e9e; }
.q-palette-btn.current { border: 2px solid #667eea; }

.footer-nav { position: fixed; bottom: 0; left: 0; width: 100%; display: flex; background: #424242; z-index: 99; box-shadow: 0 -2px 8px rgba(0,0,0,0.1); }
.footer-nav button { flex: 1; padding: 15px; border: none; background: #424242; color: #fff; font-size: 15px; font-weight: 600; cursor: pointer; }
.footer-nav button:first-child { border-right: 1px solid #555; }
.footer-nav button:disabled { opacity: 0.4; cursor: not-allowed; }
.retake-btn { background: #667eea!important; }
.retake-btn:active { background: #556cd6!important; }

/* ===== RESULT PAGE CSS ADDED ===== */
.result-page{position: fixed; top:0; left:0; width:100%; height:100%; background: rgba(0,0,0,0.85); display:flex; justify-content:center; align-items:center; z-index: 300; padding:20px;}
.result-card{background: #fff; padding: 25px 20px; border-radius: 20px; text-align: center; width: 100%; max-width: 400px; box-shadow: 0 5px 20px rgba(0,0,0,0.3);}
.result-card h2{ font-size: 22px; margin-bottom: 10px; }
.score-circle{width: 120px; height: 120px; border-radius: 50%; background: linear-gradient(135deg, #667eea, #764ba2); display:flex; justify-content:center; align-items:center; margin: 15px auto;}
#finalScore{ font-size: 32px; font-weight: 800; color: #fff; }
#resultText{ font-size: 16px; font-weight: 600; color: #555; margin-bottom: 15px; }
.result-stats{ display:flex; justify-content:space-around; margin: 20px 0; gap: 10px; }
.stat-box{ display:flex; flex-direction:column; align-items: center; padding: 10px; border-radius: 10px; width: 30%; }
.stat-box b{ font-size: 20px; font-weight: 700; }
.stat-box span{ font-size: 12px; margin-top: 4px; }
.correct-stat{ background: #e8f5e9; color: #2e7d32; }
.wrong-stat{ background: #ffebee; color: #c62828; }
.skipped-stat{ background: #f5f5f5; color: #616161; }
.footer-btn{ width: 100%; padding: 14px; border: none; border-radius: 10px; background: #667eea; color: #fff; font-weight: 700; font-size: 16px; margin-top: 10px; cursor: pointer; }
.footer-btn.retake-btn{ background: #ff9800; }
.footer-btn:active{ transform: scale(0.98); }