/* Shared visual layer. Page structure, quiz states and event handlers stay local. */
:root {
    --adda-ink: #1d2545;
    --adda-muted: #63708b;
    --adda-violet: #6554d9;
    --adda-blue: #356ae6;
    --adda-line: #e4e7f4;
    --adda-shadow: 0 12px 36px rgba(45, 44, 100, .07);
}
body.adda-theme {
    color: var(--adda-ink);
    font-family: "Segoe UI", "Nirmala UI", system-ui, sans-serif;
    background: radial-gradient(ellipse at 5% 0%, #ede9ff 0, transparent 42%),
                radial-gradient(ellipse at 95% 12%, #e3f4ff 0, transparent 38%), #f7f8fd;
    -webkit-font-smoothing: antialiased;
}
body.adda-theme :where(button, input, select, textarea) { font-family: inherit; }
body.adda-theme :where(h1, h2, h3) { letter-spacing: -.035em; line-height: 1.2; }
body.adda-theme :where(p) { line-height: 1.6; }
body.adda-theme :where(.site-header, .student-header, .admin-header) {
    border-bottom: 1px solid var(--adda-line);
    box-shadow: 0 4px 24px rgba(45, 44, 100, .04);
}
body.adda-theme :where(.login-card, .register-card, .admin-login-card, .profile-card,
    .student-section, .student-card, .feature-card, .stat-card, .live-card,
    .quiz-card, .result-card, .payment-card, .instruction-card, .dashboard-card,
    .leaderboard-header, .leaderboard-section, .quiz-leaderboard-choice) {
    border-color: var(--adda-line);
    border-radius: 22px;
    box-shadow: var(--adda-shadow);
}
body.adda-theme :where(.login-heading, .register-heading, .profile-name, .hero-title) { color: var(--adda-ink); }
body.adda-theme :where(.hero-kicker, .section-kicker, .student-label, .question-label) { color: #6757bd; }
body.adda-theme :where(.hero-primary, .login-button, .register-button, .join-quiz-btn, .submit-test-btn) {
    background: linear-gradient(115deg, #7054df, #3d70e8);
    border-color: transparent;
    box-shadow: 0 5px 14px rgba(94, 77, 211, .18);
}
body.adda-theme :where(button, a, input, select, textarea):focus-visible {
    outline: 3px solid #9583ed;
    outline-offset: 3px;
}
body.adda-theme :where(input:not([type=checkbox]):not([type=radio]), select, textarea) {
    border-radius: 12px;
}
body.adda-theme :where(.hero-logo-card) {
    border-color: #e6dfff;
    box-shadow: 0 30px 70px rgba(105, 84, 196, .15);
}
body.adda-theme .student-welcome-bar {
    border: 1px solid #e3dcff;
    background: linear-gradient(110deg, #f3eeff, #edf7ff 80%, #e8faf6);
    border-radius: 24px;
    box-shadow: var(--adda-shadow);
}
body.adda-theme .student-welcome-bar h1 { color: #30265b; }
body.adda-theme .profile-avatar { box-shadow: 0 4px 16px #6554d920; }
body.adda-theme .leaderboard-page { max-width: 1080px; padding: 28px 20px 48px; }
body.adda-theme .leaderboard-header {
    position: relative;
    padding: 28px 30px;
    overflow: hidden;
    background: linear-gradient(120deg, #ffffff 35%, #f2eeff 100%);
    border: 1px solid #e4def8;
}
body.adda-theme .leaderboard-header .brand-row { padding-bottom: 20px; margin-bottom: 20px; border-color: #e9e5f4; }
body.adda-theme .leaderboard-header h1 { color: #30265b; font-size: clamp(28px, 4vw, 40px); }
body.adda-theme .leaderboard-status { border: 1px solid var(--adda-line); box-shadow: none; }
body.adda-theme .leaderboard-section { padding: 26px; background: #fff; }
body.adda-theme .leaderboard-section .section-heading { margin-bottom: 22px; }
body.adda-theme .leaderboard-section .section-heading h2 { font-size: 23px; }
body.adda-theme #yourRank:not(:empty) {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 4px 20px;
    margin: 0 0 24px;
    padding: 20px 24px;
    border: 1px solid #7664e0;
    border-radius: 18px;
    background: linear-gradient(115deg, #6550cf, #3c70db);
    color: #fff;
    box-shadow: 0 8px 20px #6453cc20;
    text-align: left;
}
body.adda-theme #yourRank:empty { display: none; }
body.adda-theme #yourRank .your-rank-title { grid-column: 1 / -1; color: #ece8ff; font-size: 11px; letter-spacing: .12em; }
body.adda-theme #yourRank .your-rank-number { grid-row: 2 / 4; margin: 0; font-size: 38px; line-height: 1.2; }
body.adda-theme #yourRank .your-rank-score { font-size: 18px; }
body.adda-theme #yourRank .your-rank-answered { margin: 0; color: #f2efff; font-size: 13px; }
body.adda-theme .leaderboard-top-three { gap: 16px; margin-top: 12px; }
body.adda-theme .top-three-card { padding: 24px 14px; border-radius: 20px; box-shadow: 0 6px 24px #30265b08; }
body.adda-theme .top-three-card.rank-1 { background: linear-gradient(160deg, #fffbeb, #fff 75%); border-color: #e9c76b; }
body.adda-theme .top-three-card.current-student { border-color: #8c76e4; background: linear-gradient(155deg, #f2edff, #f5f9ff); }
body.adda-theme .top-three-photo { box-shadow: 0 4px 14px #30265b0d; }
body.adda-theme .top-three-name { font-size: 16px; color: #283052; overflow-wrap: anywhere; }
body.adda-theme .top-three-score { color: #6550cf; font-size: 28px; }
body.adda-theme .ranking-list-photo { flex-shrink: 0; }
body.adda-theme .back-btn { margin-top: 20px; }
body.adda-theme #backButton {
    padding: 12px 22px;
    min-height: 44px;
    border: 1px solid #dcd6f2;
    border-radius: 12px;
    color: #5945a5;
    background: #fff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 3px 10px #30265b06;
}
body.adda-theme #backButton:hover { background: #f0ebff; }
@media (max-width: 650px) {
    body.adda-theme .leaderboard-page { padding: 16px 12px 32px; }
    body.adda-theme .leaderboard-header, body.adda-theme .leaderboard-section { padding: 20px 16px; border-radius: 20px; }
    body.adda-theme #yourRank:not(:empty) { padding: 16px; gap: 5px 14px; }
    body.adda-theme .top-three-card { padding: 20px 10px; }
    body.adda-theme .top-three-card.rank-1 { min-height: 235px; }
    body.adda-theme .top-three-name { font-size: 14px; }
    body.adda-theme .leaderboard-top-three { gap: 10px; }
}
@media (prefers-reduced-motion: reduce) {
    body.adda-theme *, body.adda-theme *::before, body.adda-theme *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}
body.adda-theme :where(.hero-primary, .login-button, .register-button, .join-quiz-btn, .submit-test-btn) { color: #fff; }
