@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700&family=Ninja+Naruto&family=Comic+Neue:wght@400;700&family=Quicksand:wght@400;700&family=Roboto:wght@400;700&display=swap');

/* CSS Variables for Theme System */
:root {
    /* Ninja Theme (default) */
    --bg-color: #1A1A1A;
    --text-color: #E0E0E0;
    --container-bg: rgba(40, 40, 40, 0.8);
    --container-border: #8B0000;
    --primary-color: #8B0000;
    --primary-gradient: linear-gradient(to right, #8B0000, #B22222);
    --heading-font: 'Ninja Naruto', cursive;
    --body-font: 'Montserrat', sans-serif;
    --board-visible: block;
    --board-bg: linear-gradient(180deg, #8B4513 0%, #A0522D 10%, #8B4513 20%, #CD853F 30%, #8B4513 40%, #A0522D 50%, #8B4513 60%, #CD853F 70%, #A0522D 80%, #8B4513 90%, #654321 100%);
    --board-border: #654321;
}

/* Print Friendly Theme */
body.theme-print {
    --bg-color: #FFFFFF;
    --text-color: #000000;
    --container-bg: #FFFFFF;
    --container-border: #CCCCCC;
    --primary-color: #007bff;
    --primary-gradient: linear-gradient(to right, #007bff, #0056b3);
    --heading-font: 'Montserrat', sans-serif;
    --board-visible: none;
    --board-bg: #F8F9FA;
    --board-border: #DEE2E6;
}
body.theme-print .main-nav {
    background: #FFFFFF;
}

body {
    font-family: var(--body-font);
    line-height: 1.6;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
}

/* Hero Section */
.hero-section {
    position: relative;
    background: linear-gradient(135deg, rgba(139, 0, 0, 0.3) 0%, rgba(178, 34, 34, 0.2) 100%);
    border: 2px solid var(--container-border);
    border-radius: 12px;
    padding: 60px 40px;
    margin: 0 0 30px 0;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    overflow: visible;
}

.hero-section.hero-hidden {
    display: none !important;
}

/* Beta Notice */
.beta-notice {
    background: #F5C2C2;
    color: #8B0000;
    padding: 12px 20px;
    border-radius: 50px;
    font-size: 0.85em;
    font-weight: 600;
    display: inline-block;
    margin-top: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    font-family: var(--body-font);
    text-align: center;
    line-height: 1.4;
    max-width: 400px;
}

.beta-feedback-link {
    color: #0066cc;
    text-decoration: underline;
    cursor: pointer;
    transition: color 0.2s ease;
    font-weight: 600;
}

.beta-feedback-link:hover {
    color: #0052a3;
    text-decoration: underline;
}

.hero-math-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0.15;
    pointer-events: none;
    background-image: 
        repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(139, 0, 0, 0.1) 2px, rgba(139, 0, 0, 0.1) 4px),
        repeating-linear-gradient(90deg, transparent, transparent 2px, rgba(139, 0, 0, 0.1) 2px, rgba(139, 0, 0, 0.1) 4px);
}

.hero-math-background::before {
    content: '';
    /* Math problems removed */
}

.hero-math-background::after {
    content: '';
    /* Math problems removed */
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 700px;
    margin: 0 auto;
}

.hero-title {
    font-size: 3.5em;
    margin-bottom: 15px;
    color: var(--primary-color);
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.7);
}

.hero-subtitle {
    font-size: 1.8em;
    margin-bottom: 15px;
    color: var(--text-color);
    font-weight: 600;
}

.hero-description {
    font-size: 1.2em;
    margin-bottom: 5px;
    color: rgba(224, 224, 224, 0.9);
    line-height: 1.8;
}

.hero-description2 {
    font-size: 3em;
    margin-top: 0;
    margin-bottom: 30px;
    color: var(--primary-color);
    font-weight: bold;
    text-align: center;
    letter-spacing: 0.2em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    font-family: var(--heading-font);
}

.hero-cta-btn {
    background: var(--primary-gradient);
    border: 3px solid var(--primary-color);
    color: white;
    font-size: 1.5em;
    font-weight: bold;
    padding: 18px 40px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(139, 0, 0, 0.4);
    font-family: var(--body-font);
    margin-bottom: 15px;
}

/* About page hero (same content, compact) */
.about-hero {
    position: relative;
    background: linear-gradient(135deg, rgba(139, 0, 0, 0.25) 0%, rgba(178, 34, 34, 0.15) 100%);
    border: 2px solid var(--container-border);
    border-radius: 12px;
    padding: 40px 24px;
    margin: 0 0 28px 0;
    text-align: center;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    overflow: hidden;
}

.about-hero-math-bg {
    position: absolute;
    inset: 0;
    opacity: 0.12;
    pointer-events: none;
    background-image:
        repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(139, 0, 0, 0.1) 2px, rgba(139, 0, 0, 0.1) 4px),
        repeating-linear-gradient(90deg, transparent, transparent 2px, rgba(139, 0, 0, 0.1) 2px, rgba(139, 0, 0, 0.1) 4px);
}

.about-hero-inner {
    position: relative;
    z-index: 1;
    max-width: 600px;
    margin: 0 auto;
}

.about-hero-title {
    font-size: 2.2em;
    margin-bottom: 10px;
    color: var(--primary-color);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.6);
}

.about-hero-subtitle {
    font-size: 1.35em;
    margin-bottom: 8px;
    color: var(--text-color);
    font-weight: 600;
}

.about-hero-desc {
    font-size: 1.05em;
    margin-bottom: 4px;
    color: rgba(224, 224, 224, 0.9);
    line-height: 1.6;
}

.about-hero-ops {
    font-size: 2em;
    margin-top: 0;
    margin-bottom: 18px;
    color: var(--primary-color);
    font-weight: bold;
    letter-spacing: 0.15em;
    font-family: var(--heading-font);
}

.about-hero-cta {
    font-size: 1.2em;
    padding: 14px 28px;
    margin-bottom: 12px;
}

.about-hero-hint {
    font-size: 0.9em;
    opacity: 0.9;
    margin-bottom: 0;
}

.about-hero-beta {
    margin-top: 14px;
    font-size: 0.8em;
    padding: 10px 16px;
}

.hero-cta-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(139, 0, 0, 0.6);
    background: linear-gradient(to right, #B22222, #DC143C);
}

.hero-signup-hint {
    font-size: 0.95em;
    color: rgba(224, 224, 224, 0.7);
    font-style: italic;
    margin-top: 10px;
}

.hero-signup-link {
    margin-top: 15px;
}

.hero-signup-link a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9em;
    font-weight: 600;
    transition: all 0.2s ease;
}

.hero-signup-link a:hover {
    text-decoration: underline;
    color: #B22222;
}

.hero-demo-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 1.1em;
    font-weight: 600;
    padding: 14px 30px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--body-font);
    margin-top: 15px;
    display: inline-block;
}

.hero-demo-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.05);
}

/* Demo Modal */
.demo-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-in;
}

.demo-modal-content {
    background: #282828;
    border: 2px solid var(--container-border);
    border-radius: 12px;
    padding: 40px;
    max-width: 600px;
    width: 90%;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease-out;
}

/* Print theme - white background for demo modal */
body.theme-print .demo-modal-content {
    background: #FFFFFF;
}

.demo-modal-content h3 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 1.8em;
    color: var(--primary-color);
}

