* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

header {
    padding: 1.5rem 2rem;
    color: white;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.header-left h1 {
    font-size: 2.2rem;
    margin: 0 0 0.25rem 0;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.date {
    font-size: 1rem;
    opacity: 0.9;
    margin: 0;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.stats-summary {
    display: flex;
    gap: 1rem;
}

.stat-item {
    text-align: center;
    background: rgba(255, 255, 255, 0.15);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    backdrop-filter: blur(5px);
}

.stat-number {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
    line-height: 1;
}

.stat-label {
    font-size: 0.8rem;
    opacity: 0.9;
}

.stats-button, .leaderboard-button {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}

.stats-button:hover, .leaderboard-button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.dark-mode-toggle {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dark-mode-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.reset-button {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}

.reset-button:hover:not(:disabled) {
    background: rgba(255, 82, 82, 0.3);
    border-color: rgba(255, 82, 82, 0.5);
    transform: translateY(-2px);
}

.reset-button:disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    transform: none !important;
}

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Ad Container Styles */
.ad-container {
    margin: 1rem auto;
    padding: 0.5rem;
    text-align: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-height: 50px;
    max-height: 250px;
    overflow: hidden;
}

.ad-inline {
    max-width: 300px;
    margin: 1rem auto;
    grid-column: 1 / -1;
    justify-self: center;
}

.ad-footer {
    background: rgba(255, 255, 255, 0.05);
    padding: 1rem 0;
    margin-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.ad-bottom {
    max-width: 728px;
    margin: 0 auto;
    background: transparent;
    border: none;
    padding: 0.5rem;
}

.ad-container ins {
    display: block !important;
    max-height: 200px;
    min-width: 300px;
    width: 100%;
}

.ad-container .adsbygoogle {
    min-width: 300px;
    width: 100% !important;
    height: auto !important;
}

/* Hide ads that fail to load */
.ad-container:empty {
    display: none;
}

.ad-container ins:empty {
    display: none !important;
}

/* Intro Section */
.intro-section {
    text-align: center;
    padding: 2rem 0;
    max-width: 800px;
    margin: 0 auto 2rem auto;
}

.intro-section h2 {
    font-size: 1.8rem;
    color: white;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.intro-section p {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
    margin: 0 1rem;
}

/* Timer Styles */
.timer-container {
    margin-top: 2rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.timer-label {
    font-size: 1.2rem;
    color: white;
    text-align: center;
    margin-bottom: 1rem;
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.countdown-timer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.time-unit {
    text-align: center;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 0.75rem 0.5rem;
    min-width: 70px;
    backdrop-filter: blur(5px);
}

.time-value {
    display: block;
    font-size: 2rem;
    font-weight: bold;
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

.time-label {
    display: block;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 0.25rem;
    font-weight: 500;
}

.time-separator {
    font-size: 1.5rem;
    color: white;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    margin: 0 0.25rem;
}

/* Timer Animation */
@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes glow {
    0% { box-shadow: 0 0 5px rgba(255, 107, 107, 0.5); }
    50% { box-shadow: 0 0 20px rgba(255, 107, 107, 0.8); }
    100% { box-shadow: 0 0 5px rgba(255, 107, 107, 0.5); }
}

/* Progress Container */
.progress-container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 2rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    transition: width 0.5s ease;
    width: 16.67%; /* 1/6 = 16.67% */
}

.progress-text {
    text-align: center;
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    font-weight: 600;
}

/* Single Question Container */
.single-question-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 2rem 2rem 2rem;
}

/* Question Navigation */
.question-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 2rem;
    gap: 1rem;
}

.nav-button {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
    min-width: 120px;
}

.nav-button:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.nav-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.category-dots {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex: 1;
}

.category-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.category-dot.active {
    background: white;
    transform: scale(1.2);
}

.category-dot.completed {
    background: #4ade80;
}

.category-dot:hover {
    transform: scale(1.1);
}

/* Questions Container (Legacy - hidden) */
.questions-container {
    display: none;
}

/* Answer Input Styling */
.input-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
}

.answer-input {
    width: 100%;
    padding: 1rem 1.5rem;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1.1rem;
    font-weight: 500;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    outline: none;
}

.answer-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
    font-style: italic;
}

.answer-input:focus {
    border-color: #667eea;
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
    transform: translateY(-2px);
}

.submit-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.submit-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
}

.submit-button:active {
    transform: translateY(-1px);
}

/* Multiple Choice Options Styling */
.options-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.option-button {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.2);
    padding: 1.25rem 1.5rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    text-align: center;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.option-button:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: #667eea;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.option-button:active {
    transform: translateY(-1px);
}

/* Result Display Styling */
.result {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    border-radius: 12px;
    margin-top: 1.5rem;
    backdrop-filter: blur(10px);
}

.result.correct {
    background: rgba(34, 197, 94, 0.2);
    border: 2px solid rgba(34, 197, 94, 0.4);
}

.result.incorrect {
    background: rgba(239, 68, 68, 0.2);
    border: 2px solid rgba(239, 68, 68, 0.4);
}

.result-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.result-text {
    flex: 1;
}

.result-title {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: white;
}

.result-answer {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 0.25rem;
}

.result-correct {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
    font-style: italic;
}

.result-explanation {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.4;
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    border-left: 3px solid rgba(255, 255, 255, 0.3);
}

.result-explanation-label {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 0.5rem;
    display: block;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.question-card {
    background: white;
    border-radius: 16px;
    padding: 0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(255,255,255,0.2);
    overflow: hidden;
    position: relative;
}

.question-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem 1.5rem 1rem 1.5rem;
    position: relative;
}

.category-icon {
    font-size: 2rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.card-header h2 {
    margin: 0;
    flex-grow: 1;
}

.category-stats {
    font-size: 0.8rem;
    color: #666;
    background: #f8f9fa;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
}

.question {
    padding: 0 1.5rem;
    margin-bottom: 1.5rem;
}

.answer-section {
    padding: 0 1.5rem 1.5rem 1.5rem;
}

.question-card[data-category="technology"] .card-header::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #4CAF50;
}

.question-card[data-category="science"] .card-header::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #2196F3;
}

