:root {
    --bg-black: #020203;
    --bg-graphite-dark: rgba(8, 8, 10, 0.65);
    --bg-graphite-medium: rgba(18, 18, 22, 0.72);
    --bg-graphite-light: rgba(28, 28, 34, 0.85);
    --border-graphite: rgba(255, 255, 255, 0.055);
    --border-glow: rgba(139, 92, 246, 0.25);
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --text-muted: #52525b;
    --primary-indigo: #6366f1;
    --primary-purple: #8b5cf6;
    --primary-gradient: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    --accent-teal: #06b6d4;
    --accent-teal-glow: rgba(6, 182, 212, 0.35);
    --success-emerald: #10b981;
    --success-glow: rgba(16, 185, 129, 0.2);
    --error-rose: #f43f5e;
    --error-glow: rgba(244, 63, 94, 0.2);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.6);
    --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.8);
    --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.85), 0 0 50px rgba(139, 92, 246, 0.05);
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-full: 9999px;
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    width: 100%;
    min-height: 100%;
    background-color: var(--bg-black);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.5;
    overflow-x: hidden;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-black);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-graphite-light);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-indigo);
}

.stars-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -3;
    opacity: 0.4;
    background-image: 
        radial-gradient(1px 1px at 20px 30px, #fff, rgba(0,0,0,0)),
        radial-gradient(1px 1px at 40px 70px, #fff, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 50px 160px, #fff, rgba(0,0,0,0)),
        radial-gradient(1px 1px at 80px 240px, #fff, rgba(0,0,0,0)),
        radial-gradient(1.5px 1.5px at 150px 80px, #fff, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 250px 190px, #fff, rgba(0,0,0,0));
    background-repeat: repeat;
    background-size: 300px 300px;
}

.glow-orb {
    position: fixed;
    border-radius: var(--radius-full);
    filter: blur(120px);
    z-index: -2;
    opacity: 0.15;
    pointer-events: none;
}

#orb-1 {
    top: -10%;
    right: 5%;
    width: 40vw;
    height: 40vw;
    background: radial-gradient(circle, var(--primary-purple) 0%, transparent 80%);
    animation: floatingOrb1 20s infinite alternate;
}

#orb-2 {
    bottom: -10%;
    left: 5%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, var(--primary-indigo) 0%, transparent 80%);
    animation: floatingOrb2 25s infinite alternate;
}

@keyframes floatingOrb1 {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-10%, 15%) scale(1.1); }
}

@keyframes floatingOrb2 {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(15%, -10%) scale(1.05); }
}

.floating-nav {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 960px;
    height: 64px;
    background: rgba(13, 13, 15, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-full);
    z-index: 100;
    transition: var(--transition-normal);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

.floating-nav:hover {
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 0 8px 32px 0 rgba(99, 102, 241, 0.05);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    padding: 0 24px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.nav-logo svg {
    color: var(--primary-indigo);
}

.nav-logo span {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: -0.5px;
}

.nav-links {
    display: flex;
    gap: 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 0.9rem;
    padding: 8px 16px;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: var(--transition-fast);
}

.nav-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
    color: var(--text-primary);
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.25);
}

.nav-profile-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 4px;
    width: 46px;
    height: 46px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--transition-fast);
}

.nav-profile-trigger:hover {
    border-color: rgba(99, 102, 241, 0.3);
    background: rgba(255, 255, 255, 0.06);
}

.nav-profile-details {
    display: none !important;
}

.nav-profile-details span {
    display: inline-block;
}

.nav-profile-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.nav-profile-score {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-teal);
    letter-spacing: 0.5px;
    background: rgba(6, 182, 212, 0.15);
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

.nav-profile-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #a855f7 0%, #6366f1 100%);
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1rem;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.4), inset 0 2px 4px rgba(255, 255, 255, 0.3);
}

.nav-profile-avatar i {
    font-size: 1rem;
    color: var(--text-primary);
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.app-main {
    margin-top: 120px;
    padding: 24px;
    min-height: calc(100vh - 120px);
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.view-section {
    width: 100%;
    max-width: 800px;
    opacity: 1;
    transform: translateY(0);
    transition: opacity var(--transition-normal), transform var(--transition-normal);
}

.view-section.hidden {
    display: none !important;
    opacity: 0;
    transform: translateY(20px);
}

.hero-container {
    text-align: center;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.badge-accent {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-indigo);
    border: 1px solid rgba(99, 102, 241, 0.25);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 24px;
    display: inline-block;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 20px;
    letter-spacing: -1.5px;
}

.gradient-text {
    background: linear-gradient(90deg, #6366f1 0%, #a855f7 50%, #14b8a6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    color: var(--text-secondary);
    font-size: 1.15rem;
    max-width: 600px;
    margin-bottom: 40px;
    line-height: 1.6;
}

.user-stats-dashboard {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    width: 100%;
    max-width: 600px;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--bg-graphite-medium);
    border: 1px solid var(--border-graphite);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: var(--transition-normal);
}

.stat-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.stat-val {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.stat-lbl {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.selection-container {
    width: 100%;
    max-width: 600px;
    background: var(--bg-graphite-medium);
    border: 1px solid var(--border-graphite);
    border-radius: var(--radius-lg);
    padding: 32px;
    margin-bottom: 40px;
    text-align: left;
}

.selection-title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 20px;
}

.difficulty-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.diff-btn {
    background: var(--bg-graphite-dark);
    border: 1px solid var(--border-graphite);
    border-radius: var(--radius-md);
    padding: 16px 12px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    outline: none;
}

.diff-btn:hover {
    border-color: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
}

.diff-btn.active {
    background: rgba(99, 102, 241, 0.08);
    border-color: var(--primary-indigo);
    color: var(--text-primary);
    box-shadow: 0 0 16px rgba(99, 102, 241, 0.15);
}

.diff-label {
    font-weight: 600;
    font-size: 1rem;
}

.diff-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--bg-graphite-light);
    border: 1px solid var(--border-graphite);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
    outline: none;
    white-space: nowrap;
}

.btn:hover:not(:disabled) {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn:active:not(:disabled) {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--primary-gradient);
    border: none;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover:not(:disabled) {
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.6);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.08);
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
}

