/* Review Turtle Celebration Animation */
.turtle-review-celebrate #shell,
.turtle-review-celebrate #head,
.turtle-review-celebrate #torso,
.turtle-review-celebrate #liftArmRight,
.turtle-review-celebrate #liftArmLeft,
.turtle-review-celebrate #weight {
    animation: turtleReviewJump 1.2s cubic-bezier(0.25, 0.1, 0.25, 1) none !important;
}

@keyframes turtleReviewJump {
    0% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }

    85% {
        transform: translateY(-5px);
    }

    100% {
        transform: translateY(0);
    }
}

.turtle-jumping {
    position: relative;
    /* ensure movement stays local */
    animation: turtleArcMove 1.2s ease-in-out forwards;
    offset-path: path("M 0 0 Q 50 -80 100 0");
    offset-rotate: 0deg;
    offset-anchor: center center;
    /* prevents teleporting */
    transform: translate(0, 0);
    /* baseline position */
    z-index: 1000;
    filter: drop-shadow(0 5px 10px rgba(0, 0, 0, 0.2));
}

@keyframes turtleArcMove {
    0% {
        offset-distance: 0%;
        transform: translate(0, 0) scale(1);
    }

    25% {
        transform: translate(0, 0) scale(1.03);
    }

    50% {
        transform: translate(0, 0) scale(1.05);
    }

    75% {
        transform: translate(0, 0) scale(1.03);
    }

    100% {
        offset-distance: 100%;
        transform: translate(0, 0) scale(1);
    }
}

/* Optionally, keep legs running by not animating them. 
   Ensure your SVG has an id or class (e.g., #reviewTurtleMain) on the main group except legs. */
/* Define LexendDeca font */
@font-face {
    font-family: 'LexendDeca';
    src: url('LexendDeca-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}


* {
    box-sizing: border-box;
}

html {
    height: 100%;
}


body {
    font-family: 'LexendDeca', Arial, sans-serif;
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
    background: #f4f6f9;

    /**
    background: repeating-linear-gradient(35deg,
            #99bc60,
            #99bc60 10px,
            #7b9846 10px,
            #7b9846 20px);
    */
}


#topBar {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 10000;
    height: 5rem;
    display: flex;
    pointer-events: none;
    flex-direction: row;
    /* Make the top bar clickthrough */
}

/* Ensure child elements inside topBar are clickable */
#topBar button,
#topBar .profile-wrapper,
#topBar #profileIcon,
#topBar .profile-turtle-sprite,
#topBar #homeBtn {
    pointer-events: auto;
    /* Make sure these elements remain interactive */
}

/* ---------------- Menu View ---------------- */
#menuView {
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    overflow: hidden;
}

#menuView .main {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
    justify-content: flex-start;
    align-items: center;
    flex: 1;
    /* Full height minus lesson bar */
    box-sizing: border-box;
}


.card {
    background: white;
    padding: 1.5rem;
    border-radius: 1rem;
    text-align: center;
    max-width: 400px;
    width: 100%;
}



.progress-container {
    position: absolute;
    /* Use fixed for viewport anchoring */
    right: 2rem;
    /* Use a fixed offset instead of margin */
    bottom: 2rem;
    margin: 0;
    /* Remove margin to avoid double offset */
    display: flex;
    flex-direction: row;
    justify-content: flex-end;
    width: 30%;
    /* Prevent overflow on small screens */
    box-sizing: border-box;
    z-index: 1000;
    /* Ensure it's above other elements if needed */
}

@media (max-width: 768px) {
    .progress-container {
        visibility: hidden;
    }
}


.progress-headline {
    text-align: start;
    color: #6b6b6b;
    font-size: 1.5rem;
    font-weight: 300;
    margin: 0 0 0.5rem 0;
    padding: 0;
    padding-left: 1rem;
}

/* Mobile adjustments for main content container */
@media (max-width: 768px) {
    .main-content-container {
        flex-direction: column;
        gap: 1.5rem;
        max-width: 100%;
    }
}

/* Mobile adjustments for progress stats */
@media (max-width: 768px) {
    .progress-stats-container {
        max-width: 100%;
        padding: 0 1rem;
        margin-top: 0;
    }

    .progress-headline {
        font-size: 1.3rem;
        margin-bottom: 0.3rem;
    }

    .progress-card {
        padding: 1rem;
    }

    .progress-circle {
        width: 60px;
        height: 60px;
    }

    .progress-icon {
        font-size: 1.5rem;
    }

    .progress-label {
        font-size: 0.9rem;
    }
}

.progress-card {
    padding: 0.5rem 1rem 0.5rem 1rem;
    border-radius: 1rem;
    text-align: center;
    transition: transform 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
}

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

.progress-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    position: relative;
}

.progress-circle {
    position: relative;
    width: 80px;
    height: 80px;
    margin-bottom: 0.5rem;
}

.progress-circle svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.progress-circle-background {
    fill: none;
    stroke: #e0e0e0;
    stroke-width: 6;
}

.progress-circle-fill {
    fill: none;
    stroke: #4a90e2;
    stroke-width: 6;
    stroke-linecap: round;
    transition: stroke-dasharray 0.5s ease;
}

.progress-circle-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    line-height: 1;
}

.progress-circle-number {
    font-size: 1.2rem;
    font-weight: bold;
    color: #4a90e2;
    display: block;
}

.progress-circle-total {
    font-size: 0.7rem;
    color: #999;
    font-weight: 400;
    display: block;
}

.progress-icon {
    font-size: 2rem;
}

.progress-label {
    font-size: 1rem;
    color: #666;
    font-weight: 500;
}

.progress-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.progress-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: #4a90e2;
    line-height: 1;
}

.progress-total {
    font-size: 0.9rem;
    color: #999;
    font-weight: 400;
}

#reviewProjection {
    margin-left: 2rem;
    align-self: center;
    height: 80%;
    max-height: 100%;
}

.bar-chart {
    height: 100%;
    max-height: 100%;
}