.demo-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .main-nav-inner {
        padding-right: 140px;
        gap: 12px;
    }
    .main-nav-brand {
        font-size: 1.25em;
    }
    .main-nav-tabs .tab-btn {
        padding: 8px 12px;
        font-size: 14px;
    }
    .demo-options {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .demo-modal-content {
        padding: 25px;
        width: 95%;
    }
}

.demo-option-btn {
    background: rgba(40, 40, 40, 0.8);
    border: 2px solid var(--container-border);
    border-radius: 10px;
    padding: 20px 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: var(--text-color);
}

.demo-option-btn:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
    background: rgba(139, 0, 0, 0.2);
    box-shadow: 0 5px 20px rgba(139, 0, 0, 0.3);
}

.demo-option-title {
    font-size: 1.5em;
    font-weight: bold;
    color: var(--primary-color);
    font-family: var(--heading-font);
}

.demo-option-operations {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
}

.demo-option-operation {
    width: 50px;
    height: 50px;
    border: 2px solid #8B0000;
    background: rgba(40, 40, 40, 0.8);
    border-radius: 8px;
    font-size: 24px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #E0E0E0;
    font-family: 'Montserrat', sans-serif;
    box-shadow: 0 2px 4px rgba(139, 0, 0, 0.3);
}

.demo-option-details {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
    align-items: center;
}

.demo-option-row {
    font-size: 0.9em;
    text-align: center;
    opacity: 0.9;
    width: 100%;
    padding: 2px 0;
}

.demo-customize-btn {
    display: block;
    width: 100%;
    margin-top: 10px;
    padding: 12px 20px;
    background: rgba(40, 40, 40, 0.8);
    border: 2px solid var(--container-border);
    border-radius: 10px;
    color: var(--text-color);
    font-size: 1em;
    cursor: pointer;
    transition: all 0.2s ease;
}

.demo-customize-btn:hover {
    border-color: var(--primary-color);
    background: rgba(139, 0, 0, 0.2);
}

.demo-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(139, 0, 0, 0.3);
    border: 1px solid rgba(139, 0, 0, 0.5);
    color: var(--text-color);
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2em;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.demo-modal-close:hover {
    background: rgba(139, 0, 0, 0.5);
    transform: scale(1.1);
}

/* Top-Right Auth Container */
.auth-container-top-right {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

/* Auth Container in Hero Section - Top Right */
.auth-container-hero-top-right {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

/* Auth Container - Fixed Top Right of Viewport */
.auth-container-fixed-top-right {
    position: fixed;
    top: 14px;
    right: 14px;
    z-index: 1001;
}

/* Fixed main nav bar (ESPN-style: one bar, always visible) */
.main-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: #282828; /* solid, no transparency */
    border-bottom: 2px solid var(--container-border);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.main-nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 20px;
    padding-right: 220px; /* leave room for auth widget */
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.main-nav-brand {
    font-family: var(--heading-font);
    font-size: 1.5em;
    font-weight: 700;
    color: var(--primary-color);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
}

.main-nav-tabs {
    display: flex;
    align-items: center;
    gap: 4px;
}

.main-nav-tabs .tab-btn {
    margin-bottom: 0;
    padding: 10px 18px;
    font-size: 15px;
    border-bottom: none;
    border-radius: 6px;
}

.main-nav-tabs .tab-btn:hover {
    background: rgba(139, 0, 0, 0.2);
    color: #fff;
}

.main-nav-tabs .tab-btn.active {
    background: rgba(139, 0, 0, 0.35);
    border-radius: 6px;
    color: #fff;
}

/* Content starts below fixed nav */
.main-content-wrap {
    padding-top: 56px;
}

.auth-container-top-right .auth-user-info,
.auth-container-hero-top-right .auth-user-info,
.auth-container-fixed-top-right .auth-user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(40, 40, 40, 0.9);
    padding: 8px 15px;
    border-radius: 8px;
    border: 1px solid rgba(139, 0, 0, 0.4);
}

.auth-container-top-right .user-greeting,
.auth-container-hero-top-right .user-greeting,
.auth-container-fixed-top-right .user-greeting {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9em;
}

.auth-container-top-right .user-icon,
.auth-container-hero-top-right .user-icon,
.auth-container-fixed-top-right .user-icon {
    font-size: 1.2em;
}

.auth-container-top-right .user-name,
.auth-container-hero-top-right .user-name,
.auth-container-fixed-top-right .user-name {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.auth-container-top-right .sign-out-btn,
.auth-container-hero-top-right .sign-out-btn,
.auth-container-fixed-top-right .sign-out-btn {
    padding: 6px 12px;
    font-size: 0.85em;
    background: rgba(139, 0, 0, 0.3);
    border: 1px solid rgba(139, 0, 0, 0.5);
    color: var(--text-color);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.auth-container-top-right .sign-out-btn:hover,
.auth-container-hero-top-right .sign-out-btn:hover,
.auth-container-fixed-top-right .sign-out-btn:hover {
    background: rgba(139, 0, 0, 0.5);
}

/* Compact Auth Forms for Top-Right */
.auth-container-top-right .auth-forms-container,
.auth-container-hero-top-right .auth-forms-container,
.auth-container-fixed-top-right .auth-forms-container {
    display: flex;
    gap: 2px;
    align-items: flex-start;
    justify-content: flex-end;
}

.auth-toggle-btn {
    padding: 8px 16px;
    font-size: 0.9em;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--body-font);
    white-space: nowrap;
}

.auth-toggle-btn.primary {
    background: var(--primary-gradient);
    color: white;
    border: 2px solid var(--primary-color);
    box-shadow: 0 2px 6px rgba(139, 0, 0, 0.3);
}

.auth-toggle-btn.primary:hover {
    background: linear-gradient(to right, #B22222, #DC143C);
    transform: scale(1.05);
    box-shadow: 0 4px 10px rgba(139, 0, 0, 0.4);
}

.auth-toggle-btn.secondary {
    background: rgba(139, 0, 0, 0.2);
    color: var(--text-color);
    border: 1px solid rgba(139, 0, 0, 0.4);
    opacity: 0.8;
}

.auth-toggle-btn.secondary:hover {
    background: rgba(139, 0, 0, 0.3);
    opacity: 1;
    transform: scale(1.05);
}

.auth-container-top-right .auth-section,
.auth-container-hero-top-right .auth-section,
.auth-container-fixed-top-right .auth-section {
    background: transparent;
    padding: 0;
    border-radius: 8px;
    border: none;
    min-width: auto;
}

/* Light tan background for auth form containers when visible */
.auth-container-top-right .auth-form-container,
.auth-container-hero-top-right .auth-form-container,
.auth-container-fixed-top-right .auth-form-container,
.auth-container-top-right #signUpFormContainer,
.auth-container-hero-top-right #signUpFormContainer,
.auth-container-fixed-top-right #signUpFormContainer,
.auth-container-top-right #signInFormContainer,
.auth-container-hero-top-right #signInFormContainer,
.auth-container-fixed-top-right #signInFormContainer {
    background: #f5e6d3;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid rgba(139, 0, 0, 0.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    margin-top: 10px;
    min-width: 280px;
}

.auth-container-top-right .auth-section h3,
.auth-container-hero-top-right .auth-section h3,
.auth-container-fixed-top-right .auth-section h3 {
    font-size: 1em;
    margin: 0 0 10px 0;
    color: var(--primary-color);
}

/* Text colors for form elements on light tan background */
.auth-container-top-right #signUpFormContainer h3,
.auth-container-hero-top-right #signUpFormContainer h3,
.auth-container-fixed-top-right #signUpFormContainer h3,
.auth-container-top-right #signInFormContainer h3,
.auth-container-hero-top-right #signInFormContainer h3,
.auth-container-fixed-top-right #signInFormContainer h3 {
    color: #8B0000;
    font-weight: bold;
}

.auth-container-top-right #signUpFormContainer .form-group label,
.auth-container-hero-top-right #signUpFormContainer .form-group label,
.auth-container-fixed-top-right #signUpFormContainer .form-group label,
.auth-container-top-right #signInFormContainer .form-group label,
.auth-container-hero-top-right #signInFormContainer .form-group label,
.auth-container-fixed-top-right #signInFormContainer .form-group label {
    color: #333;
}

