body {
    font-family: 'Inter', sans-serif;
    background-color: #f0f9ff;
    /* sky-100 */
    color: #0c4a6e;
    /* sky-800 */
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 1rem;
}

.game-container {
    background-color: white;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 500px;
    text-align: center;
}

.hidden {
    display: none !important;
}

h1,
h2 {
    font-family: 'Schoolbell', cursive;
    color: #0369a1;
    /* sky-700 */
}

button {
    transition: all 0.3s ease;
    font-weight: 600;
}

button:hover {
    transform: translateY(-2px);
}

input[type="text"],
input[type="number"] {
    border: 2px solid #bae6fd;
    /* sky-200 */
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    transition: border-color 0.3s ease;
}

input[type="text"]:focus,
input[type="number"]:focus {
    border-color: #0284c7;
    /* sky-600 */
    outline: none;
}

.level-button {
    background-color: #38bdf8;
    /* sky-500 */
    color: white;
}

.level-button:hover {
    background-color: #0ea5e9;
    /* sky-600 */
}

.submit-button {
    background-color: #10b981;
    /* emerald-500 */
    color: white;
}

.submit-button:hover {
    background-color: #059669;
    /* emerald-600 */
}

.message-box {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-top: 1rem;
    font-weight: 600;
}

.message-correct {
    background-color: #d1fae5;
    /* emerald-100 */
    color: #065f46;
    /* emerald-700 */
    border: 1px solid #6ee7b7;
    /* emerald-300 */
}

.message-incorrect {
    background-color: #fee2e2;
    /* red-100 */
    color: #991b1b;
    /* red-700 */
    border: 1px solid #fca5a5;
    /* red-300 */
}

.progress-bar-container {
    width: 100%;
    background-color: #e0f2fe;
    /* sky-100 */
    border-radius: 0.5rem;
    margin: 1rem 0;
    overflow: hidden;
    border: 1px solid #bae6fd;
    /* sky-200 */
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
    position: relative;
    height: 20px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #22c55e, #16a34a);
    /* green-500 to green-600 gradient */
    width: 0%;
    border-radius: 0.5rem;
    transition: width 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    /* smooth easing */
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.2);
}

.progress-text {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.8rem;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    pointer-events: none;
    z-index: 1;
}

.modal {
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: white;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    text-align: center;
    max-width: 90%;
    width: 400px;
}

/* New styles for game modes */
.mode-practice {
    background-color: #e0f2fe;
    /* sky-100 */
    color: #0369a1;
    /* sky-700 */
}

.mode-test {
    background-color: #f3e8ff;
    /* purple-100 */
    color: #7e22ce;
    /* purple-700 */
}

.badge-practice {
    background-color: #0ea5e9;
    /* sky-500 */
    color: white;
}

.badge-test {
    background-color: #9333ea;
    /* purple-600 */
    color: white;
}

/* Completion badges */
.completion-practice {
    background-color: #0284c7;
    /* sky-600 */
    color: white;
}

.completion-test {
    background-color: #7e22ce;
    /* purple-700 */
    color: white;
}

.grade-a {
    color: #16a34a;
    /* green-600 */
}

.grade-b {
    color: #65a30d;
    /* lime-600 */
}

.grade-c {
    color: #ca8a04;
    /* yellow-600 */
}

.grade-d {
    color: #ea580c;
    /* orange-600 */
}

.grade-f {
    color: #dc2626;
    /* red-600 */
}

/* User Management Styles */
#usersList {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #bae6fd;
    /* sky-200 */
    border-radius: 0.5rem;
}

.user-row {
    padding: 0.75rem;
    border-bottom: 1px solid #e0f2fe;
    /* sky-100 */
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s ease;
}

.user-row:last-child {
    border-bottom: none;
}

.user-row:hover {
    background-color: #f0f9ff;
    /* sky-50 */
}

.user-row .select-user,
.user-row .delete-user {
    background: none;
    border: none;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    font-weight: 600;
    border-radius: 0.25rem;
}

.user-row .select-user {
    color: #0284c7;
    /* sky-600 */
}

.user-row .select-user:hover {
    background-color: #e0f2fe;
    /* sky-100 */
}

.user-row .delete-user {
    color: #dc2626;
    /* red-600 */
}

.user-row .delete-user:hover {
    background-color: #fee2e2;
    /* red-100 */
}

/* True/False Button Styling */
.true-false-btn {
    transition: all 0.3s ease;
    border: 2px solid transparent;
    min-width: 120px;
}

.true-false-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.true-false-btn.selected {
    border-color: #1e40af;
    /* blue-800 */
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
    /* blue-500 with opacity */
    transform: scale(1.05);
}

.true-false-btn:active {
    transform: scale(0.98);
}

/* Specific styling for True button */
#trueButton.selected {
    background-color: #15803d;
    /* green-700 */
    border-color: #14532d;
    /* green-900 */
}

/* Specific styling for False button */
#falseButton.selected {
    background-color: #b91c1c;
    /* red-700 */
    border-color: #7f1d1d;
    /* red-900 */
}