/* Action Cards Container */
.action-cards-container {
    position: absolute;
    display: flex;
    box-sizing: border-box;
    flex: 0 0 auto;
    z-index: 10000;
    justify-self: center;
    align-self: center;
    flex-direction: row;
    gap: 2rem;
    max-width: 100%;
    padding: 1rem;
    bottom: 0;
    top: auto;
    margin: 0;
    margin-bottom: 2rem;
}

.action-card {
    text-align: start;
    transition: transform 0.2s ease;
    height: fit-content;
    cursor: pointer;
}

/* Disabled state for action cards (desktop and mobile) */
.action-card.is-disabled {
    opacity: 0.6;
    filter: grayscale(100%);
    cursor: not-allowed !important;
    pointer-events: none;
    /* prevent clicks */
    transform: none !important;
    /* disable hover lift */
}

/* Disabled state for review card badge */
.review-card.is-disabled .review-badge-overlay {
    background: #999;
}

.action-card-icon-text {

    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 3rem;
    justify-content: space-between;
}

/* Mobile Responsive Layout */
@media (max-width: 768px) {
    .action-cards-container {
        margin-bottom: 0;
    }

    .action-card {
        min-width: unset;
        flex: 0 0 auto;
        cursor: pointer;
    }

    .action-card-icon {
        font-size: 2.5rem;
    }

    .action-card-icon img {
        width: 2.5rem;
        height: 2.5rem;
    }

    .action-card h3 {
        font-size: 1.2rem;
    }

    .action-card p {
        font-size: 0.85rem;
    }

    /* Hide buttons on mobile since cards are clickable */
    .action-card button {
        display: none;
    }
}

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

.action-card-content {
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    flex-direction: column;

    gap: 1rem;
}

.action-card-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.action-card-icon img {
    width: 3rem;
    height: 3rem;
}

.action-card h3 {
    margin: 0;
    font-size: 1.3rem;
    color: #ffffff;
    font-weight: 600;
}

.action-badge {
    display: inline-block;
    margin-left: 0.5rem;
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 600;
}

.action-card p {
    margin: 0;
    color: #ffffff;
    font-size: 0.9rem;
    line-height: 1.4;
}

.action-card button {
    width: 100%;
    padding: 0.8rem;
    border: none;
    border-radius: 0.5rem;
    background: #ffffff;
    color: rgb(0, 0, 0);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
    margin-top: 0.5rem;
}

.action-card button:hover:not(:disabled) {
    background: #3a7bc8;
}

.action-card button:disabled {
    background: #ccc;
    cursor: pointer;
}

/* Make desktop action-cards match mobile: remove inner button everywhere */
.action-card button {
    display: none;
}

/* Review card specific styling */
.review-card {
    background: transparent;
    position: relative;
    width: fit-content;
    height: fit-content;
    padding: 0;
    border-radius: 0;
}

.review-card-svg {
    width: 50px;
    height: 50px;
    display: block;
}

.review-badge-overlay {
    position: absolute;
    top: -0px;
    right: -5px;
    background: #e73c18;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

.review-card button {
    background: #ffffff;
}

.review-card button:hover:not(:disabled) {
    background: #ffffff;
}



/* ---------------- Lesson Bar ---------------- */
.lesson-bar {
    position: fixed;
    left: 0;
    right: 0;
    height: 100%;
    display: flex;
    align-items: center;
    z-index: 500;
    user-select: none;
    cursor: grab;
    max-width: 100vw;
    padding-bottom: 0;
    /* Hide scrollbar for all browsers */
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE and Edge */
}

.lesson-bar::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari, Opera */
}



#lessonTrack {
    padding-left: 1rem;
    padding-right: 1rem;
    height: 50%;
    margin-left: 20rem !important;
}

@media (max-width: 768px) {
    #lessonTrack {
        margin-left: 10rem !important;
    }
}


.lesson-square {
    flex: 0 0 60px;
    height: 50px;
    font-size: 1rem;
}


#lessonTrack {
    justify-self: center;
    /* Height for S-curve amplitude */
    min-width: unset;
    display: block;
    margin-left: 20rem;
    margin-right: 50rem;
    padding: 0;
    will-change: transform;
}

.lesson-square {
    position: absolute;
    width: 120px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgb(160, 160, 160);
    color: transparent;
    /* Hide text numbers */
    font-size: 1.2rem;
    border-radius: 60px/30px;
    overflow: hidden;
    margin: 0 auto;
    /* Remove border-bottom and circular border-radius */
}

.lesson-square:before {
    position: absolute;
    left: 0;
    top: 0;
    width: 120px;
    height: 60px;
    border-radius: 60px/30px;
    background: #aaaaaa radial-gradient(ellipse 50px 25px at 50% 50%, #dfdfdf 0 50px, transparent 30px);
    background-repeat: no-repeat;
    content: '';
    z-index: 3;
}

.lesson-square:after {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 120px;
    height: 60px;
    border-radius: 600px/30px;
    background-color: rgba(0, 0, 0, 0.2);
    content: '';
    z-index: 1;
}

.lesson-square.stage-2 {
    color: white;
    background: #7a3f27;
}

.lesson-square.stage-2:before {
    background-color: #7a3f27;
    background: #7a3f27 radial-gradient(ellipse 50px 25px at 50% 50%, #f1aa3f 0 50px, transparent 30px);
}



.lesson-square.stage-1 {
    color: white;
    background: #8ac8ca;
}

.lesson-square.stage-1:before {
    background-color: #e4ab69;
    background: #74d8d8 radial-gradient(ellipse 50px 25px at 50% 50%, #e4ab69 0 50px, transparent 30px);
}

/* Next available lesson styling */
.lesson-square.next-available {
    color: white;
    background: #995d4593;
    z-index: 10;
    /* Ensure it appears above other lesson squares */
}

.lesson-square.next-available:before {
    background-color: #a1654d96;
    background: #9b5a4188 radial-gradient(ellipse 50px 25px at 50% 50%, #ffc56f86 0 50px, transparent 30px);
}