.auth-container-top-right #signUpFormContainer .form-group input,
.auth-container-hero-top-right #signUpFormContainer .form-group input,
.auth-container-fixed-top-right #signUpFormContainer .form-group input,
.auth-container-top-right #signInFormContainer .form-group input,
.auth-container-hero-top-right #signInFormContainer .form-group input,
.auth-container-fixed-top-right #signInFormContainer .form-group input {
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    border: 1px solid rgba(139, 0, 0, 0.3);
}

.auth-container-top-right #signUpFormContainer .form-group input:focus,
.auth-container-hero-top-right #signUpFormContainer .form-group input:focus,
.auth-container-fixed-top-right #signUpFormContainer .form-group input:focus,
.auth-container-top-right #signInFormContainer .form-group input:focus,
.auth-container-hero-top-right #signInFormContainer .form-group input:focus,
.auth-container-fixed-top-right #signInFormContainer .form-group input:focus {
    background: #fff;
    border-color: rgba(139, 0, 0, 0.6);
}

.auth-container-top-right #signUpFormContainer .auth-switch,
.auth-container-hero-top-right #signUpFormContainer .auth-switch,
.auth-container-fixed-top-right #signUpFormContainer .auth-switch,
.auth-container-top-right #signInFormContainer .auth-switch,
.auth-container-hero-top-right #signInFormContainer .auth-switch,
.auth-container-fixed-top-right #signInFormContainer .auth-switch {
    color: #333;
}

.auth-container-top-right .auth-form,
.auth-container-hero-top-right .auth-form,
.auth-container-fixed-top-right .auth-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.auth-container-top-right .form-group,
.auth-container-hero-top-right .form-group,
.auth-container-fixed-top-right .form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.auth-container-top-right .form-group label,
.auth-container-hero-top-right .form-group label,
.auth-container-fixed-top-right .form-group label {
    font-size: 0.8em;
    color: rgba(224, 224, 224, 0.8);
}

.auth-container-top-right .form-group input,
.auth-container-hero-top-right .form-group input,
.auth-container-fixed-top-right .form-group input {
    padding: 6px 8px;
    font-size: 0.85em;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(139, 0, 0, 0.3);
    border-radius: 4px;
    color: var(--text-color);
}

.auth-container-top-right .auth-btn,
.auth-container-hero-top-right .auth-btn,
.auth-container-fixed-top-right .auth-btn {
    padding: 6px 12px;
    font-size: 0.85em;
    margin-top: 5px;
}

.auth-container-top-right .auth-switch,
.auth-container-hero-top-right .auth-switch,
.auth-container-fixed-top-right .auth-switch {
    font-size: 0.75em;
    margin-top: 8px;
    text-align: center;
}

.auth-container-top-right .auth-switch a,
.auth-container-hero-top-right .auth-switch a,
.auth-container-fixed-top-right .auth-switch a {
    color: var(--primary-color);
    text-decoration: underline;
}

.auth-container-top-right .error-message,
.auth-container-hero-top-right .error-message,
.auth-container-fixed-top-right .error-message {
    font-size: 0.75em;
    padding: 4px;
    margin-top: 4px;
}

.container {
    background: var(--container-bg);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    margin: 20px 0;
    border: 2px solid var(--container-border);
    position: relative; /* For absolute positioning of auth container */
}

h1, h2 {
    font-family: var(--heading-font);
    color: var(--primary-color);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    margin-bottom: 20px;
}

.tab-container {
    margin-top: 0;
}

.tab-buttons {
    display: flex;
    margin-bottom: 20px;
}

.tab-btn {
    background: none;
    border: none;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 500;
    color: #E0E0E0; /* Light gray for readability */
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    font-family: 'Montserrat', sans-serif;
}

.tab-btn:hover {
    color: #8B0000; /* Ninja red on hover */
    background: rgba(139, 0, 0, 0.1); /* Subtle red background */
}

.tab-btn.active {
    color: #8B0000; /* Ninja red for active tab */
    border-bottom-color: #8B0000;
    background: rgba(139, 0, 0, 0.1); /* Subtle red background */
}

.tab-content {
    display: none;
}

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

form {
    display: grid;
    gap: 10px;
}

fieldset {
    border: none;
    padding: 10px 0;
    margin: 15px 0;
    color: #E0E0E0; /* Light text for dark mode */
}

.range-fieldset-with-tip {
    position: relative;
}

.range-fieldset-content {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.range-fieldset-main {
    flex: 1;
}

.keyboard-tip {
    background: rgba(139, 0, 0, 0.15);
    border: 1px solid rgba(139, 0, 0, 0.3);
    border-radius: 8px;
    padding: 12px 16px;
    margin-top: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 280px;
    max-width: 320px;
    flex-shrink: 0;
}

.tip-icon {
    font-size: 1.2em;
    flex-shrink: 0;
}

.tip-text {
    font-size: 0.9em;
    color: var(--text-color);
    line-height: 1.4;
}

.tip-text kbd {
    background: rgba(139, 0, 0, 0.3);
    border: 1px solid rgba(139, 0, 0, 0.5);
    border-radius: 4px;
    padding: 2px 6px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    font-weight: bold;
    color: var(--text-color);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    display: inline-block;
    margin: 0 2px;
}

@media (max-width: 768px) {
    .range-fieldset-content {
        flex-direction: column;
    }
    
    .keyboard-tip {
        width: 100%;
        max-width: 100%;
        margin-top: 15px;
    }
}

label {
    display: block;
    color: #E0E0E0; /* Light text for dark mode */
}

legend {
    font-weight: 600;
    color: #E0E0E0; /* Light text for dark mode */
    margin-bottom: 8px;
    font-size: 14px;
    font-family: 'Montserrat', sans-serif; /* Consistent font */
}

#problemsGrid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.problem {
    padding: 15px;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    background: var(--board-bg);
    background-size: 100% 20px;
    border: 3px solid var(--board-border);
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.3),
        0 4px 6px rgba(0, 0, 0, 0.4);
    color: #FFF;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

/* Print Friendly - hide board texture */
body.theme-print .problem {
    background: #F8F9FA;
    border: 2px solid #DEE2E6;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    color: #333;
    text-shadow: none;
}

body.theme-print .board-shatter::before {
    display: none; /* No shuriken in print mode */
}

.problem input {
    width: 100px;
    margin-left: 0;
    margin-top: 8px;
    border: 2px solid #8B0000; /* Ninja red border */
    border-radius: 4px;
    background: rgba(40, 40, 40, 0.8); /* Dark ninja background */
    color: #E0E0E0; /* Light text */
    font-family: 'Montserrat', sans-serif;
    padding: 5px;
    text-align: center;
    font-size: 16px;
    font-weight: bold;
    display: block;
}

#timer {
    font-weight: bold;
    margin: 10px 0;
    color: #8B0000; /* Ninja red timer */
    font-size: 18px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