.btn-danger-outline {
    background: transparent;
    border: 1px solid rgba(244, 63, 94, 0.3);
    color: var(--error-rose);
}

.btn-danger-outline:hover:not(:disabled) {
    background: rgba(244, 63, 94, 0.08);
    border-color: var(--error-rose);
}

.btn-large {
    padding: 16px 36px;
    font-size: 1.05rem;
    border-radius: var(--radius-full);
}

.btn-full {
    width: 100%;
}

.quiz-container {
    background: var(--bg-graphite-medium);
    border: 1px solid var(--border-graphite);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.quiz-header {
    margin-bottom: 32px;
}

.quiz-progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.quiz-q-counter {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.quiz-q-counter strong {
    color: var(--text-primary);
}

.quiz-score-live {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1rem;
    color: var(--accent-teal);
    background: rgba(20, 184, 166, 0.1);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(20, 184, 166, 0.2);
}

.progress-bar-container {
    width: 100%;
    height: 6px;
    background: var(--bg-graphite-dark);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: 16px;
}

.progress-bar-fill {
    height: 100%;
    background: var(--primary-gradient);
    border-radius: var(--radius-full);
    transition: width var(--transition-normal);
}

.quiz-meta {
    display: flex;
    gap: 12px;
}

.timer-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 6px 12px;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.timer-badge.warning {
    color: var(--error-rose);
    border-color: rgba(244, 63, 94, 0.3);
    background: rgba(244, 63, 94, 0.08);
}

.streak-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(234, 179, 8, 0.1);
    border: 1px solid rgba(234, 179, 8, 0.3);
    color: #eab308;
    padding: 6px 12px;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    animation: streakGlow 1s infinite alternate;
}

@keyframes streakGlow {
    0% { box-shadow: 0 0 4px rgba(234, 179, 8, 0.2); }
    100% { box-shadow: 0 0 12px rgba(234, 179, 8, 0.4); }
}

.question-box {
    margin-bottom: 32px;
    min-height: 100px;
    display: flex;
    align-items: center;
}

.question-text {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--text-primary);
}

.options-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 40px;
}

.option-card {
    background: var(--bg-graphite-dark);
    border: 1px solid var(--border-graphite);
    border-radius: var(--radius-md);
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: var(--transition-fast);
    outline: none;
    text-align: left;
    width: 100%;
}

.option-text {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition-fast);
}

.option-marker {
    width: 24px;
    height: 24px;
    border-radius: var(--radius-full);
    border: 2px solid var(--border-graphite);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    transition: var(--transition-fast);
    flex-shrink: 0;
}

.option-card:hover:not(.disabled) {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.02);
}

.option-card:hover:not(.disabled) .option-text {
    color: var(--text-primary);
}

.option-card:hover:not(.disabled) .option-marker {
    border-color: var(--text-secondary);
    color: var(--text-secondary);
}

.option-card.selected {
    border-color: var(--primary-indigo);
    background: rgba(99, 102, 241, 0.08);
}

.option-card.selected .option-text {
    color: var(--text-primary);
}

.option-card.selected .option-marker {
    border-color: var(--primary-indigo);
    background: var(--primary-indigo);
    color: var(--text-primary);
}

.option-card.correct {
    border-color: var(--success-emerald);
    background: rgba(16, 185, 129, 0.08);
    box-shadow: 0 0 16px var(--success-glow);
}

.option-card.correct .option-text {
    color: var(--text-primary);
}

.option-card.correct .option-marker {
    border-color: var(--success-emerald);
    background: var(--success-emerald);
    color: var(--text-primary);
}

.option-card.incorrect {
    border-color: var(--error-rose);
    background: rgba(244, 63, 94, 0.08);
    box-shadow: 0 0 16px var(--error-glow);
}

.option-card.incorrect .option-text {
    color: var(--text-primary);
}

.option-card.incorrect .option-marker {
    border-color: var(--error-rose);
    background: var(--error-rose);
    color: var(--text-primary);
}