/* Start indicator above next-available lesson square */
.start-indicator {
    position: absolute;
    width: 150px;
    background: white;
    padding: 1rem;
    border-radius: 1rem;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    pointer-events: auto;
    animation: startIndicatorPulse 2s infinite;
}

.start-indicator:hover {
    transform: translateX(-50%) translateY(-5px) scale(1.02);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

/* Disabled state for start indicator */
.start-indicator.is-disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: #f0f0f0;
}

.start-indicator-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.start-indicator-icon-text {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.start-indicator-text {
    flex: 1;
    text-align: left;
}

.start-indicator-text h3 {
    margin: 0 0 0.25rem 0;
    font-size: 1.2rem;
    color: #333;
    font-weight: 600;
}

.start-indicator-text p {
    margin: 0;
    font-size: 0.9rem;
    color: #666;
}

.start-indicator-badge {
    background: #0397e9;
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    font-weight: bold;
    margin-left: 0.5rem;
}

.start-indicator-icon {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.start-indicator-icon img,
.start-indicator-icon svg {
    width: 100%;
    height: 100%;
}

/* Triangle pointer pointing down to the lesson */
.start-indicator:after {
    content: "";
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid white;
}

/* Pulse animation for the start indicator */
@keyframes startIndicatorPulse {
    0% {
        transform: translateX(-50%) translateY(20%);
    }

    50% {
        transform: translateX(-50%) translateY(25%);
    }

    100% {
        transform: translateX(-50%) translateY(20%);
    }
}


/* Lesson bar images */
.lesson-bar-image {
    position: absolute;
    z-index: 1;
    pointer-events: none;
    bottom: 20%;
    /* Position bottom edge of image directly on top of lesson bar */
}

.lesson-bar-image-wrapper {
    position: absolute;
    bottom: 20%;
    z-index: 600;
    pointer-events: none;
    display: inline-block;
    /* ensures size is based on image */
}


/* Top hat for turtle */
.lesson-bar-image.turtle::before {
    content: "";
    position: absolute;
    top: -10px;
    left: 80%;
    transform: translateX(-50%);
    width: 40px;
    height: 30px;
    /* background-image: url('images/accessories/topHat.gif'); */
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    z-index: 2;
    pointer-events: none;
}



/* Scroll-to-turtle button inside the lesson bar */
.scroll-to-turtle-btn {
    position: absolute;
    left: 0;
    /* flush left edge of lesson bar */
    top: 0;
    /* start at top of lesson bar */
    width: 80px;
    /* width of gradient + arrow */
    height: 100%;
    /* fill the full height of lesson bar */
    border: none;
    background: none;
    cursor: pointer;
    display: none;
    /* Hidden by default */
    align-items: center;
    justify-content: flex-start;
    /* arrow on the left edge */
    padding-left: 15px;
    /* space before arrow */
}

/* Large left-pointing white arrow (default) */
.scroll-to-turtle-btn::before {
    content: "";
    display: inline-block;
    width: 0;
    height: 0;
    border-top: 24px solid transparent;
    border-bottom: 24px solid transparent;
    border-right: 40px solid rgb(58, 58, 58);
}

/* Right-pointing arrow when turtle is to the right */
.scroll-to-turtle-btn.scroll-right::before {
    border-right: none;
    border-left: 40px solid rgb(58, 58, 58);
}

#french-sentence {
    margin-bottom: 0.5rem;
}

#english-sentence {
    margin-top: 0;
}



/* ---------------- Lesson View ---------------- */
#lessonView {
    display: none;
    position: relative;
    height: 100%;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 0;
}

/* Top section for progress and word card */
.lesson-top-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    z-index: 1000;
    margin-top: 2rem;
    /* Space for fixed progress bar */
}

/* Lesson Progress Bar */
.lesson-progress-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 20;
    text-align: right;
}

.lesson-progress-bar {
    width: 100%;
    height: 8px;
    background-color: #585858a6;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.lesson-progress-fill {
    height: 100%;
    background-color: #a8e24a;
    transition: width 0.3s ease;
    width: 0%;
}

.lesson-progress-text {
    font-size: 1rem;
    color: #3d3d3d;
    font-weight: 1000;
    padding-right: 1rem;
}

.lesson-word-card {
    background: white;
    padding: 1rem 3rem;
    border-radius: 1rem;
    text-align: center;
    font-size: 2rem;
    max-width: 400px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 1001;
    transition: opacity 0.3s ease, transform 0.3s ease;
    opacity: 1;
    transform: translateY(0);
}

/* Class for hiding the word card during animation */
.lesson-word-card.word-card-hidden {
    opacity: 0;
    transform: translateY(-20px);
}

/* Bottom section for input */
.lesson-bottom-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    z-index: 10;
    position: absolute;
    top: 550px;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: transform 0.3s ease-in-out;
}

/* When keyboard is open, push the bottom section up */
body.keyboard-open .lesson-bottom-section {
    transform: translate(-50%, -75%);
}

/* Mobile-specific keyboard handling */
@media (max-width: 768px) {
    .lesson-bottom-section {
        top: 450px;
        /* Start slightly higher on mobile */
    }

    /* Less aggressive push up on mobile when keyboard is open */
    body.keyboard-open .lesson-bottom-section {
        transform: translate(-50%, -90%);
        top: 420px;
        /* Move up even less on mobile */
    }
}

.lesson-input-group {
    display: flex;
    max-width: 400px;
    width: 100%;
    gap: 0.5rem;
}

.lesson-input-group input {
    flex: 1;
    padding: 0.8rem;
    border: 1px solid #ccc;
    border-radius: 0.5rem;
    font-size: 1rem;
}

.lesson-input-group button {
    padding: 0.8rem 1.2rem;
    border: none;
    border-radius: 0.5rem;
    background: #4a90e2;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    min-width: 80px;
    /* Ensure minimum touch target */
    min-height: 44px;
    /* iOS recommended minimum touch target */
    touch-action: manipulation;
    /* Prevent double-tap zoom */
    -webkit-tap-highlight-color: transparent;
    /* Remove tap highlight */
    transition: transform 0.1s ease, background-color 0.2s ease;
    /* Smooth transitions */
}