button {
    padding: 12px 24px;
    background: linear-gradient(45deg, #007bff, #0056b3);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

button:hover {
    background: linear-gradient(45deg, #0056b3, #004085);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

button:active {
    transform: translateY(0);
}

.start-timer-btn {
    background: linear-gradient(to right, #8B0000, #B22222) !important; /* Red ninja gradient */
    color: white !important;
    border: 2px solid #8B0000 !important;
    font-weight: bold !important;
    font-size: 16px !important;
    padding: 12px 24px !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 2px 4px rgba(139, 0, 0, 0.3) !important;
}

.start-timer-btn:hover {
    background: linear-gradient(to right, #B22222, #DC143C) !important; /* Lighter red gradient on hover */
    border-color: #B22222 !important;
    transform: scale(1.05) !important; /* Ninja agility hover effect */
    box-shadow: 0 4px 8px rgba(139, 0, 0, 0.4) !important;
}

.print-btn {
    background: #6c757d !important;
    color: white !important;
    border: 2px solid #6c757d !important;
    font-weight: 500 !important;
    font-size: 14px !important;
    padding: 8px 16px !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    margin-left: 10px !important;
}

.customize-btn {
    background: rgba(139, 0, 0, 0.2) !important;
    color: var(--text-color) !important;
    border: 2px solid rgba(139, 0, 0, 0.4) !important;
    font-weight: 500 !important;
    font-size: 14px !important;
    padding: 8px 16px !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    font-family: var(--body-font) !important;
}

.customize-btn:hover {
    background: rgba(139, 0, 0, 0.3) !important;
    border-color: rgba(139, 0, 0, 0.6) !important;
    transform: translateY(-1px);
}

.retake-btn {
    background: #17a2b8 !important; /* Teal */
    color: white !important;
    border: 2px solid #17a2b8 !important;
    font-weight: 500 !important;
    font-size: 14px !important;
    padding: 8px 16px !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    margin-left: 10px !important;
}

.retake-btn:hover {
    background: #138496 !important;
    border-color: #138496 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(23, 162, 184, 0.3) !important;
}

.print-btn:hover {
    background: #5a6268 !important;
    border-color: #5a6268 !important;
    transform: translateY(-1px) !important;
}

.operation-buttons {
    display: flex;
    gap: 8px;
    margin: 10px 0;
}

.operation-btn {
    width: 50px;
    height: 50px;
    border: 2px solid #8B0000; /* Ninja red border */
    background: rgba(40, 40, 40, 0.8); /* Dark ninja background */
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #E0E0E0; /* Light text */
    font-family: 'Montserrat', sans-serif;
    font-size: 16px;
}

.operation-btn:hover {
    border-color: #B22222; /* Lighter red on hover */
    background: rgba(139, 0, 0, 0.2); /* Subtle red background */
    transform: scale(1.05); /* Ninja agility hover effect */
    box-shadow: 0 2px 4px rgba(139, 0, 0, 0.3);
}

.operation-btn.active {
    background: linear-gradient(to right, #8B0000, #B22222); /* Red ninja gradient */
    border-color: #8B0000;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(139, 0, 0, 0.3);
}

.operation-btn:active {
    transform: translateY(0);
}

.problem-count-buttons {
    display: flex;
    gap: 8px;
    margin: 10px 0;
}

.count-btn {
    width: 50px;
    height: 50px;
    border: 2px solid #ddd;
    background: white;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-family: 'Montserrat', sans-serif;
}

.count-btn:hover {
    border-color: #007bff;
    background: #f8f9fa;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.count-btn.active {
    background: #007bff;
    border-color: #007bff;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,123,255,0.3);
}

.count-btn:active {
    transform: translateY(0);
}

#customCountInput {
    margin-top: 10px;
}

#customCountInput input {
    width: 50px;
    height: 50px;
    padding: 0;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 12px;
    text-align: center;
    font-weight: bold;
}

#customCountInput input:focus {
    border-color: #007bff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
}

.range-selector {
    position: relative;
    display: inline-block;
}

.range-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 200px;
    height: 50px;
    padding: 12px 16px;
    border: 2px solid #ddd;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 16px;
    font-weight: bold;
    color: #333 !important;
    margin-bottom: 15px;
    font-family: 'Montserrat', sans-serif;
}

#rangeDisplay, #rangeDisplayB {
    color: #333 !important;
    font-size: 16px !important;
    font-weight: bold !important;
    display: inline !important;
    visibility: visible !important;
    font-family: 'Montserrat', sans-serif !important;
}

.range-btn:hover {
    border-color: #007bff;
    background: #f8f9fa;
}

.dropdown-arrow {
    font-size: 12px;
    color: #666;
    transition: transform 0.2s ease;
}

.range-btn.open .dropdown-arrow {
    transform: rotate(180deg);
}

.range-popup {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
    background: white;
    border: 2px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    margin-top: 4px;
    min-width: 300px;
}

.range-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
    padding: 16px;
}

.range-item {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    background: white;
    color: #333;
}

.range-item:hover {
    border-color: #007bff;
    background: #f8f9fa;
}

.range-item.selected {
    background: #007bff;
    border-color: #007bff;
    color: white;
}

.range-item.range-start {
    background: #003d82;
    border-color: #003d82;
    color: white;
}

.range-item.range-end {
    background: #003d82;
    border-color: #003d82;
    color: white;
}

.range-instructions {
    padding: 8px 16px;
    background: #f8f9fa;
    border-top: 1px solid #ddd;
    font-size: 12px;
    color: #666;
    text-align: center;
}

.range-toggle {
    margin: 20px 0;
}

.toggle-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.toggle-label input[type="checkbox"] {
    display: none;
}

.toggle-slider {
    position: relative;
    width: 50px;
    height: 24px;
    background: #ccc;
    border-radius: 12px;
    margin-right: 12px;
    transition: background 0.3s ease;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.toggle-label input[type="checkbox"]:checked + .toggle-slider {
    background: #007bff;
}

.toggle-label input[type="checkbox"]:checked + .toggle-slider::before {
    transform: translateX(26px);
}

.toggle-text {
    user-select: none;
    color: #E0E0E0; /* Light text for dark mode */
}

/* Theme and Font Selector Buttons */
.theme-buttons, .font-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 10px 0;
}

.theme-btn, .font-btn {
    padding: 10px 20px;
    border: 2px solid var(--primary-color);
    background: rgba(40, 40, 40, 0.8);
    color: #E0E0E0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 500;
}

.theme-btn:hover, .font-btn:hover {
    background: rgba(139, 0, 0, 0.2);
    transform: translateY(-1px);
}

.theme-btn.active, .font-btn.active {
    background: var(--primary-gradient);
    border-color: var(--primary-color);
    color: white;
    box-shadow: 0 2px 4px rgba(139, 0, 0, 0.3);
}

/* Print Friendly theme button styles */
body.theme-print .theme-btn, 
body.theme-print .font-btn {
    border-color: #007bff;
    background: white;
    color: #333;
}

body.theme-print .theme-btn:hover, 
body.theme-print .font-btn:hover {
    background: #e7f3ff;
}

body.theme-print .theme-btn.active, 
body.theme-print .font-btn.active {
    background: linear-gradient(to right, #007bff, #0056b3);
    color: white;
}

.timer-options {
    margin: 10px 0;
    padding: 8px 0;
}

.timer-options .toggle-label {
    font-size: 14px;
    color: #333;
}

#secondRangeSelector {
    margin-top: 15px;
}

#secondRangeSelector label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

@media print {
    .main-nav {
        display: none !important;
    }
    .main-content-wrap {
        padding-top: 0 !important;
    }
    @page {
        margin: 0.5in;
        size: letter;
    }
    
    .problem {
        background: none !important;
        border: 1px solid #333 !important;
        box-shadow: none !important;
        color: #000 !important;
        text-shadow: none !important;
    }
    
    html, body {
        height: 100%;
        margin: 0;
        padding: 0;
        color: black;
        background: white;
    }
    
    form, #startTimer, #gradeButton, #timer, button {
        display: none !important;
    }
    
    #results {
        display: block !important;
        margin-top: 20px;
        padding: 15px;
        border: 2px solid #333;
        background: #f0f0f0;
        page-break-inside: avoid;
    }
    
    .container {
        box-shadow: none;
        margin: 0;
        padding: 0;
        background: white;
        height: auto;
        max-height: 100vh;
        overflow: hidden;
    }
    
    #problemsSection {
        display: block;
        height: auto;
        max-height: calc(100vh - 2in);
    }
    
    #problemsSection h2 {
        margin: 0 0 10px 0;
        font-size: 16px;
    }
    
    .print-settings {
        display: none;
        margin: 0 0 15px 0;
        padding: 10px;
        border: 1px solid #ddd;
        background: #f8f9fa;
        border-radius: 4px;
        font-size: 12px;
        line-height: 1.4;
    }
    
    @media print {
        .print-settings {
            display: block !important;
            margin: 0 0 15px 0;
            padding: 8px;
            border: 1px solid #ccc;
            background: #f9f9f9;
            font-size: 11px;
            line-height: 1.3;
            border-radius: 0;
        }
    }
    
    #problemsGrid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        margin: 0;
        height: auto;
        max-height: calc(100vh - 3in);
        overflow: hidden;
    }
    
    .problem {
        border: 1px solid #ccc;
        padding: 6px;
        margin: 0;
        font-size: 12px;
        line-height: 1.2;
        height: auto;
        min-height: 20px;
    }
    
    .problem input {
        display: none;
    }
    
    .answer {
        display: none;
    }
    
    /* For print with answers */
}