.question-card[data-category="history"] .card-header::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #FF9800;
}

.question-card[data-category="geography"] .card-header::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #9C27B0;
}

.question-card[data-category="literature"] .card-header::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #F44336;
}

.card-header h2 {
    font-size: 1.4rem;
    font-weight: 600;
    color: #2c3e50;
}

.question-card[data-category="technology"] h2 {
    color: #4CAF50;
}

.question-card[data-category="science"] h2 {
    color: #2196F3;
}

.question-card[data-category="history"] h2 {
    color: #FF9800;
}

.question-card[data-category="geography"] h2 {
    color: #9C27B0;
}

.question-card[data-category="literature"] h2 {
    color: #F44336;
}

.question-card[data-category="entertainment"] .card-header::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #E91E63;
}

.question-card[data-category="entertainment"] h2 {
    color: #E91E63;
}

.question {
    font-size: 1.1rem;
    line-height: 1.7;
    color: #555;
    font-style: italic;
    margin-bottom: 1rem;
}

.answer-section {
    margin-top: 1rem;
}

.answer-section textarea {
    width: 100%;
    min-height: 80px;
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
    transition: border-color 0.3s ease;
}

.answer-section textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.answer-section textarea:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
}

.answer-section button {
    margin-top: 0.75rem;
    padding: 0.75rem 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.answer-section button:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}

.answer-section button:disabled {
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 2px 8px rgba(149, 165, 166, 0.2);
}

.feedback {
    margin-top: 0.75rem;
    padding: 0.75rem;
    border-radius: 6px;
    font-size: 0.9rem;
    line-height: 1.5;
}

.feedback .success {
    color: #27ae60;
    background-color: #d5f4e6;
    border: 1px solid #a7e4c4;
    margin: 0;
}

.feedback .error {
    color: #e74c3c;
    background-color: #fdeaea;
    border: 1px solid #f5b2b2;
    margin: 0;
}

.options-container {
    margin-bottom: 0.75rem;
}

.option-label {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.option-label:hover {
    background-color: #f8f9fa;
}

.option-label input[type="radio"] {
    margin-right: 0.5rem;
    cursor: pointer;
}

.option-label input[type="radio"]:disabled {
    cursor: not-allowed;
}

.option-label span {
    font-size: 0.95rem;
    color: #333;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 2% auto;
    padding: 0;
    border-radius: 16px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #eee;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 16px 16px 0 0;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.close {
    color: white;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.close:hover {
    opacity: 1;
}

.modal-body {
    padding: 2rem;
}

.overall-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    border: 1px solid #dee2e6;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 0.5rem;
}

.stat-title {
    font-size: 0.9rem;
    color: #6c757d;
    font-weight: 500;
}

.category-breakdown, .recent-activity {
    margin-bottom: 2rem;
}

.category-breakdown h3, .recent-activity h3 {
    margin-bottom: 1rem;
    color: #2c3e50;
    font-size: 1.2rem;
}

.category-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.category-stat-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
}