.lesson-input-group button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

@media (max-width: 768px) {}


/* Mobile-specific button improvements */
@media (max-width: 768px) {
    .lesson-input-group button {
        min-width: 90px;
        /* Larger touch target on mobile */
        min-height: 48px;
        /* Larger touch target on mobile */
        padding: 1rem 1.5rem;
        /* More padding for easier tapping */
    }

    .lesson-input-group {
        gap: 0.75rem;
        /* Slightly larger gap on mobile */
    }
}

.lesson-feedback {
    margin-top: 1rem;
    font-weight: bold;
}

#studyView {
    align-items: center;
    margin: auto;
    width: 100%;
    gap: 0;
}

.study-card {
    background: white;
    padding-top: 1rem;
    border-radius: 0 0 1rem 1rem;
    text-align: center;
    font-size: 1.2rem;
    margin-bottom: 1rem;

    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

#study-card-container {
    width: 100%;
}

.study-turtle {
    display: flex;
    justify-content: center;
    margin: 1rem 0;
}

.study-turtle img {
    width: 400px;
    height: auto;
}

/* Animation for study turtle legs */
#studyLegLeft {
    transform-origin: center top;
    transform-box: fill-box;
    animation: studyLegSwingLeft 1.5s infinite alternate ease-in-out;
}

#studyLegRight {
    transform-origin: center top;
    transform-box: fill-box;
    animation: studyLegSwingRight 1.5s infinite alternate ease-in-out;
}

@keyframes studyLegSwingLeft {
    0% {
        transform: rotate(-5deg);
    }

    100% {
        transform: rotate(10deg);
    }
}

@keyframes studyLegSwingRight {
    0% {
        transform: rotate(5deg);
    }

    100% {
        transform: rotate(-10deg);
    }
}


.study-button {
    padding: 1.2rem 1.2rem;

    border: none;
    border-radius: 0.5rem;
    background: #4a90e2;
    color: white;
    font-size: 1.3rem;
    cursor: pointer;
    width: 100%;

}

#study-nav-container {
    position: absolute;
    margin-bottom: 2rem;
    bottom: 0;
    max-width: 400px;
    width: 100%;
}

.study-button:disabled {
    background: #ccc;
    cursor: not-allowed;
}


/* Home button */
#homeBtn {
    position: fixed;
    top: 0.5rem;
    background: #ffffff00;
    border: 2px solid #4a91e200;
    color: #4a90e2;
    padding: 0.3rem 0.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    z-index: 1000;
    display: none;
    /* Hidden by default */
    align-items: center;
    justify-content: center;
}

#homeBtn img {
    width: 2rem;
    height: 2rem;
    display: block;
}

/* Auth container styles */
.auth-container {
    max-width: 350px;
    margin: 60px auto;
    padding: 2em;
    background: #fff;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 1em;
}

.auth-container h2 {
    text-align: center;
}

.auth-container form {
    display: flex;
    flex-direction: column;
    gap: 0.5em;
}

.auth-container input {
    padding: 0.5em;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.auth-container button {
    padding: 0.5em;
    background: #007bff;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 0.5em;
}

.auth-container button:hover {
    background: #0056b3;
}

.auth-container #login-message,
.auth-container #register-message {
    color: #d00;
    min-height: 1.5em;
    text-align: center;
}

/* Navigation styles */
nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #fff;
    padding: 1rem;
    border-bottom: 1px solid #ccc;
    z-index: 1000;
    text-align: center;
}

nav a {
    color: #4a90e2;
    text-decoration: none;
    margin: 0 1rem;
    font-weight: bold;
}

nav a:hover {
    text-decoration: underline;
}

/* Hide navigation when logged in */
nav.hidden {
    display: none !important;
}

#topBarRight {
    display: flex;
    position: absolute;
    gap: 2rem;
    top: 1rem;
    right: 1rem;

}

/* Profile icon styles */
.profile-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #4a90e2;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
    border: 3px solid white;
    transition: all 0.3s ease;
    opacity: 0;
    transform: scale(0);
    overflow: hidden;
}

#customizationView {
    margin-top: 5rem;
}

.customization-row {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1rem;
    justify-items: center;
}

.customization-turtle-option {
    display: flex;
    flex-direction: column;
    cursor: pointer;
    align-items: center;
    gap: 0.5rem;
}

/* New circle option */
.customization-color-circle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 2px solid rgba(0, 0, 0, 0.15);
    transition: transform 0.1s ease, border-color 0.1s ease;
}

.customization-color-circle:hover {
    transform: translateY(-1px);
}

.customization-turtle-option.selected .customization-color-circle {
    border: 3px solid #4a90e2;
}

/* Keep label appearance consistent */
.customization-turtle-label {
    font-size: 0.9rem;
    color: #333;
}

.profile-turtle-sprite {
    object-fit: cover;
    transform: scaleX(-1) translateX(-27px) translateY(8px);
}

.profile-icon.visible {
    opacity: 1;
    transform: scale(1);
}

.profile-icon:hover {
    background: #5ca7f3;
}

/* Profile dropdown menu */
.profile-dropdown {
    position: fixed;
    top: 4rem;
    right: 1rem;
    background: white;
    border-radius: 0.5rem;
    padding: 0.5rem 0;
    z-index: 1000;
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    transition: all 0.3s ease;
    min-width: 150px;
}

.profile-dropdown.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.profile-dropdown-item {
    padding: 0.75rem 1rem;
    color: #333;
    text-decoration: none;
    display: block;
    transition: background-color 0.2s ease;
}

.profile-dropdown-item:hover {
    background-color: #f5f5f5;
}

.profile-dropdown-item.logout {
    color: #d32f2f;
    border-top: 1px solid #eee;
}

.customization-modal {
    display: flex;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;

    background: rgba(0, 0, 0, 0.4);
    align-items: center;
    justify-content: center;
}

.customization-modal-content {
    background: #fff;
    padding: 2rem;
    border-radius: 1rem;
    min-width: 320px;
    max-width: 90vw;
    position: relative;
    text-align: center;
}