/* Ninja animations */
@keyframes shurikenStrike {
    0% { 
        transform: rotate(0deg) scale(1); 
        box-shadow: 0 0 0 rgba(139, 0, 0, 0.5);
    }
    25% { 
        transform: rotate(90deg) scale(1.1); 
        box-shadow: 0 0 15px rgba(139, 0, 0, 0.8);
    }
    50% { 
        transform: rotate(180deg) scale(1.2); 
        box-shadow: 0 0 20px rgba(139, 0, 0, 1);
    }
    75% { 
        transform: rotate(270deg) scale(1.1); 
        box-shadow: 0 0 15px rgba(139, 0, 0, 0.8);
    }
    100% { 
        transform: rotate(360deg) scale(1); 
        box-shadow: 0 0 0 rgba(139, 0, 0, 0.5);
    }
}

@keyframes ninjaFadeIn {
    from { 
        opacity: 0; 
        transform: translateY(10px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

/* Shuriken slash animation - flies through and disappears! */
@keyframes shurikenSlash {
    0% {
        transform: translate(-250%, -250%) rotate(0deg) scale(1);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    48% {
        transform: translate(-10%, -10%) rotate(350deg) scale(1);
        opacity: 1;
    }
    50% {
        transform: translate(0%, 0%) rotate(360deg) scale(1);
        opacity: 0;
    }
    100% {
        transform: translate(250%, 250%) rotate(720deg) scale(1);
        opacity: 0;
    }
}

/* PATTERN 1: Four Corners + Center */
@keyframes pieceFly-TL {
    0% { transform: translate(0, 0) rotate(0deg); opacity: 1; }
    100% { transform: translate(-180px, -180px) rotate(-120deg) scale(0.5); opacity: 0; }
}

@keyframes pieceFly-TR {
    0% { transform: translate(0, 0) rotate(0deg); opacity: 1; }
    100% { transform: translate(180px, -180px) rotate(120deg) scale(0.5); opacity: 0; }
}

@keyframes pieceFly-BL {
    0% { transform: translate(0, 0) rotate(0deg); opacity: 1; }
    100% { transform: translate(-180px, 180px) rotate(-240deg) scale(0.5); opacity: 0; }
}

@keyframes pieceFly-BR {
    0% { transform: translate(0, 0) rotate(0deg); opacity: 1; }
    100% { transform: translate(180px, 180px) rotate(240deg) scale(0.5); opacity: 0; }
}

@keyframes pieceFly-MC {
    0% { transform: translate(0, 0) scale(1); opacity: 1; }
    100% { transform: translate(0, -150px) scale(0.3); opacity: 0; }
}

/* PATTERN 2: Vertical Split (Left/Right) */
@keyframes pieceFly-LEFT {
    0% { transform: translateX(0) rotate(0deg); opacity: 1; }
    100% { transform: translateX(-250px) rotate(-180deg) translateY(80px) scale(0.4); opacity: 0; }
}

@keyframes pieceFly-RIGHT {
    0% { transform: translateX(0) rotate(0deg); opacity: 1; }
    100% { transform: translateX(250px) rotate(180deg) translateY(80px) scale(0.4); opacity: 0; }
}

/* PATTERN 3: Horizontal Split (Top/Bottom) */
@keyframes pieceFly-TOP {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(-200px) rotate(-90deg) translateX(60px) scale(0.4); opacity: 0; }
}

@keyframes pieceFly-BOTTOM {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(200px) rotate(90deg) translateX(-60px) scale(0.4); opacity: 0; }
}

/* PATTERN 4: Diagonal Explosion */
@keyframes pieceFly-DIAG1 {
    0% { transform: translate(0, 0) rotate(0deg); opacity: 1; }
    100% { transform: translate(-200px, -200px) rotate(-180deg) scale(0.3); opacity: 0; }
}

@keyframes pieceFly-DIAG2 {
    0% { transform: translate(0, 0) rotate(0deg); opacity: 1; }
    100% { transform: translate(200px, 200px) rotate(180deg) scale(0.3); opacity: 0; }
}

/* PATTERN 5: Scatter in all directions */
@keyframes pieceFly-N {
    0% { transform: translate(0, 0) rotate(0deg); opacity: 1; }
    100% { transform: translate(0, -220px) rotate(45deg) scale(0.4); opacity: 0; }
}

@keyframes pieceFly-NE {
    0% { transform: translate(0, 0) rotate(0deg); opacity: 1; }
    100% { transform: translate(160px, -160px) rotate(90deg) scale(0.4); opacity: 0; }
}

@keyframes pieceFly-E {
    0% { transform: translate(0, 0) rotate(0deg); opacity: 1; }
    100% { transform: translate(220px, 0) rotate(135deg) scale(0.4); opacity: 0; }
}

@keyframes pieceFly-SE {
    0% { transform: translate(0, 0) rotate(0deg); opacity: 1; }
    100% { transform: translate(160px, 160px) rotate(180deg) scale(0.4); opacity: 0; }
}

@keyframes pieceFly-S {
    0% { transform: translate(0, 0) rotate(0deg); opacity: 1; }
    100% { transform: translate(0, 220px) rotate(225deg) scale(0.4); opacity: 0; }
}

@keyframes pieceFly-SW {
    0% { transform: translate(0, 0) rotate(0deg); opacity: 1; }
    100% { transform: translate(-160px, 160px) rotate(270deg) scale(0.4); opacity: 0; }
}

@keyframes pieceFly-W {
    0% { transform: translate(0, 0) rotate(0deg); opacity: 1; }
    100% { transform: translate(-220px, 0) rotate(315deg) scale(0.4); opacity: 0; }
}

@keyframes pieceFly-NW {
    0% { transform: translate(0, 0) rotate(0deg); opacity: 1; }
    100% { transform: translate(-160px, -160px) rotate(360deg) scale(0.4); opacity: 0; }
}

@keyframes ninjaMiss {
    0% { 
        transform: translateX(0); 
        box-shadow: 0 0 0 rgba(220, 53, 69, 0.5);
    }
    25% { 
        transform: translateX(-6px); 
        box-shadow: 0 0 12px rgba(220, 53, 69, 0.8);
    }
    50% { 
        transform: translateX(6px); 
        box-shadow: 0 0 16px rgba(220, 53, 69, 1);
    }
    75% { 
        transform: translateX(-3px); 
        box-shadow: 0 0 12px rgba(220, 53, 69, 0.8);
    }
    100% { 
        transform: translateX(0); 
        box-shadow: 0 0 0 rgba(220, 53, 69, 0.5);
    }
}

.shuriken-strike {
    animation: shurikenStrike 0.8s ease-out;
    position: relative;
    z-index: 10;
    opacity: 1 !important;
    visibility: visible !important;
}

.ninja-miss {
    animation: ninjaMiss 0.6s ease-out;
    position: relative;
    z-index: 10;
    opacity: 1 !important;
    visibility: visible !important;
}

.ninja-fade-in {
    animation: ninjaFadeIn 0.3s ease-out;
}

.board-shatter {
    position: relative;
    pointer-events: none;
}

/* Shuriken - 4-blade ninja star! */
.board-shatter::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100px;
    height: 100px;
    margin-left: -50px;
    margin-top: -50px;
    background: 
        radial-gradient(circle at center, #E8E8E8 0%, #E8E8E8 15%, transparent 15%, transparent 30%, #D3D3D3 30%, #D3D3D3 35%, transparent 35%),
        conic-gradient(from 0deg at 50% 50%, 
            transparent 0deg, 
            transparent 35deg,
            #2C2C2C 35deg, 
            #2C2C2C 55deg, 
            transparent 55deg,
            transparent 90deg),
        conic-gradient(from 90deg at 50% 50%, 
            transparent 0deg, 
            transparent 35deg,
            #2C2C2C 35deg, 
            #2C2C2C 55deg, 
            transparent 55deg,
            transparent 90deg),
        conic-gradient(from 180deg at 50% 50%, 
            transparent 0deg, 
            transparent 35deg,
            #2C2C2C 35deg, 
            #2C2C2C 55deg, 
            transparent 55deg,
            transparent 90deg),
        conic-gradient(from 270deg at 50% 50%, 
            transparent 0deg, 
            transparent 35deg,
            #2C2C2C 35deg, 
            #2C2C2C 55deg, 
            transparent 55deg,
            transparent 90deg);
    background-size: 100% 100%;
    box-shadow: 
        0 0 20px rgba(255, 255, 255, 0.5),
        0 0 40px rgba(192, 192, 192, 0.3),
        inset 0 0 10px rgba(255, 255, 255, 0.2);
    z-index: 100;
    animation: shurikenSlash 0.5s ease-out;
    pointer-events: none;
    filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.8));
}