.option-card.disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.quiz-actions {
    display: flex;
    justify-content: space-between;
}

.results-container {
    background: var(--bg-graphite-medium);
    border: 1px solid var(--border-graphite);
    border-radius: var(--radius-lg);
    padding: 48px;
    text-align: center;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.results-title {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.results-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 32px;
    max-width: 500px;
}

.score-visualization {
    position: relative;
    width: 160px;
    height: 160px;
    margin-bottom: 40px;
}

.score-ring {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.score-ring-bg {
    stroke: var(--bg-graphite-dark);
}

.score-ring-progress {
    stroke: var(--primary-indigo);
    stroke-linecap: round;
    transition: stroke-dashoffset 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.score-display {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.score-percent {
    font-family: var(--font-heading);
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}

.score-points {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    width: 100%;
    margin-bottom: 40px;
}

.metric-card {
    background: var(--bg-graphite-dark);
    border: 1px solid var(--border-graphite);
    border-radius: var(--radius-md);
    padding: 16px;
}

.metric-val {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.metric-lbl {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.results-actions {
    display: flex;
    gap: 16px;
}

.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal);
}

.drawer-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.drawer {
    position: fixed;
    top: 0;
    right: -420px;
    width: 100%;
    max-width: 420px;
    height: 100%;
    background: var(--bg-graphite-dark);
    border-left: 1px solid var(--border-graphite);
    z-index: 1001;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    transition: right var(--transition-normal) cubic-bezier(0.4, 0, 0.2, 1);
}

.drawer.active {
    right: 0;
}

.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid var(--border-graphite);
}

.drawer-header h2 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
}

.btn-close-drawer {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.btn-close-drawer:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.drawer-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.leaderboard-top-three {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 32px;
}

.podium-card {
    background: var(--bg-graphite-medium);
    border: 1px solid var(--border-graphite);
    border-radius: var(--radius-md);
    padding: 16px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    padding-top: 24px;
    transition: var(--transition-normal);
}

.podium-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.15);
}

.podium-card.first-place {
    transform: scale(1.05);
    border-color: rgba(234, 179, 8, 0.35);
    box-shadow: 0 0 24px rgba(234, 179, 8, 0.08);
}

.podium-card.first-place:hover {
    transform: scale(1.05) translateY(-4px);
}

.podium-badge {
    position: absolute;
    top: -10px;
    width: 24px;
    height: 24px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.75rem;
}

.gold-badge {
    background: #eab308;
    color: #000;
    box-shadow: 0 0 10px rgba(234, 179, 8, 0.4);
}

.silver-badge {
    background: #94a3b8;
    color: #000;
    box-shadow: 0 0 10px rgba(148, 163, 184, 0.4);
}

.bronze-badge {
    background: #b45309;
    color: #fff;
    box-shadow: 0 0 10px rgba(180, 83, 9, 0.4);
}

.podium-avatar {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    background: var(--bg-graphite-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    margin-bottom: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
}

.podium-name {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 2px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.podium-score {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent-teal);
}

.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.leaderboard-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-graphite);
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
}

.leaderboard-row:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.leaderboard-row.current-user-row {
    background: rgba(139, 92, 246, 0.08);
    border-color: rgba(139, 92, 246, 0.25);
    box-shadow: 0 0 16px rgba(139, 92, 246, 0.05);
}

.rank-col {
    font-weight: 700;
    width: 40px;
    color: var(--text-secondary);
}

.player-col {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    font-weight: 500;
}

.player-avatar {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    background: var(--bg-graphite-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
}

.player-name {
    display: inline-flex;
    align-items: center;
}

.accuracy-col {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-right: 20px;
}

.score-col {
    font-weight: 700;
    color: var(--accent-teal);
}

.user-tag {
    font-size: 0.65rem;
    background: var(--primary-indigo);
    color: white;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    margin-left: 8px;
    font-weight: 600;
    text-transform: uppercase;
}

.profile-avatar-customizer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.profile-avatar-preview {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-full);
    background: var(--primary-gradient);
    border: 3px solid rgba(255, 255, 255, 0.1);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    transition: var(--transition-fast);
}

.profile-avatar-preview i {
    font-size: 1.75rem;
    color: var(--text-primary);
}

.avatar-selections-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.avatar-opt-btn {
    background: var(--bg-graphite-medium);
    border: 1px solid var(--border-graphite);
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
    outline: none;
    color: var(--text-secondary);
}

.avatar-opt-btn i {
    font-size: 1.1rem;
    color: inherit;
    pointer-events: none;
}

.avatar-opt-btn:hover {
    border-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
    color: var(--text-primary);
}

.avatar-opt-btn.active {
    border-color: var(--primary-indigo);
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-indigo);
}

.profile-input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
}

.profile-input-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.profile-input-group input {
    background: var(--bg-graphite-medium);
    border: 1px solid var(--border-graphite);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition-fast);
}

.profile-input-group input:focus {
    border-color: var(--primary-indigo);
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.15);
}

.profile-achievements {
    margin-bottom: 32px;
}