.close-customization {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 2rem;
    color: #888;
    cursor: pointer;
}

#turtleOptions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    overflow: visible !important;
}

#turtleOptions img.selected {
    border: 2px solid #4a90e2;
}

#saveTurtleCustomization {
    background: #4a90e2;
    color: #fff;
    border: none;
    border-radius: 0.5rem;
    padding: 0.75rem 2rem;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

#saveTurtleCustomization:hover {
    background: #357ab8;
}

.customization-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.customization-row {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1rem;
    justify-items: center;
    margin: 1rem 0;
}

.customization-turtle-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
}

.customization-turtle-label {
    margin-top: 0.5rem;
}

/* Color set customization styles */
.customization-color-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.customization-color-option:hover {
    background-color: #f5f5f5;
}

.customization-color-option.selected {
    background-color: #e3f2fd;
    border: 2px solid #4a90e2;
    transform: scale(1.05);
}

.customization-color-option.selected .color-set-preview {
    box-shadow: 0 0 0 2px #4a90e2;
}

.color-set-preview {
    position: relative;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    border: 1px solid #ddd;
    overflow: hidden;
}

.color-segment {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
}

/* First segment (top right) */
.color-segment:nth-child(1) {
    clip-path: polygon(50% 50%, 50% 0, 100% 0, 100% 50%);
}

/* Second segment (bottom) */
.color-segment:nth-child(2) {
    clip-path: polygon(50% 50%, 100% 50%, 100% 100%, 0 100%, 0 50%);
}

/* Third segment (top left) */
.color-segment:nth-child(3) {
    clip-path: polygon(50% 50%, 0 50%, 0 0, 50% 0);
}

.customization-section h3 {
    margin: 1rem 0 0.5rem 0;
    color: #333;
    font-size: 1.1rem;
}

/* Accessory customization styles */
.customization-accessory-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.customization-accessory-option:hover {
    background-color: #f5f5f5;
}

.customization-accessory-option.selected {
    background-color: #e3f2fd;
    border: 2px solid #4a90e2;
}

.customization-accessory-option.locked {
    opacity: 0.6;
    cursor: not-allowed;
}

.customization-accessory-option.locked:hover {
    background-color: #f5f5f5;
}

.accessory-preview {
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ddd;
    border-radius: 50%;
    background-color: #fafafa;
    overflow: visible;
    position: relative;
}

.accessory-preview svg {
    width: 130%;
    height: 130%;
    max-width: none;
    max-height: none;
    position: absolute;
}




.bar-chart {
    display: flex;
    align-items: flex-end;
    /* bars grow from bottom */
    justify-content: space-around;
    height: 200px;
    /* fixed chart height */
    gap: 0.5rem;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 0.5rem;
    background: #f9f9f9;
}

.bar-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
}

.bar {
    width: 24px;
    background: #4caf50;
    border-radius: 4px 4px 0 0;
    transition: height 0.3s ease;
}

.bar-count {
    font-size: 0.8rem;
    margin-top: 4px;
    color: #333;
}

.bar-label {
    margin-top: 2px;
    font-size: 0.8rem;
    color: #555;
}


.aligned-sentence {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    margin-bottom: 1rem;
    justify-content: center;
}

.word-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.word-block div {
    font-size: 1.2rem;
}

.aligned-sentence {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.word-block {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.word-block div {
    font-size: 1.2rem;
    padding: 0.2rem 0.5rem;
    border-radius: 0.4rem;
}

.focus-word {
    color: white !important;

}

/* Cat speech bubble styles */
.cat-speech-wrapper {
    position: absolute;
    pointer-events: none;
    /* bubble itself shouldn't block pointer to other UI */
    transform-origin: bottom center;
    z-index: 1000;
}

.cat-speech {
    display: inline-block;
    max-width: 260px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.98);
    color: #222;
    font-family: 'LexendDeca', system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
    font-size: 14px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
    line-height: 1.2;
    pointer-events: auto;
}

.cat-speech::after {
    content: "";
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: -8px;
    border-width: 8px 8px 0 8px;
    border-style: solid;
    border-color: rgba(255, 255, 255, 0.98) transparent transparent transparent;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.08));
}

.cat-speech-text {
    white-space: pre-wrap;
    word-break: break-word;
    min-height: 1.2em;
}

.cat-speech-hidden {
    opacity: 0;
    transform: scale(0.85);
    transition: opacity 160ms ease, transform 200ms cubic-bezier(.2, .9, .3, 1);
}

.cat-speech-visible {
    opacity: 1;
    transform: scale(1);
    transition: opacity 160ms ease, transform 240ms cubic-bezier(.2, .9, .3, 1);
}


#lessonSky {
    position: fixed;
    width: 100%;
    height: 120%;
    z-index: -1;
    pointer-events: none;
}

#runningSky {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 500px;
    /*  background: url("images/runningSky.svg") repeat-x; */
    background-size: auto 100%;
    z-index: 1;
}

#runningGround {
    position: absolute;
    top: 300px;
    left: 0;
    width: 100%;
    height: 400px;
    /*  background: url("images/runningGround.svg") repeat-x; */
    background-size: auto 100%;
    z-index: 2;
}

#waterLayer {
    position: absolute;
    top: 500px;
    left: 0;
    width: 100%;
    height: 50%;
    /*   background: url("images/runningWater.svg") repeat-x; */
    background-size: auto 100%;
    z-index: -3;
}

#cloudLayer {
    position: absolute;
    left: 0;
    width: 100%;
    height: 200px;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.cloud {
    position: absolute;
    width: 100px;
    height: auto;
    animation: moveCloud linear forwards;
}

@keyframes moveCloud {
    from {
        transform: translateX(3000%);
    }

    to {
        transform: translateX(-120%);
    }
}

.hurdle {
    position: absolute;
    top: 280px;
    width:
        150px;
    height: 150px;
    z-index: -2;
    overflow: visible;
    animation: moveHurdle ease-in-out forwards;
}