.flying-piece {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 5;
}

.print-answers .answer {
    display: inline;
    font-weight: bold;
}

/* Level Selection Styles */
.level-track-picker {
    margin-bottom: 20px;
    padding: 12px 0;
}

.track-picker-label {
    display: block;
    font-size: 0.95em;
    color: var(--text-color);
    opacity: 0.9;
    margin-bottom: 10px;
}

.track-picker-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.track-picker-btn {
    width: 56px;
    height: 56px;
    font-size: 1.8em;
    font-weight: bold;
    border: 2px solid var(--container-border);
    border-radius: 10px;
    background: var(--container-bg);
    color: var(--text-color);
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s, background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.track-picker-btn:hover:not(.track-picker-btn-disabled) {
    border-color: var(--primary-color);
    background: rgba(139, 0, 0, 0.2);
    transform: scale(1.05);
}

.track-picker-btn.active {
    border-color: var(--primary-color);
    background: var(--primary-gradient);
    color: white;
}

.track-picker-btn-disabled {
    opacity: 0.4;
    cursor: not-allowed;
    filter: grayscale(0.6);
}

#levelsGrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.level-card {
    background: var(--container-bg);
    border: 2px solid var(--container-border);
    border-radius: 12px;
    padding: 20px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.level-card.unlocked {
    cursor: pointer;
    border-color: #28a745;
}

.level-card.unlocked:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(40, 167, 69, 0.3);
}

.level-card.locked {
    opacity: 0.6;
    border-color: #6c757d;
}

.level-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.level-header h3 {
    margin: 0;
    font-size: 1.2em;
    color: var(--text-color);
}

.level-stars {
    font-size: 1.5em;
}

.level-description {
    color: var(--text-color);
    opacity: 0.8;
    margin: 10px 0;
    font-size: 0.9em;
}

.level-range,
.level-problems {
    color: var(--text-color);
    opacity: 0.7;
    margin: 5px 0;
    font-size: 0.85em;
}

.level-start-btn {
    width: 100%;
    padding: 12px;
    margin-top: 15px;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.level-start-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(139, 0, 0, 0.4);
}

.level-locked-msg {
    text-align: center;
    color: var(--text-color);
    opacity: 0.6;
    margin-top: 15px;
    font-style: italic;
}

.level-requirements {
    margin: 15px 0;
    padding: 12px;
    background: rgba(139, 0, 0, 0.1);
    border-radius: 6px;
    border-left: 3px solid var(--primary-color);
}

.requirements-title {
    font-weight: bold;
    color: var(--text-color);
    margin-bottom: 8px;
    font-size: 0.9em;
}

.requirement-item {
    display: flex;
    align-items: center;
    margin: 6px 0;
    font-size: 0.85em;
}

.req-stars {
    min-width: 50px;
    font-size: 1.1em;
    margin-right: 10px;
}

.req-text {
    color: var(--text-color);
    opacity: 0.9;
}

/* Track Progress Bar - Top of Levels Page */
.track-progress-bar-top {
    margin: 20px 0 30px 0;
    padding: 20px;
    background: rgba(139, 0, 0, 0.1);
    border-radius: 8px;
    border: 2px solid rgba(139, 0, 0, 0.3);
}

.track-progress-label {
    font-size: 1em;
    color: var(--text-color);
    opacity: 0.9;
    margin-bottom: 15px;
    font-weight: bold;
    text-align: center;
}

.track-progress-circles {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.progress-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1em;
    font-weight: bold;
    transition: transform 0.2s, box-shadow 0.2s;
}

.progress-circle.locked {
    background: #6c757d;
    color: white;
    opacity: 0.6;
}

.progress-circle.unlocked {
    background: #007bff;
    color: white;
}

.progress-circle.completed {
    background: #28a745;
    color: white;
    font-size: 0.85em;
    padding: 4px;
}

.progress-circle:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Level Test Container (within Levels tab) */
.level-test-container {
    display: none;
    margin-top: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 25px;
    border: 2px solid rgba(139, 0, 0, 0.3);
}

body.theme-print .level-test-container {
    background: #f8f9fa;
    border: 2px solid #dee2e6;
}

.level-test-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(139, 0, 0, 0.2);
}

/* Burning Fuse Timer - Small, in corner */
.burning-fuse-timer {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.7);
    padding: 10px 15px;
    border-radius: 8px;
    border: 2px solid rgba(139, 0, 0, 0.5);
    min-width: 120px;
}