.profile-achievements h3 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-secondary);
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.achievement-card {
    background: var(--bg-graphite-medium);
    border: 1px solid var(--border-graphite);
    border-radius: var(--radius-md);
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    opacity: 0.5;
    transition: var(--transition-normal);
}

.achievement-card.unlocked {
    opacity: 1;
    border-color: rgba(16, 185, 129, 0.2);
    background: rgba(16, 185, 129, 0.02);
}

.achievement-icon {
    font-size: 1.35rem;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.achievement-card.unlocked .achievement-icon {
    color: var(--success-emerald);
}

.achievement-details {
    display: flex;
    flex-direction: column;
}

.achievement-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
}

.achievement-desc {
    font-size: 0.65rem;
    color: var(--text-secondary);
}

.profile-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

@media (max-width: 768px) {
    .floating-nav {
        top: 12px;
        width: calc(100% - 24px);
        height: 56px;
        padding: 0;
    }
    
    .nav-container {
        padding: 0 16px;
    }
    
    .nav-logo span {
        font-size: 1.1rem;
    }
    
    .nav-profile-details {
        display: none;
    }
    
    .nav-link span {
        display: none;
    }
    
    .nav-links {
        gap: 8px;
    }
    
    .nav-link {
        padding: 8px 12px;
    }
    
    .nav-link i {
        font-size: 1.1rem;
    }
    
    .app-main {
        margin-top: 88px;
        padding: 16px;
        min-height: calc(100vh - 88px);
    }
    
    .hero-title {
        font-size: 2.25rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 24px;
    }
    
    .user-stats-dashboard {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-bottom: 24px;
    }
    
    .selection-container {
        padding: 20px;
        margin-bottom: 24px;
    }
    
    .difficulty-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .btn-large {
        padding: 12px 24px;
        font-size: 0.95rem;
        width: 100%;
    }
    
    .quiz-container {
        padding: 24px;
    }
    
    .question-text {
        font-size: 1.25rem;
    }
    
    .option-card {
        padding: 16px;
    }
    
    .option-text {
        font-size: 0.9rem;
    }
    
    .results-container {
        padding: 24px;
    }
    
    .results-title {
        font-size: 1.85rem;
    }
    
    .metrics-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .results-actions {
        flex-direction: column;
        width: 100%;
        gap: 12px;
    }
    
    .drawer {
        max-width: 100%;
        right: -100%;
    }
}

.hidden {
    display: none !important;
}

.login-card {
    background: var(--bg-graphite-medium);
    border: 1px solid var(--border-graphite);
    border-radius: var(--radius-lg);
    padding: 40px;
    width: 100%;
    max-width: 480px;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: var(--transition-normal);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.login-card:hover {
    border-color: rgba(99, 102, 241, 0.25);
    box-shadow: 0 0 40px rgba(99, 102, 241, 0.08);
}

.login-title {
    font-family: var(--font-heading);
    font-size: 2.25rem;
    font-weight: 800;
    margin-bottom: 8px;
    text-align: center;
}

.login-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    text-align: center;
    margin-bottom: 32px;
    line-height: 1.5;
}

.login-input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    margin-bottom: 24px;
}

.login-input-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.login-input-group input {
    background: var(--bg-graphite-dark);
    border: 1px solid var(--border-graphite);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition-fast);
}

.login-input-group input:focus {
    border-color: var(--primary-indigo);
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.15);
}

.login-avatar-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    margin-bottom: 36px;
}

.login-avatar-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-8px); }
    40%, 80% { transform: translateX(8px); }
}

.shake {
    animation: shake 0.4s cubic-bezier(.36,.07,.19,.97) both;
}

.login-portal-container {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    gap: 32px;
    width: 100%;
    max-width: 1040px;
    margin: 20px auto;
    align-items: stretch;
}

.login-left-pane, .login-right-pane {
    display: flex;
    flex-direction: column;
}

.intro-card {
    background: var(--bg-graphite-medium);
    border: 1px solid var(--border-graphite);
    border-radius: var(--radius-lg);
    padding: 40px;
    width: 100%;
    height: 100%;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    transition: var(--transition-normal);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.intro-card:hover {
    border-color: rgba(99, 102, 241, 0.25);
    box-shadow: 0 0 40px rgba(99, 102, 241, 0.08);
}

.intro-title {
    font-family: var(--font-heading);
    font-size: 2.15rem;
    font-weight: 800;
    margin-bottom: 16px;
    line-height: 1.2;
    letter-spacing: -1px;
}

.intro-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 32px;
}

.intro-features {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

.intro-feature-item {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.feature-icon {
    font-size: 1.5rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-graphite);
    width: 46px;
    height: 46px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--primary-indigo);
}

.feature-text h4 {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.feature-text p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.45;
}

@media (max-width: 992px) {
    .login-portal-container {
        grid-template-columns: 1fr;
        gap: 24px;
        max-width: 500px;
    }
}

.leaderboard-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.leaderboard-empty-state .empty-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.6;
    animation: floatIcon 3s ease-in-out infinite;
}