@keyframes moveHurdle {
    0% {
        transform: translateX(1500%);
        animation-timing-function: cubic-bezier(0.3, 0.8, 0.7, 0.2);
    }

    100% {
        transform: translateX(-300%);
    }
}

/*

.grass {
    position: absolute;
    bottom: 100%;

    left: 100%;

    z-index: 2;
    height: 20px;

    animation: moveGrass 25s linear forwards;
    pointer-events: none;

}


@keyframes moveGrass {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(-400%);
    }
}

.tree {
    position: absolute;
    bottom: 99%;
    left: 100%;
    z-index: 0;
    height: 250px;
    animation: moveTree 35s linear forwards;
    pointer-events: none;

}

@keyframes moveTree {
    from {
        transform: translateX(0%);
    }

    to {
        transform: translateX(-2000%);
    }
}

*/

#reviewTurtle {
    display: flex;
    justify-content: center;
    position: relative;
    z-index: 3;
    width: 100%;
    top: -125px;
    pointer-events: none;
    will-change: transform;
    backface-visibility: hidden;
    transform: translateZ(0);
}

#reviewTurtle svg {

    width: 300px;
    height: auto;
    will-change: transform;
    backface-visibility: hidden;
    transform: translateZ(0);

    overflow: visible;
}

#liftSky {
    position: absolute;
    top: -345px;
    left: 0;
    width: 100%;
    height: 500px;
    /*   background: url("images/liftWall.svg") repeat-x; */
    background-size: auto 100%;
    z-index: 1;
}

#liftGround {
    position: absolute;
    top: 300px;
    left: 0;
    width: 100%;
    height: 800px;
    /*   background: url("images/liftGround.svg") repeat-x; */
    background-size: auto 100%;
    z-index: 2;
}


#runningTurtle {
    display: flex;
    justify-content: center;
    position: relative;
    z-index: 3;
    width: 100%;
    top: -125px;
    pointer-events: none;
    will-change: transform;
    backface-visibility: hidden;
    transform: translateZ(0);
}

#runningTurtle svg {

    width: 150px;
    height: auto;
    will-change: transform;
    backface-visibility: hidden;
    transform: translateZ(0);

    overflow: visible;
}

#turtleBody {
    animation: turtleBounce 0.2s infinite cubic-bezier(0.25, 0.1, 0.25, 1) alternate;
}

#turtleBody #tail {
    transform-origin: 2.5px 21.5px;
    animation: tailWag 0.5s infinite ease-in-out;
}

/* Shadow reacts to bounce: slight squash + fade when airborne */
#runningTurtle svg #shadow {
    transform-origin: center center;
    transform-box: fill-box;
    will-change: transform, opacity;
    backface-visibility: hidden;
}

/* Animate the turtle's legs and arms for running motion */
#runningTurtle svg #legRunLeft {
    transform-origin: center top;
    transform-box: fill-box;
    will-change: transform;
    backface-visibility: hidden;
    transform: translateZ(0);
    animation: legRunLeft 0.2s infinite linear alternate;
}

#runningTurtle svg #legRunRight {
    transform-origin: center top;
    transform-box: fill-box;
    will-change: transform;
    backface-visibility: hidden;
    transform: translateZ(0);
    animation: legRunRight 0.2s infinite linear alternate;
}


#runningTurtle svg #armRunLeft {
    transform-origin: center top;
    transform-box: fill-box;
    will-change: transform;
    backface-visibility: hidden;
    transform: translateZ(0);
    animation: armRunLeft 0.2s infinite linear alternate;
    animation-delay: 0s;
    /* ensure immediate start */
}

#runningTurtle svg #armRunRight {
    transform-origin: center top;
    transform-box: fill-box;
    will-change: transform;
    backface-visibility: hidden;
    transform: translateZ(0);
    animation: armRunRight 0.2s infinite linear alternate;
    animation-delay: 0s;
    /* ensure immediate start */
}

/* Running animations */
@keyframes turtleBounce {
    0% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(-0.3px);
    }
}

@keyframes tailWag {
    0% {
        transform: scaleX(0.8);
    }

    50% {
        transform: scaleX(1.2);
    }

    100% {
        transform: scaleX(0.8);
    }
}

@keyframes shadowReact {
    0% {
        transform: translate(0px, 0px);
        opacity: 0.18;
    }

    100% {
        transform: translate(0.5px, 1px);
        opacity: 0.12;
    }
}

@keyframes legRunLeft {
    0% {
        transform: rotate(-18deg);
    }

    100% {
        transform: rotate(18deg);
    }
}

@keyframes legRunRight {
    0% {
        transform: rotate(18deg);
    }

    100% {
        transform: rotate(-18deg);
    }
}

@keyframes armRunLeft {
    0% {
        transform: rotate(10deg);
    }

    100% {
        transform: rotate(-10deg);
    }
}

@keyframes armRunRight {
    0% {
        transform: rotate(-10deg);
    }

    100% {
        transform: rotate(10deg);
    }
}

.turtle-celebrate #turtleBody {
    animation: turtleJump 1.2s cubic-bezier(0.25, 0.1, 0.25, 1) none !important;
}

/* Coordinate parts during jump */
.turtle-celebrate svg #head {
    transform-origin: center center;
    transform-box: fill-box;
    will-change: transform;
    /* Disable head-specific motion for body-only jump test */
    animation: none !important;
}

.turtle-celebrate svg #armRunLeft,
.turtle-celebrate svg #armRunRight {
    transform-origin: center top;
    transform-box: fill-box;
    will-change: transform;
    /* Disable arm-specific motion for body-only jump test */
}

#runningTurtle.turtle-celebrate svg #armRunLeft {
    animation: leftArmRaise 1.1s linear forwards;
}

#runningTurtle.turtle-celebrate svg #armRunRight {
    animation: rightArmRaise 1.1s linear forwards;
}


.turtle-celebrate svg #legRunLeft,
.turtle-celebrate svg #legRunRight {
    transform-origin: center top;
    transform-box: fill-box;
    will-change: transform;
}

#runningTurtle.turtle-celebrate svg #legRunLeft {
    animation: legCelebrateLeft 1.2s linear forwards;
}

