:root {
    --primary-color: rgba(7, 7, 7, 0);
    --danger-color: #f50202;
    --dark-color: hsl(0, 0%, 5%);
    --light-bg: hsla(0, 0%, 2%, 0.878);
    --transition-standard: all 0.3s ease;
    --border-radius: 40px;
    --box-shadow-light: 40 10px 05px rgba(8, 8, 8, 0.516);
}

body {
    font-family: Helvetica, sans-serif;
    font-size: 1.5rem;
    color: #080808;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
    margin: 0;
    position: relative;
    overflow-x: hidden;
    scroll-behavior: smooth;
}


@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes slideEffect {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes refreshSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* New game container design */
.game-container {
    background: rgba(85, 85, 85, 0.013);
    backdrop-filter: blur(0px);
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0);
    max-width: 800px;
    width: 85%;
    animation: slideEffect 2.5s ease-out;
    border: 1px solid rgba(3, 0, 0, 0.985);
    position: relative;
    overflow: hidden;
}

.game-container h1 {
    margin-top: 0;
    color: var(--dark-color);
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 1.5rem;
    position: relative;
}

.game-container h1::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 2px;
}

/* Floating math symbols across the whole page */
.math-symbol {
    position: fixed;
    color: rgb(244, 7, 137);
    font-size: 1.5rem;
    pointer-events: none;
    z-index: 5;
    animation: float-symbol .5s linear infinite;
}

@keyframes float-symbol {
    0% {
        transform: translate(0, 100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.5;
    }
    90% {
        opacity: 0.5;
    }
    100% {
        transform: translate(0, -10vh) rotate(360deg);
        opacity: 0;
    }
}

/* Updated level cards */
.level-card {
    background: rgba(255, 255, 255, 0.1);
    padding: 4.5rem;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0);
    text-align: center;
    border: 1px solid rgba(16, 16, 16, 0.958);
    backdrop-filter: blur(0px);
    position: relative;
    overflow: hidden;
}



.level-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgb(255, 255, 255), transparent);
    transform: rotate(45deg);
    transition: all 0.6s ease;
    opacity: 0;
}

.level-card:hover {
    transform: translateY(-10px) scale(1.03);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.582);
    border-color: rgba(255, 255, 255, 0.3);
}

@keyframes shine {
    0% { left: -100%; opacity: 0; }
    50% { opacity: 1; }
    100% { left: 100%; opacity: 0; }
}


.grade {
    display: inline-block;
    background: var(--primary-color);
    color: #f5f8f4;
    padding: 1.2rem 1.5rem;
    border-radius: var(--border-radius);
    font-size: 1.4rem;
    font-weight: bold;
    
}

.stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
    font-size: 1.2rem;
    font-weight: bold;
    color: #ffffff;
    background-color: rgba(49, 48, 48, 0);
    padding: 0px 5px;
    border-radius: 2px;

}
    

.stats div {
    padding: 5px 10px;
}

#level, #score, #practiceLevel {
    color: #0af406;
    font-size: 1.4rem;
}


.progress-bar {
    background: #f6f3f3;
    height: 15px;
    border-radius: 5px;
    margin-bottom: 5rem;
}

.progress {
    background: #0c0c0c;
    height: 100%;
    border-radius: 5px;
    transition: width 0.3s ease;
}

.problem {
    font-size: 2rem;
    margin-bottom: 3rem;
    text-align: center;
    animation: slideIn 0.5s ease-out;
    color:#07f342
}

input {
    width: 90%;
    padding: 1.5rem;
    margin-bottom: 1rem;
    border: 2px solid #050505;
    border-radius: var(--border-radius);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Game mode answer box styling */
#gameScreen input, #testModeScreen input {
    width: 90%;
    padding: 1.5rem;
    margin: 0 auto 2rem;
    display: block;
    border: 3px solid #050505;
    border-radius: var(--border-radius);
    font-size: 1.3rem;
    background-color: rgba(255, 255, 255, 0.293);
    color: #000;
    text-align: center;
}


input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(11, 11, 11, 0);
}

button {
    width: 100%;
    padding: 0.5rem;
    background: var(--dark-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition-standard);
}

button:hover {
    background: var(--danger-color);
    transform: scale(1.02);
}

.back-button {
    margin-top: 1rem;
    background: var(--dark-color);
    font-weight: bold;
}

.back-button:hover {
    background: var(--danger-color);
    transform: translateY(-2px);
}

/* New styles for refresh and reset buttons */
.refresh-btn, .reset-btn {
    width: auto;
    margin-right: 10px;
    margin-bottom: 15px;
    padding: 8px 15px;
}

.reset-btn {
    background-color: #090909;
}

.reset-btn:hover {
    background-color: #fbf8f8;
}

/* Dialog styles for reset confirmation */
.reset-dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    z-index: 1000;
    width: 300px;
}

.level-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 15px 0;
}

.level-reset-btn {
    width: auto;
    flex: 1 0 40%;
}