@keyframes floatIcon {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.leaderboard-empty-state p {
    font-size: 0.95rem;
    line-height: 1.5;
    max-width: 300px;
}

.ai-info-section {
    width: 100%;
    margin-top: 56px;
    padding-top: 56px;
    border-top: 1px solid var(--border-graphite);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    text-align: left;
    width: 100%;
}

.info-card-premium {
    background: var(--bg-graphite-medium);
    border: 1px solid var(--border-graphite);
    border-radius: var(--radius-lg);
    padding: 32px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    transition: var(--transition-normal);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.info-card-premium:hover {
    border-color: rgba(99, 102, 241, 0.25);
    transform: translateY(-4px);
    box-shadow: 0 0 30px rgba(99, 102, 241, 0.05);
}

.badge-accent.badge-blue {
    background: rgba(6, 182, 212, 0.1);
    color: var(--accent-teal);
    border-color: rgba(6, 182, 212, 0.25);
    margin-bottom: 16px;
}

.badge-accent.badge-purple {
    background: rgba(139, 92, 246, 0.1);
    color: var(--primary-purple);
    border-color: rgba(139, 92, 246, 0.25);
    margin-bottom: 16px;
}

.badge-accent.badge-emerald {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-emerald);
    border-color: rgba(16, 185, 129, 0.25);
    margin-bottom: 16px;
}

.info-card-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.info-card-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 24px;
}

.info-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
}

.info-list li {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.info-list-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-teal);
    background: rgba(6, 182, 212, 0.08);
    border-radius: var(--radius-sm);
}

.info-list-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.45;
}

.info-list-text strong {
    color: var(--text-primary);
}

.usage-badges-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    width: 100%;
}

.usage-badge-item {
    background: var(--bg-graphite-medium);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
    color: var(--text-primary);
    transition: var(--transition-normal);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(8px);
}

.usage-badge-item:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.06);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4), 0 0 10px var(--border-glow);
}

.usage-icon {
    font-size: 1.05rem;
    color: var(--primary-purple);
    width: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .info-grid {
        grid-template-columns: 1fr;
    }
}

 

 
.grid-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: -1;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(139, 92, 246, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(139, 92, 246, 0.045) 1px, transparent 1px);
    background-size: 58px 58px;
    -webkit-mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 30%, transparent 100%);
    mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 30%, transparent 100%);
}

 
#confetti-canvas {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 9999;
}

 
#toast-container {
    position: fixed;
    bottom: 32px;
    right: 32px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 9998;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(10, 10, 14, 0.94);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 16px;
    padding: 16px 20px;
    min-width: 290px;
    max-width: 380px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255,255,255,0.03);
    pointer-events: auto;
    position: relative;
    overflow: hidden;
    animation: toastSlideIn 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.toast.hiding {
    animation: toastSlideOut 0.3s ease-in forwards;
}

.toast::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: var(--toast-color, var(--primary-indigo));
}