#runningTurtle.turtle-celebrate svg #legRunRight {
    animation: legCelebrateRight 1.2s linear forwards;
}

/* 🔁 After celebration ends, automatically restore run */
#runningTurtle.turtle-celebrate svg #legRunLeft,
#runningTurtle.turtle-celebrate svg #legRunRight {
    animation-fill-mode: forwards;
    /* maintain final state until next animation */
}

/* Ensure smooth transition back to running state */
#runningTurtle svg #legRunLeft,
#runningTurtle svg #legRunRight,
#runningTurtle svg #armRunLeft,
#runningTurtle svg #armRunRight {
    transition: none;
    /* prevent CSS transitions from interfering with animations */
}

/* Force immediate restart of running animations when celebration ends */
#runningTurtle:not(.turtle-celebrate) svg #legRunLeft {
    animation: legRunLeft 0.2s infinite linear alternate !important;
    animation-delay: 0s !important;
}

#runningTurtle:not(.turtle-celebrate) svg #legRunRight {
    animation: legRunRight 0.2s infinite linear alternate !important;
    animation-delay: 0s !important;
}

#runningTurtle:not(.turtle-celebrate) svg #armRunLeft {
    animation: armRunLeft 0.2s infinite linear alternate !important;
    animation-delay: 0s !important;
}

#runningTurtle:not(.turtle-celebrate) svg #armRunRight {
    animation: armRunRight 0.2s infinite linear alternate !important;
    animation-delay: 0s !important;
}




.turtle-celebrate svg #shadow {
    will-change: transform, opacity;
    animation: shadowCelebrate 1.5s cubic-bezier(0.2, 0.7, 0.2, 1) none !important;
}

@keyframes turtleJump {
    0% {
        transform: none;
    }

    12% {
        transform: translate(-2px, 1px) scale(0.97);
    }

    70% {
        transform: translate(4px, -12px) scale(1.01);
    }

    100% {
        transform: translate(0px, 0px) scale(1);
    }

}

@keyframes shadowCelebrate {
    0% {
        transform: translateX(0px);
    }

    20% {
        transform: translateX(0px);
    }

    50% {
        transform: translateX(-4px);
    }

    100% {
        transform: translateX(0px);
    }
}

@keyframes headJump {
    0% {
        transform: translateY(0px) rotate(0deg);
    }

    15% {
        transform: translateY(2px) rotate(10deg);
    }

    50% {
        transform: translateY(-6px) rotate(-10deg);
    }

    70% {
        transform: translateY(-2px) rotate(-4deg);
    }

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

@keyframes rightArmRaise {
    0% {
        transform: rotate(-60deg);
    }

    20% {
        transform: rotate(50deg);
    }

    80% {
        transform: rotate(40deg);
    }

    100% {
        transform: rotate(-10deg);
    }
}

@keyframes leftArmRaise {
    0% {
        transform: rotate(60deg);
    }

    20% {
        transform: rotate(-50deg);
    }

    80% {
        transform: rotate(-40deg);
    }

    100% {
        transform: rotate(10deg);
    }
}



#runningTurtle svg #legRunLeft {
    animation: legRunLeft 0.2s infinite linear alternate;
    animation-delay: 0s;
    /* ensure immediate start */
}

#runningTurtle svg #legRunRight {
    animation: legRunRight 0.2s infinite linear alternate;
    animation-delay: 0s;
    /* ensure immediate start */
}


@keyframes legCelebrateLeft {
    0% {
        transform: scaleY(0.9) rotate(-18deg);
    }

    20% {
        transform: scaleY(1) rotate(30deg);
    }

    90% {
        transform: scaleY(1) rotate(20deg);
    }

    100% {
        transform: scaleY(1) rotate(-18deg);
    }
}

@keyframes legCelebrateRight {
    0% {
        transform: scaleY(0.9) rotate(20deg);
    }

    20% {
        transform: scaleY(1) rotate(-30deg);
    }

    90% {
        transform: scaleY(1) rotate(-20deg);
    }

    100% {
        transform: scaleY(1) rotate(18deg);
    }
}


@keyframes shadowJump {
    0% {
        transform: translate(0px, 0px) scaleX(1);
        opacity: 0.18;
    }

    15% {
        transform: translate(-2px, 8px) scaleX(1.15);
        opacity: 0.22;
    }

    50% {
        transform: translate(4px, 10px) scaleX(0.6);
        opacity: 0.08;
    }

    70% {
        transform: translate(5px, 6px) scaleX(0.9);
        opacity: 0.14;
    }

    100% {
        transform: translate(0px, 0px) scaleX(1);
        opacity: 0.18;
    }
}

/* Turtle stumble animation for incorrect answers */
.turtle-stumble {
    animation: turtleStumble 0.6s ease-in-out;
}

@keyframes turtleStumble {
    0% {
        transform: translateX(0px) rotate(0deg);
    }

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

    50% {
        transform: translateX(5px) rotate(3deg);
    }

    75% {
        transform: translateX(-5px) rotate(-2deg);
    }

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




/* Streak Counter Styles */
.streak-counter {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    pointer-events: auto;
    z-index: 10000;
    gap: 0.25rem;
    margin-right: 0.75rem;
}

.streak-flame-container {
    position: relative;
    width: 25px;
    height: 25px;
}

/* Specific styles for review counter */
#reviewScheduleContainer img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.streak-count {
    font-size: 1.2rem;
    font-weight: bold;
    color: #FF9500;
    /* Orange color for the number */
    margin-left: 0.15rem;
}

/* Review count specific color */
#topBarReviewCount {
    color: #3498db;
    /* Blue color for review counter */
}


#profileWrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#Layer_2 {
    overflow: visible;
}