.fuse-container {
    position: relative;
    width: 100px;
    height: 40px;
}

.fuse-rope {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 4px;
    width: 100%;
    background: linear-gradient(to right, #8B4513 0%, #654321 50%, #8B4513 100%);
    border-radius: 2px;
    transition: width 0.1s linear, opacity 0.3s ease;
    box-shadow: 0 0 4px rgba(139, 69, 19, 0.5);
    z-index: 1;
}

.fuse-burn {
    position: absolute;
    left: 0%;
    top: 50%;
    transform: translateY(-50%) translateX(-50%);
    height: 8px;
    width: 12px; /* Constant size fire */
    background: #ff8800;
    border-radius: 50%;
    transition: left 0.1s linear, background 0.3s ease;
    box-shadow: 0 0 8px rgba(255, 136, 0, 0.8), 0 0 12px rgba(255, 68, 68, 0.6);
    animation: flicker 0.3s infinite alternate;
    z-index: 2;
}

@keyframes flicker {
    0% { 
        opacity: 0.8;
        transform: translateY(-50%) translateX(-50%) scale(1);
    }
    100% { 
        opacity: 1;
        transform: translateY(-50%) translateX(-50%) scale(1.1);
    }
}

/* Star markers with tick marks */
.fuse-star-markers {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 3;
}

.star-marker {
    position: absolute;
    top: 0;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.star-marker .tick-mark {
    width: 2px;
    height: 15px;
    background: rgba(255, 255, 255, 0.6);
    margin-bottom: 2px;
    box-shadow: 0 0 3px rgba(255, 255, 255, 0.8);
}

.star-marker .star-text {
    font-size: 0.65em;
    white-space: nowrap;
    text-shadow: 0 0 4px rgba(255, 255, 0, 0.8);
}

.fuse-stars {
    position: absolute;
    right: -30px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.7em;
    white-space: nowrap;
    z-index: 4;
}

.fuse-star-indicator {
    display: inline-block;
    font-size: 0.6em;
    opacity: 0.9;
    text-shadow: 0 0 4px rgba(255, 255, 0, 0.8);
}

.level-problems-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 30px 0;
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
}

body.theme-print .level-problems-grid {
    background: #ffffff;
    border: 1px solid #e9ecef;
}

.level-problems-grid .problem {
    /* Inherit all problem styles from main problems grid */
    background: var(--board-bg);
    border: 3px solid var(--board-border);
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.level-grade-button {
    width: 100%;
    padding: 18px;
    font-size: 20px;
    font-weight: bold;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    margin: 30px 0 20px 0;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 12px rgba(139, 0, 0, 0.3);
}

.level-grade-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(139, 0, 0, 0.5);
}

.level-grade-button:active {
    transform: translateY(0);
}

.level-results {
    margin-top: 20px;
    padding: 25px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    border: 2px solid rgba(139, 0, 0, 0.3);
}

body.theme-print .level-results {
    background: #ffffff;
    border: 2px solid #dee2e6;
}

/* Level Selection Collapsible */
.level-selection-header {
    margin-bottom: 10px;
}

.toggle-level-selection-btn {
    transition: background 0.2s, transform 0.1s;
    padding: 8px 12px !important;
    font-size: 14px !important;
}

.toggle-level-selection-btn:hover {
    background: rgba(139, 0, 0, 0.3) !important;
    transform: scale(1.02);
}

.toggle-level-selection-btn:active {
    transform: scale(0.98);
}

.level-selection-content {
    display: block; /* Start expanded */
    margin-bottom: 15px;
}

/* Make progress bar more compact */
.level-selection-content .track-progress-bar-top {
    margin: 10px 0 15px 0;
    padding: 12px 15px;
}

.level-selection-content .track-progress-label {
    font-size: 0.9em;
    margin-bottom: 10px;
}

.level-selection-content .progress-circle {
    width: 40px;
    height: 40px;
    font-size: 0.9em;
}

/* Make level cards grid more compact when in collapsible */
.level-selection-content #levelsGrid {
    gap: 15px;
    margin-top: 15px;
}

.level-selection-content .level-card {
    padding: 15px;
}

/* Countdown Animation */
.countdown-overlay {
    animation: countdownPulse 0.5s ease-in-out;
}

@keyframes countdownPulse {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Results Modal */
.results-modal-overlay {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.results-modal-content {
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Auth UI Styles */
.auth-container {
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(139, 0, 0, 0.1);
    border: 1px solid rgba(139, 0, 0, 0.3);
    border-radius: 8px;
}

.auth-user-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-greeting {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1em;
}

.user-icon {
    font-size: 1.3em;
}

.user-name {
    font-weight: 600;
    color: var(--text-color);
}

.settings-gear-btn {
    background: transparent;
    border: none;
    font-size: 1.2em;
    cursor: pointer;
    padding: 4px 8px;
    margin-left: 8px;
    opacity: 0.7;
    transition: opacity 0.2s, transform 0.2s;
    color: var(--text-color);
}

.settings-gear-btn:hover {
    opacity: 1;
    transform: rotate(90deg);
}

.settings-gear-btn:active {
    transform: rotate(90deg) scale(0.95);
}

/* Settings Modal */
.settings-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-in;
}

.settings-modal-content {
    background: #282828;
    border: 2px solid var(--container-border);
    border-radius: 12px;
    padding: 25px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease-out;
}

/* Print theme - white background for settings */
body.theme-print .settings-modal-content {
    background: #FFFFFF;
}

.settings-modal-content h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: var(--primary-color);
    font-size: 1.5em;
}

.settings-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(139, 0, 0, 0.1);
    border: 1px solid rgba(139, 0, 0, 0.3);
    color: var(--text-color);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2em;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.settings-modal-close:hover {
    background: rgba(139, 0, 0, 0.2);
    transform: scale(1.1);
}

/* Avatar Picker - Compact Grid Layout */
.avatar-picker {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.avatar-picker-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.avatar-section-label {
    font-size: 0.9em;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 5px;
}

.avatar-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    margin-bottom: 10px;
}

.avatar-option {
    position: relative;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
    padding: 4px;
}

.avatar-option:hover {
    background: rgba(139, 0, 0, 0.2);
    transform: scale(1.1);
}

.avatar-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.avatar-option input[type="radio"]:checked + .avatar-preview {
    border: 3px solid var(--primary-color);
    box-shadow: 0 0 10px rgba(139, 0, 0, 0.5);
    transform: scale(1.1);
}

.avatar-preview {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.1);
}

.avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* Make settings form more compact */
.settings-modal-content .form-group {
    margin-bottom: 15px;
}

.settings-modal-content .form-group:last-of-type {
    margin-bottom: 20px;
}

/* Responsive: fewer columns on smaller screens */
@media (max-width: 600px) {
    .avatar-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .settings-modal-content {
        padding: 20px;
        max-width: 95%;
    }
}

.auth-forms-container {
    max-width: 400px;
}

.auth-section {
    margin-bottom: 20px;
}

.auth-section h3 {
    margin: 0 0 15px 0;
    color: var(--text-color);
    font-size: 1.3em;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-group label {
    font-size: 0.9em;
    color: var(--text-color);
    font-weight: 500;
}

.form-group input {
    padding: 10px;
    border: 1px solid rgba(139, 0, 0, 0.3);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-color);
    font-size: 1em;
    font-family: inherit;
}