.toast-success  { --toast-color: #10b981; }
.toast-error    { --toast-color: #f43f5e; }
.toast-info     { --toast-color: #6366f1; }
.toast-achievement { --toast-color: #f59e0b; }

.toast-icon {
    width: 38px; height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.9rem;
}

.toast-success .toast-icon    { background: rgba(16, 185, 129, 0.12); color: #10b981; border: 1px solid rgba(16,185,129,0.2); }
.toast-error .toast-icon      { background: rgba(244,  63,  94, 0.12); color: #f43f5e; border: 1px solid rgba(244,63,94,0.2); }
.toast-info .toast-icon       { background: rgba( 99, 102, 241, 0.12); color: #6366f1; border: 1px solid rgba(99,102,241,0.2); }
.toast-achievement .toast-icon { background: rgba(245, 158,  11, 0.12); color: #f59e0b; border: 1px solid rgba(245,158,11,0.2); }

.toast-content { flex: 1; min-width: 0; }

.toast-title {
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.toast-message {
    font-size: 0.77rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    font-size: 0.8rem;
    transition: color 0.2s;
    flex-shrink: 0;
    outline: none;
}
.toast-close:hover { color: var(--text-primary); }

@keyframes toastSlideIn {
    from { transform: translateX(calc(100% + 40px)); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}
@keyframes toastSlideOut {
    from { transform: translateX(0); opacity: 1; }
    to   { transform: translateX(calc(100% + 40px)); opacity: 0; }
}

 
.btn-primary {
    position: relative;
    overflow: hidden;
}
.btn-primary::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 55%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.22), transparent);
    transform: skewX(-22deg);
    animation: btnShimmer 4s ease-in-out infinite;
}
@keyframes btnShimmer {
    0%    { left: -100%; }
    28%, 100% { left: 160%; }
}

 
.quiz-container,
.results-container,
.login-card,
.intro-card,
.info-card-premium {
    position: relative;
}
.quiz-container::before,
.results-container::before,
.login-card::before,
.intro-card::before,
.info-card-premium::before {
    content: '';
    position: absolute;
    top: 0;
    left: 12%;
    right: 12%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.16), transparent);
    pointer-events: none;
    z-index: 1;
}

 
.nav-logo span {
    background: linear-gradient(135deg, #a78bfa 0%, #6366f1 50%, #06b6d4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

 
.diff-icon {
    font-size: 1.5rem;
    margin-bottom: 6px;
    color: var(--text-muted);
    transition: color var(--transition-fast), transform var(--transition-fast);
    display: block;
}

.diff-btn {
    min-height: 110px;
}

.diff-btn:hover .diff-icon {
    color: var(--primary-indigo);
    transform: scale(1.15);
}

.diff-btn.active .diff-icon {
    color: var(--primary-indigo);
}

.diff-btn[data-difficulty="medium"].active .diff-icon,
.diff-btn[data-difficulty="medium"]:hover .diff-icon {
    color: var(--accent-teal);
}

.diff-btn[data-difficulty="hard"].active .diff-icon,
.diff-btn[data-difficulty="hard"]:hover .diff-icon {
    color: var(--error-rose);
}

.diff-btn[data-difficulty="medium"].active {
    border-color: var(--accent-teal);
    box-shadow: 0 0 24px rgba(6, 182, 212, 0.15);
}

.diff-btn[data-difficulty="hard"].active {
    border-color: var(--error-rose);
    box-shadow: 0 0 24px rgba(244, 63, 94, 0.15);
}

 
@keyframes timerPulse {
    0%   { box-shadow: 0 0 0 0 rgba(244, 63, 94, 0.55); }
    70%  { box-shadow: 0 0 0 9px rgba(244, 63, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(244, 63, 94, 0); }
}
.timer-badge.warning {
    animation: timerPulse 0.9s ease-out infinite;
}

 
.score-ring-progress {
    filter: drop-shadow(0 0 8px rgba(99, 102, 241, 0.75));
    transition: stroke-dashoffset 1.4s cubic-bezier(0.34, 1.1, 0.64, 1), stroke 0.6s ease;
}
.score-ring-progress.great {
    stroke: #10b981;
    filter: drop-shadow(0 0 10px rgba(16, 185, 129, 0.8));
}
.score-ring-progress.good {
    stroke: #f59e0b;
    filter: drop-shadow(0 0 10px rgba(245, 158, 11, 0.8));
}
.score-ring-progress.average {
    stroke: #f43f5e;
    filter: drop-shadow(0 0 10px rgba(244, 63, 94, 0.8));
}

 
.score-percent {
    background: linear-gradient(135deg, #a78bfa, #6366f1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

 
.avatar-opt-btn.active {
    box-shadow: 0 0 0 2px var(--primary-indigo), 0 0 22px rgba(99, 102, 241, 0.4);
}
.avatar-opt-btn:hover {
    box-shadow: 0 0 14px rgba(139, 92, 246, 0.25);
}

 
@keyframes avatarPulse {
    0%, 100% { box-shadow: var(--shadow-md), 0 0 0 3px rgba(139,92,246,0.35), 0 0 28px rgba(139,92,246,0.18); }
    50%       { box-shadow: var(--shadow-md), 0 0 0 4px rgba(99,102,241,0.55),  0 0 44px rgba(99,102,241,0.28); }
}
.profile-avatar-preview {
    animation: avatarPulse 3s ease-in-out infinite;
}

 
.achievement-card.unlocked[data-id="novice"]  .achievement-icon { color: #10b981; }
.achievement-card.unlocked[data-id="perfect"] .achievement-icon { color: #f59e0b; }
.achievement-card.unlocked[data-id="speed"]   .achievement-icon { color: #06b6d4; }
.achievement-card.unlocked[data-id="streak"]  .achievement-icon { color: #f43f5e; }
.achievement-card.unlocked[data-id="expert"]  .achievement-icon { color: #8b5cf6; }

.achievement-card.unlocked {
    box-shadow: 0 0 24px rgba(16, 185, 129, 0.08);
    animation: achieveGlow 3s ease-in-out infinite;
}
@keyframes achieveGlow {
    0%, 100% { box-shadow: 0 0 20px rgba(16,185,129,0.07); }
    50%       { box-shadow: 0 0 30px rgba(16,185,129,0.14); }
}

 
@keyframes firstPlaceGlow {
    0%, 100% { box-shadow: 0 0 35px rgba(234,179,8,0.18), 0 0 70px rgba(234,179,8,0.07); }
    50%       { box-shadow: 0 0 55px rgba(234,179,8,0.30), 0 0 110px rgba(234,179,8,0.12); }
}
.podium-card.first-place {
    animation: firstPlaceGlow 3s ease-in-out infinite;
}

 
.leaderboard-row.current-user-row {
    box-shadow: 0 0 22px rgba(139, 92, 246, 0.1);
}

 
.option-card {
    border-left: 3px solid transparent !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}
.option-card:hover:not(.disabled) {
    border-left-color: rgba(99, 102, 241, 0.65) !important;
}
.option-card.correct {
    border-left-color: var(--success-emerald) !important;
}
.option-card.incorrect {
    border-left-color: var(--error-rose) !important;
}

 
.stat-card:hover {
    box-shadow: 0 0 32px rgba(99,102,241,0.09), var(--shadow-md);
    background: linear-gradient(135deg, rgba(99,102,241,0.045), rgba(139,92,246,0.045));
}

 
.diff-btn.active {
    box-shadow: 0 0 0 1px var(--primary-indigo), 0 0 28px rgba(99,102,241,0.18);
}

 
@keyframes viewFadeInUp {
    from { opacity: 0; transform: translateY(22px); }
    to   { opacity: 1; transform: translateY(0); }
}
.view-section:not(.hidden) {
    animation: viewFadeInUp 0.45s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

 
.hero-title {
    letter-spacing: -2px;
}

 
.leaderboard-empty-state .empty-icon {
    color: var(--primary-indigo);
}

 
@media (max-width: 768px) {
    #toast-container {
        bottom: 20px;
        right: 16px;
        left: 16px;
    }
    .toast {
        min-width: unset;
        max-width: 100%;
    }
}

 

 
.score-popup {
    position: fixed;
    pointer-events: none;
    z-index: 10000;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.2rem;
    color: #10b981;
    text-shadow: 0 0 14px rgba(16, 185, 129, 0.85);
    white-space: nowrap;
    transform: translateX(-50%);
    animation: scorePopFloat 1s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes scorePopFloat {
    0%   { opacity: 1; transform: translateX(-50%) translateY(0)     scale(0.65); }
    35%  { opacity: 1; transform: translateX(-50%) translateY(-36px)  scale(1.12); }
    100% { opacity: 0; transform: translateX(-50%) translateY(-80px)  scale(0.9); }
}

 
.btn, .diff-btn, .avatar-opt-btn, .option-card, .nav-link {
    position: relative;
    overflow: hidden;
}
.ripple-effect {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    transform: scale(0);
    animation: rippleAnim 0.65s linear;
    pointer-events: none;
}
@keyframes rippleAnim {
    to { transform: scale(4); opacity: 0; }
}

 
.shooting-star {
    position: fixed;
    width: 160px;
    height: 1.5px;
    background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.85) 50%, rgba(255,255,255,0) 100%);
    border-radius: 50%;
    opacity: 0;
    pointer-events: none;
    z-index: 0;
    transform-origin: right center;
    animation: shootAcross var(--duration, 6s) var(--delay, 0s) linear infinite;
}
@keyframes shootAcross {
    0%   { transform: translateX(0)      scaleX(0.1); opacity: 0; }
    5%   { opacity: 0.75; }
    28%  { transform: translateX(-85vw)  scaleX(1);   opacity: 0.5; }
    35%  { opacity: 0; }
    100% { transform: translateX(-105vw) scaleX(0.1); opacity: 0; }
}

 
.typewriter-cursor {
    display: inline-block;
    width: 2px;
    height: 0.9em;
    background: var(--primary-indigo);
    margin-left: 3px;
    vertical-align: text-bottom;
    border-radius: 1px;
    animation: cursorBlink 0.75s step-end infinite;
}
@keyframes cursorBlink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0; }
}

 
.quiz-difficulty-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}
.quiz-difficulty-badge.easy   { background: rgba(16,185,129,0.12); color: #10b981; border: 1px solid rgba(16,185,129,0.25); }
.quiz-difficulty-badge.medium { background: rgba(6,182,212,0.12);  color: #06b6d4; border: 1px solid rgba(6,182,212,0.25); }
.quiz-difficulty-badge.hard   { background: rgba(244,63,94,0.12);  color: #f43f5e; border: 1px solid rgba(244,63,94,0.25); }

 
@keyframes streakContainerGlow {
    0%, 100% { box-shadow: var(--shadow-lg), 0 0 30px rgba(234,179,8,0.12); border-color: rgba(234,179,8,0.25); }
    50%       { box-shadow: var(--shadow-lg), 0 0 55px rgba(234,179,8,0.30); border-color: rgba(234,179,8,0.50); }
}
.quiz-container.streak-active {
    animation: streakContainerGlow 2.2s ease-in-out infinite;
}

 
.xp-progress-section {
    background: var(--bg-graphite-dark);
    border: 1px solid var(--border-graphite);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}
.xp-progress-section::before {
    content: '';
    position: absolute;
    top: 0; left: 10%; right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
}
.xp-level-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.xp-level-left {
    display: flex;
    align-items: center;
    gap: 8px;
}
.xp-level-icon {
    width: 28px; height: 28px;
    background: var(--primary-gradient);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.75rem;
    color: white;
}
.xp-level-info strong {
    display: block;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}
.xp-level-info span {
    font-size: 0.7rem;
    color: var(--text-secondary);
}
.xp-to-next {
    font-size: 0.7rem;
    color: var(--text-muted);
    background: rgba(255,255,255,0.04);
    padding: 3px 8px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-graphite);
}
.xp-bar-track {
    height: 6px;
    background: rgba(255,255,255,0.05);
    border-radius: var(--radius-full);
    overflow: hidden;
}
.xp-bar-fill {
    height: 100%;
    background: var(--primary-gradient);
    border-radius: var(--radius-full);
    transition: width 1.1s cubic-bezier(0.34, 1.1, 0.64, 1);
    box-shadow: 0 0 10px rgba(99,102,241,0.55);
    position: relative;
}
.xp-bar-fill::after {
    content: '';
    position: absolute;
    right: 0; top: 0; bottom: 0;
    width: 12px;
    background: rgba(255,255,255,0.4);
    border-radius: var(--radius-full);
    filter: blur(3px);
}

 
.nav-level-badge {
    font-size: 0.6rem;
    font-weight: 800;
    background: var(--primary-gradient);
    padding: 2px 6px;
    border-radius: var(--radius-full);
    color: white;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    line-height: 1.5;
    flex-shrink: 0;
}

 
@keyframes questionSlideIn {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}
.question-box {
    animation: questionSlideIn 0.38s cubic-bezier(0.4, 0, 0.2, 1);
}

 
@keyframes optionFadeIn {
    from { opacity: 0; transform: translateX(-14px); }
    to   { opacity: 1; transform: translateX(0); }
}
.option-card {
    animation: optionFadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) both;
}
.option-card:nth-child(1) { animation-delay: 0.05s; }
.option-card:nth-child(2) { animation-delay: 0.11s; }
.option-card:nth-child(3) { animation-delay: 0.17s; }
.option-card:nth-child(4) { animation-delay: 0.23s; }

 
@keyframes scoreBounceIn {
    0%   { transform: scale(0.5);  opacity: 0; }
    70%  { transform: scale(1.08); opacity: 1; }
    100% { transform: scale(1);    opacity: 1; }
}
.score-visualization {
    animation: scoreBounceIn 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s both;
}

 
.stat-val {
    background: linear-gradient(135deg, #ffffff 0%, rgba(167,139,250,0.9) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

 
.profile-stat-pills {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 20px;
}
.profile-stat-pill {
    background: var(--bg-graphite-dark);
    border: 1px solid var(--border-graphite);
    border-radius: var(--radius-md);
    padding: 10px 8px;
    text-align: center;
    transition: var(--transition-fast);
}
.profile-stat-pill:hover {
    border-color: rgba(99,102,241,0.3);
}
.profile-stat-pill .pill-val {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 700;
    display: block;
    margin-bottom: 3px;
    background: linear-gradient(135deg, #fff, rgba(167,139,250,0.85));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.profile-stat-pill .pill-lbl {
    font-size: 0.6rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

 
.login-input-group input:hover,
.profile-input-group input:hover {
    border-color: rgba(99, 102, 241, 0.3);
}

 
.option-card:hover:not(.disabled) {
    background: linear-gradient(135deg, rgba(99,102,241,0.035), rgba(139,92,246,0.035)) !important;
}

 
.quiz-score-live {
    position: relative;
    overflow: hidden;
}
.quiz-score-live::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.14) 50%, transparent 100%);
    transform: translateX(-100%);
    animation: liveScoreShimmer 3.5s ease-in-out infinite;
}
@keyframes liveScoreShimmer {
    0%        { transform: translateX(-100%); }
    40%, 100% { transform: translateX(200%); }
}

.badge-green {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-red {
    background: rgba(244, 63, 94, 0.15);
    color: #f43f5e;
    border: 1px solid rgba(244, 63, 94, 0.3);
}

.badge-blue {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.3);
}


.community-pulse-section {
    background: var(--bg-graphite-medium);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    padding: 24px;
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    animation: ambientGlow 4s ease-in-out infinite alternate;
}

@keyframes ambientGlow {
    0% { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), 0 0 10px rgba(16, 185, 129, 0.05); border-color: rgba(255, 255, 255, 0.08); }
    100% { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), 0 0 25px rgba(16, 185, 129, 0.2); border-color: rgba(16, 185, 129, 0.3); }
}

.pulse-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pulse-icon {
    font-size: 1.2rem;
    color: var(--primary-indigo);
}

.pulse-header h4 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
    flex: 1;
}

.live-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--success-emerald);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 4px 10px;
    background: var(--success-glow);
    border-radius: var(--radius-full);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background: var(--success-emerald);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.pulse-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.pulse-stat-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: var(--radius-sm);
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.pulse-stat-card .stat-value {
    font-size: 2rem;
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--primary-purple);
    margin-bottom: 4px;
}

.pulse-stat-card .stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Mobile glow fix */
@media (max-width: 768px) {
    /* Hide intense ambient glow orbs that concentrate into bands on narrow screens */
    .glow-orb,
    [class*="glow"] {
        opacity: 0 !important;
        display: none !important;
    }

    /* Remove box-shadows on cards that may bloom on mobile OLED screens */
    .login-card,
    .intro-card,
    .option-card,
    .pulse-stat-card,
    [class*="-card"] {
        box-shadow: none !important;
    }
}

.diff-grid-margin { margin-bottom: 20px; }
.ai-topic-container { margin-bottom: 24px; display: flex; gap: 8px; }
.ai-topic-input { flex: 1; padding: 12px; border-radius: 8px; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); color: white; }
.btn-ai-search-padding { padding: 0 20px; }
.start-quiz-container { display: flex; gap: 12px; margin-top: 24px; }
.btn-flex { flex: 1; }
.score-live-container { display: flex; gap: 12px; }
.quiz-score-live { color: var(--primary-indigo); }