/* Shared turtle + moustache animations */
@keyframes wag {
    0% {
        transform: rotate(0deg);
    }

    50% {
        transform: rotate(15deg);
    }

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

@keyframes stretch {
    0% {
        transform: translateY(0) scaleY(1);
    }

    50% {
        transform: translateY(2px) scaleY(1.05);
    }

    100% {
        transform: translateY(0) scaleY(1);
    }
}

@keyframes blink {

    0%,
    95%,
    100% {
        transform: scaleY(1);
    }

    97% {
        transform: scaleY(0.1);
    }
}

@keyframes faceMove {
    0% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-3px);
    }

    100% {
        transform: translateY(0);
    }
}



/* Turtle parts */
#Tail {
    transform-origin: 30px 40px;
    transform-box: fill-box;
    animation: wag 4s infinite ease-in-out;
}

#Head {
    transform-origin: center bottom;
    transform-box: fill-box;
    animation: stretch 4s infinite ease-in-out;
}

#eyeLeft,
#eyeRight {
    transform-origin: center center;
    transform-box: fill-box;
    animation: blink 10s infinite;
}

#Face {
    transform-origin: center center;
    transform-box: fill-box;
    animation: faceMove 4s infinite ease-in-out;
}

/* Moustache — use the SAME keyframes */
#MoustacheFull {
    z-index: 1000;
}






#catHead {
    transform-origin: top top;
    transform-box: fill-box;
    animation: catHeadBob 4s infinite ease-in-out;
}

#armLeft {
    transform-origin: top top;
    transform-box: fill-box;
    animation: catArmSwingLeft 6s infinite ease-in-out;
}

#armRight {
    transform-origin: top top;
    transform-box: fill-box;
    animation: catArmSwingRight 6s infinite ease-in-out;
}

#catEyeLeft,
#catEyeRight {
    transform-origin: center center;
    transform-box: fill-box;
    animation: blink 6s infinite;
}

#earLeft {
    transform-origin: center center;
    transform-box: fill-box;
    animation: earWiggleLeft 8s infinite;
}

#earRight {
    transform-origin: center center;
    transform-box: fill-box;
    animation: earWiggleLeft 8s infinite;
    animation-delay: 0.2s;
}

#Torso {
    transform-origin: center bottom;
    transform-box: fill-box;
    animation: catHeadBob 4s infinite ease-in-out;
}

#tailCat {
    transform-origin: center bottom;
    transform-box: fill-box;
    animation: catTailWave 4s infinite ease-in-out;
}





@keyframes catHeadBob {
    0% {
        transform: translateY(0) scaleY(1);
    }

    50% {
        transform: translateY(1px) scaleY(1.025);
    }

    100% {
        transform: translateY(0) scaleY(1);
    }
}

@keyframes catArmSwingRight {
    0% {
        transform: rotate(-5deg);
    }

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

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

@keyframes catArmSwingLeft {
    0% {
        transform: rotate(5deg);
    }

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

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

@keyframes blink {

    0%,
    96%,
    100% {
        transform: scaleY(1);
    }

    98% {
        transform: scaleY(0.1);
    }
}

@keyframes earWiggleLeft {

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

    96% {
        transform: rotate(-4deg);
    }

    98% {
        transform: rotate(2deg);
    }
}

@keyframes earWiggleRight {

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

    96% {
        transform: rotate(4deg);
    }

    98% {
        transform: rotate(-2deg);
    }
}

@keyframes catTailWave {
    0% {
        transform: rotate(7deg);
    }

    50% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(7deg);
    }
}







@keyframes flameFlicker {

    0%,
    100% {

        transform: scale(1) rotate(0deg);
    }

    25% {

        transform: scale(1.05) rotate(1deg);
    }

    50% {

        transform: scale(0.95) rotate(-1deg);
    }

    75% {

        transform: scale(1.02) rotate(0.5deg);
    }
}


#flameCenterFront,
#flameCenterBack {
    transform-origin: center center;
    transform-box: fill-box;
    animation: flameFlicker 8s infinite ease-in-out;
}

#flameRightFront,
#flameRightBack {
    transform-origin: center center;
    transform-box: fill-box;
    animation: flameFlicker 6s infinite ease-in-out;
}

#flameLeftFront,
#flameLeftBack {
    transform-origin: center center;
    transform-box: fill-box;
    animation: flameFlicker 4s infinite ease-in-out;
}






.ripple {
    fill: none;
    stroke: #00aaff;
    stroke-width: 2;
    opacity: 0.6;
    transform-origin: center;
    animation: rippleEllipse 1.5s ease-out forwards;
}

@keyframes rippleEllipse {
    from {
        transform: scale(1);
        opacity: 0.6;
    }

    to {
        transform: scale(40);
        /* grows evenly */
        opacity: 0;
    }

}

.french-word-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 0.5rem;
    position: relative;
}

.french-word {
    font-size: 2.5rem;
    font-weight: bold;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 12px;
    display: inline-block;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    position: relative;
}

.audio-btn {
    top: 50%;
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 3rem;
    height: 3rem;
    z-index: 1000;
}

/* Audio button specific positioning for lesson view */
#lessonView .audio-btn {
    left: calc(95% + 0.5rem);
}




/* Word type color schemes */
.word-type-n {
    background-color: #3498db;
}

/* Nouns - Blue */
.word-type-v {
    background-color: #e74c3c;
}

/* Verbs - Red */
.word-type-adj {
    background-color: #f39c12;
}

/* Adjectives - Orange */
.word-type-adv {
    background-color: #9b59b6;
}

/* Adverbs - Purple */
.word-type-pro {
    background-color: #1abc9c;
}

/* Pronouns - Teal */
.word-type-art {
    background-color: #16a085;
}

/* Articles - Teal */
.word-type-art {
    background-color: #16a085;
}

/* Articles - Teal */
.word-type-prep {
    background-color: #34495e;
}

/* Prepositions - Dark Gray */
.word-type-conj {
    background-color: #e67e22;
}

/* Conjunctions - Dark Orange */
.word-type-part {
    background-color: #27ae60;
}

/* Particles - Green */
.word-type-int {
    background-color: #8e44ad;
}

/* Interjections - Dark Purple */
.word-type-default {
    background-color: #7f8c8d;
}

/* Default - Gray */

.english-word {
    font-size: 2rem;
    font-weight: normal;
    color: #2c3e50;
}