.form-group input:focus {
    outline: none;
    border-color: rgba(139, 0, 0, 0.6);
    background: rgba(255, 255, 255, 0.15);
}

.error-message {
    padding: 10px;
    background: rgba(220, 53, 69, 0.2);
    border: 1px solid rgba(220, 53, 69, 0.5);
    border-radius: 4px;
    color: #dc3545;
    font-size: 0.9em;
}

.auth-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 4px;
    font-size: 1em;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.auth-btn.primary {
    background: rgba(139, 0, 0, 0.7);
    color: white;
}

.auth-btn.primary:hover {
    background: rgba(139, 0, 0, 0.9);
}

.auth-btn.google-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #4285F4; /* Google blue */
    border: 1px solid rgba(139, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.auth-btn.google-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #357AE8; /* Slightly darker blue on hover */
}

.auth-btn.google-btn span {
    color: #4285F4; /* Ensure text is blue */
}

.auth-btn.google-btn:hover span {
    color: #357AE8; /* Darker blue on hover */
}

.auth-btn.sign-out-btn {
    background: rgba(139, 0, 0, 0.3);
    color: var(--text-color);
    border: 1px solid rgba(139, 0, 0, 0.4);
}

.auth-btn.sign-out-btn:hover {
    background: rgba(139, 0, 0, 0.5);
}

.auth-switch {
    text-align: center;
    margin: 10px 0 0 0;
    font-size: 0.9em;
    color: var(--text-color);
}

.auth-switch a {
    color: rgba(139, 0, 0, 0.8);
    text-decoration: none;
    font-weight: 600;
}

.auth-switch a:hover {
    text-decoration: underline;
}

/* Leaderboard Styles */
.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: var(--container-bg);
    border-radius: 8px;
    overflow: hidden;
}

.leaderboard-table thead {
    background: rgba(139, 0, 0, 0.2);
}

.leaderboard-table th {
    padding: 12px;
    text-align: left;
    font-weight: bold;
    color: var(--primary-color);
    border-bottom: 2px solid var(--container-border);
}

.leaderboard-table td {
    padding: 12px;
    border-bottom: 1px solid rgba(139, 0, 0, 0.1);
}

.leaderboard-table tbody tr:hover {
    background: rgba(139, 0, 0, 0.05);
}

.leaderboard-row-current-user {
    background: rgba(139, 0, 0, 0.15) !important;
    font-weight: bold;
}

.leaderboard-row-current-user:hover {
    background: rgba(139, 0, 0, 0.2) !important;
}

/* Leaderboard Difficulty Tabs */
.leaderboard-difficulty-tabs {
    display: flex;
    gap: 10px;
    margin: 20px 0;
    border-bottom: 2px solid var(--container-border);
    padding-bottom: 10px;
}

.leaderboard-tab-btn {
    background: transparent;
    border: 2px solid var(--container-border);
    color: var(--text-color);
    padding: 10px 20px;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: all 0.2s ease;
    font-family: var(--body-font);
    margin-bottom: -2px;
}

.leaderboard-tab-btn:hover {
    background: rgba(139, 0, 0, 0.2);
    border-color: var(--primary-color);
}

.leaderboard-tab-btn.active {
    background: var(--primary-gradient);
    border-color: var(--primary-color);
    color: white;
    border-bottom-color: var(--container-bg);
}

/* Leaderboard Test Button */
.leaderboard-test-btn {
    background: var(--primary-gradient);
    color: white;
    border: 2px solid var(--primary-color);
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(139, 0, 0, 0.4);
    font-family: var(--body-font);
}

.leaderboard-test-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 0, 0, 0.6);
    background: linear-gradient(to right, #B22222, #DC143C);
}

/* Loading Indicator for Levels */
.levels-loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    gap: 20px;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(139, 0, 0, 0.2);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-text {
    color: var(--text-color);
    font-size: 1.1em;
    font-weight: 500;
    margin: 0;
}

/* About Tab Styles */
.about-content {
    padding: 20px 0;
    line-height: 1.8;
    max-width: 700px;
}

.about-content p {
    margin: 15px 0;
    font-size: 1.1em;
}

/* Floating Feedback Button */
.feedback-floating-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--primary-gradient);
    color: white;
    border: 2px solid var(--primary-color);
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(139, 0, 0, 0.4);
    z-index: 1000;
    transition: all 0.3s ease;
    font-family: var(--body-font);
    animation: feedbackPulse 2s infinite;
}

.feedback-floating-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(139, 0, 0, 0.6);
    background: linear-gradient(to right, #B22222, #DC143C);
}

@keyframes feedbackPulse {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(139, 0, 0, 0.4);
    }
    50% {
        box-shadow: 0 4px 20px rgba(139, 0, 0, 0.6);
    }
}

/* Levels login required modal */
.levels-login-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}

.levels-login-modal-content {
    background: var(--container-bg);
    border: 2px solid var(--container-border);
    border-radius: 12px;
    padding: 28px 32px;
    max-width: 400px;
    width: 100%;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.levels-login-modal-content h3 {
    margin: 0 0 12px 0;
    font-size: 1.4em;
    color: var(--text-color);
}

.levels-login-modal-message {
    color: var(--text-color);
    opacity: 0.9;
    margin: 0 0 24px 0;
    font-size: 0.95em;
    line-height: 1.5;
}

.levels-login-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.levels-login-btn-primary {
    width: 100%;
    padding: 14px 20px;
    font-size: 1.1em;
    font-weight: bold;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.levels-login-btn-primary:hover {
    transform: scale(1.02);
    box-shadow: 0 5px 18px rgba(139, 0, 0, 0.45);
}

.levels-login-modal-secondary {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.levels-login-btn-small {
    padding: 8px 16px;
    font-size: 0.9em;
    background: transparent;
    color: var(--text-color);
    border: 1px solid var(--container-border);
    border-radius: 6px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.levels-login-btn-small:hover {
    border-color: var(--primary-color);
    background: rgba(139, 0, 0, 0.15);
}

.levels-login-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(139, 0, 0, 0.2);
    color: var(--text-color);
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.1em;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.levels-login-modal-close:hover {
    background: rgba(139, 0, 0, 0.4);
}

/* Feedback Modal */
.feedback-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-in;
}

.feedback-modal-content {
    background: white;
    border-radius: 12px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease-out;
}

.feedback-modal-content h3 {
    margin-top: 0;
    color: #333;
    font-size: 1.5em;
}

.feedback-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(139, 0, 0, 0.1);
    border: 1px solid rgba(139, 0, 0, 0.3);
    color: #333;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2em;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.feedback-modal-close:hover {
    background: rgba(139, 0, 0, 0.2);
    transform: scale(1.1);
}

.feedback-modal-content .form-group {
    margin-bottom: 20px;
    margin-right: 0;
}

.feedback-modal-content .form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
}

.feedback-modal-content textarea {
    width: calc(100% - 2px);
    max-width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    min-height: 120px;
    box-sizing: border-box;
    margin: 0;
    display: block;
}

.feedback-modal-content form {
    margin: 0;
    padding: 0;
}

.feedback-modal-content textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.feedback-btn-primary {
    background: var(--primary-gradient);
    color: white;
    border: 2px solid var(--primary-color);
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.feedback-btn-primary:hover:not(:disabled) {
    background: linear-gradient(to right, #B22222, #DC143C);
    transform: translateY(-1px);
}

.feedback-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.feedback-btn-secondary {
    background: #6c757d;
    color: white;
    border: 2px solid #6c757d;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.feedback-btn-secondary:hover {
    background: #5a6268;
    border-color: #5a6268;
}