.cancel-btn {
    background-color: #6c757d;
    margin-top: 10px;
}

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

/* Progress table styles */
.progress-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.progress-table th, .progress-table td {
    padding: 8px;
    text-align: left;
    border-bottom: 1px solid #09090900;
}

.progress-table th {
    background-color: #f5f6f7;
}

.refreshing {
    animation: refreshSpin 0.5s ease;
}

/* Media queries for responsiveness */
@media (max-width: 600px) {
    .game-container {
        padding: 1rem;
        width: 95%;
    }
    
    .level-grid {
        grid-template-columns: 1fr;
    }
    
    .problem {
        font-size: 1.2rem;
    }
}

.progress-container {
    width: 100%;
    background-color: #f1f1f100;
    border-radius: 5px;
    margin: 10px 0;
}



/* Interactive button effects */
button {
    position: relative;
    overflow: hidden;
}

button:after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%);
    transform-origin: 50% 50%;
}

button:focus:not(:active)::after {
    animation: ripple 1s ease-out;
}

@keyframes ripple {
    0% {
        transform: scale(0, 0);
        opacity: 0.5;
    }
    20% {
        transform: scale(25, 25);
        opacity: 0.5;
    }
    100% {
        opacity: 0;
        transform: scale(40, 40);
    }
}

/* Answer feedback animations */
.correct-answer {
    animation: correctPulse 2.6s ease-in-out;
}

.wrong-answer {
    animation: wrongShake 2.5s ease-in-out;
}

@keyframes correctPulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 hwb(120 5% 94%); }
    50% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(0, 255, 0, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(0, 255, 0, 0); }
}

@keyframes wrongShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

/* Interactive level cards with 3D effect */
.level-card {
    transition: transform 0.5s ease, box-shadow 0.5s ease;
    transform-style: preserve-3d;
    perspective: 1000px;
}

.level-card:hover {
    transform: translateY(-10px) rotateX(5deg);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

/* Floating elements effect */
.floating {
    animation: floating 3s ease-in-out infinite;
}

@keyframes floating {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

/* Enhanced input field interactions */
input {
    transition: all 0.3s cubic-bezier(0.64, 0.09, 0.08, 1);
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 96%, var(--primary-color) 4%);
    background-position: -800px 0;
    background-size: 100% 100%;
    background-repeat: no-repeat;
}

input:focus {
    box-shadow: none;
    outline: none;
    background-position: 0 0;
    border-color: transparent;
    border-bottom: 2px solid var(--primary-color);
}

/* Custom number input controls */
input[type="number"] {
    position: relative;
    padding-right: 25px;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    opacity: 1;
    height: 30px;
    transform: scale(1.5);
    margin-right: 10px;
}

/* Animated progress bar */
.progress {
    position: relative;
    overflow: hidden;
}

.progress::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        rgba(255,255,255,0) 0%, 
        rgb(11, 11, 11) 50%, 
        rgba(255,255,255,0) 100%);
    transform: translateX(-100%);
    animation: progressShine 2s infinite;
}

@keyframes progressShine {
    to { transform: translateX(100%); }
}

/* Circular progress indicator */
.circular-progress {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: conic-gradient(var(--primary-color) var(--progress-percent), #e9ecef 0deg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.circular-progress::before {
    content: attr(data-progress) '%';
    position: absolute;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: rgb(251, 247, 247);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
}

/* Confetti animation for correct answers */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background-color: var(--primary-color);
    opacity: 2.7;
    animation: confetti-fall 3s ease-in-out;
}

@keyframes confetti-fall {
    0% { transform: translateY(-100%) rotate(0deg); opacity: 1; }
    100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}


/* Difficulty selector styles */
.difficulty-selector {
    display: flex;
    align-items: center;
    margin-top: 5px;
}

.difficulty-selector span {
    margin-right: 10px;
}

.difficulty-btn {
    padding: 5px 10px;
    margin: 0 5px;
    border: 1px solid #050505;
    background: #0b0b0b;
    cursor: pointer;
    border-radius: 5px;
}

.difficulty-btn.active {
    background: #070707;
    color: white;
    border-color: hsla(123, 43%, 39%, 0);
}

/* Visual feedback styles */
.correct-answer, .correct-problem {
    animation: pulse-green 1.5s;
}

.wrong-answer, .wrong-problem {
    animation: pulse-red 1.5s;
}