.category-stat-card .category-name {
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.category-accuracy {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 0.25rem;
}

.category-progress {
    font-size: 0.8rem;
    color: #6c757d;
}

.activity-list {
    max-height: 200px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    border-bottom: 1px solid #f1f3f4;
    font-size: 0.9rem;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-date {
    color: #6c757d;
    font-size: 0.8rem;
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
        padding: 0 0.5rem;
    }
    
    .header-left h1 {
        font-size: 1.8rem;
    }
    
    .date {
        font-size: 0.9rem;
    }
    
    .header-right {
        gap: 1rem;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .stats-summary {
        flex-direction: row;
        gap: 0.5rem;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .stat-item {
        padding: 0.4rem 0.8rem;
        min-width: 60px;
    }
    
    .stat-number {
        font-size: 1.2rem;
    }
    
    .stats-button {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }
    
    .reset-button {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }
    
    .dark-mode-toggle {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }
    
    .questions-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .card-header {
        padding: 1rem 1rem 0.5rem 1rem;
    }
    
    .category-icon {
        font-size: 1.5rem;
    }
    
    .card-header h2 {
        font-size: 1.2rem;
    }
    
    .question {
        font-size: 1rem;
        padding: 0 1rem;
    }
    
    .answer-section {
        padding: 0 1rem 1rem 1rem;
    }
    
    .answer-section textarea {
        min-height: 60px;
        font-size: 0.9rem;
    }
    
    .answer-section button {
        padding: 0.6rem 1.2rem;
        font-size: 0.85rem;
    }
    
    .modal-content {
        width: 95%;
        margin: 5% auto;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .overall-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .category-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .timer-container {
        margin-top: 1.5rem;
        padding: 1rem;
        max-width: 100%;
        margin-left: 1rem;
        margin-right: 1rem;
    }
    
    .timer-label {
        font-size: 1rem;
    }
    
    .countdown-timer {
        gap: 0.25rem;
    }
    
    .time-unit {
        min-width: 60px;
        padding: 0.5rem 0.25rem;
    }
    
    .time-value {
        font-size: 1.5rem;
    }
    
    .time-label {
        font-size: 0.7rem;
    }
    
    .time-separator {
        font-size: 1.2rem;
        margin: 0 0.1rem;
    }
    
    /* Mobile Ad Styles */
    .ad-container {
        margin: 0.5rem;
        padding: 0.25rem;
        min-height: 50px;
        max-height: 150px;
    }
    
    .ad-inline {
        max-width: 280px;
        margin: 0.75rem auto;
    }
    
    .ad-footer {
        margin-top: 1rem;
        padding: 0.5rem 0;
    }
    
    .ad-bottom {
        max-width: 320px;
        padding: 0.25rem;
    }
    
    .ad-container ins {
        max-height: 120px;
    }
}

/* Dark Mode Styles */
.dark-mode {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #e0e0e0;
}

.dark-mode header {
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.dark-mode .question-card {
    background: #2d2d2d;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
}

.dark-mode .question-card:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.dark-mode .category-stats {
    background: #3a3a3a;
    color: #ccc;
}

.dark-mode .question {
    color: #ccc;
}

.dark-mode .answer-section textarea {
    background: #3a3a3a;
    border: 2px solid #555;
    color: #e0e0e0;
}

.dark-mode .answer-section textarea:focus {
    border-color: #667eea;
    background: #404040;
}

.dark-mode .option-label {
    color: #e0e0e0;
}

.dark-mode .option-label:hover {
    background-color: #3a3a3a;
}

.dark-mode .option-label span {
    color: #e0e0e0;
}

.dark-mode .feedback .success {
    background-color: rgba(76, 175, 80, 0.2);
    border-color: rgba(76, 175, 80, 0.4);
    color: #81c784;
}

.dark-mode .feedback .error {
    background-color: rgba(244, 67, 54, 0.2);
    border-color: rgba(244, 67, 54, 0.4);
    color: #e57373;
}

.dark-mode .modal-content {
    background: #2d2d2d;
    color: #e0e0e0;
}

.dark-mode .modal-header {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

.dark-mode .stat-card {
    background: linear-gradient(135deg, #3a3a3a 0%, #2d2d2d 100%);
    border-color: #555;
    color: #e0e0e0;
}

.dark-mode .category-stat-card {
    background: #3a3a3a;
    border-color: #555;
    color: #e0e0e0;
}

.dark-mode .activity-item {
    border-bottom-color: #555;
    color: #e0e0e0;
}

.dark-mode .activity-date {
    color: #aaa;
}

.dark-mode .card-header h2 {
    color: #e0e0e0;
}

.dark-mode .question-card[data-category="technology"] h2 {
    color: #66bb6a;
}

.dark-mode .question-card[data-category="science"] h2 {
    color: #42a5f5;
}

.dark-mode .question-card[data-category="history"] h2 {
    color: #ffa726;
}

.dark-mode .question-card[data-category="geography"] h2 {
    color: #ab47bc;
}

.dark-mode .question-card[data-category="literature"] h2 {
    color: #ef5350;
}

.dark-mode .question-card[data-category="entertainment"] h2 {
    color: #ec407a;
}

.dark-mode .intro-section h2 {
    color: #e0e0e0;
}

.dark-mode .intro-section p {
    color: rgba(224, 224, 224, 0.9);
}

.dark-mode .timer-container {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.dark-mode .timer-label {
    color: #e0e0e0;
}

.dark-mode .time-unit {
    background: rgba(255, 255, 255, 0.1);
}

.dark-mode .time-value {
    color: #e0e0e0;
}

.dark-mode .time-label {
    color: rgba(224, 224, 224, 0.8);
}

.dark-mode .time-separator {
    color: #e0e0e0;
}

/* Dark Mode Ad Containers */
.dark-mode .ad-container {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.dark-mode .ad-footer {
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.dark-mode .ad-bottom {
    background: transparent;
}

/* Extra small screens (low resolution phones) */
@media (max-width: 480px) {
    header {
        padding: 1rem 0.5rem;
    }
    
    .header-content {
        gap: 0.75rem;
        padding: 0 0.25rem;
    }
    
    .header-left h1 {
        font-size: 1.5rem;
        margin-bottom: 0.1rem;
    }
    
    .date {
        font-size: 0.8rem;
    }
    
    .header-right {
        gap: 0.5rem;
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
    }
    
    .stats-summary {
        gap: 0.3rem;
        order: 2;
        width: 100%;
        justify-content: center;
    }
    
    .stat-item {
        padding: 0.3rem 0.6rem;
        min-width: 50px;
        font-size: 0.8rem;
    }
    
    .stat-number {
        font-size: 1rem;
    }
    
    .stat-label {
        font-size: 0.7rem;
    }
    
    .stats-button, .reset-button {
        padding: 0.3rem 0.6rem;
        font-size: 0.75rem;
        order: 1;
    }
    
    .dark-mode-toggle {
        width: 32px;
        height: 32px;
        padding: 0.3rem;
        font-size: 0.8rem;
        order: 1;
    }
    
    /* Make buttons wrap to new line if needed */
    .header-right > *:not(.stats-summary) {
        flex-shrink: 0;
    }
    
    /* Ensure stats summary takes full width on new line */
    .stats-summary {
        flex-basis: 100%;
    }
}

/* Additional mobile improvements for medium screens */
@media (max-width: 768px) {
    /* Improve question container spacing */
    .single-question-container {
        padding: 1rem;
        margin: 1rem auto;
        max-width: 100%;
    }
    
    .question-card {
        padding: 1rem;
    }
    
    /* Better navigation button layout */
    .question-navigation {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
        padding: 1rem;
    }
    
    .category-dots {
        order: -1;
        margin-bottom: 0.5rem;
    }
    
    .nav-button {
        min-width: 120px;
        padding: 0.75rem 1.5rem;
    }
    
    /* Improve option buttons */
    .option-button {
        min-height: 48px;
        font-size: 0.9rem;
        padding: 0.75rem 1rem;
        margin-bottom: 0.5rem;
    }
    
    /* Better input container */
    .input-container {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .answer-input {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.75rem;
        min-height: 48px;
    }
    
    .submit-button {
        min-height: 48px;
        font-size: 1rem;
        padding: 0.75rem 1.5rem;
    }
    
    /* Better timer layout */
    .timer-container {
        padding: 1rem;
        margin: 1rem 0;
    }
    
    .countdown-timer {
        gap: 0.5rem;
    }
    
    .time-unit {
        min-width: 50px;
    }
    
    /* Improve modal layout */
    .modal-content {
        margin: 1rem;
        max-height: calc(100vh - 2rem);
        overflow-y: auto;
    }
    
    /* Better progress bar */
    .progress-container {
        padding: 0 1rem;
        margin-bottom: 1rem;
    }
}

/* Enhanced small screen fixes */
@media (max-width: 480px) {
    /* Question card improvements */
    .single-question-container {
        padding: 0.5rem;
        margin: 0.5rem auto;
    }
    
    .question-card {
        padding: 0.75rem;
        margin: 0;
    }
    
    .card-header {
        padding: 0.75rem 0 0.5rem 0;
    }
    
    .category-icon {
        font-size: 1.8rem;
    }
    
    .card-header h2 {
        font-size: 1.1rem;
        margin: 0.25rem 0;
    }
    
    .question {
        font-size: 1rem;
        line-height: 1.4;
        padding: 0.75rem 0;
    }
    
    /* Navigation improvements */
    .question-navigation {
        padding: 0.75rem 0.5rem;
        gap: 0.75rem;
    }
    
    .nav-button {
        min-width: 100px;
        padding: 0.625rem 1rem;
        font-size: 0.9rem;
    }
    
    .category-dots {
        gap: 0.375rem;
    }
    
    .category-dot {
        width: 8px;
        height: 8px;
    }
    
    /* Option buttons for small screens */
    .options-container {
        gap: 0.5rem;
    }
    
    .option-button {
        padding: 0.625rem 0.75rem;
        font-size: 0.85rem;
        min-height: 44px;
        text-align: left;
    }
    
    /* Input improvements */
    .input-container {
        gap: 0.5rem;
    }
    
    .answer-input {
        padding: 0.625rem;
        font-size: 16px;
        border-radius: 6px;
    }
    
    .submit-button {
        padding: 0.625rem 1.25rem;
        font-size: 0.9rem;
        min-height: 44px;
    }
    
    /* Timer adjustments */
    .timer-container {
        padding: 0.75rem;
        margin: 0.75rem 0;
    }
    
    .timer-label {
        font-size: 0.85rem;
        margin-bottom: 0.5rem;
    }
    
    .countdown-timer {
        gap: 0.25rem;
        padding: 0.5rem;
    }
    
    .time-unit {
        min-width: 42px;
    }
    
    .time-value {
        font-size: 1.1rem;
    }
    
    .time-label {
        font-size: 0.7rem;
    }
    
    .time-separator {
        font-size: 0.9rem;
    }
    
    /* Progress bar improvements */
    .progress-container {
        padding: 0 0.5rem;
        margin-bottom: 0.75rem;
    }
    
    .progress-text {
        font-size: 0.85rem;
        margin-top: 0.25rem;
    }
    
    /* Result display improvements */
    .result {
        padding: 0.75rem;
        margin: 0.5rem 0;
        flex-direction: column;
        text-align: center;
    }
    
    .result-icon {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }
    
    .result-title {
        font-size: 1rem;
        margin-bottom: 0.25rem;
    }
    
    .result-answer, .result-correct {
        font-size: 0.85rem;
        margin: 0.125rem 0;
    }
    
    .result-explanation {
        font-size: 0.8rem;
        padding: 0.5rem;
        margin-top: 0.5rem;
    }
    
    .result-explanation-label {
        font-size: 0.75rem;
        margin-bottom: 0.25rem;
    }
    
    /* Modal improvements */
    .modal-content {
        margin: 0.5rem;
        padding: 1rem;
        border-radius: 8px;
        max-height: calc(100vh - 1rem);
    }
    
    .modal-header {
        padding-bottom: 0.75rem;
        margin-bottom: 0.75rem;
    }
    
    .modal-header h2 {
        font-size: 1.2rem;
    }
    
    /* Fix intro section */
    .intro-section {
        padding: 1rem 0.5rem;
        text-align: center;
    }
    
    .intro-section h2 {
        font-size: 1.1rem;
        margin-bottom: 0.75rem;
    }
    
    .intro-section p {
        font-size: 0.9rem;
        line-height: 1.4;
    }
}

/* Ultra small screens - enhanced */
@media (max-width: 360px) {
    .header-left h1 {
        font-size: 1.3rem;
    }
    
    .header-right {
        gap: 0.25rem;
    }
    
    .stats-button, .leaderboard-button {
        font-size: 0.7rem;
        padding: 0.25rem 0.5rem;
        white-space: nowrap;
    }
    
    .dark-mode-toggle {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }
    
    .stat-item {
        padding: 0.25rem 0.4rem;
        min-width: 45px;
    }
    
    /* Ultra small question adjustments */
    .question {
        font-size: 0.9rem;
        padding: 0.5rem 0;
    }
    
    .option-button {
        padding: 0.5rem 0.625rem;
        font-size: 0.8rem;
        min-height: 40px;
    }
    
    .nav-button {
        min-width: 80px;
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
    
    .answer-input {
        padding: 0.5rem;
        font-size: 16px;
    }
    
    .submit-button {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
        min-height: 40px;
    }
    
    /* Countdown timer for ultra small */
    .time-unit {
        min-width: 38px;
    }
    
    .time-value {
        font-size: 1rem;
    }
    
    .time-label {
        font-size: 0.65rem;
    }
    
    /* Modal adjustments */
    .modal-content {
        margin: 0.25rem;
        padding: 0.75rem;
        max-height: calc(100vh - 0.5rem);
    }
    
    .modal-header h2 {
        font-size: 1.1rem;
    }
    
    /* Leaderboard button text wrapping fix */
    .leaderboard-button {
        max-width: 80px;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .stat-number {
        font-size: 0.9rem;
    }
}

/* Landscape mobile phones */
@media (max-width: 768px) and (orientation: landscape) {
    header {
        padding: 0.75rem 1rem;
    }
    
    .header-content {
        flex-direction: row;
        align-items: center;
    }
    
    .header-left h1 {
        font-size: 1.5rem;
    }
    
    .single-question-container {
        padding: 0.75rem;
        margin: 0.5rem auto;
    }
    
    .countdown-timer {
        gap: 0.25rem;
        padding: 0.5rem;
    }
    
    .modal-content {
        max-height: calc(100vh - 1rem);
        margin: 0.5rem;
    }
}

/* Touch-friendly improvements */
@media (pointer: coarse) {
    /* Increase touch targets */
    .option-button,
    .nav-button,
    .submit-button,
    .stats-button,
    .leaderboard-button,
    .dark-mode-toggle {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Improve tap feedback */
    .option-button:active,
    .nav-button:active,
    .submit-button:active {
        transform: scale(0.98);
        opacity: 0.8;
    }
    
    /* Remove hover effects on touch devices */
    .option-button:hover,
    .nav-button:hover,
    .submit-button:hover {
        background-color: initial;
        transform: none;
    }
    
    /* Better spacing for touch */
    .category-dot {
        min-width: 24px;
        min-height: 24px;
        touch-action: manipulation;
    }
}

/* Leaderboard Modal Styles */
.leaderboard-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid #f1f3f4;
}

.tab-button {
    background: none;
    border: none;
    padding: 1rem 1.5rem;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    color: #6c757d;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.tab-button.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.tab-button:hover {
    background: rgba(102, 126, 234, 0.1);
}

.leaderboard-content {
    position: relative;
    min-height: 400px;
}

.leaderboard-tab {
    display: none;
}

.leaderboard-tab.active {
    display: block;
}

.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 12px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.leaderboard-item:hover {
    background: #e9ecef;
    transform: translateY(-2px);
}

.leaderboard-item.current-user {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    border-color: #667eea;
}

.leaderboard-rank {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.rank-number {
    font-size: 1.5rem;
    font-weight: bold;
    color: #667eea;
    min-width: 3rem;
    text-align: center;
}

.rank-number.gold {
    color: #ffd700;
}

.rank-number.silver {
    color: #c0c0c0;
}

.rank-number.bronze {
    color: #cd7f32;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: bold;
    color: white;
}

.user-info {
    flex: 1;
}

.user-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.25rem;
}

.user-stats {
    font-size: 0.9rem;
    color: #6c757d;
}

.user-score {
    text-align: right;
}

.score-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #667eea;
}

.score-label {
    font-size: 0.8rem;
    color: #6c757d;
}

.your-rank {
    margin-top: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    border-radius: 12px;
    border: 2px solid #667eea;
}

.your-rank h4 {
    margin-bottom: 1rem;
    color: #333;
}

.rank-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.rank-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: bold;
    font-size: 1.1rem;
    min-width: 3rem;
    text-align: center;
}

.rank-details {
    flex: 1;
    color: #6c757d;
}

/* Dark mode navigation styles */
:root[data-theme="dark"] .progress-bar {
    background: rgba(255, 255, 255, 0.1);
}

:root[data-theme="dark"] .progress-text {
    color: #e2e8f0;
}

:root[data-theme="dark"] .nav-button {
    background: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
    border-color: rgba(255, 255, 255, 0.2);
}

:root[data-theme="dark"] .nav-button:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.2);
}

:root[data-theme="dark"] .category-dot {
    background: rgba(255, 255, 255, 0.2);
}

:root[data-theme="dark"] .category-dot.active {
    background: #667eea;
}

/* Dark mode answer input styles */
:root[data-theme="dark"] .answer-input {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
}

:root[data-theme="dark"] .answer-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

:root[data-theme="dark"] .answer-input:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: #667eea;
}

:root[data-theme="dark"] .option-button {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
}

:root[data-theme="dark"] .option-button:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #667eea;
}

:root[data-theme="dark"] .result.correct {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.3);
}

:root[data-theme="dark"] .result.incorrect {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
}

:root[data-theme="dark"] .result-title,
:root[data-theme="dark"] .result-answer,
:root[data-theme="dark"] .result-correct {
    color: #e2e8f0;
}

/* Dark mode leaderboard styles */
:root[data-theme="dark"] .leaderboard-item {
    background: #2d3748;
    color: #e2e8f0;
}

:root[data-theme="dark"] .leaderboard-item:hover {
    background: #4a5568;
}

:root[data-theme="dark"] .user-name {
    color: #e2e8f0;
}

:root[data-theme="dark"] .tab-button {
    color: #a0aec0;
}

:root[data-theme="dark"] .tab-button.active {
    color: #667eea;
}

:root[data-theme="dark"] .your-rank {
    background: rgba(102, 126, 234, 0.2);
}

:root[data-theme="dark"] .your-rank h4 {
    color: #e2e8f0;
}

/* Responsive leaderboard styles */
@media (max-width: 768px) {
    .leaderboard-tabs {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .tab-button {
        padding: 0.75rem 1rem;
        border-radius: 8px;
        border: 1px solid #dee2e6;
    }
    
    .tab-button.active {
        background: #667eea;
        color: white;
        border-color: #667eea;
    }
    
    .leaderboard-item {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .leaderboard-rank {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .rank-info {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    .stats-button, .reset-button, .leaderboard-button {
        padding: 0.3rem 0.6rem;
        font-size: 0.75rem;
    }
    
    /* Single question interface mobile styles */
    .progress-container {
        margin: 1rem auto;
        padding: 0 1rem;
    }
    
    .single-question-container {
        padding: 0 1rem 1rem 1rem;
    }
    
    .question-navigation {
        flex-direction: column;
        gap: 1rem;
        padding: 0 1rem;
    }
    
    .nav-button {
        min-width: 100px;
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
    
    .category-dots {
        order: -1;
        margin-bottom: 1rem;
    }
    
    .category-dot {
        width: 10px;
        height: 10px;
    }
    
    /* Answer input mobile styles */
    .answer-input {
        font-size: 1rem;
        padding: 0.875rem 1.25rem;
    }
    
    .submit-button {
        font-size: 1rem;
        padding: 0.875rem 1.5rem;
    }
    
    .options-container {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .option-button {
        padding: 1rem 1.25rem;
        font-size: 0.95rem;
        min-height: 50px;
    }
    
    .result {
        flex-direction: column;
        text-align: center;
        padding: 1.25rem;
    }
    
    .result-icon {
        font-size: 1.5rem;
    }
    
    .result-title {
        font-size: 1.1rem;
    }
}

/* Notification System */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    max-width: 400px;
}

.notification {
    background: white;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-left: 4px solid #667eea;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideIn 0.3s ease-out;
    position: relative;
    word-wrap: break-word;
}

.notification.error {
    border-left-color: #e74c3c;
    background: #fff5f5;
}

.notification.warning {
    border-left-color: #f39c12;
    background: #fffdf5;
}

.notification.success {
    border-left-color: #27ae60;
    background: #f8fff8;
}

.notification.info {
    border-left-color: #3498db;
    background: #f8fbff;
}

.notification-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.notification-content {
    flex: 1;
}

.notification-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: #333;
}

.notification-message {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.4;
}

.notification-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #999;
    cursor: pointer;
    padding: 0;
    margin-left: 0.5rem;
    flex-shrink: 0;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.notification-close:hover {
    opacity: 1;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Loading States */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(2px);
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-inline {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    gap: 0.75rem;
    color: rgba(255, 255, 255, 0.8);
}

.loading-inline .loading-spinner {
    width: 24px;
    height: 24px;
    border-width: 2px;
}

/* Dark mode notification styles */
.dark-mode .notification {
    background: #2c3e50;
    color: #ecf0f1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.dark-mode .notification.error {
    background: #4a2c2a;
}

.dark-mode .notification.warning {
    background: #4a3a2a;
}

.dark-mode .notification.success {
    background: #2a4a2a;
}

.dark-mode .notification.info {
    background: #2a3a4a;
}

.dark-mode .notification-title {
    color: #ecf0f1;
}

.dark-mode .notification-message {
    color: #bdc3c7;
}

/* Mobile responsive notifications */
@media (max-width: 768px) {
    .notification-container {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .notification {
        padding: 0.875rem 1rem;
        font-size: 0.9rem;
    }
    
    .notification-title {
        font-size: 0.95rem;
    }
    
    .notification-message {
        font-size: 0.85rem;
    }
}

/* Dark mode explanation styles */
.dark-mode .result-explanation {
    background: rgba(255, 255, 255, 0.05);
    border-left-color: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.8);
}

.dark-mode .result-explanation-label {
    color: rgba(255, 255, 255, 0.9);
}

/* Accessibility improvements */
/* Enhanced focus styles */
button:focus,
input:focus,
.option-button:focus,
.nav-button:focus,
.category-dot:focus {
    outline: 3px solid #667eea;
    outline-offset: 2px;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.3);
}

.dark-mode button:focus,
.dark-mode input:focus,
.dark-mode .option-button:focus,
.dark-mode .nav-button:focus,
.dark-mode .category-dot:focus {
    outline-color: #a3bffa;
    box-shadow: 0 0 0 2px rgba(163, 191, 250, 0.3);
}

/* Dark mode account modal styles */
.dark-mode .account-section h3 {
    color: #e0e0e0;
}

.dark-mode .status-label {
    color: #b0b0b0;
}

.dark-mode .status-value {
    color: #e0e0e0;
}

.dark-mode .auth-options h3 {
    color: #e0e0e0;
}

.dark-mode .auth-option-info {
    background: #3a3a3a;
    border-color: #555;
    color: #e0e0e0;
}

.dark-mode .auth-option-info h4 {
    color: #e0e0e0;
}

.dark-mode .auth-option-info li {
    color: #b0b0b0;
}

.dark-mode .auth-info {
    color: #b0b0b0;
}

.dark-mode .auth-info p {
    color: #b0b0b0;
}

.dark-mode .form-group label {
    color: #e0e0e0;
}

.dark-mode .form-group input {
    background: #3a3a3a;
    border-color: #555;
    color: #e0e0e0;
}

.dark-mode .form-group input:focus {
    border-color: #667eea;
    background: #404040;
}

.dark-mode .back-btn {
    color: #a3bffa;
    border-color: #a3bffa;
}

.dark-mode .back-btn:hover {
    background: #a3bffa;
    color: #1a1a2e;
}

.dark-mode .auth-divider::before {
    background: #555;
}

.dark-mode .auth-divider span {
    background: #2d2d2d;
    color: #b0b0b0;
}

/* Dark mode stats modal styles */
.dark-mode .stat-title {
    color: #b0b0b0;
}

.dark-mode .category-breakdown h3 {
    color: #e0e0e0;
}

.dark-mode .recent-activity h3 {
    color: #e0e0e0;
}

.dark-mode .activity-item {
    background: #3a3a3a;
    border-color: #555;
    color: #e0e0e0;
}

.dark-mode .activity-date {
    color: #b0b0b0;
}

.dark-mode .activity-category {
    color: #a3bffa;
}

.dark-mode .activity-result {
    color: #e0e0e0;
}

.dark-mode .category-stats-grid .category-stat-item {
    background: #3a3a3a;
    border-color: #555;
    color: #e0e0e0;
}

.dark-mode .category-stat-item h4 {
    color: #e0e0e0;
}

.dark-mode .category-stat-item .stat {
    color: #b0b0b0;
}

/* Dark mode leaderboard styles */
.dark-mode .leaderboard-item {
    background: #3a3a3a;
    border-color: #555;
    color: #e0e0e0;
}

.dark-mode .leaderboard-rank {
    color: #a3bffa;
}

.dark-mode .leaderboard-name {
    color: #e0e0e0;
}

.dark-mode .leaderboard-score {
    color: #e0e0e0;
}

.dark-mode .tab-button {
    background: #3a3a3a;
    color: #b0b0b0;
    border-color: #555;
}

.dark-mode .tab-button.active {
    background: #667eea;
    color: white;
}

.dark-mode .tab-button:hover {
    background: #505050;
    color: #e0e0e0;
}

/* Skip link for screen readers */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #667eea;
    color: white;
    padding: 8px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: bold;
    z-index: 10000;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 6px;
}

/* Screen reader only content */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus trap for modals */
.modal[aria-hidden="false"] {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
}

/* Better keyboard navigation for category dots */
.category-dot {
    cursor: pointer;
    transition: all 0.2s ease;
}

.category-dot:hover,
.category-dot:focus {
    transform: scale(1.2);
}

/* Improved button states */
button:disabled,
.nav-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

button:disabled:focus,
.nav-button:disabled:focus {
    outline: 2px solid #ccc;
    box-shadow: none;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .option-button,
    .nav-button,
    .submit-button {
        border: 2px solid;
    }
    
    .result {
        border: 2px solid;
    }
    
    button:focus,
    input:focus {
        outline: 4px solid;
        outline-offset: 2px;
    }
}

/* Authentication styles */
.account-button {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}

.account-button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.auth-actions {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.auth-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    margin-bottom: 0.5rem;
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.auth-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.logout-btn {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

.logout-btn:hover {
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

.auth-form-container {
    max-width: 400px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
}

.form-group input {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-actions {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.auth-divider {
    text-align: center;
    margin: 1.5rem 0;
    position: relative;
}

.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #ddd;
}

.auth-divider span {
    background: white;
    padding: 0 1rem;
    color: #666;
    font-size: 0.9rem;
}

.anonymous-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    width: 100%;
    transition: background-color 0.3s ease;
}

.anonymous-btn:hover {
    background: #5a6268;
}

.auth-info {
    margin-top: 1rem;
    font-size: 0.85rem;
    color: #666;
    line-height: 1.4;
}

.auth-info p {
    margin-bottom: 0.5rem;
}

.status-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    padding: 0.3rem 0;
}

.status-label {
    font-weight: 600;
    color: #666;
}

.status-value {
    font-weight: 500;
    color: #333;
}

.account-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #eee;
}

.account-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.account-section h3 {
    margin-bottom: 1rem;
    color: #333;
    font-size: 1.1rem;
}

.account-section ul {
    margin-left: 1rem;
}

.account-section li {
    margin-bottom: 0.3rem;
}

/* New authentication options styles */
.auth-options {
    margin-bottom: 2rem;
}

.auth-options h3 {
    margin-bottom: 1.5rem;
    text-align: center;
    color: #333;
    font-size: 1.1rem;
}

.google-signin-btn {
    background: white;
    color: #333;
    border: 1px solid #dadce0;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    width: 100%;
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    transition: all 0.3s ease;
    font-weight: 500;
}

.google-signin-btn:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

.google-signin-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.email-signin-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    width: 100%;
    margin-bottom: 0.8rem;
    transition: all 0.3s ease;
    font-weight: 500;
}

.email-signin-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.anonymous-signin-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    width: 100%;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
    font-weight: 500;
}

.anonymous-signin-btn:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

.anonymous-signin-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.back-btn {
    background: transparent;
    color: #667eea;
    border: 1px solid #667eea;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: #667eea;
    color: white;
}

.auth-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1rem;
}

.auth-option-info {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.auth-option-info h4 {
    margin-bottom: 0.8rem;
    font-size: 0.95rem;
    color: #333;
}

.auth-option-info ul {
    margin: 0;
    padding-left: 1rem;
}

.auth-option-info li {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 0.3rem;
}

@media (max-width: 600px) {
    .auth-comparison {
        grid-template-columns: 1fr;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .notification {
        animation: none;
    }
    
    .category-dot:hover,
    .category-dot:focus {
        transform: none;
    }
}