* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%); min-height: 100vh; }
.page-wrapper { display: grid; grid-template-columns: 160px 1fr 160px; gap: 20px; min-height: 100vh; max-width: 1400px; margin: 0 auto; padding: 20px; }
.sidebar { min-height: 100vh; }
.sidebar-left, .sidebar-right { display: flex; align-items: flex-start; padding-top: 80px; }
.sticky-ad { position: sticky; top: 20px; width: 160px; min-height: 600px; }
.main-content { display: flex; justify-content: center; align-items: flex-start; padding: 20px 0; }
@media (max-width: 1024px) { .page-wrapper { grid-template-columns: 1fr; } .sidebar { display: none; } }
.container { max-width: 600px; width: 100%; }
.header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.back-button { text-decoration: none; color: #adb5bd; background: rgba(255,255,255,0.1); padding: 6px 14px; border-radius: 20px; font-size: 1em; }
.back-button:hover { background: rgba(255,255,255,0.18); color: #fff; }
.title { color: #fff; font-size: 1.5em; font-weight: 800; }
.topic-select { background: #1e1e2e; border-radius: 20px; padding: 24px; box-shadow: 0 8px 32px rgba(0,0,0,0.4); border: 1px solid rgba(255,255,255,0.08); }
.topic-select h2 { color: #e2e8f0; font-size: 1.25em; margin-bottom: 16px; text-align: center; }
.topic-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.topic-card { border: 1px solid rgba(255,255,255,0.12); border-radius: 14px; padding: 16px 12px; text-align: center; cursor: pointer; background: rgba(255,255,255,0.05); transition: all 0.2s; }
.topic-card:hover { border-color: #7c3aed; background: rgba(124,58,237,0.15); transform: translateY(-2px); }
.topic-icon { font-size: 2em; margin-bottom: 6px; }
.topic-name { font-weight: 700; color: #e2e8f0; font-size: 0.92em; }
.stats-bar { display: flex; justify-content: space-between; background: rgba(255,255,255,0.08); border-radius: 14px; padding: 10px 18px; color: #e2e8f0; font-size: 1em; margin-bottom: 8px; }
.timer-bar-wrap { background: rgba(255,255,255,0.12); border-radius: 10px; height: 7px; margin-bottom: 14px; }
.timer-bar { background: #7c3aed; border-radius: 10px; height: 7px; width: 100%; transition: width 0.5s linear; }
.topic-badge { background: rgba(124,58,237,0.3); color: #a78bfa; font-size: 0.8em; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; padding: 5px 14px; border-radius: 20px; display: inline-block; margin-bottom: 12px; border: 1px solid rgba(124,58,237,0.5); }
.question-card { background: #1e1e2e; border-radius: 18px; padding: 22px; box-shadow: 0 6px 24px rgba(0,0,0,0.3); margin-bottom: 14px; border: 1px solid rgba(255,255,255,0.08); }
.difficulty-tag { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 0.72em; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 10px; }
.difficulty-tag.easy { background: rgba(16,185,129,0.2); color: #6ee7b7; border: 1px solid rgba(16,185,129,0.3); }
.difficulty-tag.medium { background: rgba(245,158,11,0.2); color: #fcd34d; border: 1px solid rgba(245,158,11,0.3); }
.difficulty-tag.hard { background: rgba(239,68,68,0.2); color: #fca5a5; border: 1px solid rgba(239,68,68,0.3); }
.question-text { color: #e2e8f0; font-size: 1em; font-weight: 600; line-height: 1.65; }
.code-block { background: #0d1117; color: #e2e8f0; font-family: 'Courier New', monospace; font-size: 0.82em; padding: 14px; border-radius: 10px; margin-top: 12px; overflow-x: auto; border: 1px solid rgba(255,255,255,0.1); white-space: pre; line-height: 1.5; }
.options-grid { display: grid; grid-template-columns: 1fr; gap: 9px; margin-bottom: 14px; }
.option-btn { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12); border-radius: 12px; padding: 13px 16px; font-size: 0.9em; cursor: pointer; font-weight: 600; color: #e2e8f0; transition: all 0.2s; text-align: left; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; }
.option-btn:hover { border-color: #7c3aed; background: rgba(124,58,237,0.12); }
.option-btn.correct { background: rgba(16,185,129,0.2); color: #6ee7b7; border-color: #10b981; }
.option-btn.wrong { background: rgba(239,68,68,0.2); color: #fca5a5; border-color: #ef4444; }
.option-btn:disabled { cursor: not-allowed; transform: none; }
.result-box { background: #1e1e2e; border-radius: 18px; padding: 20px; text-align: center; box-shadow: 0 6px 24px rgba(0,0,0,0.3); margin-bottom: 14px; border: 1px solid rgba(255,255,255,0.08); }
.result-icon { font-size: 2em; margin-bottom: 6px; }
.result-msg { font-size: 1em; font-weight: 700; color: #e2e8f0; margin-bottom: 8px; }
.explain-text { color: #94a3b8; font-size: 0.86em; line-height: 1.6; margin-bottom: 14px; font-style: italic; background: rgba(255,255,255,0.05); padding: 10px 14px; border-radius: 10px; text-align: left; border-left: 3px solid #7c3aed; }
.next-btn { background: linear-gradient(135deg, #7c3aed, #4f46e5); color: #fff; border: none; border-radius: 12px; padding: 12px 28px; font-size: 1em; font-weight: 700; cursor: pointer; }
.game-over { background: #1e1e2e; border-radius: 20px; padding: 36px 24px; text-align: center; box-shadow: 0 8px 32px rgba(0,0,0,0.4); border: 1px solid rgba(255,255,255,0.08); }
.game-over h2 { font-size: 2em; margin-bottom: 10px; }
.game-over p { color: #94a3b8; font-size: 1.05em; margin-bottom: 8px; }
.share-btn, .play-again-btn, .change-topic-btn { border: none; border-radius: 12px; padding: 12px 20px; font-size: 0.95em; font-weight: 700; cursor: pointer; margin: 5px; }
.share-btn { background: linear-gradient(135deg, #7c3aed, #4f46e5); color: #fff; }
.play-again-btn { background: rgba(255,255,255,0.08); color: #e2e8f0; }
.change-topic-btn { background: rgba(124,58,237,0.15); color: #a78bfa; border: 1px solid rgba(124,58,237,0.3); }
.hidden { display: none; }