@keyframes pulse-green {
    0% { box-shadow: 0 0 0 0 rgba(7, 255, 16, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(76, 175, 80, 0); }
    100% { box-shadow: 0 0 0 0 rgba(76, 175, 80, 0); }
}

@keyframes pulse-red {
    0% { box-shadow: 0 0 0 0 rgba(255, 87, 34, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(255, 87, 34, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 87, 34, 0); }
}

/* Feedback message styles */
.feedback {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.5);
    padding: 5px 30px;
    border-radius: 5px;
    font-size: 14px;
    font-weight: bold;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 100;
}

.feedback.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.correct-feedback {
    background-color: #09090902;
    color: white;
}

.wrong-feedback {
    background-color: rgba(12, 12, 12, 0.9);
    color: white;
}

/* Card hover focus effect */
.card-focus {
    transition: all 0.3s ease;
    filter: grayscale(0.3);
}

.card-focus:hover {
    filter: grayscale(0);
    transform: scale(1.02);
    z-index: 5;
}

/* Improved button styles */
.btn-modern {
    border-radius: 8px;
    padding: 10px 20px;
    border: none;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.btn-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 10px rgba(0,0,0,0.15);
}

.btn-modern:active {
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Accessibility improvements */
:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Skeleton loading animation */
.skeleton {
    background: linear-gradient(90deg, #faf9f9 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 3.5s infinite;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Better mobile responsiveness */
@media (max-width: 768px) {
    .difficulty-selector {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .difficulty-btn {
        margin: 5px 0;
        width: 100%;
    }
    
    .theme-toggle {
        top: 10px;
        right: 10px;
    }
}


/* Enhanced answer box */
.answer-box {
    position: relative;
    margin: 15px 0;
    transition: all 0.3s ease;
}

.answer-box input {
    width: 100%;
    padding: 12px 15px;
    font-size: 16px;
    border: 2px solid #040404eb;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}

.answer-box input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
    transform: translateY(-2px);
}

.answer-box::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

.answer-box:focus-within::after {
    width: 100%;
}

.answer-box.correct input {
    border-color: #03f60b;
    background: rgb(11, 11, 11);
}

.answer-box.wrong input {
    border-color: #f60303;
    background: rgba(255, 87, 34, 0.1);
}

.answer-box .status-icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    transition: all 0.3s ease;
}

.answer-box.correct .status-icon {
    opacity: 1;
    color: #4CAF50;
}

.answer-box.wrong .status-icon {
    opacity: 1;
    color: #FF5722;
}


/* Progress container styles */
.progress-container {
    background: hsla(0, 12%, 95%, 0.244);
    border-radius: 40px;
    padding: 15px;
    margin: 10px 10;
    box-shadow: 0 4px 10px rgba(244, 4, 4, 0);
}

.progress-container h3 {
    margin-top: 5;
    margin-bottom: 15px;
    color: #07f31b;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 8px;
}

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

.mini-progress {
    flex-grow: 1;
    height: 10px;
    background: #e9ecef;
    border-radius: 5px;
    margin: 0 10px;
    overflow: hidden;
}

.mini-bar {
    height: 100%;
    background: var(--primary-color);
    border-radius: 5px;
    transition: width 0.5s ease;
}

/* Animation for refresh */
.refreshing {
    animation: refresh-spin 0.5s ease;
}

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

.fade-out {
    opacity: 0;
    transition: opacity 0.3s ease-out;
}

.fade-in {
    opacity: 1;
    transition: opacity 0.3s ease-in;
    animation: fadeIn 0.3s;
}

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

/* soccer background elements */
body {
    background-image: url(https://images.unsplash.com/photo-1579952363873-27f3bade9f55?w=800&auto=format&fit=crop&q=60&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxzZWFyY2h8NHx8c3BvcnRzfGVufDB8fDB8fHww);
    background-size: cover;
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-position: center;
}




/* Graffiti text effect */
h1, h2 {
    text-shadow: 2px 2px 0 #0c0c0c00, 4px 4px 0 #2d983d;
    transform: skew(-3deg);
}

.achievement-modal {
    position: fixed;
    top: 15%;
    left: 50%;
    transform: translate(-50%, 0);
    background: rgba(30,30,30,0.97);
    color: #ff0000;
    border: 2px solid #ff0000;
    border-radius: 16px;
    padding: 2rem 2.5rem;
    z-index: 9999;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    text-align: center;
    max-width: 350px;
}
.achievement-modal h3 {
    margin-top: 0;
}
.achievement-modal button {
    margin-top: 1rem;
    background: #FFD700;
    color: #222;
    border: none;
    border-radius: 8px;
    padding: 0.5rem 1.5rem;
    font-weight: bold;
    cursor: pointer;
}

/* Styles for the answer display in practice mode */
.answer-display {
    background-color: #000;
    color: rgb(247, 245, 245);
    padding: 2px;
    margin: 5px 0;
    border-radius: 2px;
    font-weight: bold;
    font-size: 1.0rem;
    text-align: center;
    border: .5px solid rgb(247, 245, 245);
    
}

/* Solution display styles */
#practiceSolution {
    background-color: #000;
    color: #fff;
    padding: 5px;
    margin: 2px 0;
    border-radius: 8px;
    font-size: 1.1rem;
    border: 1px solid #333;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

#practiceSolution.show {
    opacity: 1;
    transform: translateY(0);
}

#practiceSolution strong {
    color: #0af406;
    margin-right: 5px;
}



