/* ===================================
   Times Tables Game Styles
   =================================== */

/* Game Container */
.game-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* Back Link */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.back-link:hover {
    color: var(--primary-dark);
    transform: translateX(-5px);
}

.back-link span {
    font-size: 1.5rem;
}

/* Screens */
.screen {
    display: none;
    max-width: 800px;
    margin: 0 auto;
    animation: fadeIn 0.5s ease;
}

.screen.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Level Selection Screen */
.game-title {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 6vw, 3.5rem);
    text-align: center;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.game-subtitle {
    text-align: center;
    font-size: 1.25rem;
    color: var(--primary-dark);
    margin-bottom: 2rem;
    font-weight: 700;
}

/* Animals Grid */
.animals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 1.5rem;
    padding: 1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Enhanced Animal Button */
.animal-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    width: 100%;
    aspect-ratio: 1;
    background: var(--white);
    border: 4px solid var(--primary-light);
    border-radius: var(--radius-xl);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.animal-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 0;
}

.animal-btn:hover::before {
    opacity: 0.1;
}

.animal-btn:hover {
    transform: translateY(-8px) scale(1.05);
    border-color: var(--primary);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.animal-btn:active {
    transform: translateY(-2px) scale(0.98);
}

.animal-btn-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    z-index: 1;
    animation: wiggle 3s ease-in-out infinite;
}

@keyframes wiggle {

    0%,
    100% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(-5deg);
    }

    75% {
        transform: rotate(5deg);
    }
}

.animal-btn-label {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    color: var(--primary-dark);
    z-index: 1;
}

/* Question Screen */
.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 1.25rem;
    font-weight: 700;
}

.current-level {
    background: var(--gradient-primary);
    color: var(--white);
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius-full);
    font-size: 1.1rem;
}

.question-counter {
    color: var(--primary);
}

/* Progress */
.progress-container {
    margin-bottom: 2rem;
}

/* Question Area */
.question-area {
    text-align: center;
    padding: 2rem;
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    margin-bottom: 2rem;
}

.question-text {
    font-family: var(--font-heading);
    font-size: clamp(2.5rem, 10vw, 4rem);
    color: var(--gray-800);
    margin-bottom: 2rem;
}

.answer-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.submit-btn {
    font-size: 1.5rem;
    padding: 1rem 3rem;
}

/* Feedback */
.feedback {
    min-height: 3rem;
    font-size: 1.5rem;
    font-weight: 800;
    margin-top: 1.5rem;
    transition: all 0.3s ease;
}

.feedback.correct {
    color: var(--success);
}

.feedback.incorrect {
    color: var(--error);
}

/* Mascot */
.mascot {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    font-size: 4rem;
    animation: bounce 2s ease-in-out infinite;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
    transition: transform 0.3s ease;
}

.mascot.happy {
    animation: celebrate 0.5s ease-in-out;
}

.mascot.sad {
    animation: shake 0.5s ease-in-out;
}

/* Results Screen */
.results-header {
    text-align: center;
    margin-bottom: 2rem;
}

.results-title {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 6vw, 3rem);
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
}

.score-display {
    display: flex;
    justify-content: center;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.score-number {
    font-family: var(--font-heading);
    font-size: 5rem;
    color: var(--success);
}

.score-divider {
    font-family: var(--font-heading);
    font-size: 3rem;
    color: var(--gray-200);
}

.score-total {
    font-family: var(--font-heading);
    font-size: 3rem;
    color: var(--gray-800);
}

.score-message {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

/* Results List */
.results-list {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 2rem;
    padding: 1rem;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

/* Results Actions */
.results-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
}

/* Star Rating */
.star-rating {
    font-size: 3rem;
    margin: 1rem 0;
}

/* Responsive */
@media (max-width: 600px) {
    .game-container {
        padding: 1rem;
    }

    .animals-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .animal-btn-icon {
        font-size: 2.5rem;
    }

    .animal-btn-label {
        font-size: 1.5rem;
    }

    .question-area {
        padding: 1.5rem;
    }

    .mascot {
        font-size: 3rem;
        bottom: 1rem;
        right: 1rem;
    }

    .results-actions {
        flex-direction: column;
    }

    .results-actions .btn {
        width: 100%;
    }
}