/* Comparison button styles */
.comparison-btn {
    border-width: 2px;
    transition: all 0.2s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.comparison-btn:active {
    transform: scale(0.98);
}

/* Specific styling for comparison buttons */
#lessThanButton.selected {
    background-color: #1d4ed8;
    /* blue-700 */
    border-color: #1e3a8a;
    /* blue-900 */
}

#equalButton.selected {
    background-color: #15803d;
    /* green-700 */
    border-color: #14532d;
    /* green-900 */
}

#greaterThanButton.selected {
    background-color: #7e22ce;
    /* purple-700 */
    border-color: #581c87;
    /* purple-900 */
}

/* Fraction Visualization Styles */
#fractionIllustration {
    transition: all 0.3s ease-in-out;
}

.fraction-visual-container,
.fraction-comparison-container {
    animation: fadeInUp 0.5s ease-out;
    max-width: 100%;
    overflow-x: hidden;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fraction-display {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    line-height: 1;
}

.fraction-bar {
    width: 100%;
    text-align: center;
    margin: -5px 0;
}

.numerator,
.denominator {
    display: block;
}

.fraction-segment {
    cursor: pointer;
    transition: all 0.3s ease;
}

.fraction-segment:hover {
    filter: brightness(1.1);
    stroke-width: 3;
}

.fraction-rectangle {
    transition: all 0.3s ease;
    cursor: pointer;
}

.fraction-rectangle:hover {
    filter: brightness(1.1);
    transform: scale(1.05);
}

.fraction-cell {
    transition: all 0.3s ease;
    cursor: pointer;
}

.fraction-cell:hover {
    filter: brightness(1.1);
    transform: scale(1.1);
}

.rectangle-visualization {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.grid-visualization {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.part-explanation {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.number-line-container svg {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

/* Responsive adjustments for fraction visualizations */
@media (max-width: 480px) {
    .rectangle-visualization {
        max-width: 250px;
    }

    .grid-visualization {
        max-width: 200px;
    }

    .number-line-container svg {
        width: 100%;
        max-width: 350px;
    }

    .fraction-display {
        font-size: 0.9em;
    }

    /* Fix for fraction comparison on small screens */
    .fraction-comparison-container .fraction-container {
        transform: scale(0.85);
        margin: 0 -5px;
    }

    /* Stack fractions vertically on very small screens */
    @media (max-width: 400px) {
        .fraction-comparison-container [data-visuals-container="true"] {
            flex-direction: column !important;
            align-items: center;
        }

        .fraction-comparison-container .fraction-container {
            width: 80% !important;
            margin-bottom: 20px;
            transform: scale(1);
        }

        .fraction-comparison-container .fraction-container:last-child {
            margin-bottom: 0;
        }
    }
}


/* Custom styles for the graph elements where Tailwind might not be enough or for dynamic styles */
.bar-graph {
    border: 1px solid #cbd5e1;
    /* Slate-300 */
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    background-color: #ffffff;
    position: relative;
    /* Ensure positioning context for children */
}

.y-axis {
    border-right: 2px solid #374151;
    /* Darker slate */
}

.x-axis {
    border-top: 2px solid #374151;
    /* Darker slate */
}

.y-label,
.x-label,
.bar-value {
    color: #374151;
    /* Darker slate */
}

.chart-bar {
    border: 1px solid #374151;
    /* Darker slate */
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
    transition: height 0.5s ease;
    /* Smooth animation for bar height */
}

/* Place Value Visualization Styles */
.place-value-visual-container {
    font-family: 'Inter', sans-serif;
}

.place-value-explanation {
    background-color: #f0f9ff;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.place-value-container {
    background-color: #ffffff;
    border: 2px solid #e0f2fe;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1rem 0;
}

.tens-section,
.ones-section {
    min-width: 120px;
}

.tens-visual,
.ones-visual {
    min-height: 100px;
    align-items: flex-end;
}

.ten-bundle {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
    transition: transform 0.2s ease;
    cursor: pointer;
}

.ten-bundle:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}

.mini-stick {
    background-color: #3b82f6;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.one-stick {
    background: linear-gradient(to bottom, #22c55e 0%, #16a34a 100%);
    box-shadow: 0 2px 4px rgba(34, 197, 94, 0.2);
    transition: transform 0.2s ease;
    cursor: pointer;
}

.one-stick:hover {
    transform: scale(1.1);
    box-shadow: 0 3px 6px rgba(34, 197, 94, 0.3);
}

.total-section {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 2px solid #f59e0b;
    animation: pulse-gentle 2s infinite;
}

@keyframes pulse-gentle {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 4px 6px rgba(245, 158, 11, 0.2);
    }

    50% {
        transform: scale(1.02);
        box-shadow: 0 6px 8px rgba(245, 158, 11, 0.3);
    }
}

/* Responsive adjustments for place value */
@media (max-width: 640px) {
    .place-value-container {
        flex-direction: column;
        gap: 1rem;
    }

    .tens-visual,
    .ones-visual {
        justify-content: center;
    }

    .ten-bundle {
        width: 50px;
        height: 70px;
    }

    .one-stick {
        width: 6px;
        height: 30px;
    }
}